From 37894fa762fb2cb801c8e0d7cf57d1814506604e Mon Sep 17 00:00:00 2001 From: li-bo-boblove Date: Wed, 20 Jul 2022 14:26:13 +0800 Subject: [PATCH 001/438] add msdp is api Signed-off-by:li-bo-boblove Signed-off-by: li-bo-boblove --- api/@ohos.devicestatus.d.ts | 212 ++++++++++++++++++++++++++++ api/@ohos.motion.d.ts | 215 +++++++++++++++++++++++++++++ api/@ohos.movement.d.ts | 204 +++++++++++++++++++++++++++ api/@ohos.spatialAwareness.d.ts | 238 ++++++++++++++++++++++++++++++++ 4 files changed, 869 insertions(+) create mode 100644 api/@ohos.devicestatus.d.ts create mode 100644 api/@ohos.motion.d.ts create mode 100644 api/@ohos.movement.d.ts create mode 100644 api/@ohos.spatialAwareness.d.ts diff --git a/api/@ohos.devicestatus.d.ts b/api/@ohos.devicestatus.d.ts new file mode 100644 index 0000000000..a9c792eb20 --- /dev/null +++ b/api/@ohos.devicestatus.d.ts @@ -0,0 +1,212 @@ +/* + * 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 { AsyncCallback } from "./basic"; + +/** + * Subscribe to user device status notifications + * + * @since 9 + * @syscap SystemCapability.Msdp.DeviceStatus + * @import import sensor from '@ohos.DeviceStatus' + * @permission N/A + */ +declare namespace DeviceStatus { + /** + * Behavior-aware data。 + * @syscap SystemCapability.Msdp.DeviceStatus + */ + export interface ActivityResponse { + eventType: EventType + } + + /** + * Absolutely static data。 + * @syscap SystemCapability.Msdp.DeviceStatus + */ + export interface StillResponse extends ActivityResponse {} + + /** + * Relatively static data。 + * @syscap SystemCapability.Msdp.DeviceStatus + */ + export interface RelativeStillResponse extends ActivityResponse {} + + /** + * Vertically positioned data。 + * @syscap SystemCapability.Msdp.DeviceStatus + */ + export interface VerticalPositionResponse extends ActivityResponse {} + + /** + * Horizontal position of the data。 + * @syscap SystemCapability.Msdp.DeviceStatus + */ + export interface HorizontalPositionResponse extends ActivityResponse {} + + /** + * Behavior recognition type。 + * @syscap SystemCapability.Msdp.DeviceStatus + */ + export enum ActivityType { + TYPE_STILL = "still", + TYPE_RELATIVE_STILL = "relativeStill", + TYPE_VERTICAL_POSITION = "verticalPosition", + TYPE_HORIZONTAL_POSITION = "horizontalPosition" + } + + /** + * The event type。 + * @syscap SystemCapability.Msdp.DeviceStatus + */ + export enum EventType { + ENTER = 1, + EXIT = 2, + ENTER_EXIT = 3 + } + + /** + * Subscriptions are absolutely static。 + * + * @since 9 + * @param type Subscriptions are absolutely static, {@code type: ActivityType.TYPE_STILL}. + * @param eventType enter and exit event. + * @param reportLatencyNs report event latency. + * @param callback callback function, receive reported data. + */ + function on(type: ActivityType.TYPE_STILL, eventType: EventType, reportLatencyNs: number, callback: AsyncCallback): void; + + /** + * Subscriptions are relatively static。 + * + * @since 9 + * @param type Subscriptions are relatively static, {@code type: ActivityType.TYPE_RELATIVE_STILL}. + * @param eventType enter and exit event. + * @param reportLatencyNs report event latency. + * @param callback callback function, receive reported data. + */ + function on(type: ActivityType.TYPE_RELATIVE_STILL, eventType: EventType, reportLatencyNs: number, callback: AsyncCallback): void; + + /** + * Subscribe to the vertical position。 + * + * @since 9 + * @param type Subscribe to the vertical position, {@code type: ActivityType.TYPE_VERTICAL_POSITION}. + * @param eventType enter and exit event. + * @param reportLatencyNs report event latency. + * @param callback callback function, receive reported data. + */ + function on(type: ActivityType.TYPE_VERTICAL_POSITION, eventType: EventType, reportLatencyNs: number, callback: AsyncCallback): void; + + /** + * Subscribe to horizontal locations。 + * + * @since 9 + * @param type Subscribe to horizontal locations, {@code type: ActivityType.TYPE_HORIZONTAL_POSITION}. + * @param eventType enter and exit event. + * @param reportLatencyNs report event latency. + * @param callback callback function, receive reported data. + */ + function on(type: ActivityType.TYPE_HORIZONTAL_POSITION, eventType: EventType, reportLatencyNs: number, callback: AsyncCallback): void; + + /** + * Query whether it is absolutely static。 + * + * @since 9 + * @param type Query whether it is absolutely static, {@code type: ActivityType.TYPE_STILL}. + * @param eventType enter and exit event. + * @param reportLatencyNs report event latency. + * @param callback callback function, receive reported data. + */ + function once(type: ActivityType.TYPE_STILL, callback: AsyncCallback): void; + + /** + * Query whether it is relatively stationary。 + * + * @since 9 + * @param type Query whether it is relatively stationary, {@code type: ActivityType.TYPE_RELATIVE_STILL}. + * @param eventType enter and exit event. + * @param reportLatencyNs report event latency. + * @param callback callback function, receive reported data. + */ + function once(type: ActivityType.TYPE_RELATIVE_STILL, callback: AsyncCallback): void; + + /** + * Query whether the vertical position is。 + * + * @since 9 + * @param type Query whether the vertical position is, {@code type: ActivityType.TYPE_VERTICAL_POSITION}. + * @param eventType enter and exit event. + * @param reportLatencyNs report event latency. + * @param callback callback function, receive reported data. + */ + function once(type: ActivityType.TYPE_VERTICAL_POSITION, callback: AsyncCallback): void; + + /** + * Query whether the horizontal position is。 + * + * @since 9 + * @param type Query whether the horizontal position is, {@code type: ActivityType.TYPE_HORIZONTAL_POSITION}. + * @param eventType enter and exit event. + * @param reportLatencyNs report event latency. + * @param callback callback function, receive reported data. + */ + function once(type: ActivityType.TYPE_HORIZONTAL_POSITION, callback: AsyncCallback): void; + + /** + * Unsubscribe absolutely static。 + * + * @since 9 + * @param type Unsubscribe absolutely static, {@code type: ActivityType.TYPE_STILL}. + * @param eventType enter and exit event. + * @param reportLatencyNs report event latency. + * @param callback callback function, receive reported data. + */ + function off(type: ActivityType.TYPE_STILL, eventType: EventType, callback?: AsyncCallback): void; + + /** + * Unsubscribe is relatively static。 + * + * @since 9 + * @param type Unsubscribe is relatively static, {@code type: ActivityType.TYPE_RELATIVE_STILL}. + * @param eventType enter and exit event. + * @param reportLatencyNs report event latency. + * @param callback callback function, receive reported data. + */ + function off(type: ActivityType.TYPE_RELATIVE_STILL, eventType: EventType, callback?: AsyncCallback): void; + + /** + * Unsubscribe from the vertical location。 + * + * @since 9 + * @param type Unsubscribe from the vertical location, {@code type: ActivityType.TYPE_VERTICAL_POSITION}. + * @param eventType enter and exit event. + * @param reportLatencyNs report event latency. + * @param callback callback function, receive reported data. + */ + function off(type: ActivityType.TYPE_VERTICAL_POSITION, eventType: EventType, callback?: AsyncCallback): void; + + /** + * Unsubscribe from horizontal locations。 + * + * @since 9 + * @param type Unsubscribe from horizontal locations, {@code type: ActivityType.TYPE_HORIZONTAL_POSITION}. + * @param eventType enter and exit event. + * @param reportLatencyNs report event latency. + * @param callback callback function, receive reported data. + */ + function off(type: ActivityType.TYPE_HORIZONTAL_POSITION, eventType: EventType, callback?: AsyncCallback): void; +} +export default DeviceStatus; \ No newline at end of file diff --git a/api/@ohos.motion.d.ts b/api/@ohos.motion.d.ts new file mode 100644 index 0000000000..abd85d4cfc --- /dev/null +++ b/api/@ohos.motion.d.ts @@ -0,0 +1,215 @@ +/* + * 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 { Callback } from "./basic"; + +/** + * Provides the ability to subscribe to gesture state. + * + * @since 9 + * @sysCap SystemCapability.Sensors.Motion + * @devices phone, tablet + * @import import sensor from '@ohos.motion' + * @permission N/A + */ +declare namespace motion { + /** + * The basic data structure of gesture state events。 + * @devices phone, tablet + * @sysCap SystemCapability.Msdp.Motion + */ + export interface MotionResponse { + motionValue: boolean + } + + /** + * Pick up the data for the event。 + * @devices phone, tablet + * @sysCap SystemCapability.Msdp.Motion + */ + export interface PickupResponse extends MotionResponse {} + + /** + * Roll over the data for the event。 + * @devices phone, tablet + * @sysCap SystemCapability.Msdp.Motion + */ + export interface FlipResponse extends MotionResponse {} + + /** + * Data close to ear events。 + * @devices phone, tablet + * @sysCap SystemCapability.Msdp.Motion + */ + export interface CloseToEarResponse extends MotionResponse {} + + /** + * Shake the data of the event。 + * @devices phone, tablet + * @sysCap SystemCapability.Msdp.Motion + */ + export interface ShakeResponse extends MotionResponse {} + + /** + * Rotate the data for the event。 + * @devices phone, tablet + * @sysCap SystemCapability.Msdp.Motion + */ + export interface RotateResponse extends MotionResponse {} + + /** + * Two-finger swipe event data。 + * @devices phone, tablet + * @sysCap SystemCapability.Msdp.Motion + */ + export interface TwoFingersPinchResponse extends MotionResponse {} + + /** + * Three fingers swipe the data of the event。 + * @devices phone, tablet + * @sysCap SystemCapability.Msdp.Motion + */ + export interface ThreeFingersSlideResponse extends MotionResponse {} + + /** + * Gesture state type。 + * @devices phone, tablet + * @sysCap SystemCapability.Msdp.Motion + */ + export enum MotionType { + TYPE_PICKUP = "pickUp", + TYPE_CLOSE_TO_EAR = "closeToEar", + TYPE_FLIP = "flip", + TYPE_SHAKE = "shake", + TYPE_ROTATE = "rotate", + TYPE_TWO_FINGER_PINCH = "twoFingerPinch", + TYPE_THREE_FINGERS_SLIDE = "threeFingersSlide", + } + + /** + * Subscribe to pick up gestures。 + * @param The type of gesture state that subscribes to, {@code type: MotionType.TYPE_PICKUP}. + * @param callback The Callback function that the user subscribes to. + * @since 9 + */ + function on(type: MotionType.TYPE_PICKUP, callback: Callback): void; + + /** + * Subscribe to the near ear gesture。 + * @param Subscribe to the gesture status type, {@code type: MotionType.TYPE_CLOSE_TO_EAR}. + * @param callback The Callback function that the user subscribes to. + * @since 9 + */ + function on(type: MotionType.TYPE_CLOSE_TO_EAR, callback: Callback): void; + + /** + * Subscribe to the flip event gesture。 + * @param Subscribe to the gesture status type, {@code type: MotionType.TYPE_FLIP}. + * @param callback The Callback function that the user subscribes to. + * @since 9 + */ + function on(type: MotionType.TYPE_FLIP, callback: Callback): void; + + /** + * Subscribe to a shake gesture。 + * @param Subscribe to the gesture status type, {@code type: MotionType.TYPE_SHAKE}. + * @param callback The Callback function that the user subscribes to. + * @since 9 + */ + function on(type: MotionType.TYPE_SHAKE, callback: Callback): void; + + /** + * Subscribe to the rotate gesture。 + * @param Subscribe to the gesture status type, {@code type: MotionType.TYPE_ROTATE}. + * @param callback The Callback function that the user subscribes to. + * @since 9 + */ + function on(type: MotionType.TYPE_ROTATE, callback: Callback): void; + + /** + * Subscribe to two-finger event gestures。 + * @param Cancels the gesture state type, {@code type: MotionType.TYPE_TWO_FINGER_PINCH}. + * @param callback The User Cancels the Callback function. + * @since 9 + */ + function on(type: MotionType.TYPE_TWO_FINGER_PINCH, callback?: Callback): void; + + /** + * Subscribe to three-finger event gestures。 + * @param Cancels the gesture state type, {@code type: MotionType.TYPE_THREE_FINGERS_SLIDE}. + * @param callback The User Cancels the Callback function. + * @since 9 + */ + function on(type: MotionType.TYPE_THREE_FINGERS_SLIDE, callback?: Callback): void; + + /** + * Cancel the pick-up gesture。 + * @param 取消手势状态的类型, {@code type: MotionType.TYPE_PICKUP}. + * @param callback The User Cancels the Callback function. + * @since 9 + */ + function off(type: MotionType.TYPE_PICKUP, callback?: Callback): void; + + /** + * Cancel the close gesture。 + * @param Cancels the gesture state type, {@code type: MotionType.TYPE_CLOSE_TO_EAR}. + * @param callback The User Cancels the Callback function. + * @since 9 + */ + function off(type: MotionType.TYPE_CLOSE_TO_EAR, callback?: Callback): void; + + /** + * Cancels the flip event gesture。 + * @param Cancels the gesture state type, {@code type: MotionType.TYPE_FLIP}. + * @param callback The User Cancels the Callback function. + * @since 9 + */ + function off(type: MotionType.TYPE_FLIP, callback?: Callback): void; + + /** + * Cancel the shake gesture。 + * @param Cancels the gesture state type, {@code type: MotionType.TYPE_SHAKE}. + * @param callback The User Cancels the Callback function. + * @since 9 + */ + function off(type: MotionType.TYPE_SHAKE, callback?: Callback): void; + + /** + * Cancel the rotate gesture。 + * @param Cancels the gesture state type, {@code type: MotionType.TYPE_ROTATE}. + * @param callback The User Cancels the Callback function. + * @since 9 + */ + function off(type: MotionType.TYPE_ROTATE, callback?: Callback): void; + + /** + * Cancels the two-finger event gesture。 + * @param Cancels the gesture state type, {@code type: MotionType.TYPE_TWO_FINGER_PINCH}. + * @param callback The User Cancels the Callback function. + * @since 9 + */ + function off(type: MotionType.TYPE_TWO_FINGER_PINCH, callback?: Callback): void; + + /** + * Cancels from the three-finger event gesture。 + * @param Cancels the gesture state type, {@code type: MotionType.TYPE_THREE_FINGERS_SLIDE}. + * @param callback The User Cancels the Callback function. + * @since 9 + */ + function off(type: MotionType.TYPE_THREE_FINGERS_SLIDE, callback?: Callback): void; +} + +export default motion; + diff --git a/api/@ohos.movement.d.ts b/api/@ohos.movement.d.ts new file mode 100644 index 0000000000..a9bc11c9f1 --- /dev/null +++ b/api/@ohos.movement.d.ts @@ -0,0 +1,204 @@ +/* + * 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 { Callback } from "./basic"; + +/** + * Subscribe to user move status notifications + * + * @since 9 + * @syscap SystemCapability.Msdp.Movement + * @import import sensor from '@ohos.movement' + * @permission N/A + */ +declare namespace movement { + /** + * The basic data structure of a move state event。 + * @syscap SystemCapability.Msdp.Movement + */ + export interface MovementResponse { + movementValue: MovementValue + } + + /** + * Data on ride events。 + * @syscap SystemCapability.Msdp.Movement + */ + export interface InAutoResponse extends MovementResponse {} + + /** + * Data on cycling events。 + * @syscap SystemCapability.Msdp.Movement + */ + export interface OnBicycleResponse extends MovementResponse {} + + /** + * Walk the data of the event。 + * @syscap SystemCapability.Msdp.Movement + */ + export interface WalkingResponse extends MovementResponse {} + + /** + * Data for running events。 + * @syscap SystemCapability.Msdp.Movement + */ + export interface RuningResponse extends MovementResponse {} + + /** + * The move state type。 + * @syscap SystemCapability.Msdp.Movement + */ + export enum MovementType { + TYPE_IN_AUTO = "inAuto", + TYPE_ON_BICYCLE = "inBicycle", + TYPE_WALKING = "walking", + TYPE_RUNNING = "running", + } + + /** + * The move status value。 + * @syscap SystemCapability.Msdp.Movement + */ + export enum MovementValue { + ENTER = 1, + EXIT = 2, + ENTER_EXIT = 3 + } + + /** + * Subscribe to notifications of the mobility status of your ride。 + * + * @since 9 + * @param type Subscribe to notifications of the mobility status of your ride, {@code type: MovementType.TYPE_IN_AUTO}. + * @param eventType enter and exit event. + * @param reportLatencyNs report event latency. + * @param callback callback function, receive reported data. + */ + function on(type: MovementType.TYPE_IN_AUTO, eventType: MovementValue, reportLatencyNs: number, callback: Callback): void; + + /** + * Subscribe to notifications of the movement status of your bike。 + * + * @since 9 + * @param type The mobile state type of the subscription, {@code type: MovementType.TYPE_ON_BICYCLE}. + * @param eventType enter and exit event. + * @param reportLatencyNs report event latency. + * @param callback callback function, receive reported data. + */ + function on(type: MovementType.TYPE_ON_BICYCLE, eventType: MovementValue, reportLatencyNs: number, callback: Callback): void; + + /** + * Subscribe to mobile status notifications for walks。 + * + * @since 9 + * @param type The mobile state type of the subscription, {@code type: MovementType.TYPE_WALKING}. + * @param eventType enter and exit event. + * @param reportLatencyNs report event latency. + * @param callback callback function, receive reported data. + */ + function on(type: MovementType.TYPE_WALKING, eventType: MovementValue, reportLatencyNs: number, callback: Callback): void; + + /** + * Subscribe to notifications of the movement status of your run。 + * + * @since 9 + * @param type The mobile state type of the subscription, {@code type: MovementType.TYPE_RUNNING}. + * @param eventType enter and exit event. + * @param reportLatencyNs report event latency. + * @param callback callback function, receive reported data. + */ + function on(type: MovementType.TYPE_RUNNING, eventType: MovementValue, reportLatencyNs: number, callback: Callback): void; + + /** + * Check if you are in the car。 + * + * @since 9 + * @param type The mobile state type of the subscription, {@code MovementType.TYPE_IN_AUTO}. + * @param callback callback function, receive reported data. + */ + function once(type: MovementType.TYPE_IN_AUTO, callback: Callback): void; + + + /** + * Check if you're riding a bike。 + * + * @since 9 + * @param type The mobile state type of the subscription, {@code MovementType.TYPE_ON_BICYCLE}. + * @param callback callback function, receive reported data. + */ + function once(type: MovementType.TYPE_ON_BICYCLE, callback: Callback): void; + + + /** + * Query whether it is the status of walking。 + * + * @since 9 + * @param type The mobile state type of the subscription, {@code MovementType.TYPE_WALKING}. + * @param callback callback function, receive reported data. + */ + function once(type: MovementType.TYPE_WALKING, callback: Callback): void; + + /** + * Query whether it is the status of running。 + * + * @since 9 + * @param type The mobile state type of the subscription, {@code MovementType.TYPE_RUNNING}. + * @param callback callback function, receive reported data. + */ + function once(type: MovementType.TYPE_RUNNING, callback: Callback): void; + + /** + * Unsubscribe from the ride's mobile status notification。 + * + * @since 9 + * @param type The mobile state type of the subscription, {@code type: MovementType.TYPE_IN_AUTO}. + * @param eventType enter and exit event. + * @param callback callback function, receive reported data. + */ + function off(type: MovementType.TYPE_IN_AUTO, eventType: MovementValue, callback?: Callback): void; + + /** + * Unsubscribe from the bike's mobile status notification。 + * + * @since 9 + * @param type The mobile state type of the subscription, {@code type: MovementType.TYPE_ON_BICYCLE}. + * @param eventType enter and exit event. + * @param callback callback function, receive reported data. + */ + function off(type: MovementType.TYPE_ON_BICYCLE, eventType: MovementValue, callback?: Callback): void; + + /** + * Unsubscribe from mobile status notifications for walks。 + * + * @since 9 + * @param type The mobile state type of the subscription, {@code type: MovementType.TYPE_WALKING}. + * @param eventType enter and exit event. + * @param callback callback function, receive reported data. + */ + function off(type: MovementType.TYPE_WALKING, eventType: MovementValue, callback?: Callback): void; + + /** + * Unsubscribe from the run's motion status notification。 + * + * @since 9 + * @param type The mobile state type of the subscription, {@code type: MovementType.TYPE_RUNNING}. + * @param eventType enter and exit event. + * @param callback callback function, receive reported data. + */ + function off(type: MovementType.TYPE_RUNNING, eventType: MovementValue, callback?: Callback): void; +} + +export default movement; + diff --git a/api/@ohos.spatialAwareness.d.ts b/api/@ohos.spatialAwareness.d.ts new file mode 100644 index 0000000000..017203ef0f --- /dev/null +++ b/api/@ohos.spatialAwareness.d.ts @@ -0,0 +1,238 @@ +/* + * 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 { Callback } from './basic'; + +/** + * Provides registration and deregistration interfaces for spatial location + relationships between multiple devices, which are defined as follows: + * {@link on}: Subscribe to location relationships between devices + * {@link off}: Unsubscribe from the inter-device location relationship + * + * @since 9 + * @syscap SystemCapability.Msdp.SpatialAwareness + * @permission N/A + */ +declare namespace spatialAwareness { + /** + * Bearing relationship definition。 + * @name DirectionResponse + */ + export interface DirectionResponse { + direction : Direction + } + + /** + * Approach the relationship definition。 + * @name NearByResponse + */ + export interface NearByResponse { + nearby : boolean; + } + + /** + * Distance relationship definition。 + * @name DistanceResponse + */ + export interface DistanceBTResponse { + distance : number; + } + + /** + * Device information definition。 + */ + export interface DeviceInfo { + /** + * Device ID。 + */ + deviceId: string; + + /** + * Device name。 + */ + deviceName: string; + + /** + * Device type。 + */ + deviceType: DeviceType; + } + + /** + * Location information definition。 + * @name PositionRelation + */ + export enum PositionRelation { + /** + * Represents an azimuth relationship。 + */ + DIRECTION = "direction", + /** + * Represents a distance relationship。 + */ + DISTANCE_BT = "distanceBT", + /** + * Represents a proximity relationship。 + */ + NEARBY = "nearby" + } + + /** + * Device type definition。 + * @name DeviceType + */ + export enum DeviceType { + /** + * Represents an unknown device type。 + */ + UNKNOWN_TYPE = 1, + + /** + * Represents a speaker。 + */ + SPEAKER = 2, + + /** + * Represents a smartphone。 + */ + PHONE = 3, + + /** + * Represents a tablet。 + */ + TABLET = 4, + + /** + * Represents a smart wearable device。 + */ + WEARABLE = 5, + + /** + * Represents a car。 + */ + CAR = 6, + + /** + * Represents a Smart TV。 + */ + TV = 7 + } + + /** + * Azimuth relationship pattern definition。 + * @name Direction + */ + export enum Direction { + /** + * Represents the left side of the requesting device。 + */ + LEFT = 1, + /** + * Represents the right side of the requesting device。 + */ + RIGHT = 2, + /** + * Represented in front of the requesting device。 + */ + FRONT = 3, + /** + * Represented after the requested device。 + */ + BACK = 4, + /** + * Represented above the requesting device。 + */ + UP = 5, + /** + * Represented below the requesting device。 + */ + DOWN = 6 + } + + /** + * Spatial azimuth relationships between subscription devices。 + * + * @since 9 + * @syscap SystemCapability.Msdp.SpatialAwareness + * @param type Represents the device-to-device relationship type for a subscription {@code PositionRelation}. + * @param deviceInfo Represents the device information to subscribe to {@code DeviceInfo}. + * @param callback callback function, receive reported data + */ + function on(type: PositionRelation.DIRECTION, deviceInfo : DeviceInfo, + callback: Callback<{ directionRes : DirectionResponse }>): void; + + /** + * Spatial proximity between subscription devices。 + * + * @since 9 + * @syscap SystemCapability.Msdp.SpatialAwareness + * @param type Represents the device-to-device relationship type for a subscription {@code PositionRelation}. + * @param deviceInfo Represents the device information to subscribe to {@code DeviceInfo}. + * @param callback callback function, receive reported data + */ + function on(type: PositionRelation.NEARBY, deviceInfo : DeviceInfo, + callback: Callback<{ nearbyRes: NearByResponse }>): void; + + /** + * Spatial distance relationship between subscription devices。 + * + * @since 9 + * @syscap SystemCapability.Msdp.SpatialAwareness + * @param type Represents the device-to-device relationship type for a subscription {@code PositionRelation}. + * @param deviceInfo Represents the device information to subscribe to {@code DeviceInfo}. + * @param callback callback function, receive reported data + */ + function on(type: PositionRelation.DISTANCE_BT, deviceInfo : DeviceInfo, + callback: Callback<{ distanceRes : DistanceBTResponse }>): void; + + + /** + * Unsubscribe from spatial azimuth relationships between devices。 + * + * @since 9 + * @syscap SystemCapability.Msdp.SpatialAwareness + * @param type Unsubscribe from spatial azimuth relationships between devices {@code PositionRelation}. + * @param deviceInfo Represents device information for unsubscribed {@code DeviceInfo}. + * @param callback callback function, receive reported data + */ + function off(type: PositionRelation.DIRECTION, deviceInfo : DeviceInfo, + callback?: Callback<{ directionRes : DirectionResponse }>): void; + + /** + * Unsubscribe from the space proximity relationship between devices。 + * + * @since 9 + * @syscap SystemCapability.Msdp.SpatialAwareness + * @param type Represents the device-to-device relationship type for a subscription {@code PositionRelation}. + * @param deviceInfo Represents device information for unsubscribed {@code DeviceInfo}. + * @param callback callback function, receive reported data + */ + function off(type: PositionRelation.NEARBY, deviceInfo : DeviceInfo, + callback?: Callback<{ nearbyRes: NearByResponse }>): void; + + /** + * Unsubscribe from the spatial distance relationship between devices。 + * + * @since 9 + * @syscap SystemCapability.Msdp.SpatialAwareness + * @param type Represents the device-to-device relationship type for a subscription {@code PositionRelation}. + * @param deviceInfo Represents device information for unsubscribed {@code DeviceInfo}. + * @param callback callback function, receive reported data + */ + function off(type: PositionRelation.DISTANCE_BT, deviceInfo : DeviceInfo, + callback?: Callback<{ distanceRes : DistanceBTResponse }>): void; +} + +export default spatialAwareness; \ No newline at end of file -- Gitee From fbee6828b5be74317719a308280b46145c355a80 Mon Sep 17 00:00:00 2001 From: li-bo-boblove Date: Fri, 5 Aug 2022 15:01:36 +0800 Subject: [PATCH 002/438] add msdp js api Signed-off-by:li-bo-boblove Signed-off-by: li-bo-boblove --- api/@ohos.geofence.d.ts | 170 ++++++++++++++++++++++++++++++++++++++++ api/@ohos.timeline.d.ts | 161 +++++++++++++++++++++++++++++++++++++ 2 files changed, 331 insertions(+) create mode 100644 api/@ohos.geofence.d.ts create mode 100644 api/@ohos.timeline.d.ts diff --git a/api/@ohos.geofence.d.ts b/api/@ohos.geofence.d.ts new file mode 100644 index 0000000000..32aab86f92 --- /dev/null +++ b/api/@ohos.geofence.d.ts @@ -0,0 +1,170 @@ +/* + * 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 { Callback } from "./basic"; + +/** + * 订阅地理围栏的通知. + * + * @since 9 + * @syscap SystemCapability.Msdp.Geofence + * @import import sensor from '@ohos.geofense' + * @permission N/A + */ +declare namespace geofence { + + /** + * 订阅点围栏. + * + * @since 9 + * @param type Indicate the type to subscribe, {@code GeofenceType.TYPE_POINT_FENCE}. + * @param option Optional parameters specify optional parameters for point fence, {@code Option}. + * @param callback callback function, receive reported data. + */ + function on(type: GeofenceType.TYPE_POINT_FENCE, option: PointOption, callback: Callback): void; + + /** + * 取消点围栏的订阅. + * + * @since 9 + * @param type Indicate the type to subscribe, {@code GeofenceType.TYPE_POINT_FENCE}. + * @param option Optional parameters specify optional parameters for point fence, {@code Option}. + * @param callback callback function, receive reported data. + */ + function off(type: GeofenceType.TYPE_POINT_FENCE, option: PointOption, callback?: Callback): void; + + /** + * 订阅多边形围栏. + * + * @since 9 + * @param type Indicate the type to subscribe, {@code GeofenceType.TYPE_POLYGON_FENCE}. + * @param option Optional parameters specify optional parameters for reporting polygon fence, {@code Option}. + * @param callback callback function, receive reported data. + */ + function on(type: GeofenceType.TYPE_POLYGON_FENCE, option: PolygonOption, callback: Callback): void; + + /** + * 取消多边形围栏订阅. + * + * @since 9 + * @param type Indicate the type to subscribe, {@code GeofenceType.TYPE_POLYGON_FENCE}. + * @param option Optional parameters specify optional parameters for reporting polygon fence, {@code Option}. + * @param callback callback function, receive reported data. + */ + function off(type: GeofenceType.TYPE_POLYGON_FENCE, option: PolygonOption, callback?: Callback): void; + + /** + * 设定防呆策略的时间 + * + * @since 9 + * @param minuteTime time, greater than or equal to 0. + */ + function setFoolProofTime(inuteTime: number): void; + + + /** + * 地理围栏的订阅类型 + * @syscap SystemCapability.Msdp.Geofence + */ + export enum GeofenceType{ + /** + * Point fence + */ + TYPE_POINT_FENCE = "typePointFence", + /** + * Polygon fence + */ + TYPE_POLYGON_FENCE = "typePolygonFence", + } + + /** + * 地理围栏的状态值 + * @syscap SystemCapability.Msdp.Geofence + */ + export enum GeofenceValue { + /** + * Outside the fence + */ + VALUE_OUTSIDE = "outside", + /** + * Inside the fence + */ + VALUE_INSIDE = "inside", + /** + * Enter the fence + */ + VALUE_ENTER = "enter", + /** + * Exit the fence + */ + VALUE_EXIT = "exit", + } + + /** + * 点围栏的选项参数 + * @syscap SystemCapability.Msdp.Geofence + */ + export interface PointOption { + /** + * Coordinates of the center point of the fence + */ + centerCoordinate: Array; + /** + * Radius of fence + */ + radius: number; + } + + /** + * 多边形围栏的选项参数 + * @syscap SystemCapability.Msdp.Geofence + */ + export interface PolygonOption { + /** + * Keyword of fence + */ + keyword: string; + /** + * Type of fence + */ + type: string; + /** + * City of fence + */ + city: string; + } + + /** + * 围栏的基本数据结构 + * @syscap SystemCapability.Msdp.Geofence + */ + export interface GeofenceResponse { + geofenceValue: GeofenceValue; + } + + /** + * 点围栏的数据结构 + * @syscap SystemCapability.Msdp.Geofence + */ + export interface PointFenceResponse extends GeofenceResponse {} + + /** + * 多边形围栏的数据结构 + * @syscap SystemCapability.Msdp.Geofence + */ + export interface PolygonFenceResponse extends GeofenceResponse {} +} + +export default geofence; \ No newline at end of file diff --git a/api/@ohos.timeline.d.ts b/api/@ohos.timeline.d.ts new file mode 100644 index 0000000000..0f5b1d039d --- /dev/null +++ b/api/@ohos.timeline.d.ts @@ -0,0 +1,161 @@ +/* + * 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 { Callback } from "./basic"; + +/** + * 时间线模块提供用户轨迹的预测功能。 + * + * @since 9 + * @syscap SystemCapability.Msdp.Timeline + * @import import timeline from '@ohos.timeline' + * @permission N/A + */ +declare namespace timeline { + /** + * 时间线指定场景的基本类型 + * @syscap SystemCapability.Msdp.Timeline + */ + export enum TimelineArea { + AREA_HOME = "areaHome", + AREA_COMPANY = "areaCompany", + } + + /** + * 时间线指定场景下返回的数据的基本结构 + * @syscap SystemCapability.Msdp.Timeline + */ + export class TimelineResponse { + timelineArea: TimelineArea + } + + /** + * 订阅在指定场景下的通知 + * + * @since 9 + * @syscap SystemCapability.Msdp.Timeline + * @param type Indicate the type to subscribe, {@code TimelineArea}. + * @param callback callback function, receive reported data. + */ + function on(type: "areaHome" | "areaCompany", callback: Callback): void; + + /** + * 取消在指定场景的通知的订阅 + * + * @since 9 + * @syscap SystemCapability.Msdp.Timeline + * @param type Indicate the type to subscribe, {@code TimelineArea}. + * @param callback callback function, receive reported data. + */ + function off(type: "areaHome" | "areaCompany", callback?: Callback): void; + + /** + * 时间线返回指定的异常事件类型的基本类型 + * @syscap SystemCapability.Msdp.Timeline + */ + export enum AbnormalEventType { + DISORDER_TRAJECTORY = "disorder", + UNUSUAL_TRAJECTORY = "unusual", + DIFFERENT_WITH_SETTING = "different", + } + + /** + * 时间线指定的异常事件类型的基本类型 + * @syscap SystemCapability.Msdp.Timeline + */ + export enum AbnormalType { + ABNORMAL = "abnormal" + } + + /** + * 时间线指定异常事件下返回的基本数据结构 + * @syscap SystemCapability.Msdp.Timeline + */ + export class AbnormalEventResponse { + abnormalEvent: string + } + + /** + * 订阅异常事件 + * + * @since 9 + * @syscap SystemCapability.Msdp.Timeline + * @param type Indicate the type to subscribe, {@code AbnormalEventType}. + * @param callback callback function, receive reported data. + */ + function on(type: "abnormal", callback: Callback): void; + + /** + * 取消异常事件的订阅 + * + * @since 9 + * @syscap SystemCapability.Msdp.Timeline + * @param type Indicate the type to subscribe, {@code AbnormalEventType}. + * @param callback callback function, receive reported data. + */ + function off(type: "abnormal", callback?: Callback): void; + + /** + * 设定指定场景的位置信息 + * + * @since 9 + * @syscap SystemCapability.Msdp.Timeline + * @param longitude longitude, ranging from -180 to 180. + * @param latitude latitude, ranging from -90 to 90. + */ + function setPosition(type: "areaHome" | "areaCompany", longitude: number, latitude: number): void; + + /** + * 设定白班和晚班. + * + * @since 9 + * @syscap SystemCapability.Msdp.Timeline + * @param value, 0 means day shift, 1 means night shift. + */ + function setDayAndNightShift(value: number): void; + + /** + * Indicates the time setting type of the timeline for predicting user area. + * @syscap SystemCapability.Msdp.Timeline + */ + export enum UserTime { + SLEEPTIME = "sleepTime", + RESTTIME = "restTime", + WORKTIME = "workTime" + } + + /** + * Set the time parameter for predicting user area. + * + * @since 9 + * @syscap SystemCapability.Msdp.Timeline + * @param start Start hour , ranging from 0 to 23. + * @param end End hour , ranging from 0 to 23. + */ + function setTime(type: "sleepTime" | "restTime" | "workTime", start: number, end: number): void; + + /** + * 根据用户提供的小时信息预测用户是在那个场景 + * + * @since 9 + * @syscap SystemCapability.Msdp.Timeline + * @param hour ranging from 0 to 23. + * @param callback callback function, receive reported data. + */ + function getForcecastPosition(hour: number, callback: Callback): void + function getForcecastPosition(hour: number): Promise(TimelineArea) +} + +export default timeline; -- Gitee From 869240570876789226ec19c7b770f64bf4ebee8f Mon Sep 17 00:00:00 2001 From: li-bo-boblove Date: Fri, 5 Aug 2022 15:07:35 +0800 Subject: [PATCH 003/438] add msdp js api Signed-off-by:li-bo-boblove Signed-off-by: li-bo-boblove --- api/@ohos.devicestatus.d.ts | 221 +++++++++-------------------- api/@ohos.geofence.d.ts | 170 ----------------------- api/@ohos.motion.d.ts | 215 ----------------------------- api/@ohos.movement.d.ts | 204 --------------------------- api/@ohos.spatialAwareness.d.ts | 238 -------------------------------- api/@ohos.timeline.d.ts | 161 --------------------- 6 files changed, 64 insertions(+), 1145 deletions(-) delete mode 100644 api/@ohos.geofence.d.ts delete mode 100644 api/@ohos.motion.d.ts delete mode 100644 api/@ohos.movement.d.ts delete mode 100644 api/@ohos.spatialAwareness.d.ts delete mode 100644 api/@ohos.timeline.d.ts diff --git a/api/@ohos.devicestatus.d.ts b/api/@ohos.devicestatus.d.ts index a9c792eb20..6e231cc780 100644 --- a/api/@ohos.devicestatus.d.ts +++ b/api/@ohos.devicestatus.d.ts @@ -4,7 +4,7 @@ * 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 + * 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, @@ -13,200 +13,107 @@ * limitations under the License. */ -import { AsyncCallback } from "./basic"; +import { Callback } from "./basic"; /** - * Subscribe to user device status notifications + * Declares a namespace that provides APIs to report the device status. * * @since 9 * @syscap SystemCapability.Msdp.DeviceStatus - * @import import sensor from '@ohos.DeviceStatus' - * @permission N/A + * @import import DeviceStatus from '@ohos.DeviceStatus' */ -declare namespace DeviceStatus { +declare namespace deviceStatus { /** - * Behavior-aware data。 + * Declares a response interface to receive the device status. + * * @syscap SystemCapability.Msdp.DeviceStatus + * @since 9 */ - export interface ActivityResponse { - eventType: EventType + interface ActivityResponse { + state: ActivityState; } /** - * Absolutely static data。 - * @syscap SystemCapability.Msdp.DeviceStatus - */ - export interface StillResponse extends ActivityResponse {} - - /** - * Relatively static data。 - * @syscap SystemCapability.Msdp.DeviceStatus - */ - export interface RelativeStillResponse extends ActivityResponse {} - - /** - * Vertically positioned data。 - * @syscap SystemCapability.Msdp.DeviceStatus - */ - export interface VerticalPositionResponse extends ActivityResponse {} - - /** - * Horizontal position of the data。 - * @syscap SystemCapability.Msdp.DeviceStatus - */ - export interface HorizontalPositionResponse extends ActivityResponse {} - - /** - * Behavior recognition type。 + * Declares the device status type. + * * @syscap SystemCapability.Msdp.DeviceStatus + * @since 9 */ - export enum ActivityType { - TYPE_STILL = "still", - TYPE_RELATIVE_STILL = "relativeStill", - TYPE_VERTICAL_POSITION = "verticalPosition", - TYPE_HORIZONTAL_POSITION = "horizontalPosition" - } + type ActivityType = 'still' | 'relativeStill'; /** - * The event type。 + * Enumerates the device status events. + * * @syscap SystemCapability.Msdp.DeviceStatus + * @since 9 */ - export enum EventType { + enum ActivityEvent { + /** + * Event indicating entering device status. + */ ENTER = 1, + + /** + * Event indicating exiting device status. + */ EXIT = 2, + + /** + * Event indicating entering and exiting device status. + */ ENTER_EXIT = 3 } - - /** - * Subscriptions are absolutely static。 - * - * @since 9 - * @param type Subscriptions are absolutely static, {@code type: ActivityType.TYPE_STILL}. - * @param eventType enter and exit event. - * @param reportLatencyNs report event latency. - * @param callback callback function, receive reported data. - */ - function on(type: ActivityType.TYPE_STILL, eventType: EventType, reportLatencyNs: number, callback: AsyncCallback): void; /** - * Subscriptions are relatively static。 - * - * @since 9 - * @param type Subscriptions are relatively static, {@code type: ActivityType.TYPE_RELATIVE_STILL}. - * @param eventType enter and exit event. - * @param reportLatencyNs report event latency. - * @param callback callback function, receive reported data. - */ - function on(type: ActivityType.TYPE_RELATIVE_STILL, eventType: EventType, reportLatencyNs: number, callback: AsyncCallback): void; - - /** - * Subscribe to the vertical position。 - * - * @since 9 - * @param type Subscribe to the vertical position, {@code type: ActivityType.TYPE_VERTICAL_POSITION}. - * @param eventType enter and exit event. - * @param reportLatencyNs report event latency. - * @param callback callback function, receive reported data. - */ - function on(type: ActivityType.TYPE_VERTICAL_POSITION, eventType: EventType, reportLatencyNs: number, callback: AsyncCallback): void; - - /** - * Subscribe to horizontal locations。 - * - * @since 9 - * @param type Subscribe to horizontal locations, {@code type: ActivityType.TYPE_HORIZONTAL_POSITION}. - * @param eventType enter and exit event. - * @param reportLatencyNs report event latency. - * @param callback callback function, receive reported data. - */ - function on(type: ActivityType.TYPE_HORIZONTAL_POSITION, eventType: EventType, reportLatencyNs: number, callback: AsyncCallback): void; - - /** - * Query whether it is absolutely static。 - * - * @since 9 - * @param type Query whether it is absolutely static, {@code type: ActivityType.TYPE_STILL}. - * @param eventType enter and exit event. - * @param reportLatencyNs report event latency. - * @param callback callback function, receive reported data. - */ - function once(type: ActivityType.TYPE_STILL, callback: AsyncCallback): void; - - /** - * Query whether it is relatively stationary。 + * Declares a response interface to receive the device status. * + * @syscap SystemCapability.Msdp.DeviceStatus * @since 9 - * @param type Query whether it is relatively stationary, {@code type: ActivityType.TYPE_RELATIVE_STILL}. - * @param eventType enter and exit event. - * @param reportLatencyNs report event latency. - * @param callback callback function, receive reported data. */ - function once(type: ActivityType.TYPE_RELATIVE_STILL, callback: AsyncCallback): void; - - /** - * Query whether the vertical position is。 + enum ActivityState { + /** + * Entering device status. + */ + ENTER = 1, + + /** + * Exiting device status. + */ + EXIT = 2 + } + + /** + * Subscribes to the device status. * + * @param activity Indicates the device status type. For details, see {@code type: ActivityType}. + * @param event Indicates the device status event. + * @param reportLatencyNs Indicates the event reporting period. + * @param callback Indicates the callback for receiving reported data. + * @syscap SystemCapability.Msdp.DeviceStatus * @since 9 - * @param type Query whether the vertical position is, {@code type: ActivityType.TYPE_VERTICAL_POSITION}. - * @param eventType enter and exit event. - * @param reportLatencyNs report event latency. - * @param callback callback function, receive reported data. */ - function once(type: ActivityType.TYPE_VERTICAL_POSITION, callback: AsyncCallback): void; + function on(activity: ActivityType, event: ActivityEvent, reportLatencyNs: number, callback: Callback): void; /** - * Query whether the horizontal position is。 + * Obtains the device status. * + * @param activity Indicates the device status type. For details, see {@code type: ActivityType}. + * @param callback Indicates the callback for receiving reported data. + * @syscap SystemCapability.Msdp.DeviceStatus * @since 9 - * @param type Query whether the horizontal position is, {@code type: ActivityType.TYPE_HORIZONTAL_POSITION}. - * @param eventType enter and exit event. - * @param reportLatencyNs report event latency. - * @param callback callback function, receive reported data. */ - function once(type: ActivityType.TYPE_HORIZONTAL_POSITION, callback: AsyncCallback): void; + function once(activity: ActivityType, callback: Callback): void; /** - * Unsubscribe absolutely static。 - * - * @since 9 - * @param type Unsubscribe absolutely static, {@code type: ActivityType.TYPE_STILL}. - * @param eventType enter and exit event. - * @param reportLatencyNs report event latency. - * @param callback callback function, receive reported data. - */ - function off(type: ActivityType.TYPE_STILL, eventType: EventType, callback?: AsyncCallback): void; - - /** - * Unsubscribe is relatively static。 - * - * @since 9 - * @param type Unsubscribe is relatively static, {@code type: ActivityType.TYPE_RELATIVE_STILL}. - * @param eventType enter and exit event. - * @param reportLatencyNs report event latency. - * @param callback callback function, receive reported data. - */ - function off(type: ActivityType.TYPE_RELATIVE_STILL, eventType: EventType, callback?: AsyncCallback): void; - - /** - * Unsubscribe from the vertical location。 - * - * @since 9 - * @param type Unsubscribe from the vertical location, {@code type: ActivityType.TYPE_VERTICAL_POSITION}. - * @param eventType enter and exit event. - * @param reportLatencyNs report event latency. - * @param callback callback function, receive reported data. - */ - function off(type: ActivityType.TYPE_VERTICAL_POSITION, eventType: EventType, callback?: AsyncCallback): void; - - /** - * Unsubscribe from horizontal locations。 + * Unsubscribes from the device status. * + * @param activity Indicates the device status type. For details, see {@code type: ActivityType}. + * @param event Indicates the device status event. + * @param callback Indicates the callback for receiving reported data. + * @syscap SystemCapability.Msdp.DeviceStatus * @since 9 - * @param type Unsubscribe from horizontal locations, {@code type: ActivityType.TYPE_HORIZONTAL_POSITION}. - * @param eventType enter and exit event. - * @param reportLatencyNs report event latency. - * @param callback callback function, receive reported data. */ - function off(type: ActivityType.TYPE_HORIZONTAL_POSITION, eventType: EventType, callback?: AsyncCallback): void; + function off(activity: ActivityType, event: ActivityEvent, callback?: Callback): void; } -export default DeviceStatus; \ No newline at end of file + +export default deviceStatus; diff --git a/api/@ohos.geofence.d.ts b/api/@ohos.geofence.d.ts deleted file mode 100644 index 32aab86f92..0000000000 --- a/api/@ohos.geofence.d.ts +++ /dev/null @@ -1,170 +0,0 @@ -/* - * 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 { Callback } from "./basic"; - -/** - * 订阅地理围栏的通知. - * - * @since 9 - * @syscap SystemCapability.Msdp.Geofence - * @import import sensor from '@ohos.geofense' - * @permission N/A - */ -declare namespace geofence { - - /** - * 订阅点围栏. - * - * @since 9 - * @param type Indicate the type to subscribe, {@code GeofenceType.TYPE_POINT_FENCE}. - * @param option Optional parameters specify optional parameters for point fence, {@code Option}. - * @param callback callback function, receive reported data. - */ - function on(type: GeofenceType.TYPE_POINT_FENCE, option: PointOption, callback: Callback): void; - - /** - * 取消点围栏的订阅. - * - * @since 9 - * @param type Indicate the type to subscribe, {@code GeofenceType.TYPE_POINT_FENCE}. - * @param option Optional parameters specify optional parameters for point fence, {@code Option}. - * @param callback callback function, receive reported data. - */ - function off(type: GeofenceType.TYPE_POINT_FENCE, option: PointOption, callback?: Callback): void; - - /** - * 订阅多边形围栏. - * - * @since 9 - * @param type Indicate the type to subscribe, {@code GeofenceType.TYPE_POLYGON_FENCE}. - * @param option Optional parameters specify optional parameters for reporting polygon fence, {@code Option}. - * @param callback callback function, receive reported data. - */ - function on(type: GeofenceType.TYPE_POLYGON_FENCE, option: PolygonOption, callback: Callback): void; - - /** - * 取消多边形围栏订阅. - * - * @since 9 - * @param type Indicate the type to subscribe, {@code GeofenceType.TYPE_POLYGON_FENCE}. - * @param option Optional parameters specify optional parameters for reporting polygon fence, {@code Option}. - * @param callback callback function, receive reported data. - */ - function off(type: GeofenceType.TYPE_POLYGON_FENCE, option: PolygonOption, callback?: Callback): void; - - /** - * 设定防呆策略的时间 - * - * @since 9 - * @param minuteTime time, greater than or equal to 0. - */ - function setFoolProofTime(inuteTime: number): void; - - - /** - * 地理围栏的订阅类型 - * @syscap SystemCapability.Msdp.Geofence - */ - export enum GeofenceType{ - /** - * Point fence - */ - TYPE_POINT_FENCE = "typePointFence", - /** - * Polygon fence - */ - TYPE_POLYGON_FENCE = "typePolygonFence", - } - - /** - * 地理围栏的状态值 - * @syscap SystemCapability.Msdp.Geofence - */ - export enum GeofenceValue { - /** - * Outside the fence - */ - VALUE_OUTSIDE = "outside", - /** - * Inside the fence - */ - VALUE_INSIDE = "inside", - /** - * Enter the fence - */ - VALUE_ENTER = "enter", - /** - * Exit the fence - */ - VALUE_EXIT = "exit", - } - - /** - * 点围栏的选项参数 - * @syscap SystemCapability.Msdp.Geofence - */ - export interface PointOption { - /** - * Coordinates of the center point of the fence - */ - centerCoordinate: Array; - /** - * Radius of fence - */ - radius: number; - } - - /** - * 多边形围栏的选项参数 - * @syscap SystemCapability.Msdp.Geofence - */ - export interface PolygonOption { - /** - * Keyword of fence - */ - keyword: string; - /** - * Type of fence - */ - type: string; - /** - * City of fence - */ - city: string; - } - - /** - * 围栏的基本数据结构 - * @syscap SystemCapability.Msdp.Geofence - */ - export interface GeofenceResponse { - geofenceValue: GeofenceValue; - } - - /** - * 点围栏的数据结构 - * @syscap SystemCapability.Msdp.Geofence - */ - export interface PointFenceResponse extends GeofenceResponse {} - - /** - * 多边形围栏的数据结构 - * @syscap SystemCapability.Msdp.Geofence - */ - export interface PolygonFenceResponse extends GeofenceResponse {} -} - -export default geofence; \ No newline at end of file diff --git a/api/@ohos.motion.d.ts b/api/@ohos.motion.d.ts deleted file mode 100644 index abd85d4cfc..0000000000 --- a/api/@ohos.motion.d.ts +++ /dev/null @@ -1,215 +0,0 @@ -/* - * 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 { Callback } from "./basic"; - -/** - * Provides the ability to subscribe to gesture state. - * - * @since 9 - * @sysCap SystemCapability.Sensors.Motion - * @devices phone, tablet - * @import import sensor from '@ohos.motion' - * @permission N/A - */ -declare namespace motion { - /** - * The basic data structure of gesture state events。 - * @devices phone, tablet - * @sysCap SystemCapability.Msdp.Motion - */ - export interface MotionResponse { - motionValue: boolean - } - - /** - * Pick up the data for the event。 - * @devices phone, tablet - * @sysCap SystemCapability.Msdp.Motion - */ - export interface PickupResponse extends MotionResponse {} - - /** - * Roll over the data for the event。 - * @devices phone, tablet - * @sysCap SystemCapability.Msdp.Motion - */ - export interface FlipResponse extends MotionResponse {} - - /** - * Data close to ear events。 - * @devices phone, tablet - * @sysCap SystemCapability.Msdp.Motion - */ - export interface CloseToEarResponse extends MotionResponse {} - - /** - * Shake the data of the event。 - * @devices phone, tablet - * @sysCap SystemCapability.Msdp.Motion - */ - export interface ShakeResponse extends MotionResponse {} - - /** - * Rotate the data for the event。 - * @devices phone, tablet - * @sysCap SystemCapability.Msdp.Motion - */ - export interface RotateResponse extends MotionResponse {} - - /** - * Two-finger swipe event data。 - * @devices phone, tablet - * @sysCap SystemCapability.Msdp.Motion - */ - export interface TwoFingersPinchResponse extends MotionResponse {} - - /** - * Three fingers swipe the data of the event。 - * @devices phone, tablet - * @sysCap SystemCapability.Msdp.Motion - */ - export interface ThreeFingersSlideResponse extends MotionResponse {} - - /** - * Gesture state type。 - * @devices phone, tablet - * @sysCap SystemCapability.Msdp.Motion - */ - export enum MotionType { - TYPE_PICKUP = "pickUp", - TYPE_CLOSE_TO_EAR = "closeToEar", - TYPE_FLIP = "flip", - TYPE_SHAKE = "shake", - TYPE_ROTATE = "rotate", - TYPE_TWO_FINGER_PINCH = "twoFingerPinch", - TYPE_THREE_FINGERS_SLIDE = "threeFingersSlide", - } - - /** - * Subscribe to pick up gestures。 - * @param The type of gesture state that subscribes to, {@code type: MotionType.TYPE_PICKUP}. - * @param callback The Callback function that the user subscribes to. - * @since 9 - */ - function on(type: MotionType.TYPE_PICKUP, callback: Callback): void; - - /** - * Subscribe to the near ear gesture。 - * @param Subscribe to the gesture status type, {@code type: MotionType.TYPE_CLOSE_TO_EAR}. - * @param callback The Callback function that the user subscribes to. - * @since 9 - */ - function on(type: MotionType.TYPE_CLOSE_TO_EAR, callback: Callback): void; - - /** - * Subscribe to the flip event gesture。 - * @param Subscribe to the gesture status type, {@code type: MotionType.TYPE_FLIP}. - * @param callback The Callback function that the user subscribes to. - * @since 9 - */ - function on(type: MotionType.TYPE_FLIP, callback: Callback): void; - - /** - * Subscribe to a shake gesture。 - * @param Subscribe to the gesture status type, {@code type: MotionType.TYPE_SHAKE}. - * @param callback The Callback function that the user subscribes to. - * @since 9 - */ - function on(type: MotionType.TYPE_SHAKE, callback: Callback): void; - - /** - * Subscribe to the rotate gesture。 - * @param Subscribe to the gesture status type, {@code type: MotionType.TYPE_ROTATE}. - * @param callback The Callback function that the user subscribes to. - * @since 9 - */ - function on(type: MotionType.TYPE_ROTATE, callback: Callback): void; - - /** - * Subscribe to two-finger event gestures。 - * @param Cancels the gesture state type, {@code type: MotionType.TYPE_TWO_FINGER_PINCH}. - * @param callback The User Cancels the Callback function. - * @since 9 - */ - function on(type: MotionType.TYPE_TWO_FINGER_PINCH, callback?: Callback): void; - - /** - * Subscribe to three-finger event gestures。 - * @param Cancels the gesture state type, {@code type: MotionType.TYPE_THREE_FINGERS_SLIDE}. - * @param callback The User Cancels the Callback function. - * @since 9 - */ - function on(type: MotionType.TYPE_THREE_FINGERS_SLIDE, callback?: Callback): void; - - /** - * Cancel the pick-up gesture。 - * @param 取消手势状态的类型, {@code type: MotionType.TYPE_PICKUP}. - * @param callback The User Cancels the Callback function. - * @since 9 - */ - function off(type: MotionType.TYPE_PICKUP, callback?: Callback): void; - - /** - * Cancel the close gesture。 - * @param Cancels the gesture state type, {@code type: MotionType.TYPE_CLOSE_TO_EAR}. - * @param callback The User Cancels the Callback function. - * @since 9 - */ - function off(type: MotionType.TYPE_CLOSE_TO_EAR, callback?: Callback): void; - - /** - * Cancels the flip event gesture。 - * @param Cancels the gesture state type, {@code type: MotionType.TYPE_FLIP}. - * @param callback The User Cancels the Callback function. - * @since 9 - */ - function off(type: MotionType.TYPE_FLIP, callback?: Callback): void; - - /** - * Cancel the shake gesture。 - * @param Cancels the gesture state type, {@code type: MotionType.TYPE_SHAKE}. - * @param callback The User Cancels the Callback function. - * @since 9 - */ - function off(type: MotionType.TYPE_SHAKE, callback?: Callback): void; - - /** - * Cancel the rotate gesture。 - * @param Cancels the gesture state type, {@code type: MotionType.TYPE_ROTATE}. - * @param callback The User Cancels the Callback function. - * @since 9 - */ - function off(type: MotionType.TYPE_ROTATE, callback?: Callback): void; - - /** - * Cancels the two-finger event gesture。 - * @param Cancels the gesture state type, {@code type: MotionType.TYPE_TWO_FINGER_PINCH}. - * @param callback The User Cancels the Callback function. - * @since 9 - */ - function off(type: MotionType.TYPE_TWO_FINGER_PINCH, callback?: Callback): void; - - /** - * Cancels from the three-finger event gesture。 - * @param Cancels the gesture state type, {@code type: MotionType.TYPE_THREE_FINGERS_SLIDE}. - * @param callback The User Cancels the Callback function. - * @since 9 - */ - function off(type: MotionType.TYPE_THREE_FINGERS_SLIDE, callback?: Callback): void; -} - -export default motion; - diff --git a/api/@ohos.movement.d.ts b/api/@ohos.movement.d.ts deleted file mode 100644 index a9bc11c9f1..0000000000 --- a/api/@ohos.movement.d.ts +++ /dev/null @@ -1,204 +0,0 @@ -/* - * 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 { Callback } from "./basic"; - -/** - * Subscribe to user move status notifications - * - * @since 9 - * @syscap SystemCapability.Msdp.Movement - * @import import sensor from '@ohos.movement' - * @permission N/A - */ -declare namespace movement { - /** - * The basic data structure of a move state event。 - * @syscap SystemCapability.Msdp.Movement - */ - export interface MovementResponse { - movementValue: MovementValue - } - - /** - * Data on ride events。 - * @syscap SystemCapability.Msdp.Movement - */ - export interface InAutoResponse extends MovementResponse {} - - /** - * Data on cycling events。 - * @syscap SystemCapability.Msdp.Movement - */ - export interface OnBicycleResponse extends MovementResponse {} - - /** - * Walk the data of the event。 - * @syscap SystemCapability.Msdp.Movement - */ - export interface WalkingResponse extends MovementResponse {} - - /** - * Data for running events。 - * @syscap SystemCapability.Msdp.Movement - */ - export interface RuningResponse extends MovementResponse {} - - /** - * The move state type。 - * @syscap SystemCapability.Msdp.Movement - */ - export enum MovementType { - TYPE_IN_AUTO = "inAuto", - TYPE_ON_BICYCLE = "inBicycle", - TYPE_WALKING = "walking", - TYPE_RUNNING = "running", - } - - /** - * The move status value。 - * @syscap SystemCapability.Msdp.Movement - */ - export enum MovementValue { - ENTER = 1, - EXIT = 2, - ENTER_EXIT = 3 - } - - /** - * Subscribe to notifications of the mobility status of your ride。 - * - * @since 9 - * @param type Subscribe to notifications of the mobility status of your ride, {@code type: MovementType.TYPE_IN_AUTO}. - * @param eventType enter and exit event. - * @param reportLatencyNs report event latency. - * @param callback callback function, receive reported data. - */ - function on(type: MovementType.TYPE_IN_AUTO, eventType: MovementValue, reportLatencyNs: number, callback: Callback): void; - - /** - * Subscribe to notifications of the movement status of your bike。 - * - * @since 9 - * @param type The mobile state type of the subscription, {@code type: MovementType.TYPE_ON_BICYCLE}. - * @param eventType enter and exit event. - * @param reportLatencyNs report event latency. - * @param callback callback function, receive reported data. - */ - function on(type: MovementType.TYPE_ON_BICYCLE, eventType: MovementValue, reportLatencyNs: number, callback: Callback): void; - - /** - * Subscribe to mobile status notifications for walks。 - * - * @since 9 - * @param type The mobile state type of the subscription, {@code type: MovementType.TYPE_WALKING}. - * @param eventType enter and exit event. - * @param reportLatencyNs report event latency. - * @param callback callback function, receive reported data. - */ - function on(type: MovementType.TYPE_WALKING, eventType: MovementValue, reportLatencyNs: number, callback: Callback): void; - - /** - * Subscribe to notifications of the movement status of your run。 - * - * @since 9 - * @param type The mobile state type of the subscription, {@code type: MovementType.TYPE_RUNNING}. - * @param eventType enter and exit event. - * @param reportLatencyNs report event latency. - * @param callback callback function, receive reported data. - */ - function on(type: MovementType.TYPE_RUNNING, eventType: MovementValue, reportLatencyNs: number, callback: Callback): void; - - /** - * Check if you are in the car。 - * - * @since 9 - * @param type The mobile state type of the subscription, {@code MovementType.TYPE_IN_AUTO}. - * @param callback callback function, receive reported data. - */ - function once(type: MovementType.TYPE_IN_AUTO, callback: Callback): void; - - - /** - * Check if you're riding a bike。 - * - * @since 9 - * @param type The mobile state type of the subscription, {@code MovementType.TYPE_ON_BICYCLE}. - * @param callback callback function, receive reported data. - */ - function once(type: MovementType.TYPE_ON_BICYCLE, callback: Callback): void; - - - /** - * Query whether it is the status of walking。 - * - * @since 9 - * @param type The mobile state type of the subscription, {@code MovementType.TYPE_WALKING}. - * @param callback callback function, receive reported data. - */ - function once(type: MovementType.TYPE_WALKING, callback: Callback): void; - - /** - * Query whether it is the status of running。 - * - * @since 9 - * @param type The mobile state type of the subscription, {@code MovementType.TYPE_RUNNING}. - * @param callback callback function, receive reported data. - */ - function once(type: MovementType.TYPE_RUNNING, callback: Callback): void; - - /** - * Unsubscribe from the ride's mobile status notification。 - * - * @since 9 - * @param type The mobile state type of the subscription, {@code type: MovementType.TYPE_IN_AUTO}. - * @param eventType enter and exit event. - * @param callback callback function, receive reported data. - */ - function off(type: MovementType.TYPE_IN_AUTO, eventType: MovementValue, callback?: Callback): void; - - /** - * Unsubscribe from the bike's mobile status notification。 - * - * @since 9 - * @param type The mobile state type of the subscription, {@code type: MovementType.TYPE_ON_BICYCLE}. - * @param eventType enter and exit event. - * @param callback callback function, receive reported data. - */ - function off(type: MovementType.TYPE_ON_BICYCLE, eventType: MovementValue, callback?: Callback): void; - - /** - * Unsubscribe from mobile status notifications for walks。 - * - * @since 9 - * @param type The mobile state type of the subscription, {@code type: MovementType.TYPE_WALKING}. - * @param eventType enter and exit event. - * @param callback callback function, receive reported data. - */ - function off(type: MovementType.TYPE_WALKING, eventType: MovementValue, callback?: Callback): void; - - /** - * Unsubscribe from the run's motion status notification。 - * - * @since 9 - * @param type The mobile state type of the subscription, {@code type: MovementType.TYPE_RUNNING}. - * @param eventType enter and exit event. - * @param callback callback function, receive reported data. - */ - function off(type: MovementType.TYPE_RUNNING, eventType: MovementValue, callback?: Callback): void; -} - -export default movement; - diff --git a/api/@ohos.spatialAwareness.d.ts b/api/@ohos.spatialAwareness.d.ts deleted file mode 100644 index 017203ef0f..0000000000 --- a/api/@ohos.spatialAwareness.d.ts +++ /dev/null @@ -1,238 +0,0 @@ -/* - * 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 { Callback } from './basic'; - -/** - * Provides registration and deregistration interfaces for spatial location - relationships between multiple devices, which are defined as follows: - * {@link on}: Subscribe to location relationships between devices - * {@link off}: Unsubscribe from the inter-device location relationship - * - * @since 9 - * @syscap SystemCapability.Msdp.SpatialAwareness - * @permission N/A - */ -declare namespace spatialAwareness { - /** - * Bearing relationship definition。 - * @name DirectionResponse - */ - export interface DirectionResponse { - direction : Direction - } - - /** - * Approach the relationship definition。 - * @name NearByResponse - */ - export interface NearByResponse { - nearby : boolean; - } - - /** - * Distance relationship definition。 - * @name DistanceResponse - */ - export interface DistanceBTResponse { - distance : number; - } - - /** - * Device information definition。 - */ - export interface DeviceInfo { - /** - * Device ID。 - */ - deviceId: string; - - /** - * Device name。 - */ - deviceName: string; - - /** - * Device type。 - */ - deviceType: DeviceType; - } - - /** - * Location information definition。 - * @name PositionRelation - */ - export enum PositionRelation { - /** - * Represents an azimuth relationship。 - */ - DIRECTION = "direction", - /** - * Represents a distance relationship。 - */ - DISTANCE_BT = "distanceBT", - /** - * Represents a proximity relationship。 - */ - NEARBY = "nearby" - } - - /** - * Device type definition。 - * @name DeviceType - */ - export enum DeviceType { - /** - * Represents an unknown device type。 - */ - UNKNOWN_TYPE = 1, - - /** - * Represents a speaker。 - */ - SPEAKER = 2, - - /** - * Represents a smartphone。 - */ - PHONE = 3, - - /** - * Represents a tablet。 - */ - TABLET = 4, - - /** - * Represents a smart wearable device。 - */ - WEARABLE = 5, - - /** - * Represents a car。 - */ - CAR = 6, - - /** - * Represents a Smart TV。 - */ - TV = 7 - } - - /** - * Azimuth relationship pattern definition。 - * @name Direction - */ - export enum Direction { - /** - * Represents the left side of the requesting device。 - */ - LEFT = 1, - /** - * Represents the right side of the requesting device。 - */ - RIGHT = 2, - /** - * Represented in front of the requesting device。 - */ - FRONT = 3, - /** - * Represented after the requested device。 - */ - BACK = 4, - /** - * Represented above the requesting device。 - */ - UP = 5, - /** - * Represented below the requesting device。 - */ - DOWN = 6 - } - - /** - * Spatial azimuth relationships between subscription devices。 - * - * @since 9 - * @syscap SystemCapability.Msdp.SpatialAwareness - * @param type Represents the device-to-device relationship type for a subscription {@code PositionRelation}. - * @param deviceInfo Represents the device information to subscribe to {@code DeviceInfo}. - * @param callback callback function, receive reported data - */ - function on(type: PositionRelation.DIRECTION, deviceInfo : DeviceInfo, - callback: Callback<{ directionRes : DirectionResponse }>): void; - - /** - * Spatial proximity between subscription devices。 - * - * @since 9 - * @syscap SystemCapability.Msdp.SpatialAwareness - * @param type Represents the device-to-device relationship type for a subscription {@code PositionRelation}. - * @param deviceInfo Represents the device information to subscribe to {@code DeviceInfo}. - * @param callback callback function, receive reported data - */ - function on(type: PositionRelation.NEARBY, deviceInfo : DeviceInfo, - callback: Callback<{ nearbyRes: NearByResponse }>): void; - - /** - * Spatial distance relationship between subscription devices。 - * - * @since 9 - * @syscap SystemCapability.Msdp.SpatialAwareness - * @param type Represents the device-to-device relationship type for a subscription {@code PositionRelation}. - * @param deviceInfo Represents the device information to subscribe to {@code DeviceInfo}. - * @param callback callback function, receive reported data - */ - function on(type: PositionRelation.DISTANCE_BT, deviceInfo : DeviceInfo, - callback: Callback<{ distanceRes : DistanceBTResponse }>): void; - - - /** - * Unsubscribe from spatial azimuth relationships between devices。 - * - * @since 9 - * @syscap SystemCapability.Msdp.SpatialAwareness - * @param type Unsubscribe from spatial azimuth relationships between devices {@code PositionRelation}. - * @param deviceInfo Represents device information for unsubscribed {@code DeviceInfo}. - * @param callback callback function, receive reported data - */ - function off(type: PositionRelation.DIRECTION, deviceInfo : DeviceInfo, - callback?: Callback<{ directionRes : DirectionResponse }>): void; - - /** - * Unsubscribe from the space proximity relationship between devices。 - * - * @since 9 - * @syscap SystemCapability.Msdp.SpatialAwareness - * @param type Represents the device-to-device relationship type for a subscription {@code PositionRelation}. - * @param deviceInfo Represents device information for unsubscribed {@code DeviceInfo}. - * @param callback callback function, receive reported data - */ - function off(type: PositionRelation.NEARBY, deviceInfo : DeviceInfo, - callback?: Callback<{ nearbyRes: NearByResponse }>): void; - - /** - * Unsubscribe from the spatial distance relationship between devices。 - * - * @since 9 - * @syscap SystemCapability.Msdp.SpatialAwareness - * @param type Represents the device-to-device relationship type for a subscription {@code PositionRelation}. - * @param deviceInfo Represents device information for unsubscribed {@code DeviceInfo}. - * @param callback callback function, receive reported data - */ - function off(type: PositionRelation.DISTANCE_BT, deviceInfo : DeviceInfo, - callback?: Callback<{ distanceRes : DistanceBTResponse }>): void; -} - -export default spatialAwareness; \ No newline at end of file diff --git a/api/@ohos.timeline.d.ts b/api/@ohos.timeline.d.ts deleted file mode 100644 index 0f5b1d039d..0000000000 --- a/api/@ohos.timeline.d.ts +++ /dev/null @@ -1,161 +0,0 @@ -/* - * 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 { Callback } from "./basic"; - -/** - * 时间线模块提供用户轨迹的预测功能。 - * - * @since 9 - * @syscap SystemCapability.Msdp.Timeline - * @import import timeline from '@ohos.timeline' - * @permission N/A - */ -declare namespace timeline { - /** - * 时间线指定场景的基本类型 - * @syscap SystemCapability.Msdp.Timeline - */ - export enum TimelineArea { - AREA_HOME = "areaHome", - AREA_COMPANY = "areaCompany", - } - - /** - * 时间线指定场景下返回的数据的基本结构 - * @syscap SystemCapability.Msdp.Timeline - */ - export class TimelineResponse { - timelineArea: TimelineArea - } - - /** - * 订阅在指定场景下的通知 - * - * @since 9 - * @syscap SystemCapability.Msdp.Timeline - * @param type Indicate the type to subscribe, {@code TimelineArea}. - * @param callback callback function, receive reported data. - */ - function on(type: "areaHome" | "areaCompany", callback: Callback): void; - - /** - * 取消在指定场景的通知的订阅 - * - * @since 9 - * @syscap SystemCapability.Msdp.Timeline - * @param type Indicate the type to subscribe, {@code TimelineArea}. - * @param callback callback function, receive reported data. - */ - function off(type: "areaHome" | "areaCompany", callback?: Callback): void; - - /** - * 时间线返回指定的异常事件类型的基本类型 - * @syscap SystemCapability.Msdp.Timeline - */ - export enum AbnormalEventType { - DISORDER_TRAJECTORY = "disorder", - UNUSUAL_TRAJECTORY = "unusual", - DIFFERENT_WITH_SETTING = "different", - } - - /** - * 时间线指定的异常事件类型的基本类型 - * @syscap SystemCapability.Msdp.Timeline - */ - export enum AbnormalType { - ABNORMAL = "abnormal" - } - - /** - * 时间线指定异常事件下返回的基本数据结构 - * @syscap SystemCapability.Msdp.Timeline - */ - export class AbnormalEventResponse { - abnormalEvent: string - } - - /** - * 订阅异常事件 - * - * @since 9 - * @syscap SystemCapability.Msdp.Timeline - * @param type Indicate the type to subscribe, {@code AbnormalEventType}. - * @param callback callback function, receive reported data. - */ - function on(type: "abnormal", callback: Callback): void; - - /** - * 取消异常事件的订阅 - * - * @since 9 - * @syscap SystemCapability.Msdp.Timeline - * @param type Indicate the type to subscribe, {@code AbnormalEventType}. - * @param callback callback function, receive reported data. - */ - function off(type: "abnormal", callback?: Callback): void; - - /** - * 设定指定场景的位置信息 - * - * @since 9 - * @syscap SystemCapability.Msdp.Timeline - * @param longitude longitude, ranging from -180 to 180. - * @param latitude latitude, ranging from -90 to 90. - */ - function setPosition(type: "areaHome" | "areaCompany", longitude: number, latitude: number): void; - - /** - * 设定白班和晚班. - * - * @since 9 - * @syscap SystemCapability.Msdp.Timeline - * @param value, 0 means day shift, 1 means night shift. - */ - function setDayAndNightShift(value: number): void; - - /** - * Indicates the time setting type of the timeline for predicting user area. - * @syscap SystemCapability.Msdp.Timeline - */ - export enum UserTime { - SLEEPTIME = "sleepTime", - RESTTIME = "restTime", - WORKTIME = "workTime" - } - - /** - * Set the time parameter for predicting user area. - * - * @since 9 - * @syscap SystemCapability.Msdp.Timeline - * @param start Start hour , ranging from 0 to 23. - * @param end End hour , ranging from 0 to 23. - */ - function setTime(type: "sleepTime" | "restTime" | "workTime", start: number, end: number): void; - - /** - * 根据用户提供的小时信息预测用户是在那个场景 - * - * @since 9 - * @syscap SystemCapability.Msdp.Timeline - * @param hour ranging from 0 to 23. - * @param callback callback function, receive reported data. - */ - function getForcecastPosition(hour: number, callback: Callback): void - function getForcecastPosition(hour: number): Promise(TimelineArea) -} - -export default timeline; -- Gitee From 0408ca02cefbffbadc8a705a6f590193dce00c6a Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Tue, 23 Aug 2022 15:03:34 +0800 Subject: [PATCH 004/438] houhaoyu@huawei.com fix case s Signed-off-by: houhaoyu Change-Id: I7c95096b3e735176f04bfcbdb33ed8b64d30363b --- api/@internal/component/ets/rect.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/api/@internal/component/ets/rect.d.ts b/api/@internal/component/ets/rect.d.ts index 3bc5bdab97..05cdcd37ba 100644 --- a/api/@internal/component/ets/rect.d.ts +++ b/api/@internal/component/ets/rect.d.ts @@ -81,4 +81,13 @@ declare class RectAttribute extends CommonShapeMethod { } declare const Rect: RectInterface; + +/** + * @deprecated since 9 + */ declare const RectInStance: RectAttribute; + +/** + * @since 9 + */ +declare const RectInstance: RectAttribute; -- Gitee From 81e4750048a95bd199b108580c5f66c78d91c89e Mon Sep 17 00:00:00 2001 From: jiangkai43 Date: Mon, 5 Sep 2022 15:40:29 +0800 Subject: [PATCH 005/438] Add interface exception information https://gitee.com/openharmony/interface_sdk-js/issues/I5PR3T Signed-off-by: jiangkai43 --- api/@ohos.url.d.ts | 294 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 290 insertions(+), 4 deletions(-) diff --git a/api/@ohos.url.d.ts b/api/@ohos.url.d.ts index 0f1f6b9563..3fb05fe8aa 100644 --- a/api/@ohos.url.d.ts +++ b/api/@ohos.url.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -15,13 +15,14 @@ /** * The url module provides utilities for URL resolution and parsing. - * @since 7 + * @since 9 * @syscap SystemCapability.Utils.Lang * @import import url from '@ohos.url'; * @permission N/A */ -declare namespace url { +declare namespace util.url { + // @deprecated since 9 class URLSearchParams { /** * A parameterized constructor used to create an URLSearchParams instance. @@ -30,12 +31,14 @@ declare namespace url { * The input parameter is the object list. * The input parameter is a character string. * The input parameter is the URLSearchParams object. + * @deprecated since 9 */ constructor(init?: string[][] | Record | string | URLSearchParams); /** * Appends a specified key/value pair as a new search parameter. * @since 7 + * @deprecated since 9 * @syscap SystemCapability.Utils.Lang * @param name Key name of the search parameter to be inserted. * @param value Values of search parameters to be inserted. @@ -45,6 +48,7 @@ declare namespace url { /** * Deletes the given search parameter and its associated value,from the list of all search parameters. * @since 7 + * @deprecated since 9 * @syscap SystemCapability.Utils.Lang * @param Name of the key-value pair to be deleted. */ @@ -53,6 +57,7 @@ declare namespace url { /** * Returns all key-value pairs associated with a given search parameter as an array. * @since 7 + * @deprecated since 9 * @syscap SystemCapability.Utils.Lang * @param Name Specifies the name of a key value. * @return string[] Returns all key-value pairs with the specified name. @@ -63,6 +68,7 @@ declare namespace url { * Returns an ES6 iterator. Each item of the iterator is a JavaScript Array. * The first item of Array is name, and the second item of Array is value. * @since 7 + * @deprecated since 9 * @syscap SystemCapability.Utils.Lang * @return Returns an iterator for ES6. */ @@ -71,6 +77,7 @@ declare namespace url { /** * Callback functions are used to traverse key-value pairs on the URLSearchParams instance object. * @since 7 + * @deprecated since 9 * @syscap SystemCapability.Utils.Lang * @param value Current traversal key value. * @param key Indicates the name of the key that is traversed. @@ -82,6 +89,7 @@ declare namespace url { /** * Returns the first value associated to the given search parameter. * @since 7 + * @deprecated since 9 * @syscap SystemCapability.Utils.Lang * @param name Specifies the name of a key-value pair. * @return Returns the first value found by name. If no value is found, null is returned. @@ -91,6 +99,7 @@ declare namespace url { /** * Returns a Boolean that indicates whether a parameter with the specified name exists. * @since 7 + * @deprecated since 9 * @syscap SystemCapability.Utils.Lang * @param name Specifies the name of a key-value pair. * @return Returns a Boolean value that indicates whether a found @@ -103,6 +112,7 @@ declare namespace url { * deletes the others. If the search parameter doesn't exist, this * method creates it. * @since 7 + * @deprecated since 9 * @syscap SystemCapability.Utils.Lang * @param name Key name of the parameter to be set. * @param value Indicates the parameter value to be set. @@ -112,6 +122,7 @@ declare namespace url { /** * Sort all key/value pairs contained in this object in place and return undefined. * @since 7 + * @deprecated since 9 * @syscap SystemCapability.Utils.Lang */ sort(): void; @@ -119,6 +130,7 @@ declare namespace url { /** * Returns an iterator allowing to go through all keys contained in this object. * @since 7 + * @deprecated since 9 * @syscap SystemCapability.Utils.Lang * @return Returns an ES6 Iterator over the names of each name-value pair. */ @@ -127,6 +139,7 @@ declare namespace url { /** * Returns an iterator allowing to go through all values contained in this object. * @since 7 + * @deprecated since 9 * @syscap SystemCapability.Utils.Lang * @return Returns an ES6 Iterator over the values of each name-value pair. */ @@ -136,6 +149,7 @@ declare namespace url { * Returns an iterator allowing to go through all key/value * pairs contained in this object. * @since 7 + * @deprecated since 9 * @syscap SystemCapability.Utils.Lang * @return Returns an ES6 iterator. Each item of the iterator is a JavaScript Array. * The first item of Array is name, and the second item of Array is value. @@ -145,24 +159,166 @@ declare namespace url { /** * Returns a query string suitable for use in a URL. * @since 7 + * @deprecated since 9 * @syscap SystemCapability.Utils.Lang * @return Returns a search parameter serialized as a string, percent-encoded if necessary. */ toString(): string; } + class URLSearchParamsV9 { + /** + * A parameterized constructor used to create an URLSearchParams instance. + * As the input parameter of the constructor function, init supports four types. + * The input parameter is a character string two-dimensional array. + * The input parameter is the object list. + * The input parameter is a character string. + * The input parameter is the URLSearchParams object. + * @since 9 + * @throws {TypedError} Parameter check failed. + */ + constructor(init?: string[][] | Record | string | URLSearchParams); + + /** + * Appends a specified key/value pair as a new search parameter. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param name Key name of the search parameter to be inserted. + * @param value Values of search parameters to be inserted. + * @throws {TypedError} Parameter check failed. + */ + append(name: string, value: string): void; + + /** + * Deletes the given search parameter and its associated value,from the list of all search parameters. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param Name of the key-value pair to be deleted. + * @throws {TypedError} Parameter check failed. + */ + delete(name: string): void; + + /** + * Returns all key-value pairs associated with a given search parameter as an array. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param Name Specifies the name of a key value. + * @return string[] Returns all key-value pairs with the specified name. + * @throws {TypedError} Parameter check failed. + */ + getAll(name: string): string[]; + + /** + * Returns an ES6 iterator. Each item of the iterator is a JavaScript Array. + * The first item of Array is name, and the second item of Array is value. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @return Returns an iterator for ES6. + */ + entries(): IterableIterator<[string, string]>; + + /** + * Callback functions are used to traverse key-value pairs on the URLSearchParams instance object. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param value Current traversal key value. + * @param key Indicates the name of the key that is traversed. + * @param searchParams The instance object that is currently calling the forEach method. + * @param thisArg to be used as this value for when callbackfn is called + * @throws {TypedError} Parameter check failed. + */ + forEach(callbackfn: (value: string, key: string, searchParams: this) => void, thisArg?: Object): void; + + /** + * Returns the first value associated to the given search parameter. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param name Specifies the name of a key-value pair. + * @return Returns the first value found by name. If no value is found, null is returned. + * @throws {TypedError} Parameter check failed. + */ + get(name: string): string | null; + + /** + * Returns a Boolean that indicates whether a parameter with the specified name exists. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param name Specifies the name of a key-value pair. + * @return Returns a Boolean value that indicates whether a found + * @throws {TypedError} Parameter check failed. + */ + has(name: string): boolean; + + /** + * Sets the value associated with a given search parameter to the + * given value. If there were several matching values, this method + * deletes the others. If the search parameter doesn't exist, this + * method creates it. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param name Key name of the parameter to be set. + * @param value Indicates the parameter value to be set. + * @throws {TypedError} Parameter check failed. + */ + set(name: string, value: string): void; + + /** + * Sort all key/value pairs contained in this object in place and return undefined. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + sort(): void; + + /** + * Returns an iterator allowing to go through all keys contained in this object. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @return Returns an ES6 Iterator over the names of each name-value pair. + */ + keys(): IterableIterator; + + /** + * Returns an iterator allowing to go through all values contained in this object. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @return Returns an ES6 Iterator over the values of each name-value pair. + */ + values(): IterableIterator; + + /** + * Returns an iterator allowing to go through all key/value + * pairs contained in this object. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @return Returns an ES6 iterator. Each item of the iterator is a JavaScript Array. + * The first item of Array is name, and the second item of Array is value. + */ + [Symbol.iterator](): IterableIterator<[string, string]>; + + /** + * Returns a query string suitable for use in a URL. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @return Returns a search parameter serialized as a string, percent-encoded if necessary. + */ + toString(): string; + } + + // @deprecated since 9 class URL { /** * URL constructor, which is used to instantiate a URL object. * url: Absolute or relative input URL to resolve. Base is required if input is relative. * If input is an absolute value, base ignores the value. * base: Base URL to parse if input is not absolute. + * @deprecated since 9 */ constructor(url: string, base?: string | URL); /** * Returns the serialized URL as a string. * @since 7 + * @deprecated since 9 * @syscap SystemCapability.Utils.Lang * @return Returns the serialized URL as a string. */ @@ -171,6 +327,7 @@ declare namespace url { /** * Returns the serialized URL as a string. * @since 7 + * @deprecated since 9 * @syscap SystemCapability.Utils.Lang * @return Returns the serialized URL as a string. */ @@ -179,6 +336,7 @@ declare namespace url { /** * Gets and sets the fragment portion of the URL. * @since 7 + * @deprecated since 9 * @syscap SystemCapability.Utils.Lang */ hash: string; @@ -186,6 +344,7 @@ declare namespace url { /** * Gets and sets the host portion of the URL. * @since 7 + * @deprecated since 9 * @syscap SystemCapability.Utils.Lang */ host: string; @@ -193,6 +352,7 @@ declare namespace url { /** * Gets and sets the host name portion of the URL,not include the port. * @since 7 + * @deprecated since 9 * @syscap SystemCapability.Utils.Lang */ hostname: string; @@ -200,6 +360,7 @@ declare namespace url { /** * Gets and sets the serialized URL. * @since 7 + * @deprecated since 9 * @syscap SystemCapability.Utils.Lang */ href: string; @@ -207,6 +368,7 @@ declare namespace url { /** * Gets the read-only serialization of the URL's origin. * @since 7 + * @deprecated since 9 * @syscap SystemCapability.Utils.Lang */ readonly origin: string; @@ -214,6 +376,7 @@ declare namespace url { /** * Gets and sets the password portion of the URL. * @since 7 + * @deprecated since 9 * @syscap SystemCapability.Utils.Lang */ password: string; @@ -221,6 +384,7 @@ declare namespace url { /** * Gets and sets the path portion of the URL. * @since 7 + * @deprecated since 9 * @syscap SystemCapability.Utils.Lang */ pathname: string; @@ -228,6 +392,7 @@ declare namespace url { /** * Gets and sets the port portion of the URL. * @since 7 + * @deprecated since 9 * @syscap SystemCapability.Utils.Lang */ port: string; @@ -235,6 +400,7 @@ declare namespace url { /** * Gets and sets the protocol portion of the URL. * @since 7 + * @deprecated since 9 * @syscap SystemCapability.Utils.Lang */ protocol: string; @@ -242,6 +408,7 @@ declare namespace url { /** * Gets and sets the serialized query portion of the URL. * @since 7 + * @deprecated since 9 * @syscap SystemCapability.Utils.Lang */ search: string; @@ -255,15 +422,134 @@ declare namespace url { * @note Be careful when modifying with .searchParams, because the URLSearchParams * object uses different rules to determine which characters to * percent-encode according to the WHATWG specification. + * @deprecated since 9 */ readonly searchParams: URLSearchParams; /** * Gets and sets the username portion of the URL. * @since 7 + * @deprecated since 9 + * @syscap SystemCapability.Utils.Lang + */ + username: string; + } + + class URLV9 { + /** + * URL constructor, which is used to instantiate a URL object. + * url: Absolute or relative input URL to resolve. Base is required if input is relative. + * If input is an absolute value, base ignores the value. + * base: Base URL to parse if input is not absolute. + * @since 9 + * @throws {TypedError} Parameter check failed. + */ + constructor(url: string, base?: string | URL); + + /** + * Returns the serialized URL as a string. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @return Returns the serialized URL as a string. + */ + toString(): string; + + /** + * Returns the serialized URL as a string. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @return Returns the serialized URL as a string. + */ + toJSON(): string; + + /** + * Gets and sets the fragment portion of the URL. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + hash: string; + + /** + * Gets and sets the host portion of the URL. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + host: string; + + /** + * Gets and sets the host name portion of the URL,not include the port. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + hostname: string; + + /** + * Gets and sets the serialized URL. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + href: string; + + /** + * Gets the read-only serialization of the URL's origin. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + readonly origin: string; + + /** + * Gets and sets the password portion of the URL. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + password: string; + + /** + * Gets and sets the path portion of the URL. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + pathname: string; + + /** + * Gets and sets the port portion of the URL. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + port: string; + + /** + * Gets and sets the protocol portion of the URL. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + protocol: string; + + /** + * Gets and sets the serialized query portion of the URL. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + search: string; + + /** + * Gets the URLSearchParams object that represents the URL query parameter. + * This property is read-only, but URLSearchParams provides an object that can be used to change + * the URL instance. To replace the entire query parameter for a URL, use url.searchsetter. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @note Be careful when modifying with .searchParams, because the URLSearchParams + * object uses different rules to determine which characters to + * percent-encode according to the WHATWG specification. + */ + readonly searchParams: URLSearchParams; + + /** + * Gets and sets the username portion of the URL. + * @since 9 * @syscap SystemCapability.Utils.Lang */ username: string; } } -export default url; \ No newline at end of file +export default util.url; \ No newline at end of file -- Gitee From d5ab09e90659a51f303693a4b8f2873ecf97bf63 Mon Sep 17 00:00:00 2001 From: ltdong Date: Wed, 7 Sep 2022 22:23:18 +0800 Subject: [PATCH 006/438] api update Signed-off-by: ltdong --- api/@ohos.data.rdb.d.ts | 813 ++++++++++++++++++++++++++++++++++++ api/data/rdb/resultSet.d.ts | 293 +++++++++++++ 2 files changed, 1106 insertions(+) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index 9ae430851b..c127ca55fd 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -15,6 +15,7 @@ import {AsyncCallback, Callback} from './basic'; import { ResultSet as _ResultSet } from './data/rdb/resultSet'; +import { ResultSetV9 as _ResultSetV9 } from './data/rdb/resultSet'; import Context from "./application/BaseContext"; import dataSharePredicates from './@ohos.data.dataSharePredicates'; @@ -33,6 +34,8 @@ declare namespace rdb { * to obtain a rdb store. * * @since 7 + * @deprecated since 9 + * @useinstead getRdbStoreV9 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @param context Indicates the context of application or capability. * @param config Indicates the configuration of the database related to this RDB store. The configurations include @@ -43,10 +46,32 @@ declare namespace rdb { function getRdbStore(context: Context, config: StoreConfig, version: number, callback: AsyncCallback): void; function getRdbStore(context: Context, config: StoreConfig, version: number): Promise; + /** + * Obtains an RDB store. + * + * You can set parameters of the RDB store as required. In general, this method is recommended + * to obtain a rdb store. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param context Indicates the context of application or capability. + * @param config Indicates the configuration of the database related to this RDB store. The configurations include + * the database path, storage mode, and whether the database is read-only. + * @param version Indicates the database version for upgrade or downgrade. + * @return Returns an RDB store {@link ohos.data.rdb.RdbStore}. + * @throws {BusinessError} if process failed + * @errorcode 14800004 + * @errorcode 401 + */ + function getRdbStoreV9(context: Context, config: StoreConfig, version: number, callback: AsyncCallback): void; + function getRdbStoreV9(context: Context, config: StoreConfig, version: number): Promise; + /** * Deletes the database with a specified name. * * @since 7 + * @deprecated since 9 + * @useinstead deleteRdbStoreV9 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @param context Indicates the context of application or capability. * @param name Indicates the database name. @@ -55,6 +80,21 @@ declare namespace rdb { function deleteRdbStore(context: Context, name: string, callback: AsyncCallback): void; function deleteRdbStore(context: Context, name: string): Promise; + /** + * Deletes the database with a specified name. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param context Indicates the context of application or capability. + * @param name Indicates the database name. + * @return Returns true if the database is deleted; returns false otherwise. + * @throws {BusinessError} if process failed + * @errorcode 14800004 + * @errorcode 401 + */ + function deleteRdbStoreV9(context: Context, name: string, callback: AsyncCallback): void; + function deleteRdbStoreV9(context: Context, name: string): Promise; + /** * Indicates the database synchronization mode. * @@ -101,6 +141,7 @@ declare namespace rdb { * This class provides methods for creating, querying, updating, and deleting RDBs. * * @since 7 + * @deprecated since 9 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @import import data_rdb from '@ohos.data.rdb'; */ @@ -349,6 +390,324 @@ declare namespace rdb { off(event:'dataChange', type: SubscribeType, observer: Callback>): void; } + /** + * Provides methods for managing the relational database (RDB). + * + * This class provides methods for creating, querying, updating, and deleting RDBs. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @import import data_rdb from '@ohos.data.rdb'; + */ + interface RdbStoreV9 { + /** + * Inserts a row of data into the target table. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param table Indicates the target table. + * @param values Indicates the row of data to be inserted into the table. + * @return Returns the row ID if the operation is successful; returns -1 otherwise. + * @throws {BusinessError} if process failed + * @errorcode 14800004 + * @errorcode 401 + */ + insert(table: string, values: ValuesBucket, callback: AsyncCallback): void; + insert(table: string, values: ValuesBucket): Promise; + + /** + * Inserts a batch of data into the target table. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param table Indicates the target table. + * @param values Indicates the rows of data to be inserted into the table. + * @return Returns the number of values that were inserted if the operation is successful; returns -1 otherwise. + * @throws {BusinessError} if process failed + * @errorcode 14800004 + * @errorcode 401 + */ + batchInsert(table: string, values: Array, callback: AsyncCallback): void; + batchInsert(table: string, values: Array): Promise; + + /** + * Updates data in the database based on a a specified instance object of RdbPredicatesV9. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param values Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. + * @param predicates Indicates the specified update condition by the instance object of RdbPredicatesV9. + * @return Returns the number of affected rows. + * @throws {BusinessError} if process failed + * @errorcode 14800004 + * @errorcode 401 + */ + update(values: ValuesBucket, predicates: RdbPredicatesV9, callback: AsyncCallback): void; + update(values: ValuesBucket, predicates: RdbPredicatesV9): Promise; + + /** + * Updates data in the database based on a a specified instance object of DataSharePredicates. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @systemapi + * @param table Indicates the target table. + * @param values Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. + * @param predicates Indicates the specified update condition by the instance object of DataSharePredicates. + * @return Returns the number of affected rows. + * @throws {BusinessError} if process failed + * @errorcode 14800004 + * @errorcode 401 + */ + update(table: string, values: ValuesBucket, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; + update(table: string, values: ValuesBucket, predicates: dataSharePredicates.DataSharePredicates): Promise; + + /** + * Deletes data from the database based on a specified instance object of RdbPredicatesV9. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param predicates Indicates the specified delete condition by the instance object of RdbPredicatesV9. + * @return Returns the number of affected rows. + * @throws {BusinessError} if process failed + * @errorcode 14800004 + * @errorcode 401 + */ + delete(predicates: RdbPredicatesV9, callback: AsyncCallback): void; + delete(predicates: RdbPredicatesV9): Promise; + + /** + * Deletes data from the database based on a specified instance object of DataSharePredicates. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @systemapi + * @param table Indicates the target table. + * @param predicates Indicates the specified delete condition by the instance object of DataSharePredicates. + * @return Returns the number of affected rows. + * @throws {BusinessError} if process failed + * @errorcode 14800004 + * @errorcode 401 + */ + delete(table: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; + delete(table: string, predicates: dataSharePredicates.DataSharePredicates): Promise; + + /** + * Queries data in the database based on specified conditions. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param predicates Indicates the specified query condition by the instance object of RdbPredicatesV9. + * @param columns Indicates the columns to query. If the value is null, the query applies to all columns. + * @return Returns a ResultSetV9 object if the operation is successful; + * @throws {BusinessError} if process failed + * @errorcode 14800004 + * @errorcode 401 + */ + query(predicates: RdbPredicatesV9, columns: Array, callback: AsyncCallback): void; + query(predicates: RdbPredicatesV9, columns?: Array): Promise; + + /** + * Queries data in the database based on specified conditions. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @systemapi + * @param table Indicates the target table. + * @param predicates Indicates the specified query condition by the instance object of DataSharePredicates. + * @param columns Indicates the columns to query. If the value is null, the query applies to all columns. + * @return Returns a ResultSet object if the operation is successful; + * @throws {BusinessError} if process failed + * @errorcode 14800004 + * @errorcode 401 + */ + query(table: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array, callback: AsyncCallback): void; + query(table: string, predicates: dataSharePredicates.DataSharePredicates, columns?: Array): Promise; + + /** + * Queries remote data in the database based on specified conditions before Synchronizing Data. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param device Indicates specified remote device. + * @param table Indicates the target table. + * @param predicates Indicates the specified remote query condition by the instance object of RdbPredicatesV9. + * @param columns Indicates the columns to remote query. If the value is null, the remote query applies to all columns. + * @return Returns a ResultSetV9 object if the operation is successful; + * @throws {BusinessError} if process failed + * @errorcode 14800004 + * @errorcode 401 + */ + remoteQuery(device: string, table: string, predicates: RdbPredicatesV9, columns: Array, callback: AsyncCallback): void; + remoteQuery(device: string, table: string, predicates: RdbPredicatesV9, columns: Array): Promise; + + /** + * Queries data in the database based on SQL statement. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param sql Indicates the SQL statement to execute. + * @param bindArgs Indicates the values of the parameters in the SQL statement. The values are strings. + * @return Returns a ResultSetV9 object if the operation is successful; + * @throws {BusinessError} if process failed + * @errorcode 14800004 + * @errorcode 401 + */ + querySql(sql: string, bindArgs: Array, callback: AsyncCallback): void; + querySql(sql: string, bindArgs?: Array): Promise; + + /** + * Executes an SQL statement that contains specified parameters but returns no value. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param sql Indicates the SQL statement to execute. + * @param bindArgs Indicates the values of the parameters in the SQL statement. The values are strings. + * @throws {BusinessError} if process failed + * @errorcode 14800004 + * @errorcode 401 + */ + executeSql(sql: string, bindArgs: Array, callback: AsyncCallback): void; + executeSql(sql: string, bindArgs?: Array): Promise; + + /** + * beginTransaction before excute your sql + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @throws {BusinessError} if process failed + * @errorcode 14800004 + */ + beginTransaction():void; + + /** + * commit the the sql you have excuted. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @throws {BusinessError} if process failed + * @errorcode 14800004 + */ + commit():void; + + /** + * roll back the sql you have already excuted + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @throws {BusinessError} if process failed + * @errorcode 14800004 + */ + rollBack():void; + + /** + * Backs up a database in a specified name. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param destName Indicates the name that saves the database backup. + * @throws {BusinessError} if process failed + * @errorcode 14800004 + * @errorcode 401 + */ + backup(destName:string, callback: AsyncCallback):void; + backup(destName:string): Promise; + + /** + * Restores a database from a specified database file. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param srcName Indicates the name that saves the database file. + * @throws {BusinessError} if process failed + * @errorcode 14800004 + * @errorcode 401 + */ + restore(srcName:string, callback: AsyncCallback):void; + restore(srcName:string): Promise; + + /** + * Set table to be distributed table. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param tables the tables name you want to set + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @throws {BusinessError} if process failed + * @errorcode 14900001 + * @errorcode 201 + * @errorcode 401 + */ + setDistributedTables(tables: Array, callback: AsyncCallback): void; + setDistributedTables(tables: Array): Promise; + + /** + * Obtain distributed table name of specified remote device according to local table name. + * When query remote device database, distributed table name is needed. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param device Indicates the remote device. + * @param table Indicates the local table name. + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @return the distributed table name. + * @throws {BusinessError} if process failed + * @errorcode 14900001 + * @errorcode 201 + * @errorcode 401 + */ + obtainDistributedTableName(device: string, table: string, callback: AsyncCallback): void; + obtainDistributedTableName(device: string, table: string): Promise; + + /** + * Sync data between devices + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param mode Indicates the synchronization mode. The value can be PUSH, PULL. + * @param predicates Constraint synchronized data and devices. + * @param callback Indicates the callback used to send the synchronization result to the caller. + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @throws {BusinessError} if process failed + * @errorcode 14900001 + * @errorcode 201 + * @errorcode 401 + */ + sync(mode: SyncMode, predicates: RdbPredicatesV9, callback: AsyncCallback>): void; + sync(mode: SyncMode, predicates: RdbPredicatesV9): Promise>; + + /** + * Registers an observer for the database. When data in the distributed database changes, + * the callback will be invoked. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. + * @param observer Indicates the observer of data change events in the distributed database. + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @throws {BusinessError} if process failed + * @errorcode 14900001 + * @errorcode 201 + * @errorcode 401 + */ + on(event: 'dataChange', type: SubscribeType, observer: Callback>): void; + + /** + * Remove specified observer of specified type from the database. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. + * @param observer Indicates the data change observer already registered. + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @throws {BusinessError} if process failed + * @errorcode 14900001 + * @errorcode 201 + * @errorcode 401 + */ + off(event:'dataChange', type: SubscribeType, observer: Callback>): void; + } + /** * Indicates possible value types * @@ -748,8 +1107,462 @@ declare namespace rdb { */ notIn(field: string, value: Array): RdbPredicates; } + + /** + * Manages relational database configurations. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @import import data_rdb from '@ohos.data.rdb'; + */ + class RdbPredicatesV9 { + /** + * A parameterized constructor used to create an RdbPredicates instance. + * name Indicates the table name of the database. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + constructor(name: string) + + /** + * Specify remote devices when syncing distributed database. + * + * @note When query database, this function should not be called. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param devices Indicates specified remote devices. + * @return Returns the RdbPredicatesV9 self. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + inDevices(devices: Array): RdbPredicatesV9; + + /** + * Specify all remote devices which connect to local device when syncing distributed database. + * + * @note When query database, this function should not be called. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @return Returns the RdbPredicatesV9 self. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + inAllDevices(): RdbPredicatesV9; + + /** + * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is equal + * to a specified value. + * + * @note This method is similar to = of the SQL statement. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param field Indicates the column name in the database table. + * @param value Indicates the value to match with the RdbPredicatesV9. + * @return Returns the RdbPredicatesV9 that match the specified field. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + equalTo(field: string, value: ValueType): RdbPredicatesV9; + + /** + * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is unequal to + * a specified value. + * + * @note This method is similar to != of the SQL statement. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param field Indicates the column name in the database table. + * @param value Indicates the value to match with the RdbPredicatesV9. + * @return Returns the RdbPredicatesV9 that match the specified field. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + notEqualTo(field: string, value: ValueType): RdbPredicatesV9; + + /** + * Adds a left parenthesis to the RdbPredicatesV9. + * + * @note This method is similar to ( of the SQL statement and needs to be used together with endWrap(). + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @return Returns the RdbPredicatesV9 with the left parenthesis. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + beginWrap(): RdbPredicatesV9; + + /** + * Adds a right parenthesis to the RdbPredicatesV9. + * + * @note This method is similar to ) of the SQL statement and needs to be used together + * with beginWrap(). + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @return Returns the RdbPredicatesV9 with the right parenthesis. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + endWrap(): RdbPredicatesV9; + + /** + * Adds an or condition to the RdbPredicatesV9. + * + * @note This method is similar to or of the SQL statement. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @return Returns the RdbPredicatesV9 with the or condition. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + or(): RdbPredicatesV9; + + /** + * Adds an and condition to the RdbPredicatesV9. + * + * @note This method is similar to and of the SQL statement. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @return Returns the RdbPredicatesV9 with the and condition. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + and(): RdbPredicatesV9; + + /** + * Configures the RdbPredicatesV9 to match the field whose data type is string and value + * contains a specified value. + * + * @note This method is similar to contains of the SQL statement. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param field Indicates the column name in the database table. + * @param value Indicates the value to match with the RdbPredicatesV9. + * @return Returns the RdbPredicatesV9 that match the specified field. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + contains(field: string, value: string): RdbPredicatesV9; + + /** + * Configures the RdbPredicatesV9 to match the field whose data type is string and value starts + * with a specified string. + * + * @note This method is similar to value% of the SQL statement. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param field Indicates the column name in the database table. + * @param value Indicates the value to match with the RdbPredicatesV9. + * @return Returns the RdbPredicatesV9 that match the specified field. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + beginsWith(field: string, value: string): RdbPredicatesV9; + + /** + * Configures the RdbPredicatesV9 to match the field whose data type is string and value + * ends with a specified string. + * + * @note This method is similar to %value of the SQL statement. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param field Indicates the column name in the database table. + * @param value Indicates the value to match with the RdbPredicatesV9. + * @return Returns the RdbPredicatesV9 that match the specified field. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + endsWith(field: string, value: string): RdbPredicatesV9; + + /** + * Configures the RdbPredicatesV9 to match the fields whose value is null. + * + * @note This method is similar to is null of the SQL statement. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param field Indicates the column name in the database table. + * @return Returns the RdbPredicatesV9 that match the specified field. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + isNull(field: string): RdbPredicatesV9; + + /** + * Configures the RdbPredicatesV9 to match the specified fields whose value is not null. + * + * @note This method is similar to is not null of the SQL statement. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param field Indicates the column name in the database table. + * @return Returns the RdbPredicatesV9 that match the specified field. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + isNotNull(field: string): RdbPredicatesV9; + + /** + * Configures the RdbPredicatesV9 to match the fields whose data type is string and value is + * similar to a specified string. + * + * @note This method is similar to like of the SQL statement. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param field Indicates the column name in the database table. + * @param value Indicates the value to match with the RdbPredicatesV9. The percent sign (%) in the value + * is a wildcard (like * in a regular expression). + * @return Returns the RdbPredicatesV9 that match the specified field. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + like(field: string, value: string): RdbPredicatesV9; + + /** + * Configures RdbPredicatesV9 to match the specified field whose data type is string and the value contains + * a wildcard. + * + * @note Different from like, the input parameters of this method are case-sensitive. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param field Indicates the column name in the database table. + * @param value Indicates the value to match with RdbPredicatesV9. + * @return Returns the SQL statement with the specified RdbPredicatesV9. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + glob(field: string, value: string): RdbPredicatesV9; + + /** + * Restricts the value of the field to the range between low value and high value. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param field Indicates the column name. + * @param low Indicates the minimum value. + * @param high Indicates the maximum value. + * @return Returns the SQL query statement with the specified RdbPredicatesV9. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + between(field: string, low: ValueType, high: ValueType): RdbPredicatesV9; + + /** + * Configures RdbPredicatesV9 to match the specified field whose data type is int and value is + * out of a given range. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param field Indicates the column name in the database table. + * @param low Indicates the minimum value to match with DataAbilityPredicates. + * @param high Indicates the maximum value to match with DataAbilityPredicates. + * @return Returns the SQL query statement with the specified RdbPredicatesV9. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + notBetween(field: string, low: ValueType, high: ValueType): RdbPredicatesV9; + + /** + * Restricts the value of the field to be greater than the specified value. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param field Indicates the column name. + * @param value Indicates the String field. + * @return Returns the SQL query statement with the specified RdbPredicatesV9. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + greaterThan(field: string, value: ValueType): RdbPredicatesV9; + + /** + * Restricts the value of the field to be smaller than the specified value. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param field Indicates the column name. + * @param value Indicates the String field. + * @return Returns the SQL query statement with the specified RdbPredicatesV9. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + lessThan(field: string, value: ValueType): RdbPredicatesV9; + + /** + * Restricts the value of the field to be greater than or equal to the specified value. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param field Indicates the column name. + * @param value Indicates the String field. + * @return Returns the SQL query statement with the specified RdbPredicatesV9. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + greaterThanOrEqualTo(field: string, value: ValueType): RdbPredicatesV9; + + /** + * Restricts the value of the field to be smaller than or equal to the specified value. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param field Indicates the column name. + * @param value Indicates the String field. + * @return Returns the SQL query statement with the specified RdbPredicatesV9. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + lessThanOrEqualTo(field: string, value: ValueType): RdbPredicatesV9; + + /** + * Restricts the ascending order of the return list. When there are several orders, + * the one close to the head has the highest priority. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param field Indicates the column name for sorting the return list. + * @return Returns the SQL query statement with the specified RdbPredicatesV9. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + orderByAsc(field: string): RdbPredicatesV9; + + /** + * Restricts the descending order of the return list. When there are several orders, + * the one close to the head has the highest priority. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param field Indicates the column name for sorting the return list. + * @return Returns the SQL query statement with the specified RdbPredicatesV9. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + orderByDesc(field: string): RdbPredicatesV9; + + /** + * Restricts each row of the query result to be unique. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @return Returns the SQL query statement with the specified RdbPredicatesV9. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + distinct(): RdbPredicatesV9; + + /** + * Restricts the max number of return records. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param value Indicates the max length of the return list. + * @return Returns the SQL query statement with the specified RdbPredicatesV9. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + limitAs(value: number): RdbPredicatesV9; + + /** + * Configures RdbPredicatesV9 to specify the start position of the returned result. + * + * @note Use this method together with limit(int). + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param rowOffset Indicates the start position of the returned result. The value is a positive integer. + * @return Returns the SQL query statement with the specified AbsPredicates. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + offsetAs(rowOffset: number): RdbPredicatesV9; + + /** + * Configures RdbPredicatesV9 to group query results by specified columns. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param fields Indicates the specified columns by which query results are grouped. + * @return Returns the RdbPredicatesV9 with the specified columns by which query results are grouped. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + groupBy(fields: Array): RdbPredicatesV9; + + /** + * Configures RdbPredicatesV9 to specify the index column. + * + * @note Before using this method, you need to create an index column. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param indexName Indicates the name of the index column. + * @return Returns RdbPredicatesV9 with the specified index column. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + indexedBy(field: string): RdbPredicatesV9; + + /** + * Configures RdbPredicatesV9 to match the specified field whose data type is ValueType array and values + * are within a given range. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param field Indicates the column name in the database table. + * @param values Indicates the values to match with RdbPredicatesV9. + * @return Returns RdbPredicatesV9 that matches the specified field. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + in(field: string, value: Array): RdbPredicatesV9; + + /** + * Configures RdbPredicatesV9 to match the specified field whose data type is ValueType array and values + * are out of a given range. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param field Indicates the column name in the database table. + * @param values Indicates the values to match with RdbPredicatesV9. + * @return Returns RdbPredicatesV9 that matches the specified field. + * @throws {BusinessError} if process failed + * @errorcode 14800005 + * @errorcode 401 + */ + notIn(field: string, value: Array): RdbPredicatesV9; + } export type ResultSet = _ResultSet + export type ResultSetV9 = _ResultSetV9 } export default rdb; diff --git a/api/data/rdb/resultSet.d.ts b/api/data/rdb/resultSet.d.ts index 79d07883d2..cc5fe23567 100755 --- a/api/data/rdb/resultSet.d.ts +++ b/api/data/rdb/resultSet.d.ts @@ -19,6 +19,7 @@ import { AsyncCallback } from '../../basic' * Provides methods for accessing a database result set generated by querying the database. * * @since 7 + * @deprecated since 9 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @import import data_rdb from '@ohos.data.rdb'; */ @@ -268,4 +269,296 @@ export default interface ResultSet { * @return Returns true if the result set is closed; returns false otherwise. */ close(): void; +} + +/** + * Provides methods for accessing a database result set generated by querying the database. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @import import data_rdb from '@ohos.data.rdb'; + */ +export default interface ResultSetV9 { + /** + * Obtains the names of all columns in a result set. + * + * @note The column names are returned as a string array, in which the strings are in the same order + * as the columns in the result set. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + */ + columnNames: Array; + + /** + * Obtains the number of columns in the result set. + * + * @note The returned number is equal to the length of the string array returned by the + * columnCount method. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + */ + columnCount: number; + + /** + * Obtains the number of rows in the result set. + * + * @note N/A + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + */ + rowCount: number; + + /** + * Obtains the current index of the result set. + * + * @note The result set index starts from 0. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + */ + rowIndex: number; + + /** + * Checks whether the result set is positioned at the first row. + * + * @note N/A + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + */ + isAtFirstRow: boolean; + + /** + * Checks whether the result set is positioned at the last row. + * + * @note N/A + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + */ + isAtLastRow: boolean; + + /** + * Checks whether the result set is positioned after the last row. + * + * @note N/A + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + */ + isEnded: boolean; + + /** + * Returns whether the cursor is pointing to the position before the first + * row. + * + * @note N/A + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + */ + isStarted: boolean; + + /** + * Checks whether the current result set is closed. + * + * If the result set is closed by calling the close method, true will be returned. + * + * @note N/A + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + */ + isClosed: boolean; + + /** + * Obtains the column index based on the specified column name. + * + * @note The column name is passed as an input parameter. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param columnName Indicates the name of the specified column in the result set. + * @return Returns the index of the specified column. + * @throws {BusinessError} if process failed + * @errorcode 14800003 + * @errorcode 401 + */ + getColumnIndex(columnName: string): number; + + /** + * Obtains the column name based on the specified column index. + * + * @note The column index is passed as an input parameter. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param columnIndex Indicates the index of the specified column in the result set. + * @return Returns the name of the specified column. + * @throws {BusinessError} if process failed + * @errorcode 14800003 + * @errorcode 401 + */ + getColumnName(columnIndex: number): string; + + /** + * Go to the specified row of the result set forwards or backwards by an offset relative to its current position. + * A positive offset indicates moving backwards, and a negative offset indicates moving forwards. + * + * @note N/A + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param offset Indicates the offset relative to the current position. + * @return Returns true if the result set is moved successfully and does not go beyond the range; + * returns false otherwise. + * @throws {BusinessError} if process failed + * @errorcode 14800002 + * @errorcode 401 + */ + goTo(offset: number): boolean; + + /** + * Go to the specified row of the result set. + * + * @note N/A + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param rowIndex Indicates the index of the specified row, which starts from 0. + * @return Returns true if the result set is moved successfully; returns false otherwise. + * @throws {BusinessError} if process failed + * @errorcode 14800002 + * @errorcode 401 + */ + goToRow(position: number): boolean; + + /** + * Go to the first row of the result set. + * + * @note N/A + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @return Returns true if the result set is moved successfully; + * returns false otherwise, for example, if the result set is empty. + * @throws {BusinessError} if process failed + * @errorcode 14800002 + */ + goToFirstRow(): boolean; + + /** + * Go to the last row of the result set. + * + * @note N/A + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @return Returns true if the result set is moved successfully; + * returns false otherwise, for example, if the result set is empty. + * @throws {BusinessError} if process failed + * @errorcode 14800002 + */ + goToLastRow(): boolean; + + /** + * Go to the next row of the result set. + * + * @note N/A + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @return Returns true if the result set is moved successfully; + * returns false otherwise, for example, if the result set is already in the last row. + * @throws {BusinessError} if process failed + * @errorcode 14800002 + */ + goToNextRow(): boolean; + + /** + * Go to the previous row of the result set. + * + * @note N/A + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @return Returns true if the result set is moved successfully; + * returns false otherwise, for example, if the result set is already in the first row. + * @throws {BusinessError} if process failed + * @errorcode 14800002 + */ + goToPreviousRow(): boolean; + + /** + * Obtains the value of the specified column in the current row as a byte array. + * + * @note The implementation class determines whether to throw an exception if the value of the specified column + * in the current row is null or the specified column is not of the Blob type. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param columnIndex Indicates the specified column index, which starts from 0. + * @return Returns the value of the specified column as a byte array. + * @throws {BusinessError} if process failed + * @errorcode 14800003 + * @errorcode 401 + */ + getBlob(columnIndex: number): Uint8Array; + + /** + * Obtains the value of the specified column in the current row as string. + * + * @note The implementation class determines whether to throw an exception if the value of the specified column + * in the current row is null or the specified column is not of the string type. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param columnIndex Indicates the specified column index, which starts from 0. + * @return Returns the value of the specified column as a string. + * @throws {BusinessError} if process failed + * @errorcode 14800003 + * @errorcode 401 + */ + getString(columnIndex: number): string; + + /** + * Obtains the value of the specified column in the current row as long. + * + * @note The implementation class determines whether to throw an exception if the value of the specified column + * in the current row is null, the specified column is not of the integer type. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param columnIndex Indicates the specified column index, which starts from 0. + * @return Returns the value of the specified column as a long. + * @throws {BusinessError} if process failed + * @errorcode 14800003 + * @errorcode 401 + */ + getLong(columnIndex: number): number; + + /** + * Obtains the value of the specified column in the current row as double. + * + * @note The implementation class determines whether to throw an exception if the value of the specified column + * in the current row is null, the specified column is not of the double type. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param columnIndex Indicates the specified column index, which starts from 0. + * @return Returns the value of the specified column as a double. + * @throws {BusinessError} if process failed + * @errorcode 14800003 + * @errorcode 401 + */ + getDouble(columnIndex: number): number; + + /** + * Checks whether the value of the specified column in the current row is null. + * + * @note N/A + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @param columnIndex Indicates the specified column index, which starts from 0. + * @return Returns true if the value of the specified column in the current row is null; + * returns false otherwise. + * @throws {BusinessError} if process failed + * @errorcode 14800003 + * @errorcode 401 + */ + isColumnNull(columnIndex: number): boolean; + + /** + * Closes the result set. + * + * @note Calling this method on the result set will release all of its resources and makes it ineffective. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @return Returns true if the result set is closed; returns false otherwise. + * @throws {BusinessError} if process failed + * @errorcode 14800002 + */ + close(): void; } \ No newline at end of file -- Gitee From bd1b0b91fdfbaa410e1719b83cae50d2ec74b2e6 Mon Sep 17 00:00:00 2001 From: zhangbingce Date: Thu, 8 Sep 2022 15:49:23 +0800 Subject: [PATCH 007/438] [xcomponent] specify return value type Signed-off-by: zhangbingce Change-Id: I1ad529353029134782d2de4b7de6370c2c8a340a --- api/@internal/component/ets/xcomponent.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/@internal/component/ets/xcomponent.d.ts b/api/@internal/component/ets/xcomponent.d.ts index 522fc23bb9..27b9e77e4f 100644 --- a/api/@internal/component/ets/xcomponent.d.ts +++ b/api/@internal/component/ets/xcomponent.d.ts @@ -33,13 +33,13 @@ declare class XComponentController { * Get the id of surface created by XComponent. * @since 9 */ - getXComponentSurfaceId(); + getXComponentSurfaceId(): string; /** * Get the context of native XComponent. * @since 8 */ - getXComponentContext(); + getXComponentContext(): Object; /** * Set the surface size created by XComponent. @@ -53,7 +53,7 @@ declare class XComponentController { setXComponentSurfaceSize(value: { surfaceWidth: number; surfaceHeight: number; - }); + }): void; } /** -- Gitee From 5870a05cd4b941cfccdc6739e46fadc5d5e033ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E6=80=A1?= Date: Fri, 9 Sep 2022 02:53:50 +0000 Subject: [PATCH 008/438] =?UTF-8?q?API=E6=94=AF=E6=8C=81=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱天怡 --- api/@ohos.WorkSchedulerExtensionAbility.d.ts | 6 + api/@ohos.backgroundTaskManager.d.ts | 24 + api/@ohos.bundleState.d.ts | 46 ++ ...chedule.WorkSchedulerExtensionAbility.d.ts | 45 ++ ...esourceschedule.backgroundTaskManager.d.ts | 293 ++++++++++ ...ohos.resourceschedule.usageStatistics.d.ts | 535 ++++++++++++++++++ api/@ohos.resourceschedule.workScheduler.d.ts | 282 +++++++++ api/@ohos.workScheduler.d.ts | 24 + 8 files changed, 1255 insertions(+) create mode 100644 api/@ohos.resourceschedule.WorkSchedulerExtensionAbility.d.ts create mode 100644 api/@ohos.resourceschedule.backgroundTaskManager.d.ts create mode 100644 api/@ohos.resourceschedule.usageStatistics.d.ts create mode 100644 api/@ohos.resourceschedule.workScheduler.d.ts diff --git a/api/@ohos.WorkSchedulerExtensionAbility.d.ts b/api/@ohos.WorkSchedulerExtensionAbility.d.ts index df30bd831e..9a75d079e5 100644 --- a/api/@ohos.WorkSchedulerExtensionAbility.d.ts +++ b/api/@ohos.WorkSchedulerExtensionAbility.d.ts @@ -21,6 +21,8 @@ import workScheduler from "./@ohos.workScheduler"; * @since 9 * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.WorkSchedulerExtensionAbility */ export default class WorkSchedulerExtensionAbility { /** @@ -30,6 +32,8 @@ export default class WorkSchedulerExtensionAbility { * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly * @param work The info of work. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.WorkSchedulerExtensionAbility.onWorkStart */ onWorkStart(work: workScheduler.WorkInfo): void; @@ -40,6 +44,8 @@ export default class WorkSchedulerExtensionAbility { * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly * @param work The info of work. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.WorkSchedulerExtensionAbility.onWorkStop */ onWorkStop(work: workScheduler.WorkInfo): void; } \ No newline at end of file diff --git a/api/@ohos.backgroundTaskManager.d.ts b/api/@ohos.backgroundTaskManager.d.ts index dc66d4f79d..a051ce8115 100644 --- a/api/@ohos.backgroundTaskManager.d.ts +++ b/api/@ohos.backgroundTaskManager.d.ts @@ -22,6 +22,8 @@ import Context from './application/BaseContext'; * * @since 7 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.backgroundTaskManager */ declare namespace backgroundTaskManager { /** @@ -30,6 +32,8 @@ declare namespace backgroundTaskManager { * @name DelaySuspendInfo * @since 7 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.backgroundTaskManager.DelaySuspendInfo */ interface DelaySuspendInfo { /** @@ -48,6 +52,8 @@ declare namespace backgroundTaskManager { * @since 7 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @param requestId Indicates the identifier of the delay request. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.backgroundTaskManager.cancelSuspendDelay */ function cancelSuspendDelay(requestId: number): void; @@ -58,6 +64,8 @@ declare namespace backgroundTaskManager { * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @param requestId Indicates the identifier of the delay request. * @return The remaining delay time + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.backgroundTaskManager.getRemainingDelayTime */ function getRemainingDelayTime(requestId: number, callback: AsyncCallback): void; function getRemainingDelayTime(requestId: number): Promise; @@ -70,6 +78,8 @@ declare namespace backgroundTaskManager { * @param reason Indicates the reason for delayed transition to the suspended state. * @param callback The callback delay time expired. * @return Info of delay request + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.backgroundTaskManager.requestSuspendDelay */ function requestSuspendDelay(reason: string, callback: Callback): DelaySuspendInfo; @@ -83,6 +93,8 @@ declare namespace backgroundTaskManager { * @param context app running context. * @param bgMode Indicates which background mode to request. * @param wantAgent Indicates which ability to start when user click the notification bar. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.backgroundTaskManager.startBackgroundRunning */ function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback): void; function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise; @@ -93,6 +105,8 @@ declare namespace backgroundTaskManager { * @since 8 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @param context app running context. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.backgroundTaskManager.stopBackgroundRunning */ function stopBackgroundRunning(context: Context, callback: AsyncCallback): void; function stopBackgroundRunning(context: Context): Promise; @@ -104,6 +118,8 @@ declare namespace backgroundTaskManager { * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply * @return True if efficiency resources apply success, else false. * @systemapi Hide this for inner system use. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.backgroundTaskManager.applyEfficiencyResources */ function applyEfficiencyResources(request: EfficiencyResourcesRequest): boolean; @@ -113,6 +129,8 @@ declare namespace backgroundTaskManager { * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply * @systemapi Hide this for inner system use. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.backgroundTaskManager.resetAllEfficiencyResources */ function resetAllEfficiencyResources(): void; @@ -121,6 +139,8 @@ declare namespace backgroundTaskManager { * * @since 8 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.backgroundTaskManager.BackgroundMode */ export enum BackgroundMode { /** @@ -205,6 +225,8 @@ declare namespace backgroundTaskManager { * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply * @systemapi Hide this for inner system use. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.backgroundTaskManager.ResourceType */ export enum ResourceType { /** @@ -250,6 +272,8 @@ declare namespace backgroundTaskManager { * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply * @systemapi Hide this for inner system use. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.backgroundTaskManager.EfficiencyResourcesRequest */ export interface EfficiencyResourcesRequest { /** diff --git a/api/@ohos.bundleState.d.ts b/api/@ohos.bundleState.d.ts index 1a2ca8aa49..6e3e4f8f69 100644 --- a/api/@ohos.bundleState.d.ts +++ b/api/@ohos.bundleState.d.ts @@ -25,12 +25,16 @@ import { AsyncCallback , Callback} from './basic'; * then returns it to you. * * @since 7 + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.bundleState */ declare namespace bundleState { /** * @since 7 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.usageStatistics.BundleStateInfo */ interface BundleStateInfo { /** @@ -92,6 +96,8 @@ declare namespace bundleState { * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @systemapi Hide this for inner system use. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.usageStatistics.BundleActiveFormInfo */ interface BundleActiveFormInfo { /** @@ -120,6 +126,8 @@ declare namespace bundleState { * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @systemapi Hide this for inner system use. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.usageStatistics.BundleActiveModuleInfo */ interface BundleActiveModuleInfo { /** @@ -180,6 +188,8 @@ declare namespace bundleState { * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @systemapi Hide this for inner system use. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.usageStatistics.BundleActiveEventState */ interface BundleActiveEventState { /** @@ -201,6 +211,8 @@ declare namespace bundleState { /** * @since 7 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.usageStatistics.BundleActiveState */ interface BundleActiveState { /** @@ -232,6 +244,8 @@ declare namespace bundleState { * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @systemapi Hide this for inner system use. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.usageStatistics.BundleActiveGroupCallbackInfo */ interface BundleActiveGroupCallbackInfo { /* @@ -265,6 +279,8 @@ declare namespace bundleState { * @return Returns {@code true} if the application is idle in a particular period; * returns {@code false} otherwise. The time range of the particular period is defined by the system, * which may be hours or days. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.usageStatistics.isIdleState */ function isIdleState(bundleName: string, callback: AsyncCallback): void; function isIdleState(bundleName: string): Promise; @@ -278,6 +294,8 @@ declare namespace bundleState { * @since 7 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @return Returns the usage priority group of the calling application. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.usageStatistics.queryAppUsagePriorityGroup */ function queryAppUsagePriorityGroup(callback: AsyncCallback): void; function queryAppUsagePriorityGroup(): Promise; @@ -285,6 +303,8 @@ declare namespace bundleState { /** * @since 7 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.usageStatistics.BundleActiveInfoResponse */ interface BundleActiveInfoResponse { [key: string]: BundleStateInfo; @@ -302,6 +322,8 @@ declare namespace bundleState { * @param begin Indicates the start time of the query period, in milliseconds. * @param end Indicates the end time of the query period, in milliseconds. * @return Returns the {@link BundleActiveInfoResponse} objects containing the usage information about each bundle. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.usageStatistics.queryBundleStateInfos */ function queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback): void; function queryBundleStateInfos(begin: number, end: number): Promise; @@ -311,6 +333,8 @@ declare namespace bundleState { * * @since 7 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.usageStatistics.IntervalType */ export enum IntervalType { /** @@ -352,6 +376,8 @@ declare namespace bundleState { * @param begin Indicates the start time of the query period, in milliseconds. * @param end Indicates the end time of the query period, in milliseconds. * @return Returns the list of {@link BundleStateInfo} objects containing the usage information about each bundle. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.usageStatistics.queryBundleStateInfoByInterval */ function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback>): void; function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise>; @@ -366,6 +392,8 @@ declare namespace bundleState { * @param begin Indicates the start time of the query period, in milliseconds. * @param end Indicates the end time of the query period, in milliseconds. * @return Returns the list of {@link BundleActiveState} objects containing the state data of all bundles. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.usageStatistics.queryBundleActiveStates */ function queryBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void; function queryBundleActiveStates(begin: number, end: number): Promise>; @@ -378,6 +406,8 @@ declare namespace bundleState { * @param begin Indicates the start time of the query period, in milliseconds. * @param end Indicates the end time of the query period, in milliseconds. * @return Returns the {@link BundleActiveState} object Array containing the state data of the current bundle. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.usageStatistics.queryCurrentBundleActiveStates */ function queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void; function queryCurrentBundleActiveStates(begin: number, end: number): Promise>; @@ -391,6 +421,8 @@ declare namespace bundleState { * @systemapi Hide this for inner system use. * @param maxNum Indicates max record number in result, max value is 1000, default value is 1000. * @return Returns the {@link BundleActiveModuleInfo} object Array containing the usage data of the modules. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.usageStatistics.getRecentlyUsedModules */ function getRecentlyUsedModules(maxNum?: number, callback: AsyncCallback>): void; function getRecentlyUsedModules(maxNum?: number): Promise>; @@ -407,6 +439,8 @@ declare namespace bundleState { * @systemapi Hide this for inner system use. * @param bundleName, name of the application. * @return Returns the usage priority group of the calling application. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.usageStatistics.queryAppUsagePriorityGroup */ function queryAppUsagePriorityGroup(bundleName? : string, callback: AsyncCallback): void; function queryAppUsagePriorityGroup(bundleName? : string): Promise; @@ -417,6 +451,8 @@ declare namespace bundleState { * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @systemapi Hide this for inner system use. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.usageStatistics.GroupType */ export enum GroupType { /** @@ -460,6 +496,8 @@ declare namespace bundleState { * @param bundleName, name of the application. * @param newGroup,the group of the application whose name is bundleName. * @return Returns the result of setBundleGroup, true of false. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.usageStatistics.setBundleGroup */ function setBundleGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void; function setBundleGroup(bundleName: string, newGroup: GroupType): Promise; @@ -473,6 +511,8 @@ declare namespace bundleState { * @systemapi Hide this for inner system use. * @param Callback, callback when application group change,return the BundleActiveGroupCallbackInfo. * @return Returns BundleActiveGroupCallbackInfo when the group of bundle changed. the result of AsyncCallback is true or false. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.usageStatistics.registerGroupCallBack */ function registerGroupCallBack(callback: Callback, callback: AsyncCallback): void; function registerGroupCallBack(callback: Callback): Promise; @@ -485,6 +525,8 @@ declare namespace bundleState { * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @systemapi Hide this for inner system use. * @return Returns the result of unRegisterGroupCallBack, true of false. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.usageStatistics.unRegisterGroupCallBack */ function unRegisterGroupCallBack(callback: AsyncCallback): void; function unRegisterGroupCallBack(): Promise; @@ -499,6 +541,8 @@ declare namespace bundleState { * @param begin Indicates the start time of the query period, in milliseconds. * @param end Indicates the end time of the query period, in milliseconds. * @return Returns the {@link BundleActiveEventState} object Array containing the event states data. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.usageStatistics.queryBundleActiveEventStates */ function queryBundleActiveEventStates(begin: number, end: number, callback: AsyncCallback>): void; function queryBundleActiveEventStates(begin: number, end: number): Promise>; @@ -513,6 +557,8 @@ declare namespace bundleState { * @param begin Indicates the start time of the query period, in milliseconds. * @param end Indicates the end time of the query period, in milliseconds. * @return Returns the {@link BundleActiveEventState} object Array containing the event states data. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.usageStatistics.queryAppNotificationNumber */ function queryAppNotificationNumber(begin: number, end: number, callback: AsyncCallback>): void; function queryAppNotificationNumber(begin: number, end: number): Promise>; diff --git a/api/@ohos.resourceschedule.WorkSchedulerExtensionAbility.d.ts b/api/@ohos.resourceschedule.WorkSchedulerExtensionAbility.d.ts new file mode 100644 index 0000000000..a467626d75 --- /dev/null +++ b/api/@ohos.resourceschedule.WorkSchedulerExtensionAbility.d.ts @@ -0,0 +1,45 @@ +/* + * 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 workScheduler from "./@ohos.workScheduler"; + +/** + * Class of the work scheduler extension ability. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.WorkScheduler + * @StageModelOnly + */ +export default class WorkSchedulerExtensionAbility { + /** + * Called back when a work is started. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.WorkScheduler + * @StageModelOnly + * @param work The info of work. + */ + onWorkStart(work: workScheduler.WorkInfo): void; + + /** + * Called back when a work is stopped. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.WorkScheduler + * @StageModelOnly + * @param work The info of work. + */ + onWorkStop(work: workScheduler.WorkInfo): void; +} \ No newline at end of file diff --git a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts new file mode 100644 index 0000000000..ebc1ddc2df --- /dev/null +++ b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts @@ -0,0 +1,293 @@ +/* + * 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 { AsyncCallback , Callback} from './basic'; +import { WantAgent } from "./@ohos.wantAgent"; +import Context from './application/BaseContext'; + +/** + * Manages background tasks. + * + * @since 7 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + */ +declare namespace backgroundTaskManager { + /** + * The info of delay suspend. + * + * @name DelaySuspendInfo + * @since 7 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + */ + interface DelaySuspendInfo { + /** + * The unique identifier of the delay request. + */ + requestId: number; + /** + * The actual delay duration (ms). + */ + actualDelayTime: number; + } + + /** + * Cancels delayed transition to the suspended state. + * + * @since 7 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + * @param requestId Indicates the identifier of the delay request. + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function cancelSuspendDelay(requestId: number): void; + + /** + * Obtains the remaining time before an application enters the suspended state. + * + * @since 7 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + * @param requestId Indicates the identifier of the delay request. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return The remaining delay time + */ + function getRemainingDelayTime(requestId: number, callback: AsyncCallback): void; + function getRemainingDelayTime(requestId: number): Promise; + + /** + * Requests delayed transition to the suspended state. + * + * @since 7 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + * @param reason Indicates the reason for delayed transition to the suspended state. + * @param callback The callback delay time expired. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return Info of delay request + */ + function requestSuspendDelay(reason: string, callback: Callback): DelaySuspendInfo; + + /** + * Service ability uses this method to request start running in background. + * system will publish a notification related to the this service. + * + * @since 8 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @permission ohos.permission.KEEP_BACKGROUND_RUNNING + * @param context app running context. + * @param bgMode Indicates which background mode to request. + * @param wantAgent Indicates which ability to start when user click the notification bar. + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback): void; + function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise; + + /** + * Service ability uses this method to request stop running in background. + * + * @since 8 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @param context app running context. + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function stopBackgroundRunning(context: Context, callback: AsyncCallback): void; + function stopBackgroundRunning(context: Context): Promise; + + /** + * Apply or unapply efficiency resources. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return True if efficiency resources apply success, else false. + * @systemapi Hide this for inner system use. + */ + function applyEfficiencyResources(request: EfficiencyResourcesRequest): boolean; + + /** + * Reset all efficiency resources apply. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply + * @systemapi Hide this for inner system use. + */ + function resetAllEfficiencyResources(): void; + + /** + * supported background mode. + * + * @since 8 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + */ + export enum BackgroundMode { + /** + * data transfer mode + * + * @since 8 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + */ + DATA_TRANSFER = 1, + + /** + * audio playback mode + * + * @since 8 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + */ + AUDIO_PLAYBACK = 2, + + /** + * audio recording mode + * + * @since 8 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + */ + AUDIO_RECORDING = 3, + + /** + * location mode + * + * @since 8 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + */ + LOCATION = 4, + + /** + * bluetooth interaction mode + * + * @since 8 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + */ + BLUETOOTH_INTERACTION = 5, + + /** + * multi-device connection mode + * + * @since 8 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + */ + MULTI_DEVICE_CONNECTION = 6, + + /** + * wifi interaction mode + * + * @since 8 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @systemapi Hide this for inner system use. + */ + WIFI_INTERACTION = 7, + + /** + * Voice over Internet Phone mode + * + * @since 8 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @systemapi Hide this for inner system use. + */ + VOIP = 8, + + /** + * background continuous calculate mode, for example 3D render. + * only supported in particular device + * + * @since 8 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + */ + TASK_KEEPING = 9, + } + + /** + * The type of resource. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply + * @systemapi Hide this for inner system use. + */ + export enum ResourceType { + /** + * The cpu resource for not being suspended. + */ + CPU = 1, + + /** + * The resource for not being proxyed common_event. + */ + COMMON_EVENT = 1 << 1, + + /** + * The resource for not being proxyed timer. + */ + TIMER = 1 << 2, + + /** + * The resource for not being proxyed workscheduler. + */ + WORK_SCHEDULER = 1 << 3, + + /** + * The resource for not being proxyed bluetooth. + */ + BLUETOOTH = 1 << 4, + + /** + * The resource for not being proxyed gps. + */ + GPS = 1 << 5, + + /** + * The resource for not being proxyed audio. + */ + AUDIO = 1 << 6 + } + + /** + * The request of efficiency resources. + * + * @name EfficiencyResourcesRequest + * @since 9 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply + * @systemapi Hide this for inner system use. + */ + export interface EfficiencyResourcesRequest { + /** + * The set of resource types that app wants to apply. + */ + resourceTypes: number; + + /** + * True if the app begin to use, else false. + */ + isApply: boolean; + + /** + * The duration that the resource can be used most. + */ + timeOut: number; + + /** + * True if the apply action is persist, else false. Default value is false. + */ + isPersist?: boolean; + + /** + * True if apply action is for process, false is for package. Default value is false. + */ + isProcess?: boolean; + + /** + * The apply reason. + */ + reason: string; + } +} + +export default backgroundTaskManager; diff --git a/api/@ohos.resourceschedule.usageStatistics.d.ts b/api/@ohos.resourceschedule.usageStatistics.d.ts new file mode 100644 index 0000000000..1307d1962f --- /dev/null +++ b/api/@ohos.resourceschedule.usageStatistics.d.ts @@ -0,0 +1,535 @@ +/* + * 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 { AsyncCallback , Callback} from './basic'; + +/** + * Provides methods for managing bundle usage statistics, + * including the methods for querying bundle usage information and state data. + * + *

You can use the methods defined in this class to query + * the usage history and states of bundles in a specified period. + * The system stores the query result in a {@link BundleStateInfo} or {@link BundleActiveState} instance and + * then returns it to you. + * + * @since 7 + */ +declare namespace usageStatistics { + + /** + * @since 7 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + */ + interface BundleStateInfo { + /** + * the identifier of BundleStateInfo. + */ + id: number; + /** + * the total duration, in milliseconds. + */ + abilityInFgTotalTime?: number; + /** + * the last time when the application was accessed, in milliseconds. + */ + abilityPrevAccessTime?: number; + /** + * the last time when the application was visible in the foreground, in milliseconds. + */ + abilityPrevSeenTime?: number; + /** + * the total duration, in milliseconds. + */ + abilitySeenTotalTime?: number; + /** + * the bundle name of the application. + */ + bundleName?: string; + /** + * the total duration, in milliseconds. + */ + fgAbilityAccessTotalTime?: number; + /** + * the last time when the foreground application was accessed, in milliseconds. + */ + fgAbilityPrevAccessTime?: number; + /** + * the time of the first bundle usage record in this {@code BundleActiveInfo} object, + * in milliseconds. + */ + infosBeginTime?: number; + /** + * the time of the last bundle usage record in this {@code BundleActiveInfo} object, + * in milliseconds. + */ + infosEndTime?: number; + + /** + * Merges a specified {@link BundleActiveInfo} object with this {@link BundleActiveInfo} object. + * The bundle name of both objects must be the same. + * + * @since 7 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @param toMerge Indicates the {@link BundleActiveInfo} object to merge. + * if the bundle names of the two {@link BundleActiveInfo} objects are different. + */ + merge(toMerge: BundleStateInfo): void; + } + + /** + * @since 9 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. + */ + interface BundleActiveFormInfo { + /** + * the form name. + */ + formName: string; + /** + * the form dimension. + */ + formDimension: number; + /** + * the form id. + */ + formId: number; + /** + * the last time when the form was accessed, in milliseconds.. + */ + formLastUsedTime: number; + /** + * the click count of module. + */ + count: number; + } + + /** + * @since 9 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. + */ + interface BundleActiveModuleInfo { + /** + * the device id of module. + */ + deviceId?: string; + /** + * the bundle name. + */ + bundleName: string; + /** + * the module name. + */ + moduleName: string; + /** + * the main ability name of module. + */ + abilityName?: string; + /** + * the label id of application. + */ + appLabelId?: number; + /** + * the label id of module. + */ + labelId?: number; + /** + * the description id of application. + */ + descriptionId?: number; + /** + * the ability id of main ability. + */ + abilityLableId?: number; + /** + * the description id of main ability. + */ + abilityDescriptionId?: number; + /** + * the icon id of main ability. + */ + abilityIconId?: number; + /** + * the launch count of module. + */ + launchedCount: number; + /** + * the last time when the module was accessed, in milliseconds. + */ + lastModuleUsedTime: number; + /** + * the form usage record list of current module. + */ + formRecords: Array; + } + + /** + * @since 9 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. + */ + interface BundleActiveEventState { + /** + * the bundle name or system event name. + */ + name: string; + + /** + * the event id. + */ + eventId: number; + + /** + * the the event occurrence number. + */ + count: number; + } + + /** + * @since 7 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + */ + interface BundleActiveState { + /** + * the usage priority group of the application. + */ + appUsagePriorityGroup?: number; + /** + * the bundle name. + */ + bundleName?: string; + /** + * the shortcut ID. + */ + indexOfLink?: string; + /** + * the class name. + */ + nameOfClass?: string; + /** + * the time when this state occurred, in milliseconds. + */ + stateOccurredTime?: number; + /** + * the state type. + */ + stateType?: number; + } + /** + * @since 9 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @systemapi Hide this for inner system use. + */ + interface BundleActiveGroupCallbackInfo { + /* + * the usage old group of the application + */ + appUsageOldGroup: number; + /* + * the usage new group of the application + */ + appUsageNewGroup: number; + /* + * the use id + */ + userId: number; + /* + * the change reason + */ + changeReason: number; + /* + * the bundle name + */ + bundleName: string; + } + + /** + * Checks whether the application with a specified bundle name is in the idle state. + * + * @since 7 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @param bundleName Indicates the bundle name of the application to query. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return Returns {@code true} if the application is idle in a particular period; + * returns {@code false} otherwise. The time range of the particular period is defined by the system, + * which may be hours or days. + */ + function isIdleState(bundleName: string, callback: AsyncCallback): void; + function isIdleState(bundleName: string): Promise; + + /** + * Queries the usage priority group of the calling application. + * + *

The priority defined in a priority group restricts the resource usage of an application, + * for example, restricting the running of background tasks.

+ * + * @since 7 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return Returns the usage priority group of the calling application. + */ + function queryAppUsagePriorityGroup(callback: AsyncCallback): void; + function queryAppUsagePriorityGroup(): Promise; + + /** + * @since 7 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + */ + interface BundleActiveInfoResponse { + [key: string]: BundleStateInfo; + } + + /** + * Queries usage information about each bundle within a specified period. + * + *

This method queries usage information at the {@link #BY_OPTIMIZED} interval by default.

+ * + * @since 7 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @systemapi Hide this for inner system use. + * @param begin Indicates the start time of the query period, in milliseconds. + * @param end Indicates the end time of the query period, in milliseconds. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return Returns the {@link BundleActiveInfoResponse} objects containing the usage information about each bundle. + */ + function queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback): void; + function queryBundleStateInfos(begin: number, end: number): Promise; + + /** + * Declares interval type. + * + * @since 7 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + */ + export enum IntervalType { + /** + * Indicates the interval type that will determine the optimal interval based on the start and end time. + */ + BY_OPTIMIZED = 0, + + /** + * Indicates the daily interval. + */ + BY_DAILY = 1, + + /** + * Indicates the weekly interval. + */ + BY_WEEKLY = 2, + + /** + * Indicates the monthly interval. + */ + BY_MONTHLY = 3, + + /** + * Indicates the annually interval. + */ + BY_ANNUALLY = 4 + } + + /** + * Queries usage information about each bundle within a specified period at a specified interval. + * + * @since 7 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @systemapi Hide this for inner system use. + * @param byInterval Indicates the interval at which the usage statistics are queried. + * The value can be {@link #BY_OPTIMIZED}, {@link #BY_DAILY}, + * {@link #BY_WEEKLY}, {@link #BY_MONTHLY}, or {@link #BY_ANNUALLY}. + * @param begin Indicates the start time of the query period, in milliseconds. + * @param end Indicates the end time of the query period, in milliseconds. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return Returns the list of {@link BundleStateInfo} objects containing the usage information about each bundle. + */ + function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback>): void; + function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise>; + + /** + * Queries state data of all bundles within a specified period identified by the start and end time. + * + * @since 7 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @systemapi Hide this for inner system use. + * @param begin Indicates the start time of the query period, in milliseconds. + * @param end Indicates the end time of the query period, in milliseconds. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return Returns the list of {@link BundleActiveState} objects containing the state data of all bundles. + */ + function queryBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void; + function queryBundleActiveStates(begin: number, end: number): Promise>; + + /** + * Queries state data of the current bundle within a specified period. + * + * @since 7 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @param begin Indicates the start time of the query period, in milliseconds. + * @param end Indicates the end time of the query period, in milliseconds. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return Returns the {@link BundleActiveState} object Array containing the state data of the current bundle. + */ + function queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void; + function queryCurrentBundleActiveStates(begin: number, end: number): Promise>; + + /** + * Queries recently module usage records. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @systemapi Hide this for inner system use. + * @param maxNum Indicates max record number in result, max value is 1000, default value is 1000. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return Returns the {@link BundleActiveModuleInfo} object Array containing the usage data of the modules. + */ + function getRecentlyUsedModules(maxNum?: number, callback: AsyncCallback>): void; + function getRecentlyUsedModules(maxNum?: number): Promise>; + + /** + * Queries the usage priority group of the calling application. + * + *

The priority defined in a priority group restricts the resource usage of an application, + * for example, restricting the running of background tasks.

+ * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @systemapi Hide this for inner system use. + * @param bundleName, name of the application. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return Returns the usage priority group of the calling application. + */ + function queryAppUsagePriorityGroup(bundleName? : string, callback: AsyncCallback): void; + function queryAppUsagePriorityGroup(bundleName? : string): Promise; + + /** + * Declares group type. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @systemapi Hide this for inner system use. + */ + export enum GroupType { + /** + * Indicates the alive group. + */ + ACTIVE_GROUP_ALIVE = 10, + + /** + * Indicates the daily group. + */ + ACTIVE_GROUP_DAILY = 20, + + /** + * Indicates the fixed group. + */ + ACTIVE_GROUP_FIXED = 30, + + /** + * Indicates the rare group. + */ + ACTIVE_GROUP_RARE = 40, + + /** + * Indicates the limit group. + */ + ACTIVE_GROUP_LIMIT = 50, + + /** + * Indicates the never group. + */ + ACTIVE_GROUP_NEVER = 60 + } + + /** + * set bundle group by bundleName and number. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @systemapi Hide this for inner system use. + * @param bundleName, name of the application. + * @param newGroup,the group of the application whose name is bundleName. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return Returns the result of setBundleGroup, true of false. + */ + function setBundleGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void; + function setBundleGroup(bundleName: string, newGroup: GroupType): Promise; + + /** + * register callback to service. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @systemapi Hide this for inner system use. + * @param Callback, callback when application group change,return the BundleActiveGroupCallbackInfo. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return Returns BundleActiveGroupCallbackInfo when the group of bundle changed. the result of AsyncCallback is true or false. + */ + function registerGroupCallBack(callback: Callback, callback: AsyncCallback): void; + function registerGroupCallBack(callback: Callback): Promise; + + /** + * unRegister callback from service. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @systemapi Hide this for inner system use. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return Returns the result of unRegisterGroupCallBack, true of false. + */ + function unRegisterGroupCallBack(callback: AsyncCallback): void; + function unRegisterGroupCallBack(): Promise; + + /* + * Queries system event states data within a specified period identified by the start and end time. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @systemapi Hide this for inner system use. + * @param begin Indicates the start time of the query period, in milliseconds. + * @param end Indicates the end time of the query period, in milliseconds. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return Returns the {@link BundleActiveEventState} object Array containing the event states data. + */ + function queryBundleActiveEventStates(begin: number, end: number, callback: AsyncCallback>): void; + function queryBundleActiveEventStates(begin: number, end: number): Promise>; + + /** + * Queries app notification number within a specified period identified by the start and end time. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @systemapi Hide this for inner system use. + * @param begin Indicates the start time of the query period, in milliseconds. + * @param end Indicates the end time of the query period, in milliseconds. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return Returns the {@link BundleActiveEventState} object Array containing the event states data. + */ + function queryAppNotificationNumber(begin: number, end: number, callback: AsyncCallback>): void; + function queryAppNotificationNumber(begin: number, end: number): Promise>; +} + +export default usageStatistics; + diff --git a/api/@ohos.resourceschedule.workScheduler.d.ts b/api/@ohos.resourceschedule.workScheduler.d.ts new file mode 100644 index 0000000000..2d59f808d0 --- /dev/null +++ b/api/@ohos.resourceschedule.workScheduler.d.ts @@ -0,0 +1,282 @@ +/* + * 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 {AsyncCallback} from './basic'; + +/** + * Work scheduler interface. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.WorkScheduler + * @StageModelOnly + */ +declare namespace workScheduler { + /** + * The info of work. + * + * @name WorkInfo + * @since 9 + * @syscap SystemCapability.ResourceSchedule.WorkScheduler + * @StageModelOnly + */ + export interface WorkInfo { + /** + * The id of the current work. + */ + workId: number; + /** + * The bundle name of the current work. + */ + bundleName: string; + /** + * The ability name of the current work. + */ + abilityName: string; + /** + * Whether the current work will be saved. + */ + isPersisted?: boolean; + /** + * The network type of the current work. + */ + networkType?: NetworkType; + /** + * Whether a charging state has been set for triggering the work. + */ + isCharging?: boolean; + /** + * The charger type based on which the work is triggered. + */ + chargerType?: ChargingType; + /** + * The battery level for triggering a work. + */ + batteryLevel?: number; + /** + * The battery status for triggering a work. + */ + batteryStatus?: BatteryStatus; + /** + * Whether a storage state has been set for triggering the work. + */ + storageRequest?: StorageRequest; + /** + * The interval at which the work is repeated. + */ + repeatCycleTime?: number; + /** + * Whether the work has been set to repeat at the specified interval. + */ + isRepeat?: boolean; + /** + * The repeat of the current work. + */ + repeatCount?: number; + /** + * Whether the device deep idle state has been set for triggering the work. + */ + isDeepIdle?: boolean; + /** + * The idle wait time based on which the work is triggered. + */ + idleWaitTime?: number; + /** + * The parameters of the work. The value is only supported basic type(Number, String, Boolean). + */ + parameters?: {[key: string]: any}; + } + + /** + * Add a work to the queue. A work can be executed only when it meets the preset triggering condition + * and complies with the rules of work scheduler manager. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.WorkScheduler + * @StageModelOnly + * @param work The info of work. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return true if success, otherwise false. + */ + function startWork(work: WorkInfo): boolean; + + /** + * Stop a work. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.WorkScheduler + * @StageModelOnly + * @param work The info of work. + * @param needCancel True if need to be canceled after being stopped, otherwise false. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return true if success, otherwise false. + */ + function stopWork(work: WorkInfo, needCancel?: boolean): boolean; + + /** + * Obtains the work info of the wordId. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.WorkScheduler + * @StageModelOnly + * @param workId The id of work. + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function getWorkStatus(workId: number, callback: AsyncCallback): void; + function getWorkStatus(workId: number): Promise; + + /** + * Get all works of the calling application. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.WorkScheduler + * @StageModelOnly + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return the work info list. + */ + function obtainAllWorks(callback: AsyncCallback): Array; + function obtainAllWorks(): Promise>; + + /** + * Stop all and clear all works of the calling application. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.WorkScheduler + * @StageModelOnly + * @return true if success, otherwise false. + */ + function stopAndClearWorks(): boolean; + + /** + * Check whether last work running is timeout. The interface is for repeating work. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.WorkScheduler + * @StageModelOnly + * @param workId The id of work. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return true if last work running is timeout, otherwise false. + */ + function isLastWorkTimeOut(workId: number, callback: AsyncCallback): boolean; + function isLastWorkTimeOut(workId: number): Promise; + + /** + * Describes network type. + * + * @name NetworkType + * @since 9 + * @syscap SystemCapability.ResourceSchedule.WorkScheduler + * @StageModelOnly + */ + export enum NetworkType { + /** + * Describes any network connection. + */ + NETWORK_TYPE_ANY = 0, + /** + * Describes a mobile network connection. + */ + NETWORK_TYPE_MOBILE, + /** + * Describes a wifi network connection. + */ + NETWORK_TYPE_WIFI, + /** + * Describes a bluetooth network connection. + */ + NETWORK_TYPE_BLUETOOTH, + /** + * Describes a wifi p2p network connection. + */ + NETWORK_TYPE_WIFI_P2P, + /** + * Describes a wifi wire network connection. + */ + NETWORK_TYPE_ETHERNET + } + + /** + * Describes charging type. + * + * @name ChargingType + * @since 9 + * @syscap SystemCapability.ResourceSchedule.WorkScheduler + * @StageModelOnly + */ + export enum ChargingType { + /** + * Describes any charger is connected. + */ + CHARGING_PLUGGED_ANY = 0, + /** + * Describes ac charger is connected. + */ + CHARGING_PLUGGED_AC, + /** + * Describes usb charger is connected. + */ + CHARGING_PLUGGED_USB, + /** + * Describes wireless charger is connected. + */ + CHARGING_PLUGGED_WIRELESS + } + + /** + * Describes the battery status. + * + * @name BatteryStatus + * @since 9 + * @syscap SystemCapability.ResourceSchedule.WorkScheduler + * @StageModelOnly + */ + export enum BatteryStatus { + /** + * Describes battery status is to low. + */ + BATTERY_STATUS_LOW = 0, + /** + * Describes battery status is to ok. + */ + BATTERY_STATUS_OKAY, + /** + * Describes battery status is to low or ok. + */ + BATTERY_STATUS_LOW_OR_OKAY + } + + /** + * Describes the storage request. + * + * @name StorageRequest + * @since 9 + * @syscap SystemCapability.ResourceSchedule.WorkScheduler + * @StageModelOnly + */ + export enum StorageRequest { + /** + * Describes storage is to low. + */ + STORAGE_LEVEL_LOW = 0, + /** + * Describes storage is to ok. + */ + STORAGE_LEVEL_OKAY, + /** + * Describes storage is to low or ok. + */ + STORAGE_LEVEL_LOW_OR_OKAY + } +} +export default workScheduler; \ No newline at end of file diff --git a/api/@ohos.workScheduler.d.ts b/api/@ohos.workScheduler.d.ts index 67606bcf85..483729668e 100644 --- a/api/@ohos.workScheduler.d.ts +++ b/api/@ohos.workScheduler.d.ts @@ -21,6 +21,8 @@ import {AsyncCallback} from './basic'; * @since 9 * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.workScheduler */ declare namespace workScheduler { /** @@ -30,6 +32,8 @@ declare namespace workScheduler { * @since 9 * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.workScheduler.WorkInfo */ export interface WorkInfo { /** @@ -107,6 +111,8 @@ declare namespace workScheduler { * @StageModelOnly * @param work The info of work. * @return true if success, otherwise false. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.workScheduler.startWork */ function startWork(work: WorkInfo): boolean; @@ -119,6 +125,8 @@ declare namespace workScheduler { * @param work The info of work. * @param needCancel True if need to be canceled after being stopped, otherwise false. * @return true if success, otherwise false. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.workScheduler.stopWork */ function stopWork(work: WorkInfo, needCancel?: boolean): boolean; @@ -129,6 +137,8 @@ declare namespace workScheduler { * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly * @param workId The id of work. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.workScheduler.getWorkStatus */ function getWorkStatus(workId: number, callback: AsyncCallback): void; function getWorkStatus(workId: number): Promise; @@ -140,6 +150,8 @@ declare namespace workScheduler { * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly * @return the work info list. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.workScheduler.obtainAllWorks */ function obtainAllWorks(callback: AsyncCallback): Array; function obtainAllWorks(): Promise>; @@ -151,6 +163,8 @@ declare namespace workScheduler { * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly * @return true if success, otherwise false. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.workScheduler.stopAndClearWorks */ function stopAndClearWorks(): boolean; @@ -162,6 +176,8 @@ declare namespace workScheduler { * @StageModelOnly * @param workId The id of work. * @return true if last work running is timeout, otherwise false. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.workScheduler.isLastWorkTimeOut */ function isLastWorkTimeOut(workId: number, callback: AsyncCallback): boolean; function isLastWorkTimeOut(workId: number): Promise; @@ -173,6 +189,8 @@ declare namespace workScheduler { * @since 9 * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.workScheduler.NetworkType */ export enum NetworkType { /** @@ -208,6 +226,8 @@ declare namespace workScheduler { * @since 9 * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.workScheduler.ChargingType */ export enum ChargingType { /** @@ -235,6 +255,8 @@ declare namespace workScheduler { * @since 9 * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.workScheduler.BatteryStatus */ export enum BatteryStatus { /** @@ -258,6 +280,8 @@ declare namespace workScheduler { * @since 9 * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.workScheduler.StorageRequest */ export enum StorageRequest { /** -- Gitee From e99dbe61b6c22816496e170f089ef36d7f3def8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E6=80=A1?= Date: Fri, 9 Sep 2022 08:36:53 +0000 Subject: [PATCH 009/438] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱天怡 --- ...esourceschedule.backgroundTaskManager.d.ts | 37 +++++++++---------- ...ohos.resourceschedule.usageStatistics.d.ts | 28 +++++++------- api/@ohos.resourceschedule.workScheduler.d.ts | 9 ++--- 3 files changed, 34 insertions(+), 40 deletions(-) diff --git a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts index ebc1ddc2df..f50521a6bd 100644 --- a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts +++ b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts @@ -20,7 +20,7 @@ import Context from './application/BaseContext'; /** * Manages background tasks. * - * @since 7 + * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask */ declare namespace backgroundTaskManager { @@ -28,7 +28,7 @@ declare namespace backgroundTaskManager { * The info of delay suspend. * * @name DelaySuspendInfo - * @since 7 + * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask */ interface DelaySuspendInfo { @@ -45,7 +45,7 @@ declare namespace backgroundTaskManager { /** * Cancels delayed transition to the suspended state. * - * @since 7 + * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @param requestId Indicates the identifier of the delay request. * @throws { BusinessError } If the input parameter is not valid parameter. @@ -55,7 +55,7 @@ declare namespace backgroundTaskManager { /** * Obtains the remaining time before an application enters the suspended state. * - * @since 7 + * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @param requestId Indicates the identifier of the delay request. * @throws { BusinessError } If the input parameter is not valid parameter. @@ -67,7 +67,7 @@ declare namespace backgroundTaskManager { /** * Requests delayed transition to the suspended state. * - * @since 7 + * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @param reason Indicates the reason for delayed transition to the suspended state. * @param callback The callback delay time expired. @@ -80,7 +80,7 @@ declare namespace backgroundTaskManager { * Service ability uses this method to request start running in background. * system will publish a notification related to the this service. * - * @since 8 + * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @permission ohos.permission.KEEP_BACKGROUND_RUNNING * @param context app running context. @@ -94,7 +94,7 @@ declare namespace backgroundTaskManager { /** * Service ability uses this method to request stop running in background. * - * @since 8 + * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @param context app running context. * @throws { BusinessError } If the input parameter is not valid parameter. @@ -108,10 +108,9 @@ declare namespace backgroundTaskManager { * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply * @throws { BusinessError } If the input parameter is not valid parameter. - * @return True if efficiency resources apply success, else false. * @systemapi Hide this for inner system use. */ - function applyEfficiencyResources(request: EfficiencyResourcesRequest): boolean; + function applyEfficiencyResources(request: EfficiencyResourcesRequest): void; /** * Reset all efficiency resources apply. @@ -125,14 +124,14 @@ declare namespace backgroundTaskManager { /** * supported background mode. * - * @since 8 + * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask */ export enum BackgroundMode { /** * data transfer mode * - * @since 8 + * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask */ DATA_TRANSFER = 1, @@ -140,7 +139,7 @@ declare namespace backgroundTaskManager { /** * audio playback mode * - * @since 8 + * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask */ AUDIO_PLAYBACK = 2, @@ -148,7 +147,7 @@ declare namespace backgroundTaskManager { /** * audio recording mode * - * @since 8 + * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask */ AUDIO_RECORDING = 3, @@ -156,7 +155,7 @@ declare namespace backgroundTaskManager { /** * location mode * - * @since 8 + * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask */ LOCATION = 4, @@ -164,7 +163,7 @@ declare namespace backgroundTaskManager { /** * bluetooth interaction mode * - * @since 8 + * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask */ BLUETOOTH_INTERACTION = 5, @@ -172,7 +171,7 @@ declare namespace backgroundTaskManager { /** * multi-device connection mode * - * @since 8 + * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask */ MULTI_DEVICE_CONNECTION = 6, @@ -180,7 +179,7 @@ declare namespace backgroundTaskManager { /** * wifi interaction mode * - * @since 8 + * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @systemapi Hide this for inner system use. */ @@ -189,7 +188,7 @@ declare namespace backgroundTaskManager { /** * Voice over Internet Phone mode * - * @since 8 + * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @systemapi Hide this for inner system use. */ @@ -199,7 +198,7 @@ declare namespace backgroundTaskManager { * background continuous calculate mode, for example 3D render. * only supported in particular device * - * @since 8 + * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask */ TASK_KEEPING = 9, diff --git a/api/@ohos.resourceschedule.usageStatistics.d.ts b/api/@ohos.resourceschedule.usageStatistics.d.ts index 1307d1962f..14c41091fe 100644 --- a/api/@ohos.resourceschedule.usageStatistics.d.ts +++ b/api/@ohos.resourceschedule.usageStatistics.d.ts @@ -24,12 +24,12 @@ import { AsyncCallback , Callback} from './basic'; * The system stores the query result in a {@link BundleStateInfo} or {@link BundleActiveState} instance and * then returns it to you. * - * @since 7 + * @since 9 */ declare namespace usageStatistics { /** - * @since 7 + * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App */ interface BundleStateInfo { @@ -80,7 +80,7 @@ declare namespace usageStatistics { * Merges a specified {@link BundleActiveInfo} object with this {@link BundleActiveInfo} object. * The bundle name of both objects must be the same. * - * @since 7 + * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @param toMerge Indicates the {@link BundleActiveInfo} object to merge. * if the bundle names of the two {@link BundleActiveInfo} objects are different. @@ -199,7 +199,7 @@ declare namespace usageStatistics { } /** - * @since 7 + * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App */ interface BundleActiveState { @@ -259,7 +259,7 @@ declare namespace usageStatistics { /** * Checks whether the application with a specified bundle name is in the idle state. * - * @since 7 + * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @param bundleName Indicates the bundle name of the application to query. * @throws { BusinessError } If the input parameter is not valid parameter. @@ -276,7 +276,7 @@ declare namespace usageStatistics { *

The priority defined in a priority group restricts the resource usage of an application, * for example, restricting the running of background tasks.

* - * @since 7 + * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @throws { BusinessError } If the input parameter is not valid parameter. * @return Returns the usage priority group of the calling application. @@ -285,7 +285,7 @@ declare namespace usageStatistics { function queryAppUsagePriorityGroup(): Promise; /** - * @since 7 + * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App */ interface BundleActiveInfoResponse { @@ -297,7 +297,7 @@ declare namespace usageStatistics { * *

This method queries usage information at the {@link #BY_OPTIMIZED} interval by default.

* - * @since 7 + * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @systemapi Hide this for inner system use. @@ -312,7 +312,7 @@ declare namespace usageStatistics { /** * Declares interval type. * - * @since 7 + * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App */ export enum IntervalType { @@ -345,7 +345,7 @@ declare namespace usageStatistics { /** * Queries usage information about each bundle within a specified period at a specified interval. * - * @since 7 + * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @systemapi Hide this for inner system use. @@ -363,7 +363,7 @@ declare namespace usageStatistics { /** * Queries state data of all bundles within a specified period identified by the start and end time. * - * @since 7 + * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @systemapi Hide this for inner system use. @@ -378,7 +378,7 @@ declare namespace usageStatistics { /** * Queries state data of the current bundle within a specified period. * - * @since 7 + * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @param begin Indicates the start time of the query period, in milliseconds. * @param end Indicates the end time of the query period, in milliseconds. @@ -468,7 +468,6 @@ declare namespace usageStatistics { * @param bundleName, name of the application. * @param newGroup,the group of the application whose name is bundleName. * @throws { BusinessError } If the input parameter is not valid parameter. - * @return Returns the result of setBundleGroup, true of false. */ function setBundleGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void; function setBundleGroup(bundleName: string, newGroup: GroupType): Promise; @@ -482,7 +481,7 @@ declare namespace usageStatistics { * @systemapi Hide this for inner system use. * @param Callback, callback when application group change,return the BundleActiveGroupCallbackInfo. * @throws { BusinessError } If the input parameter is not valid parameter. - * @return Returns BundleActiveGroupCallbackInfo when the group of bundle changed. the result of AsyncCallback is true or false. + * @return Returns BundleActiveGroupCallbackInfo when the group of bundle changed. */ function registerGroupCallBack(callback: Callback, callback: AsyncCallback): void; function registerGroupCallBack(callback: Callback): Promise; @@ -495,7 +494,6 @@ declare namespace usageStatistics { * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @systemapi Hide this for inner system use. * @throws { BusinessError } If the input parameter is not valid parameter. - * @return Returns the result of unRegisterGroupCallBack, true of false. */ function unRegisterGroupCallBack(callback: AsyncCallback): void; function unRegisterGroupCallBack(): Promise; diff --git a/api/@ohos.resourceschedule.workScheduler.d.ts b/api/@ohos.resourceschedule.workScheduler.d.ts index 2d59f808d0..62152bdbba 100644 --- a/api/@ohos.resourceschedule.workScheduler.d.ts +++ b/api/@ohos.resourceschedule.workScheduler.d.ts @@ -107,9 +107,8 @@ declare namespace workScheduler { * @StageModelOnly * @param work The info of work. * @throws { BusinessError } If the input parameter is not valid parameter. - * @return true if success, otherwise false. */ - function startWork(work: WorkInfo): boolean; + function startWork(work: WorkInfo): void; /** * Stop a work. @@ -120,9 +119,8 @@ declare namespace workScheduler { * @param work The info of work. * @param needCancel True if need to be canceled after being stopped, otherwise false. * @throws { BusinessError } If the input parameter is not valid parameter. - * @return true if success, otherwise false. */ - function stopWork(work: WorkInfo, needCancel?: boolean): boolean; + function stopWork(work: WorkInfo, needCancel?: boolean): void; /** * Obtains the work info of the wordId. @@ -154,9 +152,8 @@ declare namespace workScheduler { * @since 9 * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly - * @return true if success, otherwise false. */ - function stopAndClearWorks(): boolean; + function stopAndClearWorks(): void; /** * Check whether last work running is timeout. The interface is for repeating work. -- Gitee From 6bd208934cb050257272bf0d12670c92ead97803 Mon Sep 17 00:00:00 2001 From: zhutianyi Date: Tue, 13 Sep 2022 10:34:13 +0800 Subject: [PATCH 010/438] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhutianyi --- api/@ohos.WorkSchedulerExtensionAbility.d.ts | 6 --- ...chedule.WorkSchedulerExtensionAbility.d.ts | 45 ------------------- 2 files changed, 51 deletions(-) delete mode 100644 api/@ohos.resourceschedule.WorkSchedulerExtensionAbility.d.ts diff --git a/api/@ohos.WorkSchedulerExtensionAbility.d.ts b/api/@ohos.WorkSchedulerExtensionAbility.d.ts index 9a75d079e5..df30bd831e 100644 --- a/api/@ohos.WorkSchedulerExtensionAbility.d.ts +++ b/api/@ohos.WorkSchedulerExtensionAbility.d.ts @@ -21,8 +21,6 @@ import workScheduler from "./@ohos.workScheduler"; * @since 9 * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly - * @deprecated since 9 - * @useinstead @ohos.resourceschedule.WorkSchedulerExtensionAbility */ export default class WorkSchedulerExtensionAbility { /** @@ -32,8 +30,6 @@ export default class WorkSchedulerExtensionAbility { * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly * @param work The info of work. - * @deprecated since 9 - * @useinstead @ohos.resourceschedule.WorkSchedulerExtensionAbility.onWorkStart */ onWorkStart(work: workScheduler.WorkInfo): void; @@ -44,8 +40,6 @@ export default class WorkSchedulerExtensionAbility { * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly * @param work The info of work. - * @deprecated since 9 - * @useinstead @ohos.resourceschedule.WorkSchedulerExtensionAbility.onWorkStop */ onWorkStop(work: workScheduler.WorkInfo): void; } \ No newline at end of file diff --git a/api/@ohos.resourceschedule.WorkSchedulerExtensionAbility.d.ts b/api/@ohos.resourceschedule.WorkSchedulerExtensionAbility.d.ts deleted file mode 100644 index a467626d75..0000000000 --- a/api/@ohos.resourceschedule.WorkSchedulerExtensionAbility.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 workScheduler from "./@ohos.workScheduler"; - -/** - * Class of the work scheduler extension ability. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - */ -export default class WorkSchedulerExtensionAbility { - /** - * Called back when a work is started. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - * @param work The info of work. - */ - onWorkStart(work: workScheduler.WorkInfo): void; - - /** - * Called back when a work is stopped. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - * @param work The info of work. - */ - onWorkStop(work: workScheduler.WorkInfo): void; -} \ No newline at end of file -- Gitee From bb0e0819284c0d8c4274e7bacba25fc748470352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E6=80=A1?= Date: Tue, 13 Sep 2022 11:35:15 +0000 Subject: [PATCH 011/438] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱天怡 --- ...chedule.WorkSchedulerExtensionAbility.d.ts | 45 +++++++++++++++++++ api/@ohos.WorkSchedulerExtensionAbility.d.ts | 6 +++ 2 files changed, 51 insertions(+) create mode 100644 @ohos.resourceschedule.WorkSchedulerExtensionAbility.d.ts diff --git a/@ohos.resourceschedule.WorkSchedulerExtensionAbility.d.ts b/@ohos.resourceschedule.WorkSchedulerExtensionAbility.d.ts new file mode 100644 index 0000000000..a467626d75 --- /dev/null +++ b/@ohos.resourceschedule.WorkSchedulerExtensionAbility.d.ts @@ -0,0 +1,45 @@ +/* + * 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 workScheduler from "./@ohos.workScheduler"; + +/** + * Class of the work scheduler extension ability. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.WorkScheduler + * @StageModelOnly + */ +export default class WorkSchedulerExtensionAbility { + /** + * Called back when a work is started. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.WorkScheduler + * @StageModelOnly + * @param work The info of work. + */ + onWorkStart(work: workScheduler.WorkInfo): void; + + /** + * Called back when a work is stopped. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.WorkScheduler + * @StageModelOnly + * @param work The info of work. + */ + onWorkStop(work: workScheduler.WorkInfo): void; +} \ No newline at end of file diff --git a/api/@ohos.WorkSchedulerExtensionAbility.d.ts b/api/@ohos.WorkSchedulerExtensionAbility.d.ts index df30bd831e..9a75d079e5 100644 --- a/api/@ohos.WorkSchedulerExtensionAbility.d.ts +++ b/api/@ohos.WorkSchedulerExtensionAbility.d.ts @@ -21,6 +21,8 @@ import workScheduler from "./@ohos.workScheduler"; * @since 9 * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.WorkSchedulerExtensionAbility */ export default class WorkSchedulerExtensionAbility { /** @@ -30,6 +32,8 @@ export default class WorkSchedulerExtensionAbility { * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly * @param work The info of work. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.WorkSchedulerExtensionAbility.onWorkStart */ onWorkStart(work: workScheduler.WorkInfo): void; @@ -40,6 +44,8 @@ export default class WorkSchedulerExtensionAbility { * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly * @param work The info of work. + * @deprecated since 9 + * @useinstead @ohos.resourceschedule.WorkSchedulerExtensionAbility.onWorkStop */ onWorkStop(work: workScheduler.WorkInfo): void; } \ No newline at end of file -- Gitee From 544cd3aa9bb90d6f3b90c39c23b6279e4e5d7268 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E6=80=A1?= Date: Tue, 13 Sep 2022 11:36:23 +0000 Subject: [PATCH 012/438] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱天怡 --- @ohos.resourceschedule.WorkSchedulerExtensionAbility.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/@ohos.resourceschedule.WorkSchedulerExtensionAbility.d.ts b/@ohos.resourceschedule.WorkSchedulerExtensionAbility.d.ts index a467626d75..1aaa8c13f5 100644 --- a/@ohos.resourceschedule.WorkSchedulerExtensionAbility.d.ts +++ b/@ohos.resourceschedule.WorkSchedulerExtensionAbility.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import workScheduler from "./@ohos.workScheduler"; +import workScheduler from "./@ohos.resourceschedule.workScheduler"; /** * Class of the work scheduler extension ability. -- Gitee From 6d17db147e9c489addb14101c2da2ae3573005a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E6=80=A1?= Date: Thu, 15 Sep 2022 01:38:36 +0000 Subject: [PATCH 013/438] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱天怡 --- api/@ohos.bundleState.d.ts | 40 +++--- ...ohos.resourceschedule.usageStatistics.d.ts | 131 ++++++++++-------- 2 files changed, 92 insertions(+), 79 deletions(-) diff --git a/api/@ohos.bundleState.d.ts b/api/@ohos.bundleState.d.ts index 6e3e4f8f69..f443844370 100644 --- a/api/@ohos.bundleState.d.ts +++ b/api/@ohos.bundleState.d.ts @@ -26,7 +26,7 @@ import { AsyncCallback , Callback} from './basic'; * * @since 7 * @deprecated since 9 - * @useinstead @ohos.resourceschedule.bundleState + * @useinstead @ohos.resourceschedule.usageStatistics */ declare namespace bundleState { @@ -34,7 +34,7 @@ declare namespace bundleState { * @since 7 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.BundleStateInfo + * @useinstead @ohos.resourceschedule.usageStatistics.BundleStatsInfo */ interface BundleStateInfo { /** @@ -97,7 +97,7 @@ declare namespace bundleState { * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.BundleActiveFormInfo + * @useinstead @ohos.resourceschedule.usageStatistics.HapFormInfo */ interface BundleActiveFormInfo { /** @@ -127,7 +127,7 @@ declare namespace bundleState { * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.BundleActiveModuleInfo + * @useinstead @ohos.resourceschedule.usageStatistics.HapModuleInfo */ interface BundleActiveModuleInfo { /** @@ -189,7 +189,7 @@ declare namespace bundleState { * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.BundleActiveEventState + * @useinstead @ohos.resourceschedule.usageStatistics.DeviceEventStats */ interface BundleActiveEventState { /** @@ -212,7 +212,7 @@ declare namespace bundleState { * @since 7 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.BundleActiveState + * @useinstead @ohos.resourceschedule.usageStatistics.BundleEvents */ interface BundleActiveState { /** @@ -245,7 +245,7 @@ declare namespace bundleState { * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.BundleActiveGroupCallbackInfo + * @useinstead @ohos.resourceschedule.usageStatistics.AppGroupCallbackInfo */ interface BundleActiveGroupCallbackInfo { /* @@ -295,7 +295,7 @@ declare namespace bundleState { * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @return Returns the usage priority group of the calling application. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.queryAppUsagePriorityGroup + * @useinstead @ohos.resourceschedule.usageStatistics.queryAppGroup */ function queryAppUsagePriorityGroup(callback: AsyncCallback): void; function queryAppUsagePriorityGroup(): Promise; @@ -304,7 +304,7 @@ declare namespace bundleState { * @since 7 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.BundleActiveInfoResponse + * @useinstead @ohos.resourceschedule.usageStatistics.BundleStatsMap */ interface BundleActiveInfoResponse { [key: string]: BundleStateInfo; @@ -323,7 +323,7 @@ declare namespace bundleState { * @param end Indicates the end time of the query period, in milliseconds. * @return Returns the {@link BundleActiveInfoResponse} objects containing the usage information about each bundle. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.queryBundleStateInfos + * @useinstead @ohos.resourceschedule.usageStatistics.queryBundleStatsInfos */ function queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback): void; function queryBundleStateInfos(begin: number, end: number): Promise; @@ -377,7 +377,7 @@ declare namespace bundleState { * @param end Indicates the end time of the query period, in milliseconds. * @return Returns the list of {@link BundleStateInfo} objects containing the usage information about each bundle. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.queryBundleStateInfoByInterval + * @useinstead @ohos.resourceschedule.usageStatistics.queryBundleStatsInfoByInterval */ function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback>): void; function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise>; @@ -393,7 +393,7 @@ declare namespace bundleState { * @param end Indicates the end time of the query period, in milliseconds. * @return Returns the list of {@link BundleActiveState} objects containing the state data of all bundles. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.queryBundleActiveStates + * @useinstead @ohos.resourceschedule.usageStatistics.queryBundleEvents */ function queryBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void; function queryBundleActiveStates(begin: number, end: number): Promise>; @@ -407,7 +407,7 @@ declare namespace bundleState { * @param end Indicates the end time of the query period, in milliseconds. * @return Returns the {@link BundleActiveState} object Array containing the state data of the current bundle. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.queryCurrentBundleActiveStates + * @useinstead @ohos.resourceschedule.usageStatistics.queryCurrentBundleEvents */ function queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void; function queryCurrentBundleActiveStates(begin: number, end: number): Promise>; @@ -422,7 +422,7 @@ declare namespace bundleState { * @param maxNum Indicates max record number in result, max value is 1000, default value is 1000. * @return Returns the {@link BundleActiveModuleInfo} object Array containing the usage data of the modules. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.getRecentlyUsedModules + * @useinstead @ohos.resourceschedule.usageStatistics.queryModuleUsageRecords */ function getRecentlyUsedModules(maxNum?: number, callback: AsyncCallback>): void; function getRecentlyUsedModules(maxNum?: number): Promise>; @@ -440,7 +440,7 @@ declare namespace bundleState { * @param bundleName, name of the application. * @return Returns the usage priority group of the calling application. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.queryAppUsagePriorityGroup + * @useinstead @ohos.resourceschedule.usageStatistics.queryAppGroup */ function queryAppUsagePriorityGroup(bundleName? : string, callback: AsyncCallback): void; function queryAppUsagePriorityGroup(bundleName? : string): Promise; @@ -497,7 +497,7 @@ declare namespace bundleState { * @param newGroup,the group of the application whose name is bundleName. * @return Returns the result of setBundleGroup, true of false. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.setBundleGroup + * @useinstead @ohos.resourceschedule.usageStatistics.setAppGroup */ function setBundleGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void; function setBundleGroup(bundleName: string, newGroup: GroupType): Promise; @@ -512,7 +512,7 @@ declare namespace bundleState { * @param Callback, callback when application group change,return the BundleActiveGroupCallbackInfo. * @return Returns BundleActiveGroupCallbackInfo when the group of bundle changed. the result of AsyncCallback is true or false. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.registerGroupCallBack + * @useinstead @ohos.resourceschedule.usageStatistics.registerAppGroupCallBack */ function registerGroupCallBack(callback: Callback, callback: AsyncCallback): void; function registerGroupCallBack(callback: Callback): Promise; @@ -526,7 +526,7 @@ declare namespace bundleState { * @systemapi Hide this for inner system use. * @return Returns the result of unRegisterGroupCallBack, true of false. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.unRegisterGroupCallBack + * @useinstead @ohos.resourceschedule.usageStatistics.unRegisterAppGroupCallBack */ function unRegisterGroupCallBack(callback: AsyncCallback): void; function unRegisterGroupCallBack(): Promise; @@ -542,7 +542,7 @@ declare namespace bundleState { * @param end Indicates the end time of the query period, in milliseconds. * @return Returns the {@link BundleActiveEventState} object Array containing the event states data. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.queryBundleActiveEventStates + * @useinstead @ohos.resourceschedule.usageStatistics.queryDeviceEventStates */ function queryBundleActiveEventStates(begin: number, end: number, callback: AsyncCallback>): void; function queryBundleActiveEventStates(begin: number, end: number): Promise>; @@ -558,7 +558,7 @@ declare namespace bundleState { * @param end Indicates the end time of the query period, in milliseconds. * @return Returns the {@link BundleActiveEventState} object Array containing the event states data. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.queryAppNotificationNumber + * @useinstead @ohos.resourceschedule.usageStatistics.queryNotificationNumber */ function queryAppNotificationNumber(begin: number, end: number, callback: AsyncCallback>): void; function queryAppNotificationNumber(begin: number, end: number): Promise>; diff --git a/api/@ohos.resourceschedule.usageStatistics.d.ts b/api/@ohos.resourceschedule.usageStatistics.d.ts index 14c41091fe..79f63d1442 100644 --- a/api/@ohos.resourceschedule.usageStatistics.d.ts +++ b/api/@ohos.resourceschedule.usageStatistics.d.ts @@ -21,7 +21,7 @@ import { AsyncCallback , Callback} from './basic'; * *

You can use the methods defined in this class to query * the usage history and states of bundles in a specified period. - * The system stores the query result in a {@link BundleStateInfo} or {@link BundleActiveState} instance and + * The system stores the query result in a {@link BundleStatsInfo} instance and * then returns it to you. * * @since 9 @@ -32,9 +32,9 @@ declare namespace usageStatistics { * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App */ - interface BundleStateInfo { + interface BundleStatsInfo { /** - * the identifier of BundleStateInfo. + * the identifier of BundleStatsInfo. */ id: number; /** @@ -85,7 +85,7 @@ declare namespace usageStatistics { * @param toMerge Indicates the {@link BundleActiveInfo} object to merge. * if the bundle names of the two {@link BundleActiveInfo} objects are different. */ - merge(toMerge: BundleStateInfo): void; + merge(toMerge: BundleStatsInfo): void; } /** @@ -93,7 +93,7 @@ declare namespace usageStatistics { * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @systemapi Hide this for inner system use. */ - interface BundleActiveFormInfo { + interface HapFormInfo { /** * the form name. */ @@ -121,7 +121,7 @@ declare namespace usageStatistics { * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @systemapi Hide this for inner system use. */ - interface BundleActiveModuleInfo { + interface HapModuleInfo { /** * the device id of module. */ @@ -173,7 +173,7 @@ declare namespace usageStatistics { /** * the form usage record list of current module. */ - formRecords: Array; + formRecords: Array; } /** @@ -181,7 +181,7 @@ declare namespace usageStatistics { * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @systemapi Hide this for inner system use. */ - interface BundleActiveEventState { + interface DeviceEventStats { /** * the bundle name or system event name. */ @@ -202,11 +202,11 @@ declare namespace usageStatistics { * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App */ - interface BundleActiveState { + interface BundleEvents { /** - * the usage priority group of the application. + * the usage group of the application. */ - appUsagePriorityGroup?: number; + appUsageGroup?: number; /** * the bundle name. */ @@ -222,18 +222,18 @@ declare namespace usageStatistics { /** * the time when this state occurred, in milliseconds. */ - stateOccurredTime?: number; + eventOccurredTime?: number; /** - * the state type. + * the event type. */ - stateType?: number; + eventId?: number; } /** * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @systemapi Hide this for inner system use. */ - interface BundleActiveGroupCallbackInfo { + interface AppGroupCallbackInfo { /* * the usage old group of the application */ @@ -271,7 +271,7 @@ declare namespace usageStatistics { function isIdleState(bundleName: string): Promise; /** - * Queries the usage priority group of the calling application. + * Queries the app group of the calling application. * *

The priority defined in a priority group restricts the resource usage of an application, * for example, restricting the running of background tasks.

@@ -279,17 +279,17 @@ declare namespace usageStatistics { * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @throws { BusinessError } If the input parameter is not valid parameter. - * @return Returns the usage priority group of the calling application. + * @return Returns the app group of the calling application. */ - function queryAppUsagePriorityGroup(callback: AsyncCallback): void; - function queryAppUsagePriorityGroup(): Promise; + function queryAppGroup(callback: AsyncCallback): void; + function queryAppGroup(): Promise; /** * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App */ - interface BundleActiveInfoResponse { - [key: string]: BundleStateInfo; + interface BundleStatsMap { + [key: string]: BundleStatsInfo; } /** @@ -304,10 +304,10 @@ declare namespace usageStatistics { * @param begin Indicates the start time of the query period, in milliseconds. * @param end Indicates the end time of the query period, in milliseconds. * @throws { BusinessError } If the input parameter is not valid parameter. - * @return Returns the {@link BundleActiveInfoResponse} objects containing the usage information about each bundle. + * @return Returns the {@link BundleStatsMap} objects containing the usage information about each bundle. */ - function queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback): void; - function queryBundleStateInfos(begin: number, end: number): Promise; + function queryBundleStatsInfos(begin: number, end: number, callback: AsyncCallback): void; + function queryBundleStatsInfos(begin: number, end: number): Promise; /** * Declares interval type. @@ -355,10 +355,10 @@ declare namespace usageStatistics { * @param begin Indicates the start time of the query period, in milliseconds. * @param end Indicates the end time of the query period, in milliseconds. * @throws { BusinessError } If the input parameter is not valid parameter. - * @return Returns the list of {@link BundleStateInfo} objects containing the usage information about each bundle. + * @return Returns the list of {@link BundleStatsInfo} objects containing the usage information about each bundle. */ - function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback>): void; - function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise>; + function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback>): void; + function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise>; /** * Queries state data of all bundles within a specified period identified by the start and end time. @@ -370,10 +370,10 @@ declare namespace usageStatistics { * @param begin Indicates the start time of the query period, in milliseconds. * @param end Indicates the end time of the query period, in milliseconds. * @throws { BusinessError } If the input parameter is not valid parameter. - * @return Returns the list of {@link BundleActiveState} objects containing the state data of all bundles. + * @return Returns the list of {@link BundleEvents} objects containing the state data of all bundles. */ - function queryBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void; - function queryBundleActiveStates(begin: number, end: number): Promise>; + function queryBundleEvents(begin: number, end: number, callback: AsyncCallback>): void; + function queryBundleEvents(begin: number, end: number): Promise>; /** * Queries state data of the current bundle within a specified period. @@ -383,10 +383,10 @@ declare namespace usageStatistics { * @param begin Indicates the start time of the query period, in milliseconds. * @param end Indicates the end time of the query period, in milliseconds. * @throws { BusinessError } If the input parameter is not valid parameter. - * @return Returns the {@link BundleActiveState} object Array containing the state data of the current bundle. + * @return Returns the {@link BundleEvents} object Array containing the state data of the current bundle. */ - function queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void; - function queryCurrentBundleActiveStates(begin: number, end: number): Promise>; + function queryCurrentBundleEvents(begin: number, end: number, callback: AsyncCallback>): void; + function queryCurrentBundleEvents(begin: number, end: number): Promise>; /** * Queries recently module usage records. @@ -397,10 +397,23 @@ declare namespace usageStatistics { * @systemapi Hide this for inner system use. * @param maxNum Indicates max record number in result, max value is 1000, default value is 1000. * @throws { BusinessError } If the input parameter is not valid parameter. - * @return Returns the {@link BundleActiveModuleInfo} object Array containing the usage data of the modules. + * @return Returns the {@link HapModuleInfo} object Array containing the usage data of the modules. + */ + function queryModuleUsageRecords(maxNum: number, callback: AsyncCallback>): void; + function queryModuleUsageRecords(maxNum: number): Promise>; + + /** + * Queries recently module usage records. + * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @systemapi Hide this for inner system use. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @return Returns the {@link HapModuleInfo} object Array containing the usage data of the modules. */ - function getRecentlyUsedModules(maxNum?: number, callback: AsyncCallback>): void; - function getRecentlyUsedModules(maxNum?: number): Promise>; + function queryModuleUsageRecords(callback: AsyncCallback>): void; + function queryModuleUsageRecords(): Promise>; /** * Queries the usage priority group of the calling application. @@ -416,8 +429,8 @@ declare namespace usageStatistics { * @throws { BusinessError } If the input parameter is not valid parameter. * @return Returns the usage priority group of the calling application. */ - function queryAppUsagePriorityGroup(bundleName? : string, callback: AsyncCallback): void; - function queryAppUsagePriorityGroup(bundleName? : string): Promise; + function queryAppGroup(bundleName? : string, callback: AsyncCallback): void; + function queryAppGroup(bundleName? : string): Promise; /** * Declares group type. @@ -430,47 +443,47 @@ declare namespace usageStatistics { /** * Indicates the alive group. */ - ACTIVE_GROUP_ALIVE = 10, + ALIVE_GROUP = 10, /** * Indicates the daily group. */ - ACTIVE_GROUP_DAILY = 20, + DAILY_GROUP = 20, /** * Indicates the fixed group. */ - ACTIVE_GROUP_FIXED = 30, + FIXED_GROUP = 30, /** * Indicates the rare group. */ - ACTIVE_GROUP_RARE = 40, + RARE_GROUP = 40, /** * Indicates the limit group. */ - ACTIVE_GROUP_LIMIT = 50, + LIMITED_GROUP = 50, /** * Indicates the never group. */ - ACTIVE_GROUP_NEVER = 60 + NEVER_GROUP = 60 } /** - * set bundle group by bundleName and number. + * set app group by bundleName and number. * * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @systemapi Hide this for inner system use. * @param bundleName, name of the application. - * @param newGroup,the group of the application whose name is bundleName. + * @param newGroup, the group of the application whose name is bundleName. * @throws { BusinessError } If the input parameter is not valid parameter. */ - function setBundleGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void; - function setBundleGroup(bundleName: string, newGroup: GroupType): Promise; + function setAppGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void; + function setAppGroup(bundleName: string, newGroup: GroupType): Promise; /** * register callback to service. @@ -481,10 +494,10 @@ declare namespace usageStatistics { * @systemapi Hide this for inner system use. * @param Callback, callback when application group change,return the BundleActiveGroupCallbackInfo. * @throws { BusinessError } If the input parameter is not valid parameter. - * @return Returns BundleActiveGroupCallbackInfo when the group of bundle changed. + * @return Returns AppGroupCallbackInfo when the group of bundle changed. */ - function registerGroupCallBack(callback: Callback, callback: AsyncCallback): void; - function registerGroupCallBack(callback: Callback): Promise; + function registerAppGroupCallBack(callback: Callback, callback: AsyncCallback): void; + function registerAppGroupCallBack(callback: Callback): Promise; /** * unRegister callback from service. @@ -495,8 +508,8 @@ declare namespace usageStatistics { * @systemapi Hide this for inner system use. * @throws { BusinessError } If the input parameter is not valid parameter. */ - function unRegisterGroupCallBack(callback: AsyncCallback): void; - function unRegisterGroupCallBack(): Promise; + function unRegisterAppGroupCallBack(callback: AsyncCallback): void; + function unRegisterAppGroupCallBack(): Promise; /* * Queries system event states data within a specified period identified by the start and end time. @@ -508,10 +521,10 @@ declare namespace usageStatistics { * @param begin Indicates the start time of the query period, in milliseconds. * @param end Indicates the end time of the query period, in milliseconds. * @throws { BusinessError } If the input parameter is not valid parameter. - * @return Returns the {@link BundleActiveEventState} object Array containing the event states data. + * @return Returns the {@link DeviceEventStats} object Array containing the event states data. */ - function queryBundleActiveEventStates(begin: number, end: number, callback: AsyncCallback>): void; - function queryBundleActiveEventStates(begin: number, end: number): Promise>; + function queryDeviceEventStates(begin: number, end: number, callback: AsyncCallback>): void; + function queryDeviceEventStates(begin: number, end: number): Promise>; /** * Queries app notification number within a specified period identified by the start and end time. @@ -523,10 +536,10 @@ declare namespace usageStatistics { * @param begin Indicates the start time of the query period, in milliseconds. * @param end Indicates the end time of the query period, in milliseconds. * @throws { BusinessError } If the input parameter is not valid parameter. - * @return Returns the {@link BundleActiveEventState} object Array containing the event states data. + * @return Returns the {@link DeviceEventStats} object Array containing the event states data. */ - function queryAppNotificationNumber(begin: number, end: number, callback: AsyncCallback>): void; - function queryAppNotificationNumber(begin: number, end: number): Promise>; + function queryNotificationNumber(begin: number, end: number, callback: AsyncCallback>): void; + function queryNotificationNumber(begin: number, end: number): Promise>; } export default usageStatistics; -- Gitee From 85ad9ff0b623e301ec1ea7eebdd5d029314c186e Mon Sep 17 00:00:00 2001 From: wuwenlu Date: Thu, 15 Sep 2022 17:14:48 +0800 Subject: [PATCH 014/438] Add registerFont api. Signed-off-by: wuwenlu --- api/@ohos.font.d.ts | 48 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 api/@ohos.font.d.ts diff --git a/api/@ohos.font.d.ts b/api/@ohos.font.d.ts new file mode 100644 index 0000000000..6a7a589ee7 --- /dev/null +++ b/api/@ohos.font.d.ts @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development 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. + */ + +/** + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 9 + * @import font from '@ohos.font'; + */ +declare namespace font { + /** + * @since 9 + */ + interface FontOptions { + + /** + * The font name to register. + * @since 9 + */ + familyName: string; + + /** + * The path of the font file. + * @since 9 + */ + familySrc: string; + } + /** + * Register a customized font in the FontManager. + * @param options FontOptions + * @since 9 + */ + function registerFont(options: FontOptions):void; + +} + +export default font; -- Gitee From c411ddb05f279de4de468494c42bb068fc2a2bfa Mon Sep 17 00:00:00 2001 From: dboy190 Date: Fri, 16 Sep 2022 00:33:57 +0800 Subject: [PATCH 015/438] add error code for kvdb d.ts Signed-off-by: dboy190 --- api/@ohos.data.distributedData.d.ts | 1506 ++++++++++++++++++++++++++- 1 file changed, 1485 insertions(+), 21 deletions(-) diff --git a/api/@ohos.data.distributedData.d.ts b/api/@ohos.data.distributedData.d.ts index e020a04031..f531718ce4 100644 --- a/api/@ohos.data.distributedData.d.ts +++ b/api/@ohos.data.distributedData.d.ts @@ -766,10 +766,25 @@ declare namespace distributedData { * Obtains a key-value pair. * * @since 8 + * @deprecated since 9 + * @useinstead getEntryV9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @returns Returns a key-value pair. */ getEntry(): Entry; + /** + * Obtains a key-value pair. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @returns Returns a key-value pair. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100006 + * @errorcode 15100008 + */ + getEntryV9(): Entry; } /** @@ -781,6 +796,8 @@ declare namespace distributedData { *

This class also provides methods for adding predicates to the {@code Query} instance. * * @since 8 + * @deprecated since 9 + * @useinstead QueryV9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A */ @@ -1094,6 +1111,366 @@ declare namespace distributedData { getSqlLike():string; } + /** + * Represents a database query using a predicate. + * + *

This class provides a constructor used to create a {@code QueryV9} instance, which is used to query data matching specified + * conditions in the database. + * + *

This class also provides methods for adding predicates to the {@code QueryV9} instance. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + */ + class QueryV9 { + /** + * A constructor used to create a Query instance. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + */ + constructor() + /** + * Resets this {@code QueryV9} object. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @returns Returns the reset {@code QueryV9} object. + */ + reset(): QueryV9; + /** + * Constructs a {@code QueryV9} object to query entries with the specified field whose value is equal to the specified long value. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @param value IIndicates the long value. + * @returns Returns the {@coed QueryV9} object. + * @throws throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + equalTo(field: string, value: number|string|boolean): QueryV9; + /** + * Constructs a {@code QueryV9} object to query entries with the specified field whose value is not equal to the specified int value. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @param value Indicates the int value. + * @returns Returns the {@coed QueryV9} object. + * @throws throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + notEqualTo(field: string, value: number|string|boolean): QueryV9; + /** + * Constructs a {@code QueryV9} object to query entries with the specified field whose value is greater than or equal to the + * specified int value. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @param value Indicates the int value. + * @returns Returns the {@coed QueryV9} object. + * @throws throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + greaterThan(field: string, value: number|string|boolean): QueryV9; + /** + * Constructs a {@code QueryV9} object to query entries with the specified field whose value is less than the specified int value. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @param value Indicates the int value. + * @returns Returns the {@coed QueryV9} object. + * @throws throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + lessThan(field: string, value: number|string): QueryV9; + /** + * Constructs a {@code QueryV9} object to query entries with the specified field whose value is greater than or equal to the + * specified int value. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @param value Indicates the int value. + * @returns Returns the {@coed QueryV9} object. + * @throws throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + greaterThanOrEqualTo(field: string, value: number|string): QueryV9; + /** + * Constructs a {@code QueryV9} object to query entries with the specified field whose value is less than or equal to the + * specified int value. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @param value Indicates the int value. + * @returns Returns the {@coed QueryV9} object. + * @throws throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + lessThanOrEqualTo(field: string, value: number|string): QueryV9; + /** + * Constructs a {@code QueryV9} object to query entries with the specified field whose value is null. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @returns Returns the {@coed QueryV9} object. + * @throws throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + isNull(field: string): QueryV9; + /** + * Constructs a {@code QueryV9} object to query entries with the specified field whose value is within the specified int value list. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @param valueList Indicates the int value list. + * @returns Returns the {@coed QueryV9} object. + * @throws throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + inNumber(field: string, valueList: number[]): QueryV9; + /** + * Constructs a {@code QueryV9} object to query entries with the specified field whose value is within the specified string value list. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + + * @import N/A + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @param valueList Indicates the string value list. + * @returns Returns the {@coed QueryV9} object. + * @throws throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + inString(field: string, valueList: string[]): QueryV9; + /** + * Constructs a {@code QueryV9} object to query entries with the specified field whose value is not within the specified int value list. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @param valueList Indicates the int value list. + * @returns Returns the {@coed QueryV9} object. + * @throws throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + notInNumber(field: string, valueList: number[]): QueryV9; + /** + * Constructs a {@code QueryV9} object to query entries with the specified field whose value is not within the specified string value list. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @param valueList Indicates the string value list. + * @returns Returns the {@coed QueryV9} object. + * @throws throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + notInString(field: string, valueList: string[]): QueryV9; + /** + * Constructs a {@code QueryV9} object to query entries with the specified field whose value is similar to the specified string value. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @param value Indicates the string value. + * @returns Returns the {@coed QueryV9} object. + * @throws throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + like(field: string, value: string): QueryV9; + /** + * Constructs a {@code QueryV9} object to query entries with the specified field whose value is not similar to the specified string value. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @param value Indicates the string value. + * @returns Returns the {@coed QueryV9} object. + * @throws throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + unlike(field: string, value: string): QueryV9; + /** + * Constructs a {@code QueryV9} object with the and condition. + * + *

Multiple predicates should be connected using the and or or condition. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @returns Returns the {@coed QueryV9} object. + */ + and(): QueryV9; + /** + * Constructs a {@code QueryV9} object with the or condition. + * + *

Multiple predicates should be connected using the and or or condition. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @returns Returns the {@coed QueryV9} object. + */ + or(): QueryV9; + /** + * Constructs a {@code QueryV9} object to sort the query results in ascending order. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @returns Returns the {@coed QueryV9} object. + * @throws throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + orderByAsc(field: string): QueryV9; + /** + * Constructs a {@code QueryV9} object to sort the query results in descending order. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @returns Returns the {@coed QueryV9} object. + * @throws throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + orderByDesc(field: string): QueryV9; + /** + * Constructs a {@code QueryV9} object to specify the number of results and the start position. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param total Indicates the number of results. + * @param offset Indicates the start position. + * @returns Returns the {@coed QueryV9} object. + */ + limit(total: number, offset: number): QueryV9; + /** + * Creates a {@code QueryV9} condition with a specified field that is not null. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param field Indicates the specified field. + * @returns Returns the {@coed QueryV9} object. + * @throws throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + isNotNull(field: string): QueryV9; + /** + * Creates a query condition group with a left bracket. + * + *

Multiple query conditions in an {@code QueryV9} object can be grouped. The query conditions in a group can be used as a + * whole to combine with other query conditions. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @returns Returns the {@coed QueryV9} object. + */ + beginGroup(): QueryV9; + /** + * Creates a query condition group with a right bracket. + * + *

Multiple query conditions in an {@code QueryV9} object can be grouped. The query conditions in a group can be used as a + * whole to combine with other query conditions. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @returns Returns the {@coed QueryV9} object. + */ + endGroup(): QueryV9; + /** + * Creates a query condition with a specified key prefix. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param prefix Indicates the specified key prefix. + * @returns Returns the {@coed QueryV9} object. + * @throws throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + prefixKey(prefix: string): QueryV9; + /** + * Sets a specified index that will be preferentially used for query. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param index Indicates the index to set. + * @returns Returns the {@coed QueryV9} object. + * @throws throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + setSuggestIndex(index: string): QueryV9; + /** + * Add device ID key prefix.Used by {@code DeviceKVStore}. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param deviceId Specify device id to query from. + * @return Returns the {@code QueryV9} object with device ID prefix added. + * @throws throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + deviceId(deviceId:string):QueryV9; + /** + * Get a String that repreaents this {@code QueryV9}. + * + *

The String would be parsed to DB query format. + * The String length should be no longer than 500kb. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @return String representing this {@code QueryV9}. + */ + getSqlLike():string; + } + /** * Represents a key-value distributed database and provides methods for adding, deleting, modifying, querying, * and subscribing to distributed data. @@ -1103,6 +1480,8 @@ declare namespace distributedData { * including {@code SingleKVStore}. * * @since 7 + * @deprecated since 9 + * @useinstead KVStoreV9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @version 1 @@ -1329,34 +1708,334 @@ declare namespace distributedData { } /** - * Provides methods related to single-version distributed databases. + * Represents a key-value distributed database and provides methods for adding, deleting, modifying, querying, + * and subscribing to distributed data. * - *

To create a {@code SingleKVStore} database, - * you can use the {@link data.distributed.common.KVManager#getKVStore​(Options, String)} method - * with {@code KVStoreType} set to {@code SINGLE_VERSION} for the input parameter {@code Options}. - * This database synchronizes data to other databases in time sequence. - * The {@code SingleKVStore} database does not support - * synchronous transactions, or data search using snapshots. + *

You can create distributed databases of different types by {@link KVManagerV9#getKVStore (Options, String)} + * with input parameter {@code Options}. Distributed database types are defined in {@code KVStoreType}, + * including {@code SingleKVStoreV9}. * - * @since 7 + * @since 9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @version 1 */ - interface SingleKVStore extends KVStore { + interface KVStoreV9 { /** - * Obtains the {@code String} value of a specified key. - * - * @since 7 + * Writes a key-value pair of the string type into the {@code KvStoreV9} database. + * + *

If you do not want to synchronize this key-value pair to other devices, set the write option in the local database. + * + * @since 9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A - * @param key Indicates the key of the boolean value to be queried. - * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, - * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}, and {@code KEY_NOT_FOUND}. + * @param key Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. + * Spaces before and after the key will be cleared. + * @param value Indicates the string value, which must be less than 4 MB as a UTF-8 byte array. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100008 + * @errorcode 401 */ - get(key: string, callback: AsyncCallback): void; - get(key: string): Promise; - + put(key: string, value: Uint8Array | string | number | boolean, callback: AsyncCallback): void; + put(key: string, value: Uint8Array | string | number | boolean): Promise; + + /** + * Writes a value of the valuesbucket type into the {@code KvStoreV9} database. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @systemapi + * @param value Indicates the data record to put. + * Spaces before and after the key will be cleared. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100008 + * @errorcode 401 + */ + putBatch(value: Array, callback: AsyncCallback): void; + putBatch(value: Array): Promise; + + /** + * Deletes the key-value pair based on a specified key. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param key Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. + * Spaces before and after the key will be cleared. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100006 + * @errorcode 15100008 + * @errorcode 401 + */ + delete(key: string, callback: AsyncCallback): void; + delete(key: string): Promise; + + /** + * Deletes the key-value pair based on a specified key. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @systemapi + * @param predicates Indicates the datasharePredicates. + * Spaces before and after the key will be cleared. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100006 + * @errorcode 15100008 + * @errorcode 401 + */ + delete(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback); + delete(predicates: dataSharePredicates.DataSharePredicates): Promise; + + /** + * Backs up a database in a specified name. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param file Indicates the name that saves the database backup. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100002 + * @errorcode 15100007 + * @errorcode 15100008 + * @errorcode 401 + */ + backup(file:string, callback: AsyncCallback):void; + backup(file:string): Promise; + + /** + * Restores a database from a specified database file. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param file Indicates the name that saves the database file. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100002 + * @errorcode 15100007 + * @errorcode 15100008 + * @errorcode 401 + */ + restore(file:string, callback: AsyncCallback):void; + restore(file:string): Promise; + + /** + * Delete a backup files based on a specified name. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param files list Indicates the name that backup file to delete. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + deleteBackup(files:Array, callback: AsyncCallback>):void; + deleteBackup(files:Array): Promise>; + + /** + * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in + * {@code KvStoreObserver} will be invoked. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. + * @param listener Indicates the observer of data change events in the distributed database. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100002 + * @errorcode 15100004 + * @errorcode 15100008 + * @errorcode 15100009 + * @errorcode 401 + */ + on(event: 'dataChange', type: SubscribeType, listener: Callback): void; + + /** + * Subscribes from the {@code KvStoreV9} database based on the specified subscribeType and {@code KvStoreObserver}. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + on(event: 'syncComplete', syncCallback: Callback>): void; + + /** + * Unsubscribes from the {@code KvStoreV9} database based on the specified subscribeType and {@code KvStoreObserver}. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100002 + * @errorcode 15100004 + * @errorcode 15100008 + * @errorcode 15100010 + * @errorcode 401 + */ + off(event:'dataChange', listener?: Callback): void; + + /** + * UnRegister Synchronizes {@code KvStoreV9} database callback. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param syncCallback Indicates the callback used to send the synchronization result to caller. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + off(event: 'syncComplete', syncCallback?: Callback>): void; + + /** + * Inserts key-value pairs into the {@code KvStoreV9} database in batches. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param entries Indicates the key-value pairs to be inserted in batches. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100008 + * @errorcode 401 + */ + putBatch(entries: Entry[], callback: AsyncCallback): void; + putBatch(entries: Entry[]): Promise; + + /** + * Deletes key-value pairs in batches from the {@code KvStoreV9} database. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param keys Indicates the key-value pairs to be deleted in batches. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100006 + * @errorcode 15100008 + * @errorcode 401 + */ + deleteBatch(keys: string[], callback: AsyncCallback): void; + deleteBatch(keys: string[]): Promise; + + /** + * Starts a transaction operation in the {@code KvStoreV9} database. + * + *

After the database transaction is started, you can submit or roll back the operation. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100002 + * @errorcode 15100004 + * @errorcode 15100008 + */ + startTransaction(callback: AsyncCallback): void; + startTransaction(): Promise; + + /** + * Submits a transaction operation in the {@code KvStoreV9} database. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param callback + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100008 + */ + commit(callback: AsyncCallback): void; + commit(): Promise; + + /** + * Rolls back a transaction operation in the {@code KvStoreV9} database. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100008 + */ + rollback(callback: AsyncCallback): void; + rollback(): Promise; + + /** + * Sets whether to enable synchronization. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param enabled Specifies whether to enable synchronization. The value true means to enable + * synchronization, and false means the opposite. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100002 + * @errorcode 401 + */ + enableSync(enabled: boolean, callback: AsyncCallback): void; + enableSync(enabled: boolean): Promise; + + /** + * Sets synchronization range labels. + * + *

The labels determine the devices with which data will be synchronized. + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param localLabels Indicates the synchronization labels of the local device. + * @param remoteSupportLabels Indicates the labels of the devices with which data will be synchronized. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100002 + * @errorcode 401 + */ + setSyncRange(localLabels: string[], remoteSupportLabels: string[], callback: AsyncCallback): void; + setSyncRange(localLabels: string[], remoteSupportLabels: string[]): Promise; + } + + /** + * Provides methods related to single-version distributed databases. + * + *

To create a {@code SingleKVStore} database, + * you can use the {@link data.distributed.common.KVManager#getKVStore​(Options, String)} method + * with {@code KVStoreType} set to {@code SINGLE_VERSION} for the input parameter {@code Options}. + * This database synchronizes data to other databases in time sequence. + * The {@code SingleKVStore} database does not support + * synchronous transactions, or data search using snapshots. + * + * @since 7 + * @deprecated since 9 + * @useinstead SingleKVStoreV9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @version 1 + */ + interface SingleKVStore extends KVStore { + /** + * Obtains the {@code String} value of a specified key. + * + * @since 7 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param key Indicates the key of the boolean value to be queried. + * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, + * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}, and {@code KEY_NOT_FOUND}. + */ + get(key: string, callback: AsyncCallback): void; + get(key: string): Promise; + /** * Obtains all key-value pairs that match a specified key prefix. * @@ -1566,6 +2245,305 @@ declare namespace distributedData { getSecurityLevel(): Promise; } + /** + * Provides methods related to single-version distributed databases. + * + *

To create a {@code SingleKVStoreV9} database, + * you can use the {@link data.distributed.common.KVManagerV9#getKVStore​(Options, String)} method + * with {@code KVStoreType} set to {@code SINGLE_VERSION} for the input parameter {@code Options}. + * This database synchronizes data to other databases in time sequence. + * The {@code SingleKVStoreV9} database does not support + * synchronous transactions, or data search using snapshots. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @version 1 + */ + interface SingleKVStoreV9 extends KVStoreV9 { + /** + * Obtains the {@code String} value of a specified key. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100006 + * @errorcode 15100008 + * @errorcode 401 + */ + get(key: string, callback: AsyncCallback): void; + get(key: string): Promise; + + /** + * Obtains all key-value pairs that match a specified key prefix. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param keyPrefix Indicates the key prefix to match. + * @returns Returns the list of all key-value pairs that match the specified key prefix. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100008 + * @errorcode 401 + */ + getEntries(keyPrefix: string, callback: AsyncCallback): void; + getEntries(keyPrefix: string): Promise; + + /** + * Obtains the list of key-value pairs matching the specified {@code QueryV9} object. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param query Indicates the {@code QueryV9} object. + * @returns Returns the list of key-value pairs matching the specified {@code QueryV9} object. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100007 + * @errorcode 15100008 + * @errorcode 401 + */ + getEntries(query: QueryV9, callback: AsyncCallback): void; + getEntries(query: QueryV9): Promise; + + /** + * Obtains the result sets with a specified prefix from a {@code KvStoreV9} database. The {@code KvStoreResultSet} object can be used to + * query all key-value pairs that meet the search criteria. Each {@code KvStoreV9} instance can have a maximum of four + * {@code KvStoreResultSet} objects at the same time. If you have created four objects, calling this method will return a + * failure. Therefore, you are advised to call the closeResultSet method to close unnecessary {@code KvStoreResultSet} objects + * in a timely manner. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param keyPrefix Indicates the key prefix to match. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100008 + * @errorcode 401 + */ + getResultSet(keyPrefix: string, callback: AsyncCallback): void; + getResultSet(keyPrefix: string): Promise; + + /** + * Obtains the {@code KvStoreResultSet} object matching the specified {@code QueryV9} object. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param query Indicates the {@code QueryV9} object. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100008 + * @errorcode 401 + */ + getResultSet(query: QueryV9, callback: AsyncCallback): void; + getResultSet(query: QueryV9): Promise; + + /** + * Obtains the KvStoreResultSet object matching the specified Predicate object. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @systemapi + * @param predicates Indicates the datasharePredicates. + * Spaces before and after the key will be cleared. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100008 + * @errorcode 401 + */ + getResultSet(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; + getResultSet(predicates: dataSharePredicates.DataSharePredicates): Promise; + + /** + * Closes a {@code KvStoreResultSet} object returned by getResultSet. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param resultSet Indicates the {@code KvStoreResultSet} object to close. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 401 + */ + closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; + closeResultSet(resultSet: KvStoreResultSet): Promise; + + /** + * Obtains the number of results matching the specified {@code QueryV9} object. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param query Indicates the {@code QueryV9} object. + * @returns Returns the number of results matching the specified {@code QueryV9} object. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100008 + * @errorcode 401 + */ + getResultSize(query: QueryV9, callback: AsyncCallback): void; + getResultSize(query: QueryV9): Promise; + + /** + * void removeDeviceData​({@link String} deviceId) throws {@link KvStoreException} + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param deviceId Indicates the device to be removed data. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100008 + * @errorcode 401 + */ + removeDeviceData(deviceId: string, callback: AsyncCallback): void; + removeDeviceData(deviceId: string): Promise; + + /** + * Synchronizes the database to the specified devices with the specified delay allowed. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param deviceIds Indicates the list of devices to which to synchronize the database. + * @param mode Indicates the synchronization mode. The value can be {@code PUSH}, {@code PULL}, or {@code PUSH_PULL}. + * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100002 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100006 + * @errorcode 401 + */ + sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void + + /** + * Synchronizes the database to the specified devices with the specified delay allowed. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param deviceIds Indicates the list of devices to which to synchronize the database. + * @param mode Indicates the synchronization mode. The value can be {@code PUSH}, {@code PULL}, or {@code PUSH_PULL}. + * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. + * @param query Indicates the {@code QueryV9} object. + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100002 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100006 + * @errorcode 401 + */ + sync(deviceIds: string[], query: QueryV9, mode: SyncMode, delayMs?: number): void; + + /** + * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in + * {@code KvStoreObserver} will be invoked. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. + * @param listener Indicates the observer of data change events in the distributed database. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100002 + * @errorcode 15100004 + * @errorcode 15100008 + * @errorcode 15100009 + * @errorcode 401 + */ + on(event: 'dataChange', type: SubscribeType, listener: Callback): void; + + /** + * Register Synchronizes SingleKvStore databases callback. + *

Sync result is returned through asynchronous callback. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param syncCallback Indicates the callback used to send the synchronization result to the caller. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + on(event: 'syncComplete', syncCallback: Callback>): void; + + /** + * Unsubscribes from the SingleKvStore database based on the specified subscribeType and {@code KvStoreObserver}. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100002 + * @errorcode 15100004 + * @errorcode 15100008 + * @errorcode 15100010 + * @errorcode 401 + */ + off(event:'dataChange', listener?: Callback): void; + + /** + * UnRegister Synchronizes SingleKvStore databases callback. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + off(event: 'syncComplete', syncCallback?: Callback>): void; + + + /** + * Sets the default delay allowed for database synchronization + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param defaultAllowedDelayMs Indicates the default delay allowed for the database synchronization, in milliseconds. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100002 + * @errorcode 401 + */ + setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback): void; + setSyncParam(defaultAllowedDelayMs: number): Promise; + + /** + * Get the security level of the database. + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @returns SecurityLevel {@code SecurityLevel} the security level of the database. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100008 + */ + getSecurityLevel(callback: AsyncCallback): void; + getSecurityLevel(): Promise; + } + /** * Manages distributed data by device in a distributed system. * @@ -1575,6 +2553,8 @@ declare namespace distributedData { * into the database, the system automatically adds the ID of the device running the application to the key. * * @since 8 + * @deprecated since 9 + * @useinstead DeviceKVStoreV9 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A */ @@ -1835,6 +2815,356 @@ declare namespace distributedData { */ off(event: 'syncComplete', syncCallback?: Callback>): void; } + + /** + * Manages distributed data by device in a distributed system. + * + *

To create a {@code DeviceKVStoreV9} database, you can use the {@link data.distributed.common.KVManagerV9.getKvStore(Options, String)} + * method with {@code KvStoreType} set to {@code DEVICE_COLLABORATION} for the input parameter Options. This database manages distributed + * data by device, and cannot modify data synchronized from remote devices. When an application writes a key-value pair entry + * into the database, the system automatically adds the ID of the device running the application to the key. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @import N/A + */ + interface DeviceKVStoreV9 extends KVStoreV9 { + /** + * Obtains the {@code String} value matching a specified device ID and key. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @param deviceId Indicates the device to be queried. + * @param key Indicates the key of the value to be queried. + * @return Returns the value matching the given criteria. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100006 + * @errorcode 15100008 + * @errorcode 401 + */ + get(deviceId: string, key: string, callback: AsyncCallback): void; + get(deviceId: string, key: string): Promise; + + /** + * Obtains all key-value pairs matching a specified device ID and key prefix. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @param deviceId Identifies the device whose data is to be queried. + * @param keyPrefix Indicates the key prefix to match. + * @returns Returns the list of all key-value pairs meeting the given criteria. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100008 + * @errorcode 401 + */ + getEntries(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; + getEntries(deviceId: string, keyPrefix: string): Promise; + + /** + * Obtains the list of key-value pairs matching the specified {@code QueryV9} object. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @param query Indicates the {@code QueryV9} object. + * @returns Returns the list of key-value pairs matching the specified {@code QueryV9} object. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100007 + * @errorcode 15100008 + * @errorcode 401 + */ + getEntries(query: QueryV9, callback: AsyncCallback): void; + getEntries(query: QueryV9): Promise; + + /** + * Obtains the list of key-value pairs matching a specified device ID and {@code QueryV9} object. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @param deviceId Indicates the ID of the device to which the key-value pairs belong. + * @param query Indicates the {@code QueryV9} object. + * @returns Returns the list of key-value pairs matching the specified {@code QueryV9} object. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100007 + * @errorcode 15100008 + * @errorcode 401 + */ + getEntries(deviceId: string, query: QueryV9, callback: AsyncCallback): void; + getEntries(deviceId: string, query: QueryV9): Promise; + + /** + * Obtains the {@code KvStoreResultSet} object matching the specified device ID and key prefix. + * + *

The {@code KvStoreResultSet} object can be used to query all key-value pairs that meet the search criteria. Each {@code KvStoreV9} + * instance can have a maximum of four {@code KvStoreResultSet} objects at the same time. If you have created four objects, + * calling this method will return a failure. Therefore, you are advised to call the closeResultSet method to close unnecessary + * {@code KvStoreResultSet} objects in a timely manner. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @param deviceId Identifies the device whose data is to be queried. + * @param keyPrefix Indicates the key prefix to match. + * @returns Returns the {@code KvStoreResultSet} objects. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100008 + * @errorcode 401 + */ + getResultSet(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; + getResultSet(deviceId: string, keyPrefix: string): Promise; + + /** + * Obtains the {@code KvStoreResultSet} object matching the specified {@code QueryV9} object. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @param query Indicates the {@code QueryV9} object. + * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code QueryV9} object. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100008 + * @errorcode 401 + */ + getResultSet(query: QueryV9, callback: AsyncCallback): void; + getResultSet(query: QueryV9): Promise; + + /** + * Obtains the {@code KvStoreResultSet} object matching a specified device ID and {@code QueryV9} object. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @param deviceId Indicates the ID of the device to which the {@code KvStoreResultSet} object belongs. + * @param query Indicates the {@code QueryV9} object. + * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code QueryV9} object. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100008 + * @errorcode 401 + */ + getResultSet(deviceId: string, query: QueryV9, callback: AsyncCallback): void; + getResultSet(deviceId: string, query: QueryV9): Promise; + + /** + * Obtains the KvStoreResultSet object matching the specified Predicate object. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param predicates Indicates the datasharePredicates. + * @systemapi + * Spaces before and after the key will be cleared. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100008 + * @errorcode 401 + */ + getResultSet(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; + getResultSet(predicates: dataSharePredicates.DataSharePredicates): Promise; + + /** + * Obtains the KvStoreResultSet object matching a specified Device ID and Predicate object. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @systemapi + * @param predicates Indicates the key. + * @param deviceId Indicates the ID of the device to which the results belong. + * Spaces before and after the key will be cleared. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100008 + * @errorcode 401 + */ + getResultSet(deviceId: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; + getResultSet(deviceId: string, predicates: dataSharePredicates.DataSharePredicates): Promise; + + /** + * Closes a {@code KvStoreResultSet} object returned by getResultSet. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @param resultSet Indicates the {@code KvStoreResultSet} object to close. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 401 + */ + closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; + closeResultSet(resultSet: KvStoreResultSet): Promise; + + /** + * Obtains the number of results matching the specified {@code QueryV9} object. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @param query Indicates the {@code QueryV9} object. + * @returns Returns the number of results matching the specified {@code QueryV9} object. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100008 + * @errorcode 401 + */ + getResultSize(query: QueryV9, callback: AsyncCallback): void; + getResultSize(query: QueryV9): Promise; + + /** + * Obtains the number of results matching a specified device ID and {@code Query} object. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @param deviceId Indicates the ID of the device to which the results belong. + * @param query Indicates the {@code QueryV9} object. + * @returns Returns the number of results matching the specified {@code QueryV9} object. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100008 + * @errorcode 401 + */ + getResultSize(deviceId: string, query: QueryV9, callback: AsyncCallback): void; + getResultSize(deviceId: string, query: QueryV9): Promise; + + /** + * Removes data of a specified device from the current database. This method is used to remove only the data + * synchronized from remote devices. This operation does not synchronize data to other databases or affect + * subsequent data synchronization. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @param deviceId Identifies the device whose data is to be removed. The value cannot be the current device ID. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100004 + * @errorcode 15100008 + * @errorcode 401 + */ + removeDeviceData(deviceId: string, callback: AsyncCallback): void; + removeDeviceData(deviceId: string): Promise; + + /** + * Synchronizes {@code DeviceKVStore} databases. + * + *

This method returns immediately and sync result will be returned through asynchronous callback. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param deviceIds Indicates the list of IDs of devices whose + * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. + * {@code DeviceKVStore} databases are to be synchronized. + * @param mode Indicates the synchronization mode, {@code PUSH}, {@code PULL}, or + * {@code PUSH_PULL}. + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100002 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100006 + * @errorcode 401 + */ + sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; + + /** + * Synchronizes {@code DeviceKVStore} databases. + * + *

This method returns immediately and sync result will be returned through asynchronous callback. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param deviceIds Indicates the list of IDs of devices whose + * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. + * {@code DeviceKVStore} databases are to be synchronized. + * @param query Indicates the {@code Query} object. + * @param mode Indicates the synchronization mode, {@code PUSH}, {@code PULL}, or + * {@code PUSH_PULL}. + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100002 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 15100006 + * @errorcode 401 + */ + sync(deviceIds: string[], query: Query, mode: SyncMode, delayMs?: number): void; + + /** + * Register Synchronizes DeviceKVStore databases callback. + * + *

Sync result is returned through asynchronous callback. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param syncCallback Indicates the callback used to send the synchronization result to the caller. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + on(event: 'syncComplete', syncCallback: Callback>): void; + + /** + * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in + * {@code KvStoreObserver} will be invoked. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. + * @param listener Indicates the observer of data change events in the distributed database. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100002 + * @errorcode 15100004 + * @errorcode 15100008 + * @errorcode 15100009 + * @errorcode 401 + */ + on(event: 'dataChange', type: SubscribeType, listener: Callback): void; + + /** + * Unsubscribes from the DeviceKVStore database based on the specified subscribeType and {@code KvStoreObserver}. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100002 + * @errorcode 15100004 + * @errorcode 15100008 + * @errorcode 15100010 + * @errorcode 401 + */ + off(event:'dataChange', listener?: Callback): void; + + /** + * UnRegister Synchronizes DeviceKVStore databases callback. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + off(event: 'syncComplete', syncCallback?: Callback>): void; + } /** * Creates a {@link KVManager} instance based on the configuration information. @@ -1842,7 +3172,9 @@ declare namespace distributedData { *

You must pass {@link KVManagerConfig} to provide configuration information * for creating the {@link KVManager} instance. * - * @since 7 + * @since 9 + * @deprecated since 9 + * @useinstead createKVManagerV9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param config Indicates the {@link KVStore} configuration information, * including the user information and package name. @@ -1852,10 +3184,30 @@ declare namespace distributedData { function createKVManager(config: KVManagerConfig, callback: AsyncCallback): void; function createKVManager(config: KVManagerConfig): Promise; + /** + * Creates a {@link KVManagerV9} instance based on the configuration information. + * + *

You must pass {@link KVManagerConfig} to provide configuration information + * for creating the {@link KVManagerV9} instance. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param config Indicates the {@link KVStoreV9} configuration information, + * including the user information and package name. + * @return Returns the {@code KVManagerV9} instance. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + function createKVManagerV9(config: KVManagerConfig, callback: AsyncCallback): void; + function createKVManagerV9(config: KVManagerConfig): Promise; + /** * Provides interfaces to manage a {@code KVStore} database, including obtaining, closing, and deleting the {@code KVStore}. * - * @since 7 + * @since 9 + * @deprecated since 9 + * @useinstead KVManagerV9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @version 1 @@ -1950,6 +3302,118 @@ declare namespace distributedData { */ off(event: 'distributedDataServiceDie', deathCallback?: Callback): void; } + + /** + * Provides interfaces to manage a {@code KVStoreV9} database, including obtaining, closing, and deleting the {@code KVStoreV9}. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @version 1 + */ + interface KVManagerV9 { + /** + * Creates and obtains a {@code KVStoreV9} database by specifying {@code Options} and {@code storeId}. + * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param options Indicates the options used for creating and obtaining the {@code KVStoreV9} database, + * including {@code isCreateIfMissing}, {@code isEncrypt}, and {@code KVStoreType}. + * @param storeId Identifies the {@code KVStoreV9} database. + * The value of this parameter must be unique for the same application, + * and different applications can share the same value. + * @return Returns a {@code KVStoreV9}, or {@code SingleKVStoreV9}. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100003 + * @errorcode 15100004 + * @errorcode 15100005 + * @errorcode 401 + */ + getKVStore(storeId: string, options: Options): Promise; + getKVStore(storeId: string, options: Options, callback: AsyncCallback): void; + + /** + * Closes the {@code KvStoreV9} database. + * + *

Warning: This method is not thread-safe. If you call this method to stop a KvStore database that is running, your + * thread may crash. + * + *

The {@code KvStoreV9} database to close must be an object created by using the {@code getKvStoreV9} method. Before using this + * method, release the resources created for the database, for example, {@code KvStoreResultSet} for {@code SingleKvStoreV9}, + * otherwise closing the database will fail. If you are attempting to close a database that is already closed, an error + * will be returned. + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param kvStore Indicates the {@code KvStoreV9} database to close. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + closeKVStore(appId: string, storeId: string, kvStore: KVStoreV9, callback: AsyncCallback): void; + closeKVStore(appId: string, storeId: string, kvStore: KVStoreV9): Promise; + + /** + * Deletes the {@code KvStoreV9} database identified by storeId. + * + *

Before using this method, close all {@code KvStoreV9} instances in use that are identified by the same storeId. + * + *

You can use this method to delete a {@code KvStoreV9} database not in use. After the database is deleted, all its data will be + * lost. + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param storeId Identifies the {@code KvStoreV9} database to delete. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100002 + * @errorcode 15100004 + * @errorcode 15100006 + * @errorcode 401 + */ + deleteKVStore(appId: string, storeId: string, callback: AsyncCallback): void; + deleteKVStore(appId: string, storeId: string): Promise; + + /** + * Obtains the storeId of all {@code KvStoreV9} databases that are created by using the {@code getKvStoreV9} method and not deleted by + * calling the {@code deleteKvStore} method. + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @returns Returns the storeId of all created {@code KvStore} databases. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 15100002 + * @errorcode 15100004 + * @errorcode 401 + */ + getAllKVStoreId(appId: string, callback: AsyncCallback): void; + getAllKVStoreId(appId: string): Promise; + + /** + * register DeviceChangeCallback to get notification when device's status changed + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @param deathCallback device change callback {@code DeviceChangeCallback} + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + on(event: 'distributedDataServiceDie', deathCallback: Callback): void; + + /** + * unRegister DeviceChangeCallback and can not receive notification + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @param deathCallback device change callback {@code DeviceChangeCallback} which has been registered. + * @throws {BusinessError} if process failed. + * @errorcode 15100001 + * @errorcode 401 + */ + off(event: 'distributedDataServiceDie', deathCallback?: Callback): void; + } } export default distributedData; \ No newline at end of file -- Gitee From 406606d43db572226a85f3d2aece8b8c52b02e1f Mon Sep 17 00:00:00 2001 From: dboy190 Date: Fri, 16 Sep 2022 00:39:18 +0800 Subject: [PATCH 016/438] since fix Signed-off-by: dboy190 --- api/@ohos.data.distributedData.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/@ohos.data.distributedData.d.ts b/api/@ohos.data.distributedData.d.ts index f531718ce4..be10b3903e 100644 --- a/api/@ohos.data.distributedData.d.ts +++ b/api/@ohos.data.distributedData.d.ts @@ -3344,7 +3344,7 @@ declare namespace distributedData { * otherwise closing the database will fail. If you are attempting to close a database that is already closed, an error * will be returned. * - * @since 8 + * @since 9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param kvStore Indicates the {@code KvStoreV9} database to close. * @throws {BusinessError} if process failed. @@ -3361,7 +3361,7 @@ declare namespace distributedData { * *

You can use this method to delete a {@code KvStoreV9} database not in use. After the database is deleted, all its data will be * lost. - * @since 8 + * @since 9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param storeId Identifies the {@code KvStoreV9} database to delete. * @throws {BusinessError} if process failed. @@ -3378,7 +3378,7 @@ declare namespace distributedData { * Obtains the storeId of all {@code KvStoreV9} databases that are created by using the {@code getKvStoreV9} method and not deleted by * calling the {@code deleteKvStore} method. * - * @since 8 + * @since 9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @returns Returns the storeId of all created {@code KvStore} databases. * @throws {BusinessError} if process failed. @@ -3393,7 +3393,7 @@ declare namespace distributedData { /** * register DeviceChangeCallback to get notification when device's status changed * - * @since 8 + * @since 9 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deathCallback device change callback {@code DeviceChangeCallback} * @throws {BusinessError} if process failed. @@ -3405,7 +3405,7 @@ declare namespace distributedData { /** * unRegister DeviceChangeCallback and can not receive notification * - * @since 8 + * @since 9 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deathCallback device change callback {@code DeviceChangeCallback} which has been registered. * @throws {BusinessError} if process failed. -- Gitee From f13eb3cf35384e41277843e37675f1d4d798b37f Mon Sep 17 00:00:00 2001 From: limeng Date: Mon, 19 Sep 2022 13:25:30 +0800 Subject: [PATCH 017/438] update interfaces for waterflow & flowitem Signed-off-by: limeng --- api/@internal/component/ets/flow_Item.d.ts | 34 +++++++ api/@internal/component/ets/water_flow.d.ts | 100 ++++++++++++++++++++ 2 files changed, 134 insertions(+) create mode 100644 api/@internal/component/ets/flow_Item.d.ts create mode 100644 api/@internal/component/ets/water_flow.d.ts diff --git a/api/@internal/component/ets/flow_Item.d.ts b/api/@internal/component/ets/flow_Item.d.ts new file mode 100644 index 0000000000..fcfc6f1ebb --- /dev/null +++ b/api/@internal/component/ets/flow_Item.d.ts @@ -0,0 +1,34 @@ +/* + * 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. + */ + +/** + * Mesh container for static fixed-size layout scenarios. + * @since 9 + */ +interface FlowItemInterface { + /** + * Return to get flowItem. + * @since 9 + */ + (): FlowItemAttribute; +} + +/** + * @since 9 + */ +declare class FlowItemAttribute extends CommonMethod {} + +declare const FlowItem: FlowItemInterface +declare const FlowItemInstance: FlowItemAttribute; diff --git a/api/@internal/component/ets/water_flow.d.ts b/api/@internal/component/ets/water_flow.d.ts new file mode 100644 index 0000000000..d3e1e13d04 --- /dev/null +++ b/api/@internal/component/ets/water_flow.d.ts @@ -0,0 +1,100 @@ +/* + * 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. + */ + +/** +* Defines the water flow options. +* @since 9 +*/ +declare interface WaterFlowOptions { + /** + * Describes the water flow footer. + * @since 9 + */ + footer?: CustomBuilder; + + /** + * Describes the water flow scroller. + * @since 9 + */ + scroller?: Scroller; +} + + +/** + * @since 9 + */ +interface WaterFlowInterface { + /** + * WaterFlow is returned when the parameter is transferred. only support api: scrollToIndex + * @since 9 + */ + (options?: WaterFlowOptions): WaterFlowAttribute; +} + +/** + * @since 9 + */ +declare class WaterFlowAttribute extends CommonMethod { + /** + * This parameter specifies the number of columns in the current waterflow. + * @since 9 + */ + columnsTemplate(value: string): WaterFlowAttribute; + + /** + * This parameter specifies the min or max size of each item. + * @since 9 + */ + itemConstraintSize(value: ConstraintSizeOptions): WaterFlowAttribute; + + /** + * Lets you set the number of rows in the current waterflow。 + * @since 9 + */ + rowsTemplate(value: string): WaterFlowAttribute; + + /** + * Allows you to set the spacing between columns. + * @since 9 + */ + columnsGap(value: Length): WaterFlowAttribute; + + /** + * Lets you set the spacing between rows. + * @since 9 + */ + rowsGap(value: Length): WaterFlowAttribute; + + /** + * control WaterFlowDirection of the WaterFlow. + * @since 9 + */ + layoutDirection(value: FlexDirection): WaterFlowAttribute; + + /** + * Called when the water flow begins to arrive. + * @since 9 + */ + onReachStart(event: () => void): WaterFlowAttribute; + + /** + * Called when the water flow reaches the end. + * @since 9 + */ + onReachEnd(event: () => void): WaterFlowAttribute; +} + +declare const WaterFlow: WaterFlowInterface; +declare const WaterFlowInstance: WaterFlowAttribute; -- Gitee From dc611132520e70f37b5dac287c575d4495388bc9 Mon Sep 17 00:00:00 2001 From: linhaoran Date: Tue, 6 Sep 2022 17:54:01 +0800 Subject: [PATCH 018/438] Add interface exception information. Signed-off-by: linhaoran --- api/@ohos.util.ArrayList.d.ts | 44 ++++++++++++++++++++++----- api/@ohos.util.Deque.d.ts | 17 ++++++++--- api/@ohos.util.HashMap.d.ts | 21 ++++++++++++- api/@ohos.util.HashSet.d.ts | 19 ++++++++++-- api/@ohos.util.LightWeightMap.d.ts | 37 ++++++++++++++++++++++- api/@ohos.util.LightWeightSet.d.ts | 28 ++++++++++++++++- api/@ohos.util.LinkedList.d.ts | 41 +++++++++++++++++++++---- api/@ohos.util.List.d.ts | 41 +++++++++++++++++++++---- api/@ohos.util.PlainArray.d.ts | 48 +++++++++++++++++++++++++----- api/@ohos.util.Queue.d.ts | 12 ++++++-- api/@ohos.util.Stack.d.ts | 12 +++++++- api/@ohos.util.TreeMap.d.ts | 27 ++++++++++++++++- api/@ohos.util.TreeSet.d.ts | 24 ++++++++++++++- api/@ohos.util.Vector.d.ts | 3 +- 14 files changed, 332 insertions(+), 42 deletions(-) diff --git a/api/@ohos.util.ArrayList.d.ts b/api/@ohos.util.ArrayList.d.ts index ac7174e497..c97b879b7f 100644 --- a/api/@ohos.util.ArrayList.d.ts +++ b/api/@ohos.util.ArrayList.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,9 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + declare class ArrayList { /** * A constructor used to create a ArrayList object. + * @throws {NewTargetIsNullError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -29,6 +31,7 @@ declare class ArrayList { * Appends the specified element to the end of this arraylist. * @param element to be appended to this arraylist * @returns the boolean type, returns true if the addition is successful, and returns false if it fails. + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -39,7 +42,9 @@ declare class ArrayList { * any subsequent elements to the right (adds one to their index). * @param index index at which the specified element is to be inserted * @param element element to be inserted - * @throws If index is greater than or equal to length, or less than 0, an exception is thrown and cannot be inserted + * @throws {ContainerBindError} Method not support bind. + * @throws {RangeError} Index out of range. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -48,6 +53,7 @@ declare class ArrayList { * Check if arraylist contains the specified element * @param element element to be contained * @return the boolean type,if arraylist contains the specified element,return true,else return false + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -57,6 +63,7 @@ declare class ArrayList { * in this arraylist, or -1 if this arraylist does not contain the element. * @param element element to be contained * @return the number type ,returns the lowest index such that or -1 if there is no such index. + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -66,7 +73,9 @@ declare class ArrayList { * delete the element, and move the index of all elements to the right of the element forward by one. * @param index the index in the arraylist * @return the T type ,returns undefined if arraylist is empty,If the index is - * out of bounds (greater than or equal to length or less than 0), throw an exception + * @throws {ContainerBindError} Method not support bind. + * @throws {RangeError} Index out of range. + * @throws {TypeError} Parameter check failed. * * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -77,6 +86,7 @@ declare class ArrayList { * unchanged. More formally, removes the element with the lowest index * @param element element to remove * @return the boolean type ,If there is no such element, return false + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -86,6 +96,7 @@ declare class ArrayList { * or -1 if the arraylist does not contain the element. * @param element element to find * @return the number type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -94,8 +105,9 @@ declare class ArrayList { * Removes from this arraylist all of the elements whose index is between fromIndex,inclusive,and toIndex ,exclusive. * @param fromIndex The starting position of the index, containing the value at that index position * @param toIndex the end of the index, excluding the value at that index - * @throws If the fromIndex is out of range (greater than or equal to length or less than 0), - * or if toIndex is less than fromIndex, an IndexOutOfBoundException is thrown + * @throws {ContainerBindError} Method not support bind. + * @throws {RangeError} Index out of range. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -109,11 +121,13 @@ declare class ArrayList { * @param arrlist (Optional) The arraylist object to which the current element belongs. * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ replaceAllElements(callbackfn: (value: T, index?: number, arrlist?: ArrayList) => T, - thisArg?: Object): void; + thisArg?: Object): void; /** * Executes a provided function once for each value in the arraylist object. * @param callbackfn (required) A function that accepts up to four arguments.The function to @@ -123,6 +137,8 @@ declare class ArrayList { * @param arrlist (Optional) The arraylist object to which the current element belongs. * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -137,6 +153,8 @@ declare class ArrayList { * @param firstValue (Optional) previous element * @param secondValue (Optional) next elements * If this parameter is empty, it will default to ASCII sorting + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -145,8 +163,9 @@ declare class ArrayList { * Returns a view of the portion of this arraylist between the specified fromIndex,inclusize,and toIndex,exclusive * @param fromIndex The starting position of the index, containing the value at that index position * @param toIndex the end of the index, excluding the value at that index - * @throws If the fromIndex or toIndex index is out of range (greater than or equal to length or less than 0), - * or if toIndex is less than fromIndex, an IndexOutOfBoundException is thrown + * @throws {ContainerBindError} Method not support bind. + * @throws {RangeError} Index out of range. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -154,6 +173,7 @@ declare class ArrayList { /** * Removes all of the elements from this arraylist.The arraylist will * be empty after this call returns.length becomes 0 + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -161,6 +181,7 @@ declare class ArrayList { /** * Returns a shallow copy of this instance. (The elements themselves are not copied.) * @return this arraylist instance + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -168,6 +189,7 @@ declare class ArrayList { /** * returns the capacity of this arraylist * @return the number type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -175,6 +197,7 @@ declare class ArrayList { /** * convert arraylist to array * @return the Array type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -182,6 +205,7 @@ declare class ArrayList { /** * Determine whether arraylist is empty and whether there is an element * @return the boolean type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -189,18 +213,22 @@ declare class ArrayList { /** * If the newCapacity provided by the user is greater than or equal to length, * change the capacity of the arraylist to newCapacity, otherwise the capacity will not be changed + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ increaseCapacityTo(newCapacity: number): void; /** * Limit the capacity to the current length + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ trimToCurrentLength(): void; /** * returns an iterator.Each item of the iterator is a Javascript Object + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.Deque.d.ts b/api/@ohos.util.Deque.d.ts index b8b284b44a..04d1212372 100644 --- a/api/@ohos.util.Deque.d.ts +++ b/api/@ohos.util.Deque.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,9 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + declare class Deque { /** * A constructor used to create a Deque object. + * @throws {NewTargetIsNullError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -28,6 +30,7 @@ declare class Deque { /** * Inserts an element into the deque header. * @param element to be appended to this deque + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -35,6 +38,7 @@ declare class Deque { /** * Inserting an element at the end of a deque * @param element to be appended to this deque + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -43,6 +47,7 @@ declare class Deque { * Check if deque contains the specified element * @param element element to be contained * @return the boolean type,if deque contains the specified element,return true,else return false + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -50,6 +55,7 @@ declare class Deque { /** * Obtains the header element of a deque. * @return the T type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -57,7 +63,7 @@ declare class Deque { /** * Obtains the end element of a deque. * @return the T type - * @throws an exception if the queue is empty + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -65,7 +71,7 @@ declare class Deque { /** * Obtains the header element of a deque and delete the element. * @return the T type - * @throws an exception if the deque is empty + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -73,7 +79,7 @@ declare class Deque { /** * Obtains the end element of a deque and delete the element. * @return the T type - * @throws an exception if the deque is empty + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -86,6 +92,8 @@ declare class Deque { * @param deque (Optional) The deque object to which the current element belongs. * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value + * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -93,6 +101,7 @@ declare class Deque { thisArg?: Object): void; /** * returns an iterator.Each item of the iterator is a Javascript Object + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.HashMap.d.ts b/api/@ohos.util.HashMap.d.ts index db6a86247b..b2f1bb1807 100644 --- a/api/@ohos.util.HashMap.d.ts +++ b/api/@ohos.util.HashMap.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,9 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + declare class HashMap { /** * A constructor used to create a HashMap object. + * @throws {NewTargetIsNullError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -28,6 +30,7 @@ declare class HashMap { /** * Returns whether the Map object contains elements * @return the boolean type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -36,6 +39,7 @@ declare class HashMap { * Returns whether a key is contained in this map * @param key need to determine whether to include the key * @return the boolean type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -44,6 +48,7 @@ declare class HashMap { * Returns whether a value is contained in this map * @param value need to determine whether to include the value * @return the boolean type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -52,6 +57,7 @@ declare class HashMap { * Returns a specified element in a Map object, or null if there is no corresponding element * @param key the index in HashMap * @return value or null + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -59,6 +65,8 @@ declare class HashMap { /** * Adds all element groups in one map to another map * @param map the Map object to add members + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -68,6 +76,8 @@ declare class HashMap { * @param key Added or updated targets * @param value Added or updated value * @returns the map object after set + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -76,24 +86,28 @@ declare class HashMap { * Remove a specified element from a Map object * @param key Target to be deleted * @return Target mapped value + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ remove(key: K): V; /** * Clear all element groups in the map + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ clear(): void; /** * Returns a new Iterator object that contains the keys contained in this map + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ keys(): IterableIterator; /** * Returns a new Iterator object that contains the values contained in this map + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -103,6 +117,7 @@ declare class HashMap { * @param key Updated targets * @param newValue Updated the target mapped value * @returns the boolean type(Is there a target pointed to by the key) + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -110,6 +125,8 @@ declare class HashMap { /** * Executes the given callback function once for each real key in the map. * It does not perform functions on deleted keys + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -117,12 +134,14 @@ declare class HashMap { thisArg?: Object): void; /** * Returns a new Iterator object that contains the [key, value] pairs for each element in the Map object in insertion order + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ entries(): IterableIterator<[K, V]>; /** * returns an iterator.Each item of the iterator is a Javascript Object + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.HashSet.d.ts b/api/@ohos.util.HashSet.d.ts index 88c292927a..b368347aea 100644 --- a/api/@ohos.util.HashSet.d.ts +++ b/api/@ohos.util.HashSet.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,9 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + declare class HashSet { /** * A constructor used to create a HashSet object. + * @throws {NewTargetIsNullError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -28,6 +30,7 @@ declare class HashSet { /** * Returns whether the Set object contains elements * @return the boolean type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -36,6 +39,8 @@ declare class HashSet { * Returns whether the Set object contain s the elements * @param value need to determine whether to include the element * @return the boolean type + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -44,6 +49,8 @@ declare class HashSet { * If the set does not contain the element, the specified element is added * @param value Added element * @returns the boolean type(Is there contain this element) + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -52,18 +59,23 @@ declare class HashSet { * Remove a specified element from a Set object * @param value Target to be deleted * @return the boolean type(Is there contain this element) + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed * @since 8 * @syscap SystemCapability.Utils.Lang */ - remove(value: T): boolean; + remove(value: T): boolean; /** * Clears all element groups in a set + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ clear(): void; /** * Executes a provided function once for each value in the Set object. + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -71,18 +83,21 @@ declare class HashSet { thisArg?: Object): void; /** * Returns a new Iterator object that contains the values contained in this set + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ values(): IterableIterator; /** * Returns a new Iterator object that contains the [key, value] pairs for each element in the Set object in insertion order + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ entries(): IterableIterator<[T, T]>; /** * returns an iterator.Each item of the iterator is a Javascript Object + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.LightWeightMap.d.ts b/api/@ohos.util.LightWeightMap.d.ts index cc34b5dfbf..d10712ebd6 100644 --- a/api/@ohos.util.LightWeightMap.d.ts +++ b/api/@ohos.util.LightWeightMap.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,9 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + declare class LightWeightMap { /** * A constructor used to create a LightWeightMap object. + * @throws {NewTargetIsNullError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -29,6 +31,8 @@ declare class LightWeightMap { * Returns whether this map has all the object in a specified map * @param map the Map object to compare * @return the boolean type + * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -37,6 +41,7 @@ declare class LightWeightMap { * Returns whether a key is contained in this map * @param key need to determine whether to include the key * @return the boolean type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -45,6 +50,7 @@ declare class LightWeightMap { * Returns whether a value is contained in this map * @param value need to determine whether to include the value * @return the boolean type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -53,12 +59,15 @@ declare class LightWeightMap { * Ensures that the capacity of an LightWeightMap container is greater than or equal to a apecified value, * and that the container has all the original objects after capacity expansion * @param minimumCapacity Minimum capacity to be reserved + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ increaseCapacityTo(minimumCapacity: number): void; /** * Returns a new Iterator object that contains the [key, value] pairs for each element in the Map object in insertion order + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -67,6 +76,7 @@ declare class LightWeightMap { * Returns the value to which the specified key is mapped, or undefined if this map contains no mapping for the key * @param key the index in LightWeightMap * @return value or undefined + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -75,6 +85,7 @@ declare class LightWeightMap { * Obtains the index of the key equal to a specified key in an LightWeightMap container * @param key Looking for goals * @return Subscript corresponding to target + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -83,6 +94,7 @@ declare class LightWeightMap { * Obtains the index of the value equal to a specified value in an LightWeightMap container * @param value Looking for goals * @return Subscript corresponding to target + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -90,6 +102,7 @@ declare class LightWeightMap { /** * Returns whether the Map object contains elements * @return the boolean type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -98,12 +111,16 @@ declare class LightWeightMap { * Obtains the key at the loaction identified by index in an LightWeightMap container * @param index Target subscript for search * @return the key of key-value pairs + * @throws {ContainerBindError} Method not support bind. + * @throws {RangeError} Index out of range. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ getKeyAt(index: number): K; /** * Obtains a ES6 iterator that contains all the keys of an LightWeightMap container + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -111,6 +128,8 @@ declare class LightWeightMap { /** * Adds all element groups in one map to another map * @param map the Map object to add members + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -120,6 +139,7 @@ declare class LightWeightMap { * @param key Added or updated targets * @param value Added or updated value * @returns the map object after set + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -128,6 +148,7 @@ declare class LightWeightMap { * Remove the mapping for this key from this map if present * @param key Target to be deleted * @return Target mapped value + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -136,6 +157,8 @@ declare class LightWeightMap { * Deletes a key-value pair at the loaction identified by index from an LightWeightMap container * @param index Target subscript for search * @return the boolean type(Is there a delete value) + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -143,6 +166,7 @@ declare class LightWeightMap { /** * Removes all of the mapping from this map * The map will be empty after this call returns + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -152,6 +176,9 @@ declare class LightWeightMap { * @param index Target subscript for search * @param value Updated the target mapped value * @return the boolean type(Is there a value corresponding to the subscript) + * @throws {ContainerBindError} Method not support bind. + * @throws {RangeError} Index out of range. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -159,6 +186,8 @@ declare class LightWeightMap { /** * Executes the given callback function once for each real key in the map. * It does not perform functions on deleted keys + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -166,12 +195,14 @@ declare class LightWeightMap { thisArg?: Object): void; /** * returns an ES6 iterator.Each item of the iterator is a Javascript Object + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ [Symbol.iterator](): IterableIterator<[K, V]>; /** * Obtains a string that contains all the keys and values in an LightWeightMap container + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -180,12 +211,16 @@ declare class LightWeightMap { * Obtains the value identified by index in an LightWeightMap container * @param index Target subscript for search * @return the value of key-value pairs + * @throws {ContainerBindError} Method not support bind. + * @throws {RangeError} Index out of range. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ getValueAt(index: number): V; /** * Returns an iterator of the values contained in this map + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.LightWeightSet.d.ts b/api/@ohos.util.LightWeightSet.d.ts index e882104ee8..fe554a86fe 100644 --- a/api/@ohos.util.LightWeightSet.d.ts +++ b/api/@ohos.util.LightWeightSet.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,9 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + declare class LightWeightSet { /** * A constructor used to create a LightWeightSet object. + * @throws {NewTargetIsNullError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -29,6 +31,7 @@ declare class LightWeightSet { * If the set does not contain the element, the specified element is added * @param value Added element * @returns the boolean type(Is there contain this element) + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -37,6 +40,8 @@ declare class LightWeightSet { * Adds all the objects in a specified LightWeightSet container to the current LightWeightSet container * @param set the Set object to provide the added element * @returns the boolean type(Is there any new data added successfully) + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -45,6 +50,8 @@ declare class LightWeightSet { * Returns whether this set has all the object in a specified set * @param set the Set object to compare * @return the boolean type + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -53,6 +60,7 @@ declare class LightWeightSet { * Checks whether an LightWeightSet container has a specified key * @param key need to determine whether to include the key * @return the boolean type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -61,6 +69,7 @@ declare class LightWeightSet { * Checks whether an the objects of an LightWeighSet containeer are of the same type as a specified Object LightWeightSet * @param obj need to determine whether to include the obj * @return the boolean type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -69,6 +78,9 @@ declare class LightWeightSet { * Ensures that the capacity of an LightWeightSet container is greater than or equal to a apecified value, * and that the container has all the original objects after capacity expansion * @param minimumCapacity Minimum capacity to be reserved + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. + * @throws {RangeError} Index out of range. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -77,6 +89,7 @@ declare class LightWeightSet { * Obtains the index of s key of a specified Object type in an LightWeightSet container * @param key Looking for goals * @return Subscript corresponding to target + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -85,6 +98,7 @@ declare class LightWeightSet { * Deletes an object of a specified Object type from an LightWeightSet container * @param key Target to be deleted * @return Target element + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -93,6 +107,8 @@ declare class LightWeightSet { * Deletes an object at the loaction identified by index from an LightWeightSet container * @param index Target subscript for search * @return the boolean type(Is there a delete value) + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -100,6 +116,7 @@ declare class LightWeightSet { /** * Removes all of the mapping from this map * The map will be empty after this call returns + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -107,6 +124,8 @@ declare class LightWeightSet { /** * Executes the given callback function once for each real key in the map. * It does not perform functions on deleted keys + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -114,6 +133,7 @@ declare class LightWeightSet { thisArg?: Object): void; /** * returns an ES6 iterator.Each item of the iterator is a Javascript Object + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -126,6 +146,7 @@ declare class LightWeightSet { toString(): String; /** * Obtains an Array that contains all the objects of an LightWeightSet container. + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -134,24 +155,29 @@ declare class LightWeightSet { * Obtains the object at the location identified by index in an LightWeightSet container * @param index Target subscript for search * @return the value of key-value pairs + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ getValueAt(index: number): T; /** * Returns a ES6 iterator of the values contained in this Set + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ values(): IterableIterator; /** * Returns a Iterator object that contains the [key, value] pairs for each element in the Set object in insertion order + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ entries(): IterableIterator<[T, T]>; /** * Returns whether the set object contains elements + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.LinkedList.d.ts b/api/@ohos.util.LinkedList.d.ts index e81ef5c4d2..3a31b2ecfc 100644 --- a/api/@ohos.util.LinkedList.d.ts +++ b/api/@ohos.util.LinkedList.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,9 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + declare class LinkedList { /** * A constructor used to create a LinkedList object. + * @throws {NewTargetIsNullError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -29,6 +31,7 @@ declare class LinkedList { * Appends the specified element to the end of this linkedlist. * @param element to be appended to this linkedlist * @returns the boolean type, returns true if the addition is successful, and returns false if it fails. + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -37,7 +40,9 @@ declare class LinkedList { * Inserts the specified element at the specified position in this linkedlist. * @param index index at which the specified element is to be inserted * @param element element to be inserted - * @throws If index is greater than or equal to length, or less than 0, an exception is thrown and cannot be inserted + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. + * @throws {RangeError} Index out of range. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -47,6 +52,8 @@ declare class LinkedList { * or returns undefined if this linkedlist is empty * @param index specified position * @return the T type + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -54,6 +61,7 @@ declare class LinkedList { /** * Inserts the specified element at the beginning of this LinkedList. * @param element the element to add + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -61,7 +69,8 @@ declare class LinkedList { /** * Retrieves and removes the head (first element) of this linkedlist. * @return the head of this list - * @throws NoSuchElementException if this linkedlist is empty + * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerIsEmptyError} Container is Empty. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -69,16 +78,17 @@ declare class LinkedList { /** * Removes and returns the last element from this linkedlist. * @return the head of this list - * @throws NoSuchElementException if this linkedlist is empty + * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerIsEmptyError} Container is Empty. * @since 8 * @syscap SystemCapability.Utils.Lang - * */ removeLast(): T; /** * Check if linkedlist contains the specified element * @param element element to be contained * @return the boolean type,if linkedList contains the specified element,return true,else return false + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -88,6 +98,7 @@ declare class LinkedList { * in this linkedlist, or -1 if this linkedlist does not contain the element. * @param element element to be contained * @return the number type ,returns the lowest index such that or -1 if there is no such index. + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -97,6 +108,9 @@ declare class LinkedList { * @param index the index in the linkedlist * @return the T type ,returns undefined if linkedlist is empty,If the index is * out of bounds (greater than or equal to length or less than 0), throw an exception + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. + * @throws {RangeError} Index out of range. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -107,6 +121,7 @@ declare class LinkedList { * unchanged. More formally, removes the element with the lowest index * @param element element to remove * @return the boolean type ,If there is no such element, return false + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -117,6 +132,8 @@ declare class LinkedList { * unchanged. More formally, removes the element with the lowest index * @param element element to remove * @return the boolean type ,If there is no such element, return false + * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerIsEmptyError} Container is Empty. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -127,6 +144,8 @@ declare class LinkedList { * unchanged. More formally, removes the element with the lowest index * @param element element to remove * @return the boolean type ,If there is no such element, return false + * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerIsEmptyError} Container is Empty. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -136,6 +155,7 @@ declare class LinkedList { * or -1 if the linkedlist does not contain the element. * @param element element to find * @return the number type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -144,6 +164,7 @@ declare class LinkedList { * Returns the first element (the item at index 0) of this linkedlist. * or returns undefined if linkedlist is empty * @return the T type ,returns undefined if linkedList is empty + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -152,6 +173,7 @@ declare class LinkedList { * Returns the Last element (the item at index length-1) of this linkedlist. * or returns undefined if linkedlist is empty * @return the T type ,returns undefined if linkedList is empty + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -161,6 +183,9 @@ declare class LinkedList { * @param element replaced element * @param index index to find * @return the T type ,returns undefined if linkedList is empty + * @throws {ContainerBindError} Method not support bind. + * @throws {RangeError} Index out of range. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -174,6 +199,8 @@ declare class LinkedList { * @param LinkedList (Optional) The linkedlist object to which the current element belongs. * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -182,6 +209,7 @@ declare class LinkedList { /** * Removes all of the elements from this linkedlist.The linkedlist will * be empty after this call returns.length becomes 0 + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -189,6 +217,7 @@ declare class LinkedList { /** * Returns a shallow copy of this instance. (The elements themselves are not copied.) * @return this linkedlist instance + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -196,12 +225,14 @@ declare class LinkedList { /** * convert linkedlist to array * @return the Array type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ convertToArray(): Array; /** * returns an iterator.Each item of the iterator is a Javascript Object + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.List.d.ts b/api/@ohos.util.List.d.ts index fa79586eca..55a57208b3 100644 --- a/api/@ohos.util.List.d.ts +++ b/api/@ohos.util.List.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,9 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + declare class List { /** * A constructor used to create a List object. + * @throws {NewTargetIsNullError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -29,6 +31,7 @@ declare class List { * Appends the specified element to the end of this list. * @param element to be appended to this list * @returns the boolean type, returns true if the addition is successful, and returns false if it fails. + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -37,7 +40,9 @@ declare class List { * Inserts the specified element at the specified position in this list. * @param index index at which the specified element is to be inserted * @param element element to be inserted - * @throws If index is greater than or equal to length, or less than 0, an exception is thrown and cannot be inserted + * @throws {ContainerBindError} Method not support bind. + * @throws {RangeError} Index out of range. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -47,6 +52,8 @@ declare class List { * or returns undefined if this list is empty * @param index specified position * @return the T type + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -55,6 +62,7 @@ declare class List { * Check if list contains the specified element * @param element element to be contained * @return the boolean type,if list contains the specified element,return true,else return false + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -64,6 +72,7 @@ declare class List { * in this list, or -1 if this list does not contain the element. * @param element element to be contained * @return the number type ,returns the lowest index such that or -1 if there is no such index. + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -73,6 +82,9 @@ declare class List { * @param index the index in the list * @return the T type ,returns undefined if list is empty,If the index is * out of bounds (greater than or equal to length or less than 0), throw an exception + * @throws {ContainerBindError} Method not support bind. + * @throws {RangeError} Index out of range. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -83,6 +95,7 @@ declare class List { * unchanged. More formally, removes the element with the lowest index * @param element element to remove * @return the boolean type ,If there is no such element, return false + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -92,6 +105,7 @@ declare class List { * or -1 if the list does not contain the element. * @param element element to find * @return the number type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -100,6 +114,7 @@ declare class List { * Returns the first element (the item at index 0) of this list. * or returns undefined if list is empty * @return the T type ,returns undefined if list is empty + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -108,6 +123,7 @@ declare class List { * Returns the Last element (the item at index length-1) of this list. * or returns undefined if list is empty * @return the T type ,returns undefined if list is empty + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -117,6 +133,9 @@ declare class List { * @param element replaced element * @param index index to find * @return the T type + * @throws {ContainerBindError} Method not support bind. + * @throws {RangeError} Index out of range. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -126,6 +145,7 @@ declare class List { * return true, otherwise return false. * @param obj Compare objects * @return the boolean type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -139,6 +159,8 @@ declare class List { * @param List (Optional) The list object to which the current element belongs. * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -152,6 +174,8 @@ declare class List { * minus firstValue, it returns an list sorted in descending order; * @param firstValue (Optional) previous element * @param secondValue (Optional) next elements + * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -159,6 +183,7 @@ declare class List { /** * Removes all of the elements from this list.The list will * be empty after this call returns.length becomes 0 + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -167,8 +192,9 @@ declare class List { * Returns a view of the portion of this list between the specified fromIndex,inclusize,and toIndex,exclusive * @param fromIndex The starting position of the index, containing the value at that index position * @param toIndex the end of the index, excluding the value at that index - * @throws If the fromIndex or toIndex index is out of range (greater than or equal to length or less than 0), - * or if toIndex is less than fromIndex, an IndexOutOfBoundException is thrown + * @throws {ContainerBindError} Method not support bind. + * @throws {RangeError} Index out of range. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -182,14 +208,17 @@ declare class List { * @param list (Optional) The list object to which the current element belongs. * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ replaceAllElements(callbackfn: (value: T, index?: number, list?: List) => T, - thisArg?: Object): void; + thisArg?: Object): void; /** * convert list to array * @return the Array type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -197,12 +226,14 @@ declare class List { /** * Determine whether list is empty and whether there is an element * @return the boolean type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ isEmpty(): boolean; /** * returns an iterator.Each item of the iterator is a Javascript Object + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.PlainArray.d.ts b/api/@ohos.util.PlainArray.d.ts index 37012f6ad2..e4a356f24e 100644 --- a/api/@ohos.util.PlainArray.d.ts +++ b/api/@ohos.util.PlainArray.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,9 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + declare class PlainArray { /** * A constructor used to create a PlainArray object. + * @throws {NewTargetIsNullError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -29,19 +31,22 @@ declare class PlainArray { * Appends a key-value pair to PlainArray * @param key Added the key of key-value * @param value Added the value of key-value - * @throws Throws this exception if input is invaild + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ add(key: number, value: T): void; /** * Clears the current PlainArray object + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ clear(): void; /** * Obtains a clone of the current PlainArray object + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -50,6 +55,8 @@ declare class PlainArray { * Checks whether the current PlainArray object contains the specified key * @param key need to determine whether to include the key * @return the boolean type + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -58,6 +65,8 @@ declare class PlainArray { * Queries the value associated with the specified key * @param key Looking for goals * @return the value of key-value pairs + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -66,21 +75,25 @@ declare class PlainArray { * Queries the index for a specified key * @param key Looking for goals * @return Subscript corresponding to target + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ getIndexOfKey(key: number): number; /** - * Queries the index for a specified value - * @param value Looking for goals - * @return Subscript corresponding to target - * @since 8 - * @syscap SystemCapability.Utils.Lang - */ + * Queries the index for a specified value + * @param value Looking for goals + * @return Subscript corresponding to target + * @throws {ContainerBindError} Method not support bind. + * @since 8 + * @syscap SystemCapability.Utils.Lang + */ getIndexOfValue(value: T): number; /** * Checks whether the current PlainArray object is empty * @return the boolean type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -89,6 +102,8 @@ declare class PlainArray { * Queries the key at a specified index * @param index Target subscript for search * @return the key of key-value pairs + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -97,6 +112,8 @@ declare class PlainArray { * Remove the key-value pair based on a specified key if it exists and return the value * @param key Target to be deleted * @return Target mapped value + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -105,6 +122,8 @@ declare class PlainArray { * Remove the key-value pair at a specified index if it exists and return the value * @param index Target subscript for search * @return the T type + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -114,6 +133,9 @@ declare class PlainArray { * @param index remove start index * @param size Expected deletion quantity * @return Actual deleted quantity + * @throws {ContainerBindError} Method not support bind. + * @throws {RangeError} Index out of range. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -122,12 +144,16 @@ declare class PlainArray { * Update value on specified index * @param index Target subscript for search * @param value Updated the target mapped value + * @throws {ContainerBindError} Method not support bind. + * @throws {RangeError} Index out of range. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ setValueAt(index: number, value: T): void; /** * Obtains the string representation of the PlainArray object + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -136,12 +162,17 @@ declare class PlainArray { * Queries the value at a specified index * @param index Target subscript for search * @return the value of key-value pairs + * @throws {ContainerBindError} Method not support bind. + * @throws {RangeError} Index out of range. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ getValueAt(index: number): T; /** * Executes a provided function once for each value in the PlainArray object. + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -149,6 +180,7 @@ declare class PlainArray { thisArg?: Object): void; /** * returns an iterator.Each item of the iterator is a Javascript Object + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.Queue.d.ts b/api/@ohos.util.Queue.d.ts index 69c2762bd4..f7587f051e 100644 --- a/api/@ohos.util.Queue.d.ts +++ b/api/@ohos.util.Queue.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,9 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + declare class Queue { /** * A constructor used to create a Queue object. + * @throws {NewTargetIsNullError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -30,6 +32,7 @@ declare class Queue { * so immediately without violating capacity restrictions. * @param element to be appended to this queue * @return the boolean type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -37,7 +40,7 @@ declare class Queue { /** * Obtains the header element of a queue. * @return the T type - * @throws an exception if the queue is empty + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -45,7 +48,7 @@ declare class Queue { /** * Retrieves and removes the head of this queue * @return the T type - * @throws an exception if the queue is empty + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -59,6 +62,8 @@ declare class Queue { * @param Queue (Optional) The queue object to which the current element belongs. * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -66,6 +71,7 @@ declare class Queue { thisArg?: Object): void; /** * returns an iterator.Each item of the iterator is a Javascript Object + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.Stack.d.ts b/api/@ohos.util.Stack.d.ts index 59ef60e5d4..79a1413841 100644 --- a/api/@ohos.util.Stack.d.ts +++ b/api/@ohos.util.Stack.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,9 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + declare class Stack { /** * A constructor used to create a Stack object. + * @throws {NewTargetIsNullError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -28,6 +30,7 @@ declare class Stack { /** * Tests if this stack is empty * @return the boolean type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -36,6 +39,7 @@ declare class Stack { * Looks at the object at the top of this stack without removing it from the stack * Return undfined if this stack is empty * @return the top value or undefined + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -44,6 +48,7 @@ declare class Stack { * Removes the object at the top of this stack and returns that object as the value of this function * an exception if the stack is empty * @returns Stack top value or undefined + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -52,6 +57,7 @@ declare class Stack { * Pushes an item onto the top of this stack * @param item to be appended to this Stack * @returns the T type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -60,6 +66,7 @@ declare class Stack { * Returns the 1-based position where an object is on this stack * @param element Target to be deleted * @returns the T type,If there is no such element, return -1 + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -73,6 +80,8 @@ declare class Stack { * @param stack (Optional) The Stack object to which the current element belongs. * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -80,6 +89,7 @@ declare class Stack { thisArg?: Object): void; /** * returns an ES6 iterator.Each item of the iterator is a Javascript Object + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.TreeMap.d.ts b/api/@ohos.util.TreeMap.d.ts index 2b4647f18f..69ebaed707 100644 --- a/api/@ohos.util.TreeMap.d.ts +++ b/api/@ohos.util.TreeMap.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,12 +12,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + declare class TreeMap { + /** * A constructor used to create a TreeMap object. * @param comparator (Optional) User-defined comparison functions * @param firstValue (Optional) previous element * @param secondValue (Optional) next element + * @throws {NewTargetIsNullError} Parameter check failed. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -31,6 +35,7 @@ declare class TreeMap { /** * Returns whether the Map object contains elements * @return the boolean type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -39,6 +44,7 @@ declare class TreeMap { * Returns whether a key is contained in this map * @param key need to determine whether to include the key * @return the boolean type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -47,6 +53,7 @@ declare class TreeMap { * Returns whether a value is contained in this map * @param value need to determine whether to include the value * @return the boolean type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -55,6 +62,7 @@ declare class TreeMap { * Returns a specified element in a Map object, or null if there is no corresponding element * @param key the index in TreeMap * @return value or null + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -63,6 +71,7 @@ declare class TreeMap { * Obtains the first sorted key in the treemap. * Or returns undefined if tree map is empty * @return value or undefined + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -71,6 +80,7 @@ declare class TreeMap { * Obtains the last sorted key in the treemap. * Or returns undefined if tree map is empty * @return value or undefined + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -78,6 +88,8 @@ declare class TreeMap { /** * Adds all element groups in one map to another map * @param map the Map object to add members + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -87,6 +99,8 @@ declare class TreeMap { * @param key Added or updated targets * @param value Added or updated value * @returns the map object after set + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -94,6 +108,7 @@ declare class TreeMap { /** * Remove a specified element from a Map object * @param key Target to be deleted + * @throws {ContainerBindError} Method not support bind. * @return Target mapped value * @since 8 * @syscap SystemCapability.Utils.Lang @@ -101,6 +116,7 @@ declare class TreeMap { remove(key: K): V; /** * Clear all element groups in the map + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -109,6 +125,7 @@ declare class TreeMap { * Returns the greatest element smaller than or equal to the specified key * if the key does not exist, undefied is returned * @param key Objective of comparison + * @throws {ContainerBindError} Method not support bind. * @return key or undefined * @since 8 * @syscap SystemCapability.Utils.Lang @@ -119,18 +136,21 @@ declare class TreeMap { * if the key does not exist, undefied is returned * @param key Objective of comparison * @return key or undefined + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ getHigherKey(key: K): K; /** * Returns a new Iterator object that contains the keys contained in this map + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ keys(): IterableIterator; /** * Returns a new Iterator object that contains the values contained in this map + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -140,6 +160,7 @@ declare class TreeMap { * @param key Updated targets * @param value Updated the target mapped value * @returns the boolean type(Is there a target pointed to by the key) + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -147,6 +168,8 @@ declare class TreeMap { /** * Executes the given callback function once for each real key in the map. * It does not perform functions on deleted keys + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -154,12 +177,14 @@ declare class TreeMap { thisArg?: Object): void; /** * Returns a new Iterator object that contains the [key, value] pairs for each element in the Map object in insertion order + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ entries(): IterableIterator<[K, V]>; /** * returns an ES6 iterator.Each item of the iterator is a Javascript Object + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.TreeSet.d.ts b/api/@ohos.util.TreeSet.d.ts index a71ef36bf0..f83f36ae14 100644 --- a/api/@ohos.util.TreeSet.d.ts +++ b/api/@ohos.util.TreeSet.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,12 +12,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + declare class TreeSet { /** * A constructor used to create a TreeSet object. * @param comparator (Optional) User-defined comparison functions * @param firstValue (Optional) previous element * @param secondValue (Optional) next element + * @throws {NewTargetIsNullError} Parameter check failed. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -31,6 +34,7 @@ declare class TreeSet { /** * Returns whether the Set object contains elements * @return the boolean type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -39,6 +43,7 @@ declare class TreeSet { * Returns whether the Set object contain s the elements * @param value need to determine whether to include the element * @return the boolean type + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -47,6 +52,8 @@ declare class TreeSet { * If the set does not contain the element, the specified element is added * @param value Added element * @returns the boolean type(Is there contain this element) + * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -55,12 +62,14 @@ declare class TreeSet { * Remove a specified element from a Set object * @param value Target to be deleted * @return the boolean type(Is there contain this element) + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ remove(value: T): boolean; /** * Clears all element groups in a set + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -68,6 +77,7 @@ declare class TreeSet { /** * Gets the first elements in a set * @return value or undefined + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -75,6 +85,7 @@ declare class TreeSet { /** * Gets the last elements in a set * @return value or undefined + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -84,6 +95,8 @@ declare class TreeSet { * if the key does not exist, undefied is returned * @param key Objective of comparison * @return key or undefined + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -93,6 +106,8 @@ declare class TreeSet { * if the key does not exist, undefied is returned * @param key Objective of comparison * @return key or undefined + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -100,6 +115,7 @@ declare class TreeSet { /** * Return and delete the first element, returns undefined if tree set is empty * @return first value or undefined + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -107,12 +123,15 @@ declare class TreeSet { /** * Return and delete the last element, returns undefined if tree set is empty * @return last value or undefined + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ popLast(): T; /** * Executes a provided function once for each value in the Set object. + * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError} Parameter check failed. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -120,18 +139,21 @@ declare class TreeSet { thisArg?: Object): void; /** * Returns a new Iterator object that contains the values contained in this set + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ values(): IterableIterator; /** * Returns a new Iterator object that contains the [key, value] pairs for each element in the Set object in insertion order + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ entries(): IterableIterator<[T, T]>; /** * returns an ES6 iterator.Each item of the iterator is a Javascript Object + * @throws {ContainerBindError} Method not support bind. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.Vector.d.ts b/api/@ohos.util.Vector.d.ts index 67d310c7b5..b170704ac7 100644 --- a/api/@ohos.util.Vector.d.ts +++ b/api/@ohos.util.Vector.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// @deprecated since 9 declare class Vector { /** * A constructor used to create a Vector object. -- Gitee From 3612259b522e902ce227821c45a49cc3039c2eee Mon Sep 17 00:00:00 2001 From: lijuan124 Date: Thu, 22 Sep 2022 15:06:47 +0800 Subject: [PATCH 019/438] =?UTF-8?q?scroll=E6=96=87=E6=A1=A3=E6=95=B4?= =?UTF-8?q?=E6=94=B9,sdk=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lijuan124 --- api/@internal/component/ets/enums.d.ts | 3 +++ api/@internal/component/ets/scroll.d.ts | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/api/@internal/component/ets/enums.d.ts b/api/@internal/component/ets/enums.d.ts index b77938feff..c0b8d344bf 100644 --- a/api/@internal/component/ets/enums.d.ts +++ b/api/@internal/component/ets/enums.d.ts @@ -507,6 +507,7 @@ declare enum Edge { /** * Center horizontal and vertical. * @since 7 + * @deprecated since 9 */ Center, @@ -519,6 +520,7 @@ declare enum Edge { /** * Cross axis direction text baseline alignment. * @since 7 + * @deprecated since 9 */ Baseline, @@ -531,6 +533,7 @@ declare enum Edge { /** * Middle * @since 7 + * @deprecated since 9 */ Middle, diff --git a/api/@internal/component/ets/scroll.d.ts b/api/@internal/component/ets/scroll.d.ts index 47334f21c6..6795800e39 100644 --- a/api/@internal/component/ets/scroll.d.ts +++ b/api/@internal/component/ets/scroll.d.ts @@ -33,6 +33,7 @@ declare enum ScrollDirection { /** * Free scrolling is supported. * @since 7 + * @deprecated since 9 */ Free, @@ -72,9 +73,16 @@ declare class Scroller { /** * Called when page turning mode is set. * @since 7 + * @deprecated since 9 */ scrollPage(value: { next: boolean; direction?: Axis }); + /** + * Called when page turning mode is set. + * @since 9 + */ + scrollPage(value: { next: boolean }); + /** * Called when viewing the scroll offset. * @since 7 -- Gitee From 6037a9013d31260059c8ca3b0ff538872e1bac12 Mon Sep 17 00:00:00 2001 From: lengchangjing Date: Tue, 6 Sep 2022 19:01:49 +0800 Subject: [PATCH 020/438] add buffer exception description Signed-off-by: lengchangjing --- api/@ohos.buffer.d.ts | 231 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 225 insertions(+), 6 deletions(-) diff --git a/api/@ohos.buffer.d.ts b/api/@ohos.buffer.d.ts index 0b8907dcc1..d95dd3a029 100644 --- a/api/@ohos.buffer.d.ts +++ b/api/@ohos.buffer.d.ts @@ -32,6 +32,7 @@ declare namespace buffer { * @param [fill=0] A value to pre-fill the new Buffer with * @param [encoding='utf8'] If `fill` is a string, this is its encoding * @return Return a new allocated Buffer + * @throws TypeError: The "size" argument must be of type number and cannot be negative. Received [message] */ function alloc(size: number, fill?: string | Buffer | number, encoding?: BufferEncoding): Buffer; @@ -41,6 +42,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param size The desired length of the new Buffer * @return Return a new allocated Buffer + * @throws TypeError: The "size" argument must be of type number and cannot be negative. Received [message] */ function allocUninitializedFromPool(size: number): Buffer; @@ -50,6 +52,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param size The desired length of the new Buffer * @return Return a new allocated Buffer + * @throws TypeError: The "size" argument must be of type number and cannot be negative. Received [message] */ function allocUninitialized(size: number): Buffer; @@ -62,6 +65,7 @@ declare namespace buffer { * @param string A value to calculate the length of * @param [encoding='utf8'] If `string` is a string, this is its encoding * @return The number of bytes contained within `string` + * @throws TypeError: The "string" argument must be of type string or an instance of Buffer or ArrayBuffer. Received [message] */ function byteLength(string: string | Buffer | TypedArray | DataView | ArrayBuffer | SharedArrayBuffer, encoding?: BufferEncoding): number; @@ -72,6 +76,9 @@ declare namespace buffer { * @param list List of `Buffer` or Uint8Array instances to concatenate * @param totalLength Total length of the `Buffer` instances in `list` when concatenated * @return Return a new allocated Buffer + * @throws TypeError: The "list" argument must be an instance of Array. Received [message] + * @throws TypeError: The "list" argument must be an instance of Array. Received type number ([number]) + * @throws RangeError: The value of "length" is out of range. It must be >= 0 && <= max unsigned int. Received [number] */ function concat(list: Buffer[] | Uint8Array[], totalLength?: number): Buffer; @@ -81,6 +88,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param array an array of bytes in the range 0 – 255 * @return Return a new allocated Buffer + * @throws TypeError: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received [message] */ function from(array: number[]): Buffer; @@ -92,6 +100,9 @@ declare namespace buffer { * @param [byteOffset = 0] Index of first byte to expose * @param [length = arrayBuffer.byteLength - byteOffset] Number of bytes to expose * @return Return a view of the ArrayBuffer + * @throws TypeError: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received [message] + * @throws BufferRangeError: Start offset [number] is outside the bounds of the buffer + * @throws BufferRangeError: "length" is outside of buffer bounds */ function from(arrayBuffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): Buffer; @@ -101,6 +112,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param buffer An existing Buffer or Uint8Array from which to copy data * @return Return a new allocated Buffer + * @throws TypeError: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received [message] */ function from(buffer: Buffer | Uint8Array): Buffer; @@ -113,6 +125,7 @@ declare namespace buffer { * @param offsetOrEncoding A byte-offset or encoding * @param length A length * @return Return a new allocated Buffer + * @throws TypeError: Unknown encoding: [encoding] */ function from(object: Object, offsetOrEncoding: number | string, length: number): Buffer; @@ -124,6 +137,7 @@ declare namespace buffer { * @param string A string to encode * @param [encoding='utf8'] The encoding of string * @return Return a new Buffer containing string + * @throws TypeError: Unknown encoding: [encoding] */ function from(string: String, encoding?: BufferEncoding): Buffer; @@ -154,6 +168,8 @@ declare namespace buffer { * @return 0 is returned if target is the same as buf * 1 is returned if target should come before buf when sorted. * -1 is returned if target should come after buf when sorted. + * @throws TypeError: The "buf1" argument must be an instance of Buffer or Uint8Array. Received [message] + * @throws TypeError: The "buf2" argument must be an instance of Buffer or Uint8Array. Received [message] */ function compare(buf1: Buffer | Uint8Array, buf2: Buffer | Uint8Array): -1 | 0 | 1; @@ -165,6 +181,8 @@ declare namespace buffer { * @param fromEnc The current encoding * @param toEnc To target encoding * @return Returns a new Buffer instance + * @throws TypeError: The "source" argument must be an instance of Buffer or Uint8Array. Received [message] + * @throws Error: Unable to transcode Buffer [U_ILLEGAL_ARGUMENT_ERROR] */ function transcode(source: Buffer | Uint8Array, fromEnc: string, toEnc: string): Buffer; @@ -176,20 +194,23 @@ declare namespace buffer { * Returns the number of bytes in buf * @since 9 * @syscap SystemCapability.Utils.Lang + * @throws TypeError: Cannot set property length of [object Object] which has only a getter */ length: number; /** * The underlying ArrayBuffer object based on which this Buffer object is created. * @since 9 - * @syscap SystemCapability.Utils.Lang + * @syscap SystemCapability.Utils.Lang + * @throws TypeError: Cannot set property buffer of [object Object] which has only a getter */ buffer: ArrayBuffer; /** * The byteOffset of the Buffers underlying ArrayBuffer object * @since 9 - * @syscap SystemCapability.Utils.Lang + * @syscap SystemCapability.Utils.Lang + * @throws TypeError: Cannot set property byteOffset of [object Object] which has only a getter */ byteOffset: number; @@ -202,6 +223,9 @@ declare namespace buffer { * @param [end = buf.length] Where to stop filling buf (not inclusive) * @param [encoding='utf8'] The encoding for value if value is a string * @return A reference to buf + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 && <= max unsigned int. Received [number] + * @throws RangeError: The value of "end" is out of range. It must be >= 0 && <= [number]. Received [number] + * @throws TypeError: Unknown encoding: [encoding] */ fill(value: string | Buffer | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): Buffer; @@ -218,6 +242,12 @@ declare namespace buffer { * @return 0 is returned if target is the same as buf * 1 is returned if target should come before buf when sorted. * -1 is returned if target should come after buf when sorted. + * @throws TypeError: The "target" argument must be an instance of Buffer or Uint8Array. Received [message] + * @throws TypeError: The "[param]" argument must be of type number. Received [message] + * @throws RangeError: The value of "targetStart" is out of range. It must be >= 0 && <= max unsigned int. Received [number] + * @throws RangeError: The value of "targetEnd" is out of range. It must be >= 0 && <= [number]. Received [number] + * @throws RangeError: The value of "sourceStart" is out of range. It must be >= 0 && <= max unsigned int. Received [number] + * @throws RangeError: The value of "sourceEnd" is out of range. It must be >= 0 && <= [number]. Received [number] */ compare(target: Buffer | Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): -1 | 0 | 1; @@ -231,6 +261,10 @@ declare namespace buffer { * @param [sourceStart = 0] The offset within buf from which to begin copying * @param [sourceEnd = buf.length] The offset within buf at which to stop copying (not inclusive) * @return The number of bytes copied + * @throws TypeError: The "target" argument must be an instance of Buffer or Uint8Array. Received [message] + * @throws RangeError: The value of "targetStart" is out of range. It must be >= 0. Received [number] + * @throws RangeError: The value of "sourceStart" is out of range. It must be >= 0. Received [number] + * @throws RangeError: The value of "sourceEnd" is out of range. It must be >= 0. Received [number] */ copy(target: Buffer | Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; @@ -240,6 +274,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param otherBuffer A Buffer or Uint8Array with which to compare buf * @return true or false + * @throws TypeError: The "otherBuffer" argument must be an instance of Buffer or Uint8Array. Received [message] */ equals(otherBuffer: Uint8Array | Buffer): boolean; @@ -251,6 +286,8 @@ declare namespace buffer { * @param [byteOffset = 0] Where to begin searching in buf. If negative, then offset is calculated from the end of buf * @param [encoding='utf8'] If value is a string, this is its encoding * @return true or false + * @throws TypeError: The "value" argument must be one of type number or string or an instance of Buffer or Uint8Array. Received [message] + * @throws TypeError: Unknown encoding: [encoding] */ includes(value: string | number | Buffer | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): boolean; @@ -262,6 +299,8 @@ declare namespace buffer { * @param [byteOffset = 0] Where to begin searching in buf * @param [encoding='utf8'] If value is a string, this is the encoding used to determine the binary representation of the string that will be searched for in buf * @return The index of the first occurrence of value in buf, or -1 if buf does not contain value + * @throws TypeError: The "value" argument must be one of type number or string or an instance of Buffer or Uint8Array. Received [message] + * @throws TypeError: Unknown encoding: [encoding] */ indexOf(value: string | number | Buffer | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; @@ -294,6 +333,8 @@ declare namespace buffer { * @param [byteOffset = 0] Where to begin searching in buf * @param [encoding='utf8'] If value is a string, this is the encoding used to determine the binary representation of the string that will be searched for in buf * @return The index of the last occurrence of value in buf, or -1 if buf does not contain value + * @throws TypeError: The "value" argument must be one of type number or string or an instance of Buffer or Uint8Array. Received [message] + * @throws TypeError: Unknown encoding: [encoding] */ lastIndexOf(value: string | number | Buffer | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; @@ -303,6 +344,9 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 * @return Return a signed, big-endian 64-bit integer + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] + * @throws BufferBufferRangeError: Attempt to access memory outside buffer bounds */ readBigInt64BE(offset?: number): number; @@ -311,7 +355,10 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 - * @return Return a signed, little-endian 64-bit integer + * @return Return a signed, little-endian 64-bit integer + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] + * @throws BufferBufferRangeError: Attempt to access memory outside buffer bounds */ readBigInt64LE(offset?: number): number; @@ -321,6 +368,9 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 * @return Return a unsigned, big-endian 64-bit integer + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] + * @throws BufferBufferRangeError: Attempt to access memory outside buffer bounds */ readBigUInt64BE(offset?: number): number; @@ -330,6 +380,9 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 * @return Return a unsigned, little-endian 64-bit integer + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] + * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readBigUInt64LE(offset?: number): number; @@ -339,6 +392,9 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 * @return Return a 64-bit, big-endian double + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] + * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readDoubleBE(offset?: number): number; @@ -348,6 +404,9 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 * @return Return a 64-bit, little-endian double + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] + * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readDoubleLE(offset?: number): number; @@ -357,6 +416,9 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4 * @return Return a 32-bit, big-endian float + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] + * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readFloatBE(offset?: number): number; @@ -365,7 +427,10 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4 - * @return Return a 32-bit, little-endian float + * @return Return a 32-bit, little-endian float + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] + * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readFloatLE(offset?: number): number; @@ -375,6 +440,9 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 1 * @return Return a signed 8-bit integer + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 1. Received [offset] + * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readInt8(offset?: number): number; @@ -384,6 +452,9 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 2 * @return Return a signed, big-endian 16-bit integer + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received [offset] + * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readInt16BE(offset?: number): number; @@ -393,6 +464,9 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 2 * @return Return a signed, little-endian 16-bit integer + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received [offset] + * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readInt16LE(offset?: number): number; @@ -402,6 +476,9 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4 * @return Return a signed, big-endian 32-bit integer + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] + * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readInt32BE(offset?: number): number; @@ -411,6 +488,9 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4 * @return Return a signed, little-endian 32-bit integer + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] + * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readInt32LE(offset?: number): number; @@ -422,6 +502,11 @@ declare namespace buffer { * @param offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to read. Must satisfy 0 < byteLength <= 6 * @return + * @throws TypeError: The "byteLength" argument must be of type number. Received [message] + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received [offset] + * @throws RangeError: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received [byteLength] + * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readIntBE(offset: number, byteLength: number): number; @@ -433,6 +518,11 @@ declare namespace buffer { * @param offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to read. Must satisfy 0 < byteLength <= 6 * @return + * @throws TypeError: The "byteLength" argument must be of type number. Received [message] + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received [offset] + * @throws RangeError: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received [byteLength] + * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readIntLE(offset: number, byteLength: number): number; @@ -442,6 +532,9 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 1 * @return Reads an unsigned 8-bit integer + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 1. Received [offset] + * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readUInt8(offset?: number): number; @@ -451,6 +544,9 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 2 * @return Reads an unsigned, big-endian 16-bit integer + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received [offset] + * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readUInt16BE(offset?: number): number; @@ -460,6 +556,9 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 2 * @return Reads an unsigned, little-endian 16-bit integer + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received [offset] + * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readUInt16LE(offset?: number): number; @@ -469,6 +568,9 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 4 * @return Reads an unsigned, big-endian 32-bit integer + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] + * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readUInt32BE(offset?: number): number; @@ -478,6 +580,9 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 4 * @return Reads an unsigned, little-endian 32-bit integer + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] + * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readUInt32LE(offset?: number): number; @@ -489,6 +594,11 @@ declare namespace buffer { * @param offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to read. Must satisfy 0 < byteLength <= 6 * @return + * @throws TypeError: The "byteLength" argument must be of type number. Received [message] + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received [offset] + * @throws RangeError: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received [byteLength] + * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readUIntBE(offset: number, byteLength: number): number; @@ -500,6 +610,11 @@ declare namespace buffer { * @param offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to read. Must satisfy 0 < byteLength <= 6 * @return + * @throws TypeError: The "byteLength" argument must be of type number. Received [message] + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received [offset] + * @throws RangeError: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received [byteLength] + * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readUIntLE(offset: number, byteLength: number): number; @@ -518,6 +633,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @return A reference to buf + * @throws BufferSizeError: Buffer size must be a multiple of 16-bits */ swap16(): Buffer; @@ -526,6 +642,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @return A reference to buf + * @throws BufferSizeError: Buffer size must be a multiple of 32-bits */ swap32(): Buffer; @@ -534,6 +651,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @return A reference to buf + * @throws BufferSizeError: Buffer size must be a multiple of 64-bits */ swap64(): Buffer; @@ -552,6 +670,7 @@ declare namespace buffer { * @param [encoding='utf8'] The character encoding to use * @param [start = 0] The byte offset to start decoding at * @param [end = buf.length] The byte offset to stop decoding at (not inclusive) + * @throws TypeError: Unknown encoding: [encoding] */ toString(encoding?: string, start?: number, end?: number): string; @@ -564,6 +683,12 @@ declare namespace buffer { * @param [length = buf.length - offset] Maximum number of bytes to write (written bytes will not exceed buf.length - offset) * @param [encoding='utf8'] The character encoding of string. * @return Number of bytes written. + * @throws TypeError: The "str" argument must be of type string. Received [message] + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws TypeError: The "length" argument must be of type number. Received [message] + * @throws TypeError: Unknown encoding: [encoding] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 && <= buf.length. Received [offset] + * @throws RangeError: The value of "length" is out of range. It must be >= 0 && <= buf.length. Received [offset] */ write(str: string, offset?: number, length?: number, encoding?: string): number; @@ -574,6 +699,10 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 * @return offset plus the number of bytes written + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws TypeError: The "value" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] + * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2n ** 64n. Received [value] */ writeBigInt64BE(value: number, offset?: number): number; @@ -584,6 +713,10 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 * @return offset plus the number of bytes written + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws TypeError: The "value" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] + * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2n ** 64n. Received [value] */ writeBigInt64LE(value: number, offset?: number): number; @@ -594,6 +727,10 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 * @return offset plus the number of bytes written + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws TypeError: The "value" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] + * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2n ** 64n. Received [value] */ writeBigUInt64BE(value: number, offset?: number): number; @@ -603,7 +740,11 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 - * @return offset plus the number of bytes written + * @return offset plus the number of bytes written + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws TypeError: The "value" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] + * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2n ** 64n. Received [value] */ writeBigUInt64LE(value: number, offset?: number): number; @@ -614,6 +755,9 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 * @return offset plus the number of bytes written + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws TypeError: The "value" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] */ writeDoubleBE(value: number, offset?: number): number; @@ -624,6 +768,9 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 * @return offset plus the number of bytes written + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws TypeError: The "value" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] */ writeDoubleLE(value: number, offset?: number): number; @@ -634,6 +781,9 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 4 * @return offset plus the number of bytes written + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws TypeError: The "value" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] */ writeFloatBE(value: number, offset?: number): number; @@ -644,6 +794,9 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 4 * @return offset plus the number of bytes written + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws TypeError: The "value" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] */ writeFloatLE(value: number, offset?: number): number; @@ -652,8 +805,12 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf - * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 + * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 1 * @return offset plus the number of bytes written + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws TypeError: The "value" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 1. Received [offset] + * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**8 - 1. Received [value] */ writeInt8(value: number, offset?: number): number; @@ -664,6 +821,10 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 2 * @return offset plus the number of bytes written + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws TypeError: The "value" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received [offset] + * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**16 - 1. Received [value] */ writeInt16BE(value: number, offset?: number): number; @@ -674,6 +835,10 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 2 * @return offset plus the number of bytes written + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws TypeError: The "value" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received [offset] + * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**16 - 1. Received [value] */ writeInt16LE(value: number, offset?: number): number; @@ -684,6 +849,10 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 4 * @return offset plus the number of bytes written + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws TypeError: The "value" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] + * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**32 - 1. Received [value] */ writeInt32BE(value: number, offset?: number): number; @@ -694,6 +863,10 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 4 * @return offset plus the number of bytes written + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws TypeError: The "value" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] + * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**32 - 1. Received [value] */ writeInt32LE(value: number, offset?: number): number; @@ -705,6 +878,12 @@ declare namespace buffer { * @param offset Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to write. Must satisfy 0 < byteLength <= 6 * @return offset plus the number of bytes written + * @throws TypeError: The "byteLength" argument must be of type number. Received [message] + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws TypeError: The "value" argument must be of type number. Received [message] + * @throws RangeError: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received [byteLength] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received [offset] + * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**48 - 1. Received [value] */ writeIntBE(value: number, offset: number, byteLength: number): number; @@ -716,6 +895,12 @@ declare namespace buffer { * @param offset Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to write. Must satisfy 0 < byteLength <= 6 * @return offset plus the number of bytes written + * @throws TypeError: The "byteLength" argument must be of type number. Received [message] + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws TypeError: The "value" argument must be of type number. Received [message] + * @throws RangeError: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received [byteLength] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received [offset] + * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**48 - 1. Received [value] */ writeIntLE(value : number, offset: number, byteLength: number): number; @@ -726,6 +911,10 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 1 * @return offset plus the number of bytes written + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws TypeError: The "value" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 1. Received [offset] + * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**8 - 1. Received [value] */ writeUInt8(value: number, offset?: number): number; @@ -736,6 +925,10 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 2 * @return offset plus the number of bytes written + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws TypeError: The "value" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received [offset] + * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**16 - 1. Received [value] */ writeUInt16BE(value: number, offset?: number): number; @@ -746,6 +939,10 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 2 * @return offset plus the number of bytes written + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws TypeError: The "value" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received [offset] + * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**16 - 1. Received [value] */ writeUInt16LE(value: number, offset?: number): number; @@ -756,6 +953,10 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 4 * @return offset plus the number of bytes written + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws TypeError: The "value" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] + * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**32 - 1. Received [value] */ writeUInt32BE(value: number, offset?: number): number; @@ -766,6 +967,10 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 4 * @return offset plus the number of bytes written + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws TypeError: The "value" argument must be of type number. Received [message] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] + * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**32 - 1. Received [value] */ writeUInt32LE(value: number, offset?: number): number; @@ -777,6 +982,12 @@ declare namespace buffer { * @param offset Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to write. Must satisfy 0 < byteLength <= 6 * @return offset plus the number of bytes written + * @throws TypeError: The "byteLength" argument must be of type number. Received [message] + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws TypeError: The "value" argument must be of type number. Received [message] + * @throws RangeError: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received [byteLength] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received [offset] + * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**48 - 1. Received [value] */ writeUIntBE(value: number, offset: number, byteLength: number): number; @@ -788,6 +999,12 @@ declare namespace buffer { * @param offset Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to write. Must satisfy 0 < byteLength <= 6 * @return offset plus the number of bytes written + * @throws TypeError: The "byteLength" argument must be of type number. Received [message] + * @throws TypeError: The "offset" argument must be of type number. Received [message] + * @throws TypeError: The "value" argument must be of type number. Received [message] + * @throws RangeError: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received [byteLength] + * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received [offset] + * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**48 - 1. Received [value] */ writeUIntLE(value: number, offset: number, byteLength: number): number; @@ -803,6 +1020,8 @@ declare namespace buffer { * @param options {endings: string, type: string} * endings: One of either 'transparent' or 'native'. * type: The Blob content-type + * @throws TypeError: The "sources" argument must be an instance of Iterable. Received [message] + * @throws TypeError: The "options" argument must be of type object. Received [message] */ constructor(sources: string[] | ArrayBuffer[] | TypedArray[] | DataView[] | Blob[] , options: Object); -- Gitee From 9de7fb7ff890645ccf9a2f87fdb87cb8abb0803b Mon Sep 17 00:00:00 2001 From: lengchangjing Date: Mon, 26 Sep 2022 15:53:13 +0800 Subject: [PATCH 021/438] del BufferRangedError Signed-off-by: lengchangjing --- api/@ohos.buffer.d.ts | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/api/@ohos.buffer.d.ts b/api/@ohos.buffer.d.ts index d95dd3a029..680fb3f376 100644 --- a/api/@ohos.buffer.d.ts +++ b/api/@ohos.buffer.d.ts @@ -101,8 +101,6 @@ declare namespace buffer { * @param [length = arrayBuffer.byteLength - byteOffset] Number of bytes to expose * @return Return a view of the ArrayBuffer * @throws TypeError: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received [message] - * @throws BufferRangeError: Start offset [number] is outside the bounds of the buffer - * @throws BufferRangeError: "length" is outside of buffer bounds */ function from(arrayBuffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): Buffer; @@ -346,7 +344,6 @@ declare namespace buffer { * @return Return a signed, big-endian 64-bit integer * @throws TypeError: The "offset" argument must be of type number. Received [message] * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] - * @throws BufferBufferRangeError: Attempt to access memory outside buffer bounds */ readBigInt64BE(offset?: number): number; @@ -358,7 +355,6 @@ declare namespace buffer { * @return Return a signed, little-endian 64-bit integer * @throws TypeError: The "offset" argument must be of type number. Received [message] * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] - * @throws BufferBufferRangeError: Attempt to access memory outside buffer bounds */ readBigInt64LE(offset?: number): number; @@ -370,7 +366,6 @@ declare namespace buffer { * @return Return a unsigned, big-endian 64-bit integer * @throws TypeError: The "offset" argument must be of type number. Received [message] * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] - * @throws BufferBufferRangeError: Attempt to access memory outside buffer bounds */ readBigUInt64BE(offset?: number): number; @@ -382,7 +377,6 @@ declare namespace buffer { * @return Return a unsigned, little-endian 64-bit integer * @throws TypeError: The "offset" argument must be of type number. Received [message] * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] - * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readBigUInt64LE(offset?: number): number; @@ -394,7 +388,6 @@ declare namespace buffer { * @return Return a 64-bit, big-endian double * @throws TypeError: The "offset" argument must be of type number. Received [message] * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] - * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readDoubleBE(offset?: number): number; @@ -406,7 +399,6 @@ declare namespace buffer { * @return Return a 64-bit, little-endian double * @throws TypeError: The "offset" argument must be of type number. Received [message] * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] - * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readDoubleLE(offset?: number): number; @@ -418,7 +410,6 @@ declare namespace buffer { * @return Return a 32-bit, big-endian float * @throws TypeError: The "offset" argument must be of type number. Received [message] * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] - * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readFloatBE(offset?: number): number; @@ -430,7 +421,6 @@ declare namespace buffer { * @return Return a 32-bit, little-endian float * @throws TypeError: The "offset" argument must be of type number. Received [message] * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] - * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readFloatLE(offset?: number): number; @@ -442,7 +432,6 @@ declare namespace buffer { * @return Return a signed 8-bit integer * @throws TypeError: The "offset" argument must be of type number. Received [message] * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 1. Received [offset] - * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readInt8(offset?: number): number; @@ -454,7 +443,6 @@ declare namespace buffer { * @return Return a signed, big-endian 16-bit integer * @throws TypeError: The "offset" argument must be of type number. Received [message] * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received [offset] - * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readInt16BE(offset?: number): number; @@ -466,7 +454,6 @@ declare namespace buffer { * @return Return a signed, little-endian 16-bit integer * @throws TypeError: The "offset" argument must be of type number. Received [message] * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received [offset] - * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readInt16LE(offset?: number): number; @@ -478,7 +465,6 @@ declare namespace buffer { * @return Return a signed, big-endian 32-bit integer * @throws TypeError: The "offset" argument must be of type number. Received [message] * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] - * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readInt32BE(offset?: number): number; @@ -490,7 +476,6 @@ declare namespace buffer { * @return Return a signed, little-endian 32-bit integer * @throws TypeError: The "offset" argument must be of type number. Received [message] * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] - * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readInt32LE(offset?: number): number; @@ -506,7 +491,6 @@ declare namespace buffer { * @throws TypeError: The "offset" argument must be of type number. Received [message] * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received [offset] * @throws RangeError: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received [byteLength] - * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readIntBE(offset: number, byteLength: number): number; @@ -522,7 +506,6 @@ declare namespace buffer { * @throws TypeError: The "offset" argument must be of type number. Received [message] * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received [offset] * @throws RangeError: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received [byteLength] - * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readIntLE(offset: number, byteLength: number): number; @@ -534,7 +517,6 @@ declare namespace buffer { * @return Reads an unsigned 8-bit integer * @throws TypeError: The "offset" argument must be of type number. Received [message] * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 1. Received [offset] - * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readUInt8(offset?: number): number; @@ -546,7 +528,6 @@ declare namespace buffer { * @return Reads an unsigned, big-endian 16-bit integer * @throws TypeError: The "offset" argument must be of type number. Received [message] * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received [offset] - * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readUInt16BE(offset?: number): number; @@ -558,7 +539,6 @@ declare namespace buffer { * @return Reads an unsigned, little-endian 16-bit integer * @throws TypeError: The "offset" argument must be of type number. Received [message] * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received [offset] - * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readUInt16LE(offset?: number): number; @@ -570,7 +550,6 @@ declare namespace buffer { * @return Reads an unsigned, big-endian 32-bit integer * @throws TypeError: The "offset" argument must be of type number. Received [message] * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] - * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readUInt32BE(offset?: number): number; @@ -582,7 +561,6 @@ declare namespace buffer { * @return Reads an unsigned, little-endian 32-bit integer * @throws TypeError: The "offset" argument must be of type number. Received [message] * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] - * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readUInt32LE(offset?: number): number; @@ -598,7 +576,6 @@ declare namespace buffer { * @throws TypeError: The "offset" argument must be of type number. Received [message] * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received [offset] * @throws RangeError: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received [byteLength] - * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readUIntBE(offset: number, byteLength: number): number; @@ -614,7 +591,6 @@ declare namespace buffer { * @throws TypeError: The "offset" argument must be of type number. Received [message] * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received [offset] * @throws RangeError: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received [byteLength] - * @throws BufferRangeError: Attempt to access memory outside buffer bounds */ readUIntLE(offset: number, byteLength: number): number; -- Gitee From 48e67bd8e8884b4f8bca7cd5dbbfeddce0d527ae Mon Sep 17 00:00:00 2001 From: lengchangjing Date: Mon, 26 Sep 2022 21:45:59 +0800 Subject: [PATCH 022/438] modify interface exception information Signed-off-by: lengchangjing --- api/@ohos.util.ArrayList.d.ts | 70 ++++++++++++++++-------------- api/@ohos.util.Deque.d.ts | 22 +++++----- api/@ohos.util.HashMap.d.ts | 36 +++++++-------- api/@ohos.util.HashSet.d.ts | 28 ++++++------ api/@ohos.util.LightWeightMap.d.ts | 68 ++++++++++++++--------------- api/@ohos.util.LightWeightSet.d.ts | 50 ++++++++++----------- api/@ohos.util.LinkedList.d.ts | 60 ++++++++++++------------- api/@ohos.util.List.d.ts | 68 +++++++++++++++-------------- api/@ohos.util.PlainArray.d.ts | 64 +++++++++++++-------------- api/@ohos.util.Queue.d.ts | 14 +++--- api/@ohos.util.Stack.d.ts | 18 ++++---- api/@ohos.util.TreeMap.d.ts | 46 ++++++++++---------- api/@ohos.util.TreeSet.d.ts | 42 +++++++++--------- 13 files changed, 296 insertions(+), 290 deletions(-) diff --git a/api/@ohos.util.ArrayList.d.ts b/api/@ohos.util.ArrayList.d.ts index c97b879b7f..3aca051352 100644 --- a/api/@ohos.util.ArrayList.d.ts +++ b/api/@ohos.util.ArrayList.d.ts @@ -16,7 +16,7 @@ declare class ArrayList { /** * A constructor used to create a ArrayList object. - * @throws {NewTargetIsNullError} Parameter check failed. + * @throws {NewTargetIsNullError}: The ArrayList's constructor cannot be directly invoked. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -31,7 +31,7 @@ declare class ArrayList { * Appends the specified element to the end of this arraylist. * @param element to be appended to this arraylist * @returns the boolean type, returns true if the addition is successful, and returns false if it fails. - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The add method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -42,9 +42,9 @@ declare class ArrayList { * any subsequent elements to the right (adds one to their index). * @param index index at which the specified element is to be inserted * @param element element to be inserted - * @throws {ContainerBindError} Method not support bind. - * @throws {RangeError} Index out of range. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The insert method cannot be bound. + * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length]. Received value is: [index] + * @throws {TypeError}: The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -53,7 +53,7 @@ declare class ArrayList { * Check if arraylist contains the specified element * @param element element to be contained * @return the boolean type,if arraylist contains the specified element,return true,else return false - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The has method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -63,7 +63,7 @@ declare class ArrayList { * in this arraylist, or -1 if this arraylist does not contain the element. * @param element element to be contained * @return the number type ,returns the lowest index such that or -1 if there is no such index. - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The getIndexOf method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -73,9 +73,9 @@ declare class ArrayList { * delete the element, and move the index of all elements to the right of the element forward by one. * @param index the index in the arraylist * @return the T type ,returns undefined if arraylist is empty,If the index is - * @throws {ContainerBindError} Method not support bind. - * @throws {RangeError} Index out of range. - * @throws {TypeError} Parameter check failed. * + * @throws {ContainerBindError}: The removeByIndex method cannot be bound. + * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] + * @throws {TypeError}: The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -86,7 +86,7 @@ declare class ArrayList { * unchanged. More formally, removes the element with the lowest index * @param element element to remove * @return the boolean type ,If there is no such element, return false - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The remove method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -96,7 +96,7 @@ declare class ArrayList { * or -1 if the arraylist does not contain the element. * @param element element to find * @return the number type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The getLastIndexOf method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -105,9 +105,11 @@ declare class ArrayList { * Removes from this arraylist all of the elements whose index is between fromIndex,inclusive,and toIndex ,exclusive. * @param fromIndex The starting position of the index, containing the value at that index position * @param toIndex the end of the index, excluding the value at that index - * @throws {ContainerBindError} Method not support bind. - * @throws {RangeError} Index out of range. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The removeByRange method cannot be bound. + * @throws {RangeError}: The value of "fromIndex" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [fromIndex] + * @throws {RangeError}: The value of "toIndex" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [toIndex] + * @throws {TypeError}: The type of "fromIndex" must be number. Received value is: [fromIndex] + * @throws {TypeError}: The type of "toIndex" must be number. Received value is: [toIndex] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -121,8 +123,8 @@ declare class ArrayList { * @param arrlist (Optional) The arraylist object to which the current element belongs. * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The replaceAllElements method cannot be bound. + * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -137,8 +139,8 @@ declare class ArrayList { * @param arrlist (Optional) The arraylist object to which the current element belongs. * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The forEach method cannot be bound. + * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -153,8 +155,8 @@ declare class ArrayList { * @param firstValue (Optional) previous element * @param secondValue (Optional) next elements * If this parameter is empty, it will default to ASCII sorting - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The sort method cannot be bound. + * @throws {TypeError}: The type of "comparator" must be callable. Received value is: [comparator] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -163,9 +165,11 @@ declare class ArrayList { * Returns a view of the portion of this arraylist between the specified fromIndex,inclusize,and toIndex,exclusive * @param fromIndex The starting position of the index, containing the value at that index position * @param toIndex the end of the index, excluding the value at that index - * @throws {ContainerBindError} Method not support bind. - * @throws {RangeError} Index out of range. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The subArrayList method cannot be bound. + * @throws {RangeError}: The value of "fromIndex" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [fromIndex] + * @throws {RangeError}: The value of "toIndex" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [toIndex] + * @throws {TypeError}: The type of "fromIndex" must be number. Received value is: [fromIndex] + * @throws {TypeError}: The type of "toIndex" must be number. Received value is: [toIndex] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -173,7 +177,7 @@ declare class ArrayList { /** * Removes all of the elements from this arraylist.The arraylist will * be empty after this call returns.length becomes 0 - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The clear method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -181,7 +185,7 @@ declare class ArrayList { /** * Returns a shallow copy of this instance. (The elements themselves are not copied.) * @return this arraylist instance - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The clone method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -189,7 +193,7 @@ declare class ArrayList { /** * returns the capacity of this arraylist * @return the number type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The getCapacity method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -197,7 +201,7 @@ declare class ArrayList { /** * convert arraylist to array * @return the Array type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The convertToArray method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -205,7 +209,7 @@ declare class ArrayList { /** * Determine whether arraylist is empty and whether there is an element * @return the boolean type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -213,22 +217,22 @@ declare class ArrayList { /** * If the newCapacity provided by the user is greater than or equal to length, * change the capacity of the arraylist to newCapacity, otherwise the capacity will not be changed - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The increaseCapacityTo method cannot be bound. + * @throws {TypeError}: The type of "newCapacity" must be number. Received value is: [newCapacity] * @since 8 * @syscap SystemCapability.Utils.Lang */ increaseCapacityTo(newCapacity: number): void; /** * Limit the capacity to the current length - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The trimToCurrentLength method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ trimToCurrentLength(): void; /** * returns an iterator.Each item of the iterator is a Javascript Object - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The Symbol.iterator method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.Deque.d.ts b/api/@ohos.util.Deque.d.ts index 04d1212372..11a71336ac 100644 --- a/api/@ohos.util.Deque.d.ts +++ b/api/@ohos.util.Deque.d.ts @@ -16,7 +16,7 @@ declare class Deque { /** * A constructor used to create a Deque object. - * @throws {NewTargetIsNullError} Parameter check failed. + * @throws {NewTargetIsNullError}: The Deque's constructor cannot be directly invoked. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -30,7 +30,7 @@ declare class Deque { /** * Inserts an element into the deque header. * @param element to be appended to this deque - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The insertFront method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -38,7 +38,7 @@ declare class Deque { /** * Inserting an element at the end of a deque * @param element to be appended to this deque - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The insertEnd method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -47,7 +47,7 @@ declare class Deque { * Check if deque contains the specified element * @param element element to be contained * @return the boolean type,if deque contains the specified element,return true,else return false - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The has method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -55,7 +55,7 @@ declare class Deque { /** * Obtains the header element of a deque. * @return the T type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The getFirst method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -63,7 +63,7 @@ declare class Deque { /** * Obtains the end element of a deque. * @return the T type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The getLast method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -71,7 +71,7 @@ declare class Deque { /** * Obtains the header element of a deque and delete the element. * @return the T type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The popFirst method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -79,7 +79,7 @@ declare class Deque { /** * Obtains the end element of a deque and delete the element. * @return the T type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The popLast method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -92,8 +92,8 @@ declare class Deque { * @param deque (Optional) The deque object to which the current element belongs. * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value - * @throws {TypeError} Parameter check failed. - * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws {ContainerBindError}: The forEach method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -101,7 +101,7 @@ declare class Deque { thisArg?: Object): void; /** * returns an iterator.Each item of the iterator is a Javascript Object - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The Symbol.iterator method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.HashMap.d.ts b/api/@ohos.util.HashMap.d.ts index b2f1bb1807..e90c74aba7 100644 --- a/api/@ohos.util.HashMap.d.ts +++ b/api/@ohos.util.HashMap.d.ts @@ -16,7 +16,7 @@ declare class HashMap { /** * A constructor used to create a HashMap object. - * @throws {NewTargetIsNullError} Parameter check failed. + * @throws {NewTargetIsNullError}: The HashMap's constructor cannot be directly invoked. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -30,7 +30,7 @@ declare class HashMap { /** * Returns whether the Map object contains elements * @return the boolean type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -39,7 +39,7 @@ declare class HashMap { * Returns whether a key is contained in this map * @param key need to determine whether to include the key * @return the boolean type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The hasKey method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -48,7 +48,7 @@ declare class HashMap { * Returns whether a value is contained in this map * @param value need to determine whether to include the value * @return the boolean type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The hasValue method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -57,7 +57,7 @@ declare class HashMap { * Returns a specified element in a Map object, or null if there is no corresponding element * @param key the index in HashMap * @return value or null - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The get method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -65,8 +65,8 @@ declare class HashMap { /** * Adds all element groups in one map to another map * @param map the Map object to add members - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The setAll method cannot be bound. + * @throws {TypeError}: The type of "map" must be HashMap. Received value is: [map] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -76,8 +76,8 @@ declare class HashMap { * @param key Added or updated targets * @param value Added or updated value * @returns the map object after set - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The set method cannot be bound. + * @throws {TypeError}: The type of "key" must be not null. Received value is: [key] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -86,28 +86,28 @@ declare class HashMap { * Remove a specified element from a Map object * @param key Target to be deleted * @return Target mapped value - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The remove method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ remove(key: K): V; /** * Clear all element groups in the map - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The clear method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ clear(): void; /** * Returns a new Iterator object that contains the keys contained in this map - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The keys method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ keys(): IterableIterator; /** * Returns a new Iterator object that contains the values contained in this map - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The values method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -117,7 +117,7 @@ declare class HashMap { * @param key Updated targets * @param newValue Updated the target mapped value * @returns the boolean type(Is there a target pointed to by the key) - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The replace method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -125,8 +125,8 @@ declare class HashMap { /** * Executes the given callback function once for each real key in the map. * It does not perform functions on deleted keys - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The forEach method cannot be bound. + * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -134,14 +134,14 @@ declare class HashMap { thisArg?: Object): void; /** * Returns a new Iterator object that contains the [key, value] pairs for each element in the Map object in insertion order - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The entries method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ entries(): IterableIterator<[K, V]>; /** * returns an iterator.Each item of the iterator is a Javascript Object - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The Symbol.iterator method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.HashSet.d.ts b/api/@ohos.util.HashSet.d.ts index b368347aea..478bb206b5 100644 --- a/api/@ohos.util.HashSet.d.ts +++ b/api/@ohos.util.HashSet.d.ts @@ -16,7 +16,7 @@ declare class HashSet { /** * A constructor used to create a HashSet object. - * @throws {NewTargetIsNullError} Parameter check failed. + * @throws {NewTargetIsNullError}: The HashSet's constructor cannot be directly invoked. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -30,7 +30,7 @@ declare class HashSet { /** * Returns whether the Set object contains elements * @return the boolean type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -39,8 +39,8 @@ declare class HashSet { * Returns whether the Set object contain s the elements * @param value need to determine whether to include the element * @return the boolean type - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed + * @throws {ContainerBindError}: The has method cannot be bound. + * @throws {TypeError}: The type of "value" must be not null. Received value is: [value] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -49,8 +49,8 @@ declare class HashSet { * If the set does not contain the element, the specified element is added * @param value Added element * @returns the boolean type(Is there contain this element) - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed + * @throws {ContainerBindError}: The add method cannot be bound. + * @throws {TypeError}: The type of "value" must be not null. Received value is: [value] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -59,23 +59,23 @@ declare class HashSet { * Remove a specified element from a Set object * @param value Target to be deleted * @return the boolean type(Is there contain this element) - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed + * @throws {ContainerBindError}: The remove method cannot be bound. + * @throws {TypeError}: The type of "value" must be not null. Received value is: [value] * @since 8 * @syscap SystemCapability.Utils.Lang */ remove(value: T): boolean; /** * Clears all element groups in a set - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The clear method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ clear(): void; /** * Executes a provided function once for each value in the Set object. - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The forEach method cannot be bound. + * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -83,21 +83,21 @@ declare class HashSet { thisArg?: Object): void; /** * Returns a new Iterator object that contains the values contained in this set - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The values method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ values(): IterableIterator; /** * Returns a new Iterator object that contains the [key, value] pairs for each element in the Set object in insertion order - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The entries method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ entries(): IterableIterator<[T, T]>; /** * returns an iterator.Each item of the iterator is a Javascript Object - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The Symbol.iterator method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.LightWeightMap.d.ts b/api/@ohos.util.LightWeightMap.d.ts index d10712ebd6..b542d80b50 100644 --- a/api/@ohos.util.LightWeightMap.d.ts +++ b/api/@ohos.util.LightWeightMap.d.ts @@ -16,7 +16,7 @@ declare class LightWeightMap { /** * A constructor used to create a LightWeightMap object. - * @throws {NewTargetIsNullError} Parameter check failed. + * @throws {NewTargetIsNullError}: The LightWeightMap's constructor cannot be directly invoked. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -31,8 +31,8 @@ declare class LightWeightMap { * Returns whether this map has all the object in a specified map * @param map the Map object to compare * @return the boolean type - * @throws {TypeError} Parameter check failed. - * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError}: The type of "map" must be LightWeightMap. Received value is: [map] + * @throws {ContainerBindError}: The hasAll method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -41,7 +41,7 @@ declare class LightWeightMap { * Returns whether a key is contained in this map * @param key need to determine whether to include the key * @return the boolean type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The hasKey method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -50,7 +50,7 @@ declare class LightWeightMap { * Returns whether a value is contained in this map * @param value need to determine whether to include the value * @return the boolean type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The hasValue method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -59,15 +59,15 @@ declare class LightWeightMap { * Ensures that the capacity of an LightWeightMap container is greater than or equal to a apecified value, * and that the container has all the original objects after capacity expansion * @param minimumCapacity Minimum capacity to be reserved - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The increaseCapacityTo method cannot be bound. + * @throws {TypeError}: The type of "minimumCapacity" must be number. Received value is: [minimumCapacity] * @since 8 * @syscap SystemCapability.Utils.Lang */ increaseCapacityTo(minimumCapacity: number): void; /** * Returns a new Iterator object that contains the [key, value] pairs for each element in the Map object in insertion order - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The entries method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -76,7 +76,7 @@ declare class LightWeightMap { * Returns the value to which the specified key is mapped, or undefined if this map contains no mapping for the key * @param key the index in LightWeightMap * @return value or undefined - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The get method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -85,7 +85,7 @@ declare class LightWeightMap { * Obtains the index of the key equal to a specified key in an LightWeightMap container * @param key Looking for goals * @return Subscript corresponding to target - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The getIndexOfKey method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -94,7 +94,7 @@ declare class LightWeightMap { * Obtains the index of the value equal to a specified value in an LightWeightMap container * @param value Looking for goals * @return Subscript corresponding to target - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The getIndexOfValue method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -102,7 +102,7 @@ declare class LightWeightMap { /** * Returns whether the Map object contains elements * @return the boolean type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -111,16 +111,16 @@ declare class LightWeightMap { * Obtains the key at the loaction identified by index in an LightWeightMap container * @param index Target subscript for search * @return the key of key-value pairs - * @throws {ContainerBindError} Method not support bind. - * @throws {RangeError} Index out of range. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The getKeyAt method cannot be bound. + * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] + * @throws {TypeError}: The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ getKeyAt(index: number): K; /** * Obtains a ES6 iterator that contains all the keys of an LightWeightMap container - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The keys method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -128,8 +128,8 @@ declare class LightWeightMap { /** * Adds all element groups in one map to another map * @param map the Map object to add members - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The setAll method cannot be bound. + * @throws {TypeError}: The type of "map" must be LightWeightMap. Received value is: [map] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -139,7 +139,7 @@ declare class LightWeightMap { * @param key Added or updated targets * @param value Added or updated value * @returns the map object after set - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The set method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -148,7 +148,7 @@ declare class LightWeightMap { * Remove the mapping for this key from this map if present * @param key Target to be deleted * @return Target mapped value - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The remove method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -157,8 +157,8 @@ declare class LightWeightMap { * Deletes a key-value pair at the loaction identified by index from an LightWeightMap container * @param index Target subscript for search * @return the boolean type(Is there a delete value) - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The removeAt method cannot be bound. + * @throws {TypeError}: The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -166,7 +166,7 @@ declare class LightWeightMap { /** * Removes all of the mapping from this map * The map will be empty after this call returns - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The clear method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -176,9 +176,9 @@ declare class LightWeightMap { * @param index Target subscript for search * @param value Updated the target mapped value * @return the boolean type(Is there a value corresponding to the subscript) - * @throws {ContainerBindError} Method not support bind. - * @throws {RangeError} Index out of range. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The setValueAt method cannot be bound. + * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] + * @throws {TypeError}: The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -186,8 +186,8 @@ declare class LightWeightMap { /** * Executes the given callback function once for each real key in the map. * It does not perform functions on deleted keys - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The forEach method cannot be bound. + * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -195,14 +195,14 @@ declare class LightWeightMap { thisArg?: Object): void; /** * returns an ES6 iterator.Each item of the iterator is a Javascript Object - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The Symbol.iterator method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ [Symbol.iterator](): IterableIterator<[K, V]>; /** * Obtains a string that contains all the keys and values in an LightWeightMap container - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The toString method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -211,16 +211,16 @@ declare class LightWeightMap { * Obtains the value identified by index in an LightWeightMap container * @param index Target subscript for search * @return the value of key-value pairs - * @throws {ContainerBindError} Method not support bind. - * @throws {RangeError} Index out of range. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The getValueAt method cannot be bound. + * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] + * @throws {TypeError}: The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ getValueAt(index: number): V; /** * Returns an iterator of the values contained in this map - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The values method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.LightWeightSet.d.ts b/api/@ohos.util.LightWeightSet.d.ts index fe554a86fe..7c8dc838b0 100644 --- a/api/@ohos.util.LightWeightSet.d.ts +++ b/api/@ohos.util.LightWeightSet.d.ts @@ -16,7 +16,7 @@ declare class LightWeightSet { /** * A constructor used to create a LightWeightSet object. - * @throws {NewTargetIsNullError} Parameter check failed. + * @throws {NewTargetIsNullError}: The LightWeightSet's constructor cannot be directly invoked. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -31,7 +31,7 @@ declare class LightWeightSet { * If the set does not contain the element, the specified element is added * @param value Added element * @returns the boolean type(Is there contain this element) - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The add method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -40,8 +40,8 @@ declare class LightWeightSet { * Adds all the objects in a specified LightWeightSet container to the current LightWeightSet container * @param set the Set object to provide the added element * @returns the boolean type(Is there any new data added successfully) - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The addAll method cannot be bound. + * @throws {TypeError}: The type of "set" must be LightWeightSet. Received value is: [set] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -50,8 +50,8 @@ declare class LightWeightSet { * Returns whether this set has all the object in a specified set * @param set the Set object to compare * @return the boolean type - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The hasAll method cannot be bound. + * @throws {TypeError}: The type of "set" must be LightWeightSet. Received value is: [set] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -60,7 +60,7 @@ declare class LightWeightSet { * Checks whether an LightWeightSet container has a specified key * @param key need to determine whether to include the key * @return the boolean type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The has method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -69,7 +69,7 @@ declare class LightWeightSet { * Checks whether an the objects of an LightWeighSet containeer are of the same type as a specified Object LightWeightSet * @param obj need to determine whether to include the obj * @return the boolean type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The equal method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -78,9 +78,9 @@ declare class LightWeightSet { * Ensures that the capacity of an LightWeightSet container is greater than or equal to a apecified value, * and that the container has all the original objects after capacity expansion * @param minimumCapacity Minimum capacity to be reserved - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. - * @throws {RangeError} Index out of range. + * @throws {ContainerBindError}: The increaseCapacityTo method cannot be bound. + * @throws {TypeError}: The type of "minimumCapacity" must be number. Received value is: [minimumCapacity] + * @throws {RangeError}: The value of "minimumCapacity" is out of range. It must be > [currentCapacity]. Received value is: [minimumCapacity] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -89,7 +89,7 @@ declare class LightWeightSet { * Obtains the index of s key of a specified Object type in an LightWeightSet container * @param key Looking for goals * @return Subscript corresponding to target - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The getIndexOf method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -98,7 +98,7 @@ declare class LightWeightSet { * Deletes an object of a specified Object type from an LightWeightSet container * @param key Target to be deleted * @return Target element - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The remove method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -107,8 +107,8 @@ declare class LightWeightSet { * Deletes an object at the loaction identified by index from an LightWeightSet container * @param index Target subscript for search * @return the boolean type(Is there a delete value) - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The removeAt method cannot be bound. + * @throws {TypeError}: The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -116,7 +116,7 @@ declare class LightWeightSet { /** * Removes all of the mapping from this map * The map will be empty after this call returns - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The clear method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -124,8 +124,8 @@ declare class LightWeightSet { /** * Executes the given callback function once for each real key in the map. * It does not perform functions on deleted keys - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The forEach method cannot be bound. + * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -133,7 +133,7 @@ declare class LightWeightSet { thisArg?: Object): void; /** * returns an ES6 iterator.Each item of the iterator is a Javascript Object - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The Symbol.iterator method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -146,7 +146,7 @@ declare class LightWeightSet { toString(): String; /** * Obtains an Array that contains all the objects of an LightWeightSet container. - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The toArray method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -155,29 +155,29 @@ declare class LightWeightSet { * Obtains the object at the location identified by index in an LightWeightSet container * @param index Target subscript for search * @return the value of key-value pairs - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The getValueAt method cannot be bound. + * @throws {TypeError}: The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ getValueAt(index: number): T; /** * Returns a ES6 iterator of the values contained in this Set - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The values method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ values(): IterableIterator; /** * Returns a Iterator object that contains the [key, value] pairs for each element in the Set object in insertion order - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The entries method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ entries(): IterableIterator<[T, T]>; /** * Returns whether the set object contains elements - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.LinkedList.d.ts b/api/@ohos.util.LinkedList.d.ts index 3a31b2ecfc..e6166e5a26 100644 --- a/api/@ohos.util.LinkedList.d.ts +++ b/api/@ohos.util.LinkedList.d.ts @@ -16,7 +16,7 @@ declare class LinkedList { /** * A constructor used to create a LinkedList object. - * @throws {NewTargetIsNullError} Parameter check failed. + * @throws {NewTargetIsNullError}: The LinkedList's constructor cannot be directly invoked. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -31,7 +31,7 @@ declare class LinkedList { * Appends the specified element to the end of this linkedlist. * @param element to be appended to this linkedlist * @returns the boolean type, returns true if the addition is successful, and returns false if it fails. - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The add method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -40,9 +40,9 @@ declare class LinkedList { * Inserts the specified element at the specified position in this linkedlist. * @param index index at which the specified element is to be inserted * @param element element to be inserted - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. - * @throws {RangeError} Index out of range. + * @throws {ContainerBindError}: The insert method cannot be bound. + * @throws {TypeError}: The type of "index" must be number. Received value is: [index] + * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length]. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -52,8 +52,8 @@ declare class LinkedList { * or returns undefined if this linkedlist is empty * @param index specified position * @return the T type - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The get method cannot be bound. + * @throws {TypeError}: The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -61,7 +61,7 @@ declare class LinkedList { /** * Inserts the specified element at the beginning of this LinkedList. * @param element the element to add - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The addFirst method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -69,7 +69,7 @@ declare class LinkedList { /** * Retrieves and removes the head (first element) of this linkedlist. * @return the head of this list - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The removeFirst method cannot be bound. * @throws {ContainerIsEmptyError} Container is Empty. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -78,7 +78,7 @@ declare class LinkedList { /** * Removes and returns the last element from this linkedlist. * @return the head of this list - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The removeLast method cannot be bound. * @throws {ContainerIsEmptyError} Container is Empty. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -88,7 +88,7 @@ declare class LinkedList { * Check if linkedlist contains the specified element * @param element element to be contained * @return the boolean type,if linkedList contains the specified element,return true,else return false - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The has method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -98,7 +98,7 @@ declare class LinkedList { * in this linkedlist, or -1 if this linkedlist does not contain the element. * @param element element to be contained * @return the number type ,returns the lowest index such that or -1 if there is no such index. - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The getIndexOf method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -108,9 +108,9 @@ declare class LinkedList { * @param index the index in the linkedlist * @return the T type ,returns undefined if linkedlist is empty,If the index is * out of bounds (greater than or equal to length or less than 0), throw an exception - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. - * @throws {RangeError} Index out of range. + * @throws {ContainerBindError}: The removeByIndex method cannot be bound. + * @throws {TypeError}: The type of "index" must be number. Received value is: [index] + * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -121,7 +121,7 @@ declare class LinkedList { * unchanged. More formally, removes the element with the lowest index * @param element element to remove * @return the boolean type ,If there is no such element, return false - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The remove method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -132,7 +132,7 @@ declare class LinkedList { * unchanged. More formally, removes the element with the lowest index * @param element element to remove * @return the boolean type ,If there is no such element, return false - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The removeFirstFound method cannot be bound. * @throws {ContainerIsEmptyError} Container is Empty. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -144,7 +144,7 @@ declare class LinkedList { * unchanged. More formally, removes the element with the lowest index * @param element element to remove * @return the boolean type ,If there is no such element, return false - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The removeLastFound method cannot be bound. * @throws {ContainerIsEmptyError} Container is Empty. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -155,7 +155,7 @@ declare class LinkedList { * or -1 if the linkedlist does not contain the element. * @param element element to find * @return the number type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The getLastIndexOf method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -164,7 +164,7 @@ declare class LinkedList { * Returns the first element (the item at index 0) of this linkedlist. * or returns undefined if linkedlist is empty * @return the T type ,returns undefined if linkedList is empty - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The getFirst method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -173,7 +173,7 @@ declare class LinkedList { * Returns the Last element (the item at index length-1) of this linkedlist. * or returns undefined if linkedlist is empty * @return the T type ,returns undefined if linkedList is empty - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The getLast method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -183,9 +183,9 @@ declare class LinkedList { * @param element replaced element * @param index index to find * @return the T type ,returns undefined if linkedList is empty - * @throws {ContainerBindError} Method not support bind. - * @throws {RangeError} Index out of range. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The set method cannot be bound. + * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] + * @throws {TypeError}: The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -199,8 +199,8 @@ declare class LinkedList { * @param LinkedList (Optional) The linkedlist object to which the current element belongs. * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The forEach method cannot be bound. + * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -209,7 +209,7 @@ declare class LinkedList { /** * Removes all of the elements from this linkedlist.The linkedlist will * be empty after this call returns.length becomes 0 - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The clear method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -217,7 +217,7 @@ declare class LinkedList { /** * Returns a shallow copy of this instance. (The elements themselves are not copied.) * @return this linkedlist instance - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The clone method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -225,14 +225,14 @@ declare class LinkedList { /** * convert linkedlist to array * @return the Array type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The convertToArray method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ convertToArray(): Array; /** * returns an iterator.Each item of the iterator is a Javascript Object - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The Symbol.iterator method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.List.d.ts b/api/@ohos.util.List.d.ts index 55a57208b3..24822675c3 100644 --- a/api/@ohos.util.List.d.ts +++ b/api/@ohos.util.List.d.ts @@ -16,7 +16,7 @@ declare class List { /** * A constructor used to create a List object. - * @throws {NewTargetIsNullError} Parameter check failed. + * @throws {NewTargetIsNullError}: The List's constructor cannot be directly invoked. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -31,7 +31,7 @@ declare class List { * Appends the specified element to the end of this list. * @param element to be appended to this list * @returns the boolean type, returns true if the addition is successful, and returns false if it fails. - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The add method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -40,9 +40,9 @@ declare class List { * Inserts the specified element at the specified position in this list. * @param index index at which the specified element is to be inserted * @param element element to be inserted - * @throws {ContainerBindError} Method not support bind. - * @throws {RangeError} Index out of range. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The insert method cannot be bound. + * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length]. Received value is: [index] + * @throws {TypeError}: The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -52,8 +52,8 @@ declare class List { * or returns undefined if this list is empty * @param index specified position * @return the T type - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed + * @throws {ContainerBindError}: The get method cannot be bound. + * @throws {TypeError}: The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -62,7 +62,7 @@ declare class List { * Check if list contains the specified element * @param element element to be contained * @return the boolean type,if list contains the specified element,return true,else return false - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The has method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -72,7 +72,7 @@ declare class List { * in this list, or -1 if this list does not contain the element. * @param element element to be contained * @return the number type ,returns the lowest index such that or -1 if there is no such index. - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The getIndexOf method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -82,9 +82,9 @@ declare class List { * @param index the index in the list * @return the T type ,returns undefined if list is empty,If the index is * out of bounds (greater than or equal to length or less than 0), throw an exception - * @throws {ContainerBindError} Method not support bind. - * @throws {RangeError} Index out of range. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The removeByIndex method cannot be bound. + * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] + * @throws {TypeError}: The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -95,7 +95,7 @@ declare class List { * unchanged. More formally, removes the element with the lowest index * @param element element to remove * @return the boolean type ,If there is no such element, return false - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The remove method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -105,7 +105,7 @@ declare class List { * or -1 if the list does not contain the element. * @param element element to find * @return the number type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The getLastIndexOf method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -114,7 +114,7 @@ declare class List { * Returns the first element (the item at index 0) of this list. * or returns undefined if list is empty * @return the T type ,returns undefined if list is empty - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The getFirst method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -123,7 +123,7 @@ declare class List { * Returns the Last element (the item at index length-1) of this list. * or returns undefined if list is empty * @return the T type ,returns undefined if list is empty - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The getLast method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -133,9 +133,9 @@ declare class List { * @param element replaced element * @param index index to find * @return the T type - * @throws {ContainerBindError} Method not support bind. - * @throws {RangeError} Index out of range. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The set method cannot be bound. + * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] + * @throws {TypeError}: The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -145,7 +145,7 @@ declare class List { * return true, otherwise return false. * @param obj Compare objects * @return the boolean type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The equal method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -159,8 +159,8 @@ declare class List { * @param List (Optional) The list object to which the current element belongs. * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The forEach method cannot be bound. + * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -174,8 +174,8 @@ declare class List { * minus firstValue, it returns an list sorted in descending order; * @param firstValue (Optional) previous element * @param secondValue (Optional) next elements - * @throws {TypeError} Parameter check failed. - * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError}: The type of "comparator" must be callable. Received value is: [comparator] + * @throws {ContainerBindError}: The sort method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -183,7 +183,7 @@ declare class List { /** * Removes all of the elements from this list.The list will * be empty after this call returns.length becomes 0 - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The clear method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -192,9 +192,11 @@ declare class List { * Returns a view of the portion of this list between the specified fromIndex,inclusize,and toIndex,exclusive * @param fromIndex The starting position of the index, containing the value at that index position * @param toIndex the end of the index, excluding the value at that index - * @throws {ContainerBindError} Method not support bind. - * @throws {RangeError} Index out of range. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The getSubList method cannot be bound. + * @throws {RangeError}: The value of "fromIndex" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [fromIndex] + * @throws {RangeError}: The value of "toIndex" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [toIndex] + * @throws {TypeError}: The type of "fromIndex" must be number. Received value is: [fromIndex] + * @throws {TypeError}: The type of "toIndex" must be number. Received value is: [toIndex] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -208,8 +210,8 @@ declare class List { * @param list (Optional) The list object to which the current element belongs. * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The replaceAllElements method cannot be bound. + * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -218,7 +220,7 @@ declare class List { /** * convert list to array * @return the Array type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The convertToArray method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -226,14 +228,14 @@ declare class List { /** * Determine whether list is empty and whether there is an element * @return the boolean type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ isEmpty(): boolean; /** * returns an iterator.Each item of the iterator is a Javascript Object - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The Symbol.iterator method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.PlainArray.d.ts b/api/@ohos.util.PlainArray.d.ts index e4a356f24e..cc9e9622a4 100644 --- a/api/@ohos.util.PlainArray.d.ts +++ b/api/@ohos.util.PlainArray.d.ts @@ -16,7 +16,7 @@ declare class PlainArray { /** * A constructor used to create a PlainArray object. - * @throws {NewTargetIsNullError} Parameter check failed. + * @throws {NewTargetIsNullError}: The PlainArray's constructor cannot be directly invoked. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -31,22 +31,22 @@ declare class PlainArray { * Appends a key-value pair to PlainArray * @param key Added the key of key-value * @param value Added the value of key-value - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The add method cannot be bound. + * @throws {TypeError}: The type of "key" must be number. Received value is: [key] * @since 8 * @syscap SystemCapability.Utils.Lang */ add(key: number, value: T): void; /** * Clears the current PlainArray object - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The clear method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ clear(): void; /** * Obtains a clone of the current PlainArray object - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The clone method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -55,8 +55,8 @@ declare class PlainArray { * Checks whether the current PlainArray object contains the specified key * @param key need to determine whether to include the key * @return the boolean type - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The has method cannot be bound. + * @throws {TypeError}: The type of "key" must be number. Received value is: [key] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -65,8 +65,8 @@ declare class PlainArray { * Queries the value associated with the specified key * @param key Looking for goals * @return the value of key-value pairs - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The get method cannot be bound. + * @throws {TypeError}: The type of "key" must be number. Received value is: [key] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -75,8 +75,8 @@ declare class PlainArray { * Queries the index for a specified key * @param key Looking for goals * @return Subscript corresponding to target - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The getIndexOfKey method cannot be bound. + * @throws {TypeError}: The type of "key" must be number. Received value is: [key] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -85,7 +85,7 @@ declare class PlainArray { * Queries the index for a specified value * @param value Looking for goals * @return Subscript corresponding to target - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The getIndexOfValue method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -93,7 +93,7 @@ declare class PlainArray { /** * Checks whether the current PlainArray object is empty * @return the boolean type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -102,8 +102,8 @@ declare class PlainArray { * Queries the key at a specified index * @param index Target subscript for search * @return the key of key-value pairs - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The getKeyAt method cannot be bound. + * @throws {TypeError}: The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -112,8 +112,8 @@ declare class PlainArray { * Remove the key-value pair based on a specified key if it exists and return the value * @param key Target to be deleted * @return Target mapped value - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed + * @throws {ContainerBindError}: The remove method cannot be bound. + * @throws {TypeError}: The type of "key" must be number. Received value is: [key] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -122,8 +122,8 @@ declare class PlainArray { * Remove the key-value pair at a specified index if it exists and return the value * @param index Target subscript for search * @return the T type - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed + * @throws {ContainerBindError}: The removeAt method cannot be bound. + * @throws {TypeError}: The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -133,9 +133,9 @@ declare class PlainArray { * @param index remove start index * @param size Expected deletion quantity * @return Actual deleted quantity - * @throws {ContainerBindError} Method not support bind. - * @throws {RangeError} Index out of range. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The removeRangeFrom method cannot be bound. + * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] + * @throws {TypeError}: The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -144,16 +144,16 @@ declare class PlainArray { * Update value on specified index * @param index Target subscript for search * @param value Updated the target mapped value - * @throws {ContainerBindError} Method not support bind. - * @throws {RangeError} Index out of range. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The setValueAt method cannot be bound. + * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] + * @throws {TypeError}: The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ setValueAt(index: number, value: T): void; /** * Obtains the string representation of the PlainArray object - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The toString method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -162,17 +162,17 @@ declare class PlainArray { * Queries the value at a specified index * @param index Target subscript for search * @return the value of key-value pairs - * @throws {ContainerBindError} Method not support bind. - * @throws {RangeError} Index out of range. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The getValueAt method cannot be bound. + * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] + * @throws {TypeError}: The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ getValueAt(index: number): T; /** * Executes a provided function once for each value in the PlainArray object. - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The forEach method cannot be bound. + * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -180,7 +180,7 @@ declare class PlainArray { thisArg?: Object): void; /** * returns an iterator.Each item of the iterator is a Javascript Object - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The Symbol.iterator method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.Queue.d.ts b/api/@ohos.util.Queue.d.ts index f7587f051e..4711a01724 100644 --- a/api/@ohos.util.Queue.d.ts +++ b/api/@ohos.util.Queue.d.ts @@ -16,7 +16,7 @@ declare class Queue { /** * A constructor used to create a Queue object. - * @throws {NewTargetIsNullError} Parameter check failed. + * @throws {NewTargetIsNullError}: The Queue's constructor cannot be directly invoked. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -32,7 +32,7 @@ declare class Queue { * so immediately without violating capacity restrictions. * @param element to be appended to this queue * @return the boolean type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The add method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -40,7 +40,7 @@ declare class Queue { /** * Obtains the header element of a queue. * @return the T type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The getFirst method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -48,7 +48,7 @@ declare class Queue { /** * Retrieves and removes the head of this queue * @return the T type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The pop method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -62,8 +62,8 @@ declare class Queue { * @param Queue (Optional) The queue object to which the current element belongs. * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The forEach method cannot be bound. + * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -71,7 +71,7 @@ declare class Queue { thisArg?: Object): void; /** * returns an iterator.Each item of the iterator is a Javascript Object - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The Symbol.iterator method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.Stack.d.ts b/api/@ohos.util.Stack.d.ts index 79a1413841..3539b676be 100644 --- a/api/@ohos.util.Stack.d.ts +++ b/api/@ohos.util.Stack.d.ts @@ -16,7 +16,7 @@ declare class Stack { /** * A constructor used to create a Stack object. - * @throws {NewTargetIsNullError} Parameter check failed. + * @throws {NewTargetIsNullError}: The Stack's constructor cannot be directly invoked. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -30,7 +30,7 @@ declare class Stack { /** * Tests if this stack is empty * @return the boolean type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -39,7 +39,7 @@ declare class Stack { * Looks at the object at the top of this stack without removing it from the stack * Return undfined if this stack is empty * @return the top value or undefined - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The peek method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -48,7 +48,7 @@ declare class Stack { * Removes the object at the top of this stack and returns that object as the value of this function * an exception if the stack is empty * @returns Stack top value or undefined - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The pop method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -57,7 +57,7 @@ declare class Stack { * Pushes an item onto the top of this stack * @param item to be appended to this Stack * @returns the T type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The push method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -66,7 +66,7 @@ declare class Stack { * Returns the 1-based position where an object is on this stack * @param element Target to be deleted * @returns the T type,If there is no such element, return -1 - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The locate method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -80,8 +80,8 @@ declare class Stack { * @param stack (Optional) The Stack object to which the current element belongs. * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The forEach method cannot be bound. + * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -89,7 +89,7 @@ declare class Stack { thisArg?: Object): void; /** * returns an ES6 iterator.Each item of the iterator is a Javascript Object - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The Symbol.iterator method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.TreeMap.d.ts b/api/@ohos.util.TreeMap.d.ts index 69ebaed707..9bbc58ca6f 100644 --- a/api/@ohos.util.TreeMap.d.ts +++ b/api/@ohos.util.TreeMap.d.ts @@ -20,8 +20,8 @@ declare class TreeMap { * @param comparator (Optional) User-defined comparison functions * @param firstValue (Optional) previous element * @param secondValue (Optional) next element - * @throws {NewTargetIsNullError} Parameter check failed. - * @throws {TypeError} Parameter check failed. + * @throws {NewTargetIsNullError}: The TreeMap's constructor cannot be directly invoked. + * @throws {TypeError}: The type of "comparator" must be callable. Received value is: [comparator] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -35,7 +35,7 @@ declare class TreeMap { /** * Returns whether the Map object contains elements * @return the boolean type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -44,7 +44,7 @@ declare class TreeMap { * Returns whether a key is contained in this map * @param key need to determine whether to include the key * @return the boolean type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The hasKey method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -53,7 +53,7 @@ declare class TreeMap { * Returns whether a value is contained in this map * @param value need to determine whether to include the value * @return the boolean type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The hasValue method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -62,7 +62,7 @@ declare class TreeMap { * Returns a specified element in a Map object, or null if there is no corresponding element * @param key the index in TreeMap * @return value or null - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The get method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -71,7 +71,7 @@ declare class TreeMap { * Obtains the first sorted key in the treemap. * Or returns undefined if tree map is empty * @return value or undefined - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The getFirstKey method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -80,7 +80,7 @@ declare class TreeMap { * Obtains the last sorted key in the treemap. * Or returns undefined if tree map is empty * @return value or undefined - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The getLastKey method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -88,8 +88,8 @@ declare class TreeMap { /** * Adds all element groups in one map to another map * @param map the Map object to add members - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The setAll method cannot be bound. + * @throws {TypeError}: The type of "map" must be TreeMap. Received value is: [map] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -99,8 +99,8 @@ declare class TreeMap { * @param key Added or updated targets * @param value Added or updated value * @returns the map object after set - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The set method cannot be bound. + * @throws {TypeError}: The type of "key" must be not null. Received value is: [key] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -108,7 +108,7 @@ declare class TreeMap { /** * Remove a specified element from a Map object * @param key Target to be deleted - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The remove method cannot be bound. * @return Target mapped value * @since 8 * @syscap SystemCapability.Utils.Lang @@ -116,7 +116,7 @@ declare class TreeMap { remove(key: K): V; /** * Clear all element groups in the map - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The clear method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -125,7 +125,7 @@ declare class TreeMap { * Returns the greatest element smaller than or equal to the specified key * if the key does not exist, undefied is returned * @param key Objective of comparison - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The getLowerKey method cannot be bound. * @return key or undefined * @since 8 * @syscap SystemCapability.Utils.Lang @@ -136,21 +136,21 @@ declare class TreeMap { * if the key does not exist, undefied is returned * @param key Objective of comparison * @return key or undefined - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The getHigherKey method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ getHigherKey(key: K): K; /** * Returns a new Iterator object that contains the keys contained in this map - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The keys method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ keys(): IterableIterator; /** * Returns a new Iterator object that contains the values contained in this map - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The values method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -160,7 +160,7 @@ declare class TreeMap { * @param key Updated targets * @param value Updated the target mapped value * @returns the boolean type(Is there a target pointed to by the key) - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The replace method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -168,8 +168,8 @@ declare class TreeMap { /** * Executes the given callback function once for each real key in the map. * It does not perform functions on deleted keys - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The forEach method cannot be bound. + * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -177,14 +177,14 @@ declare class TreeMap { thisArg?: Object): void; /** * Returns a new Iterator object that contains the [key, value] pairs for each element in the Map object in insertion order - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The entries method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ entries(): IterableIterator<[K, V]>; /** * returns an ES6 iterator.Each item of the iterator is a Javascript Object - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The Symbol.iterator method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.TreeSet.d.ts b/api/@ohos.util.TreeSet.d.ts index f83f36ae14..eabec4bb9a 100644 --- a/api/@ohos.util.TreeSet.d.ts +++ b/api/@ohos.util.TreeSet.d.ts @@ -19,8 +19,8 @@ declare class TreeSet { * @param comparator (Optional) User-defined comparison functions * @param firstValue (Optional) previous element * @param secondValue (Optional) next element - * @throws {NewTargetIsNullError} Parameter check failed. - * @throws {TypeError} Parameter check failed. + * @throws {NewTargetIsNullError}: The TreeSet's constructor cannot be directly invoked. + * @throws {TypeError}: The type of "comparator" must be callable. Received value is: [comparator] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -34,7 +34,7 @@ declare class TreeSet { /** * Returns whether the Set object contains elements * @return the boolean type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -43,7 +43,7 @@ declare class TreeSet { * Returns whether the Set object contain s the elements * @param value need to determine whether to include the element * @return the boolean type - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The has method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -52,8 +52,8 @@ declare class TreeSet { * If the set does not contain the element, the specified element is added * @param value Added element * @returns the boolean type(Is there contain this element) - * @throws {TypeError} Parameter check failed. - * @throws {ContainerBindError} Method not support bind. + * @throws {TypeError}: The type of "value" must be not null. Received value is: [value] + * @throws {ContainerBindError}: The add method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -62,14 +62,14 @@ declare class TreeSet { * Remove a specified element from a Set object * @param value Target to be deleted * @return the boolean type(Is there contain this element) - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The remove method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ remove(value: T): boolean; /** * Clears all element groups in a set - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The clear method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -77,7 +77,7 @@ declare class TreeSet { /** * Gets the first elements in a set * @return value or undefined - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The getFirstValue method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -85,7 +85,7 @@ declare class TreeSet { /** * Gets the last elements in a set * @return value or undefined - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The getLastValue method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -95,8 +95,8 @@ declare class TreeSet { * if the key does not exist, undefied is returned * @param key Objective of comparison * @return key or undefined - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The getLowerValue method cannot be bound. + * @throws {TypeError}: The type of "key" must be not null. Received value is: [key] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -106,8 +106,8 @@ declare class TreeSet { * if the key does not exist, undefied is returned * @param key Objective of comparison * @return key or undefined - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The getHigherValue method cannot be bound. + * @throws {TypeError}: The type of "key" must be not null. Received value is: [key] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -115,7 +115,7 @@ declare class TreeSet { /** * Return and delete the first element, returns undefined if tree set is empty * @return first value or undefined - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The popFirst method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -123,15 +123,15 @@ declare class TreeSet { /** * Return and delete the last element, returns undefined if tree set is empty * @return last value or undefined - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The popLast method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ popLast(): T; /** * Executes a provided function once for each value in the Set object. - * @throws {ContainerBindError} Method not support bind. - * @throws {TypeError} Parameter check failed. + * @throws {ContainerBindError}: The forEach method cannot be bound. + * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -139,21 +139,21 @@ declare class TreeSet { thisArg?: Object): void; /** * Returns a new Iterator object that contains the values contained in this set - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The values method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ values(): IterableIterator; /** * Returns a new Iterator object that contains the [key, value] pairs for each element in the Set object in insertion order - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The entries method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ entries(): IterableIterator<[T, T]>; /** * returns an ES6 iterator.Each item of the iterator is a Javascript Object - * @throws {ContainerBindError} Method not support bind. + * @throws {ContainerBindError}: The Symbol.iterator method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ -- Gitee From 19f7c65a41af2d7162af6ecb01c8b354092aad2e Mon Sep 17 00:00:00 2001 From: dboy190 Date: Tue, 27 Sep 2022 15:01:44 +0800 Subject: [PATCH 023/438] fix new errorcode Signed-off-by: dboy190 --- api/@ohos.data.distributedData.d.ts | 231 ++++++++-------------------- 1 file changed, 67 insertions(+), 164 deletions(-) diff --git a/api/@ohos.data.distributedData.d.ts b/api/@ohos.data.distributedData.d.ts index be10b3903e..c42ebba9ea 100644 --- a/api/@ohos.data.distributedData.d.ts +++ b/api/@ohos.data.distributedData.d.ts @@ -782,7 +782,6 @@ declare namespace distributedData { * @errorcode 15100001 * @errorcode 15100004 * @errorcode 15100006 - * @errorcode 15100008 */ getEntryV9(): Entry; } @@ -1150,7 +1149,6 @@ declare namespace distributedData { * @param value IIndicates the long value. * @returns Returns the {@coed QueryV9} object. * @throws throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ equalTo(field: string, value: number|string|boolean): QueryV9; @@ -1164,7 +1162,6 @@ declare namespace distributedData { * @param value Indicates the int value. * @returns Returns the {@coed QueryV9} object. * @throws throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ notEqualTo(field: string, value: number|string|boolean): QueryV9; @@ -1179,7 +1176,6 @@ declare namespace distributedData { * @param value Indicates the int value. * @returns Returns the {@coed QueryV9} object. * @throws throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ greaterThan(field: string, value: number|string|boolean): QueryV9; @@ -1193,7 +1189,6 @@ declare namespace distributedData { * @param value Indicates the int value. * @returns Returns the {@coed QueryV9} object. * @throws throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ lessThan(field: string, value: number|string): QueryV9; @@ -1207,7 +1202,6 @@ declare namespace distributedData { * @param value Indicates the int value. * @returns Returns the {@coed QueryV9} object. * @throws throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ greaterThanOrEqualTo(field: string, value: number|string): QueryV9; @@ -1222,7 +1216,6 @@ declare namespace distributedData { * @param value Indicates the int value. * @returns Returns the {@coed QueryV9} object. * @throws throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ lessThanOrEqualTo(field: string, value: number|string): QueryV9; @@ -1235,7 +1228,6 @@ declare namespace distributedData { * @param field Indicates the field, which must start with $. and cannot contain ^. * @returns Returns the {@coed QueryV9} object. * @throws throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ isNull(field: string): QueryV9; @@ -1249,7 +1241,6 @@ declare namespace distributedData { * @param valueList Indicates the int value list. * @returns Returns the {@coed QueryV9} object. * @throws throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ inNumber(field: string, valueList: number[]): QueryV9; @@ -1263,7 +1254,6 @@ declare namespace distributedData { * @param valueList Indicates the string value list. * @returns Returns the {@coed QueryV9} object. * @throws throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ inString(field: string, valueList: string[]): QueryV9; @@ -1276,7 +1266,6 @@ declare namespace distributedData { * @param valueList Indicates the int value list. * @returns Returns the {@coed QueryV9} object. * @throws throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ notInNumber(field: string, valueList: number[]): QueryV9; @@ -1290,7 +1279,6 @@ declare namespace distributedData { * @param valueList Indicates the string value list. * @returns Returns the {@coed QueryV9} object. * @throws throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ notInString(field: string, valueList: string[]): QueryV9; @@ -1304,7 +1292,6 @@ declare namespace distributedData { * @param value Indicates the string value. * @returns Returns the {@coed QueryV9} object. * @throws throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ like(field: string, value: string): QueryV9; @@ -1318,7 +1305,6 @@ declare namespace distributedData { * @param value Indicates the string value. * @returns Returns the {@coed QueryV9} object. * @throws throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ unlike(field: string, value: string): QueryV9; @@ -1353,7 +1339,6 @@ declare namespace distributedData { * @param field Indicates the field, which must start with $. and cannot contain ^. * @returns Returns the {@coed QueryV9} object. * @throws throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ orderByAsc(field: string): QueryV9; @@ -1366,7 +1351,6 @@ declare namespace distributedData { * @param field Indicates the field, which must start with $. and cannot contain ^. * @returns Returns the {@coed QueryV9} object. * @throws throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ orderByDesc(field: string): QueryV9; @@ -1390,7 +1374,6 @@ declare namespace distributedData { * @param field Indicates the specified field. * @returns Returns the {@coed QueryV9} object. * @throws throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ isNotNull(field: string): QueryV9; @@ -1427,7 +1410,6 @@ declare namespace distributedData { * @param prefix Indicates the specified key prefix. * @returns Returns the {@coed QueryV9} object. * @throws throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ prefixKey(prefix: string): QueryV9; @@ -1440,7 +1422,6 @@ declare namespace distributedData { * @param index Indicates the index to set. * @returns Returns the {@coed QueryV9} object. * @throws throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ setSuggestIndex(index: string): QueryV9; @@ -1453,7 +1434,6 @@ declare namespace distributedData { * @param deviceId Specify device id to query from. * @return Returns the {@code QueryV9} object with device ID prefix added. * @throws throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ deviceId(deviceId:string):QueryV9; @@ -1733,9 +1713,8 @@ declare namespace distributedData { * @param value Indicates the string value, which must be less than 4 MB as a UTF-8 byte array. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100004 - * @errorcode 15100005 - * @errorcode 15100008 + * @errorcode 15100003 + * @errorcode 15100006 * @errorcode 401 */ put(key: string, value: Uint8Array | string | number | boolean, callback: AsyncCallback): void; @@ -1751,9 +1730,8 @@ declare namespace distributedData { * Spaces before and after the key will be cleared. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100004 - * @errorcode 15100005 - * @errorcode 15100008 + * @errorcode 15100003 + * @errorcode 15100006 * @errorcode 401 */ putBatch(value: Array, callback: AsyncCallback): void; @@ -1768,10 +1746,9 @@ declare namespace distributedData { * Spaces before and after the key will be cleared. * @throws {BusinessError} if process failed. * @errorcode 15100001 + * @errorcode 15100003 * @errorcode 15100004 - * @errorcode 15100005 * @errorcode 15100006 - * @errorcode 15100008 * @errorcode 401 */ delete(key: string, callback: AsyncCallback): void; @@ -1786,10 +1763,9 @@ declare namespace distributedData { * Spaces before and after the key will be cleared. * @throws {BusinessError} if process failed. * @errorcode 15100001 + * @errorcode 15100003 * @errorcode 15100004 - * @errorcode 15100005 * @errorcode 15100006 - * @errorcode 15100008 * @errorcode 401 */ delete(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback); @@ -1803,9 +1779,8 @@ declare namespace distributedData { * @param file Indicates the name that saves the database backup. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100002 - * @errorcode 15100007 - * @errorcode 15100008 + * @errorcode 15100005 + * @errorcode 15100006 * @errorcode 401 */ backup(file:string, callback: AsyncCallback):void; @@ -1819,9 +1794,8 @@ declare namespace distributedData { * @param file Indicates the name that saves the database file. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100002 - * @errorcode 15100007 - * @errorcode 15100008 + * @errorcode 15100005 + * @errorcode 15100006 * @errorcode 401 */ restore(file:string, callback: AsyncCallback):void; @@ -1834,7 +1808,6 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param files list Indicates the name that backup file to delete. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ deleteBackup(files:Array, callback: AsyncCallback>):void; @@ -1850,10 +1823,8 @@ declare namespace distributedData { * @param listener Indicates the observer of data change events in the distributed database. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100002 - * @errorcode 15100004 - * @errorcode 15100008 - * @errorcode 15100009 + * @errorcode 15100006 + * @errorcode 15100007 * @errorcode 401 */ on(event: 'dataChange', type: SubscribeType, listener: Callback): void; @@ -1864,7 +1835,6 @@ declare namespace distributedData { * @since 9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ on(event: 'syncComplete', syncCallback: Callback>): void; @@ -1877,10 +1847,7 @@ declare namespace distributedData { * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100002 - * @errorcode 15100004 - * @errorcode 15100008 - * @errorcode 15100010 + * @errorcode 15100006 * @errorcode 401 */ off(event:'dataChange', listener?: Callback): void; @@ -1891,7 +1858,6 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param syncCallback Indicates the callback used to send the synchronization result to caller. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ off(event: 'syncComplete', syncCallback?: Callback>): void; @@ -1904,9 +1870,8 @@ declare namespace distributedData { * @param entries Indicates the key-value pairs to be inserted in batches. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100004 - * @errorcode 15100005 - * @errorcode 15100008 + * @errorcode 15100003 + * @errorcode 15100006 * @errorcode 401 */ putBatch(entries: Entry[], callback: AsyncCallback): void; @@ -1920,10 +1885,9 @@ declare namespace distributedData { * @param keys Indicates the key-value pairs to be deleted in batches. * @throws {BusinessError} if process failed. * @errorcode 15100001 + * @errorcode 15100003 * @errorcode 15100004 - * @errorcode 15100005 * @errorcode 15100006 - * @errorcode 15100008 * @errorcode 401 */ deleteBatch(keys: string[], callback: AsyncCallback): void; @@ -1938,9 +1902,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100002 - * @errorcode 15100004 - * @errorcode 15100008 + * @errorcode 15100006 */ startTransaction(callback: AsyncCallback): void; startTransaction(): Promise; @@ -1953,8 +1915,7 @@ declare namespace distributedData { * @param callback * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100004 - * @errorcode 15100008 + * @errorcode 15100006 */ commit(callback: AsyncCallback): void; commit(): Promise; @@ -1966,8 +1927,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100004 - * @errorcode 15100008 + * @errorcode 15100006 */ rollback(callback: AsyncCallback): void; rollback(): Promise; @@ -1981,7 +1941,6 @@ declare namespace distributedData { * synchronization, and false means the opposite. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100002 * @errorcode 401 */ enableSync(enabled: boolean, callback: AsyncCallback): void; @@ -1998,7 +1957,6 @@ declare namespace distributedData { * @param remoteSupportLabels Indicates the labels of the devices with which data will be synchronized. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100002 * @errorcode 401 */ setSyncRange(localLabels: string[], remoteSupportLabels: string[], callback: AsyncCallback): void; @@ -2269,10 +2227,9 @@ declare namespace distributedData { * @import N/A * @throws {BusinessError} if process failed. * @errorcode 15100001 + * @errorcode 15100003 * @errorcode 15100004 - * @errorcode 15100005 * @errorcode 15100006 - * @errorcode 15100008 * @errorcode 401 */ get(key: string, callback: AsyncCallback): void; @@ -2288,9 +2245,8 @@ declare namespace distributedData { * @returns Returns the list of all key-value pairs that match the specified key prefix. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100004 - * @errorcode 15100005 - * @errorcode 15100008 + * @errorcode 15100003 + * @errorcode 15100006 * @errorcode 401 */ getEntries(keyPrefix: string, callback: AsyncCallback): void; @@ -2306,10 +2262,9 @@ declare namespace distributedData { * @returns Returns the list of key-value pairs matching the specified {@code QueryV9} object. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100004 + * @errorcode 15100003 * @errorcode 15100005 - * @errorcode 15100007 - * @errorcode 15100008 + * @errorcode 15100006 * @errorcode 401 */ getEntries(query: QueryV9, callback: AsyncCallback): void; @@ -2328,9 +2283,8 @@ declare namespace distributedData { * @param keyPrefix Indicates the key prefix to match. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100004 - * @errorcode 15100005 - * @errorcode 15100008 + * @errorcode 15100003 + * @errorcode 15100006 * @errorcode 401 */ getResultSet(keyPrefix: string, callback: AsyncCallback): void; @@ -2345,9 +2299,8 @@ declare namespace distributedData { * @param query Indicates the {@code QueryV9} object. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100004 - * @errorcode 15100005 - * @errorcode 15100008 + * @errorcode 15100003 + * @errorcode 15100006 * @errorcode 401 */ getResultSet(query: QueryV9, callback: AsyncCallback): void; @@ -2363,9 +2316,8 @@ declare namespace distributedData { * Spaces before and after the key will be cleared. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100004 - * @errorcode 15100005 - * @errorcode 15100008 + * @errorcode 15100003 + * @errorcode 15100006 * @errorcode 401 */ getResultSet(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; @@ -2380,7 +2332,6 @@ declare namespace distributedData { * @param resultSet Indicates the {@code KvStoreResultSet} object to close. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100004 * @errorcode 401 */ closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; @@ -2396,9 +2347,8 @@ declare namespace distributedData { * @returns Returns the number of results matching the specified {@code QueryV9} object. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100004 - * @errorcode 15100005 - * @errorcode 15100008 + * @errorcode 15100003 + * @errorcode 15100006 * @errorcode 401 */ getResultSize(query: QueryV9, callback: AsyncCallback): void; @@ -2413,8 +2363,7 @@ declare namespace distributedData { * @param deviceId Indicates the device to be removed data. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100004 - * @errorcode 15100008 + * @errorcode 15100006 * @errorcode 401 */ removeDeviceData(deviceId: string, callback: AsyncCallback): void; @@ -2431,10 +2380,8 @@ declare namespace distributedData { * @permission ohos.permission.DISTRIBUTED_DATASYNC * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100002 + * @errorcode 15100003 * @errorcode 15100004 - * @errorcode 15100005 - * @errorcode 15100006 * @errorcode 401 */ sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void @@ -2451,10 +2398,8 @@ declare namespace distributedData { * @permission ohos.permission.DISTRIBUTED_DATASYNC * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100002 + * @errorcode 15100003 * @errorcode 15100004 - * @errorcode 15100005 - * @errorcode 15100006 * @errorcode 401 */ sync(deviceIds: string[], query: QueryV9, mode: SyncMode, delayMs?: number): void; @@ -2469,10 +2414,8 @@ declare namespace distributedData { * @param listener Indicates the observer of data change events in the distributed database. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100002 - * @errorcode 15100004 - * @errorcode 15100008 - * @errorcode 15100009 + * @errorcode 15100006 + * @errorcode 15100007 * @errorcode 401 */ on(event: 'dataChange', type: SubscribeType, listener: Callback): void; @@ -2484,7 +2427,6 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param syncCallback Indicates the callback used to send the synchronization result to the caller. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ on(event: 'syncComplete', syncCallback: Callback>): void; @@ -2496,10 +2438,7 @@ declare namespace distributedData { * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100002 - * @errorcode 15100004 - * @errorcode 15100008 - * @errorcode 15100010 + * @errorcode 15100006 * @errorcode 401 */ off(event:'dataChange', listener?: Callback): void; @@ -2509,7 +2448,6 @@ declare namespace distributedData { * @since 9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ off(event: 'syncComplete', syncCallback?: Callback>): void; @@ -2523,7 +2461,6 @@ declare namespace distributedData { * @param defaultAllowedDelayMs Indicates the default delay allowed for the database synchronization, in milliseconds. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100002 * @errorcode 401 */ setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback): void; @@ -2537,8 +2474,7 @@ declare namespace distributedData { * @returns SecurityLevel {@code SecurityLevel} the security level of the database. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100004 - * @errorcode 15100008 + * @errorcode 15100006 */ getSecurityLevel(callback: AsyncCallback): void; getSecurityLevel(): Promise; @@ -2839,10 +2775,9 @@ declare namespace distributedData { * @return Returns the value matching the given criteria. * @throws {BusinessError} if process failed. * @errorcode 15100001 + * @errorcode 15100003 * @errorcode 15100004 - * @errorcode 15100005 * @errorcode 15100006 - * @errorcode 15100008 * @errorcode 401 */ get(deviceId: string, key: string, callback: AsyncCallback): void; @@ -2858,9 +2793,8 @@ declare namespace distributedData { * @returns Returns the list of all key-value pairs meeting the given criteria. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100004 - * @errorcode 15100005 - * @errorcode 15100008 + * @errorcode 15100003 + * @errorcode 15100006 * @errorcode 401 */ getEntries(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; @@ -2875,10 +2809,9 @@ declare namespace distributedData { * @returns Returns the list of key-value pairs matching the specified {@code QueryV9} object. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100004 + * @errorcode 15100003 * @errorcode 15100005 - * @errorcode 15100007 - * @errorcode 15100008 + * @errorcode 15100006 * @errorcode 401 */ getEntries(query: QueryV9, callback: AsyncCallback): void; @@ -2894,10 +2827,9 @@ declare namespace distributedData { * @returns Returns the list of key-value pairs matching the specified {@code QueryV9} object. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100004 + * @errorcode 15100003 * @errorcode 15100005 - * @errorcode 15100007 - * @errorcode 15100008 + * @errorcode 15100006 * @errorcode 401 */ getEntries(deviceId: string, query: QueryV9, callback: AsyncCallback): void; @@ -2918,9 +2850,8 @@ declare namespace distributedData { * @returns Returns the {@code KvStoreResultSet} objects. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100004 - * @errorcode 15100005 - * @errorcode 15100008 + * @errorcode 15100003 + * @errorcode 15100006 * @errorcode 401 */ getResultSet(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; @@ -2935,9 +2866,8 @@ declare namespace distributedData { * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code QueryV9} object. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100004 - * @errorcode 15100005 - * @errorcode 15100008 + * @errorcode 15100003 + * @errorcode 15100006 * @errorcode 401 */ getResultSet(query: QueryV9, callback: AsyncCallback): void; @@ -2953,9 +2883,8 @@ declare namespace distributedData { * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code QueryV9} object. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100004 - * @errorcode 15100005 - * @errorcode 15100008 + * @errorcode 15100003 + * @errorcode 15100006 * @errorcode 401 */ getResultSet(deviceId: string, query: QueryV9, callback: AsyncCallback): void; @@ -2971,9 +2900,8 @@ declare namespace distributedData { * Spaces before and after the key will be cleared. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100004 - * @errorcode 15100005 - * @errorcode 15100008 + * @errorcode 15100003 + * @errorcode 15100006 * @errorcode 401 */ getResultSet(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; @@ -2989,9 +2917,8 @@ declare namespace distributedData { * Spaces before and after the key will be cleared. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100004 - * @errorcode 15100005 - * @errorcode 15100008 + * @errorcode 15100003 + * @errorcode 15100006 * @errorcode 401 */ getResultSet(deviceId: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; @@ -3005,7 +2932,6 @@ declare namespace distributedData { * @param resultSet Indicates the {@code KvStoreResultSet} object to close. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100004 * @errorcode 401 */ closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; @@ -3020,9 +2946,8 @@ declare namespace distributedData { * @returns Returns the number of results matching the specified {@code QueryV9} object. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100004 - * @errorcode 15100005 - * @errorcode 15100008 + * @errorcode 15100003 + * @errorcode 15100006 * @errorcode 401 */ getResultSize(query: QueryV9, callback: AsyncCallback): void; @@ -3038,9 +2963,8 @@ declare namespace distributedData { * @returns Returns the number of results matching the specified {@code QueryV9} object. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100004 - * @errorcode 15100005 - * @errorcode 15100008 + * @errorcode 15100003 + * @errorcode 15100006 * @errorcode 401 */ getResultSize(deviceId: string, query: QueryV9, callback: AsyncCallback): void; @@ -3056,8 +2980,7 @@ declare namespace distributedData { * @param deviceId Identifies the device whose data is to be removed. The value cannot be the current device ID. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100004 - * @errorcode 15100008 + * @errorcode 15100006 * @errorcode 401 */ removeDeviceData(deviceId: string, callback: AsyncCallback): void; @@ -3077,10 +3000,8 @@ declare namespace distributedData { * @permission ohos.permission.DISTRIBUTED_DATASYNC * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100002 + * @errorcode 15100003 * @errorcode 15100004 - * @errorcode 15100005 - * @errorcode 15100006 * @errorcode 401 */ sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; @@ -3100,10 +3021,8 @@ declare namespace distributedData { * @permission ohos.permission.DISTRIBUTED_DATASYNC * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100002 + * @errorcode 15100003 * @errorcode 15100004 - * @errorcode 15100005 - * @errorcode 15100006 * @errorcode 401 */ sync(deviceIds: string[], query: Query, mode: SyncMode, delayMs?: number): void; @@ -3116,7 +3035,6 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param syncCallback Indicates the callback used to send the synchronization result to the caller. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ on(event: 'syncComplete', syncCallback: Callback>): void; @@ -3131,10 +3049,8 @@ declare namespace distributedData { * @param listener Indicates the observer of data change events in the distributed database. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100002 - * @errorcode 15100004 - * @errorcode 15100008 - * @errorcode 15100009 + * @errorcode 15100006 + * @errorcode 15100007 * @errorcode 401 */ on(event: 'dataChange', type: SubscribeType, listener: Callback): void; @@ -3147,10 +3063,7 @@ declare namespace distributedData { * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100002 - * @errorcode 15100004 - * @errorcode 15100008 - * @errorcode 15100010 + * @errorcode 15100006 * @errorcode 401 */ off(event:'dataChange', listener?: Callback): void; @@ -3160,7 +3073,6 @@ declare namespace distributedData { * @since 9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ off(event: 'syncComplete', syncCallback?: Callback>): void; @@ -3196,7 +3108,6 @@ declare namespace distributedData { * including the user information and package name. * @return Returns the {@code KVManagerV9} instance. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ function createKVManagerV9(config: KVManagerConfig, callback: AsyncCallback): void; @@ -3325,9 +3236,8 @@ declare namespace distributedData { * @return Returns a {@code KVStoreV9}, or {@code SingleKVStoreV9}. * @throws {BusinessError} if process failed. * @errorcode 15100001 + * @errorcode 15100002 * @errorcode 15100003 - * @errorcode 15100004 - * @errorcode 15100005 * @errorcode 401 */ getKVStore(storeId: string, options: Options): Promise; @@ -3348,7 +3258,6 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param kvStore Indicates the {@code KvStoreV9} database to close. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ closeKVStore(appId: string, storeId: string, kvStore: KVStoreV9, callback: AsyncCallback): void; @@ -3366,9 +3275,7 @@ declare namespace distributedData { * @param storeId Identifies the {@code KvStoreV9} database to delete. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100002 * @errorcode 15100004 - * @errorcode 15100006 * @errorcode 401 */ deleteKVStore(appId: string, storeId: string, callback: AsyncCallback): void; @@ -3383,8 +3290,6 @@ declare namespace distributedData { * @returns Returns the storeId of all created {@code KvStore} databases. * @throws {BusinessError} if process failed. * @errorcode 15100001 - * @errorcode 15100002 - * @errorcode 15100004 * @errorcode 401 */ getAllKVStoreId(appId: string, callback: AsyncCallback): void; @@ -3397,7 +3302,6 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deathCallback device change callback {@code DeviceChangeCallback} * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ on(event: 'distributedDataServiceDie', deathCallback: Callback): void; @@ -3409,7 +3313,6 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deathCallback device change callback {@code DeviceChangeCallback} which has been registered. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ off(event: 'distributedDataServiceDie', deathCallback?: Callback): void; -- Gitee From 6a1ed05461b8f9c7f14766df1a01f3baafb87f94 Mon Sep 17 00:00:00 2001 From: dboy190 Date: Tue, 27 Sep 2022 16:40:57 +0800 Subject: [PATCH 024/438] add missed 401 errorcode Signed-off-by: dboy190 --- api/@ohos.data.distributedData.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/@ohos.data.distributedData.d.ts b/api/@ohos.data.distributedData.d.ts index c42ebba9ea..53d1e0ad94 100644 --- a/api/@ohos.data.distributedData.d.ts +++ b/api/@ohos.data.distributedData.d.ts @@ -718,6 +718,8 @@ declare namespace distributedData { * the destination position will be entry 1. The valid final position after moving forwards starts with 0. If the * final position is invalid, false will be returned. * @returns Returns true if the operation succeeds; return false otherwise. + * @throws throws {BusinessError} if process failed. + * @errorcode 401 */ move(offset: number): boolean; /** @@ -727,6 +729,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param position Indicates the absolute position. * @returns Returns true if the operation succeeds; return false otherwise. + * @throws throws {BusinessError} if process failed. + * @errorcode 401 */ moveToPosition(position: number): boolean; /** @@ -1363,6 +1367,8 @@ declare namespace distributedData { * @param total Indicates the number of results. * @param offset Indicates the start position. * @returns Returns the {@coed QueryV9} object. + * @throws throws {BusinessError} if process failed. + * @errorcode 401 */ limit(total: number, offset: number): QueryV9; /** -- Gitee From f4dc319500cf56a77263ac68886782fc728a4c08 Mon Sep 17 00:00:00 2001 From: limeng Date: Tue, 27 Sep 2022 17:42:43 +0800 Subject: [PATCH 025/438] modify index-full Signed-off-by: limeng --- api/@internal/component/ets/index-full.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/@internal/component/ets/index-full.d.ts b/api/@internal/component/ets/index-full.d.ts index 85abad3e47..b5c05715db 100644 --- a/api/@internal/component/ets/index-full.d.ts +++ b/api/@internal/component/ets/index-full.d.ts @@ -106,3 +106,5 @@ /// /// /// +/// +/// -- Gitee From 2177dee68ae061a2118da0054651be7e82cf7e83 Mon Sep 17 00:00:00 2001 From: dboy190 Date: Wed, 28 Sep 2022 17:35:15 +0800 Subject: [PATCH 026/438] fix move v9 Signed-off-by: dboy190 --- api/@ohos.data.distributedData.d.ts | 30 +++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/api/@ohos.data.distributedData.d.ts b/api/@ohos.data.distributedData.d.ts index 53d1e0ad94..733000b591 100644 --- a/api/@ohos.data.distributedData.d.ts +++ b/api/@ohos.data.distributedData.d.ts @@ -711,6 +711,21 @@ declare namespace distributedData { * Moves the read position by a relative offset to the current position. * * @since 8 + * @deprecated since 9 + * @useinstead moveV9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param offset Indicates the relative offset to the current position. Anegative offset indicates moving backwards, and a + * positive offset indicates moving forewards. Forexample, if the current position is entry 1 and thisoffset is 2, + * the destination position will be entry 3; ifthe current position is entry 3 and this offset is -2, + * the destination position will be entry 1. The valid final position after moving forwards starts with 0. If the + * final position is invalid, false will be returned. + * @returns Returns true if the operation succeeds; return false otherwise. + */ + move(offset: number): boolean; + /** + * Moves the read position by a relative offset to the current position. + * + * @since 9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param offset Indicates the relative offset to the current position. Anegative offset indicates moving backwards, and a * positive offset indicates moving forewards. Forexample, if the current position is entry 1 and thisoffset is 2, @@ -721,18 +736,29 @@ declare namespace distributedData { * @throws throws {BusinessError} if process failed. * @errorcode 401 */ - move(offset: number): boolean; + moveV9(offset: number): boolean; /** * Moves the read position from 0 to an absolute position. * * @since 8 + * @deprecated since 9 + * @useinstead moveToPositionV9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param position Indicates the absolute position. + * @returns Returns true if the operation succeeds; return false otherwise. + */ + moveToPosition(position: number): boolean; + /** + * Moves the read position from 0 to an absolute position. + * + * @since 9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param position Indicates the absolute position. * @returns Returns true if the operation succeeds; return false otherwise. * @throws throws {BusinessError} if process failed. * @errorcode 401 */ - moveToPosition(position: number): boolean; + moveToPositionV9(position: number): boolean; /** * Checks whether the read position is the first line. * -- Gitee From bd57078919172bc6d9156c1ad74513c1c9a86ae8 Mon Sep 17 00:00:00 2001 From: niudongyao Date: Thu, 29 Sep 2022 15:57:30 +0800 Subject: [PATCH 027/438] =?UTF-8?q?api=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: niudongyao --- .idea/.gitignore | 8 ++ .idea/interface_sdk-js.iml | 8 ++ .idea/modules.xml | 8 ++ .idea/vcs.xml | 6 ++ api/@ohos.data.dataShare.d.ts | 184 +++++++++++++++++++++++++++++++++- 5 files changed, 213 insertions(+), 1 deletion(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/interface_sdk-js.iml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000000..73f69e0958 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/.idea/interface_sdk-js.iml b/.idea/interface_sdk-js.iml new file mode 100644 index 0000000000..bc2cd87409 --- /dev/null +++ b/.idea/interface_sdk-js.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000000..732dc43fc9 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000000..94a25f7f4c --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/api/@ohos.data.dataShare.d.ts b/api/@ohos.data.dataShare.d.ts index a773ff1954..10d8314da3 100644 --- a/api/@ohos.data.dataShare.d.ts +++ b/api/@ohos.data.dataShare.d.ts @@ -33,6 +33,22 @@ declare namespace dataShare { function createDataShareHelper(context: Context, uri: string, callback: AsyncCallback): void; function createDataShareHelper(context: Context, uri: string): Promise; + /** + * Obtains the dataShareHelper. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @param context Indicates the application context. + * @param uri Indicates the path of the file to open. + * @return Returns the dataShareHelper. + * @throws {BusinessError} if process failed + * @errorcode 157000010 + * @errorcode 401 + * @StageModelOnly + */ + function createDataShareHelperV9(context: Context, uri: string, callback: AsyncCallback): void; + function createDataShareHelperV9(context: Context, uri: string): Promise; + /** * DataShareHelper * @since 9 @@ -183,6 +199,172 @@ declare namespace dataShare { notifyChange(uri: string, callback: AsyncCallback): void; notifyChange(uri: string): Promise; } + + /** + * DataShareHelperV9 + * @since 9 + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @StageModelOnly + */ + interface DataShareHelperV9 { + /** + * Registers an observer to observe data specified by the given uri. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @param type dataChange. + * @param uri Indicates the path of the data to operate. + * @param callback Indicates the callback when dataChange. + * @return - + * @StageModelOnly + */ + on(type: 'dataChange', uri: string, callback: AsyncCallback): void; + + /** + * Deregisters an observer used for monitoring data specified by the given uri. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @param type dataChange. + * @param uri Indicates the path of the data to operate. + * @param callback Indicates the registered callback. + * @return - + * @StageModelOnly + */ + off(type: 'dataChange', uri: string, callback?: AsyncCallback): void; + + /** + * Inserts a single data record into the database. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @param uri Indicates the path of the data to operate. + * @param value Indicates the data record to insert. If this parameter is null, a blank row will be inserted. + * @return Returns the index of the inserted data record. + * @throws {BusinessError} if process failed + * @errorcode 15700000 + * @errorcode 401 + * @StageModelOnly + */ + insert(uri: string, value: ValuesBucket, callback: AsyncCallback): void; + insert(uri: string, value: ValuesBucket): Promise; + + /** + * Deletes one or more data records from the database. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @param uri Indicates the path of the data to operate. + * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. + * @return Returns the number of data records deleted. + * @throws {BusinessError} if process failed + * @errorcode 15700000 + * @errorcode 401 + * @StageModelOnly + */ + delete(uri: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; + delete(uri: string, predicates: dataSharePredicates.DataSharePredicates): Promise; + + /** + * Queries data in the database. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @param uri Indicates the path of data to query. + * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. + * @param columns Indicates the columns to query. If this parameter is null, all columns are queried. + * @return Returns the query result. + * @throws {BusinessError} if process failed + * @errorcode 15700000 + * @errorcode 401 + * @StageModelOnly + */ + query(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array, callback: AsyncCallback): void; + query(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array): Promise; + + /** + * Updates data records in the database. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @param uri Indicates the path of data to update. + * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. + * @param value Indicates the data to update. This parameter can be null. + * @return Returns the number of data records updated. + * @throws {BusinessError} if process failed + * @errorcode 15700000 + * @errorcode 401 + * @StageModelOnly + */ + update(uri: string, predicates: dataSharePredicates.DataSharePredicates, value: ValuesBucket, callback: AsyncCallback): void; + update(uri: string, predicates: dataSharePredicates.DataSharePredicates, value: ValuesBucket): Promise; + + /** + * Inserts multiple data records into the database. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @param uri Indicates the path of the data to operate. + * @param values Indicates the data records to insert. + * @return Returns the number of data records inserted. + * @throws {BusinessError} if process failed + * @errorcode 15700000 + * @errorcode 401 + * @StageModelOnly + */ + batchInsert(uri: string, values: Array, callback: AsyncCallback): void; + batchInsert(uri: string, values: Array): Promise; + + /** + * Converts the given {@code uri} that refers to the DataShare into a normalized {@link ohos.utils.net.Uri}. + * A normalized uri can be used across devices, persisted, backed up, and restored. + *

To transfer a normalized uri from another environment to the current environment, you should call this + * method again to re-normalize the uri for the current environment or call {@link #denormalizeUri(Uri)} + * to convert it to a denormalized uri that can be used only in the current environment. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @param uri Indicates the {@link ohos.utils.net.Uri} object to normalize. + * @return Returns the normalized {@code Uri} object if the DataShare supports uri normalization; + * returns {@code null} otherwise. + * @throws DataShareRemoteException Throws this exception if the remote process exits. + * @throws NullPointerException Throws this exception if {@code uri} is null. + * @see #denormalizeUri + * @StageModelOnly + */ + normalizeUri(uri: string, callback: AsyncCallback): void; + normalizeUri(uri: string): Promise; + + /** + * Converts the given normalized {@code uri} generated by {@link #normalizeUri(Uri)} into a denormalized one. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @param uri Indicates the {@link ohos.utils.net.Uri} object to denormalize. + * @return Returns the denormalized {@code Uri} object if the denormalization is successful; returns the + * original {@code Uri} passed to this method if there is nothing to do; returns {@code null} if the data + * identified by the normalized {@code Uri} cannot be found in the current environment. + * @throws DataShareRemoteException Throws this exception if the remote process exits. + * @throws NullPointerException Throws this exception if {@code uri} is null. + * @see #normalizeUri + * @StageModelOnly + */ + denormalizeUri(uri: string, callback: AsyncCallback): void; + denormalizeUri(uri: string): Promise; + + /** + * Notifies the registered observers of a change to the data resource specified by Uri. + * @since 9 + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @param uri Indicates the {@link ohos.utils.net.Uri} object to notifyChange. + * @return - + * @StageModelOnly + */ + notifyChange(uri: string, callback: AsyncCallback): void; + notifyChange(uri: string): Promise; + } } -export default dataShare; +export default dataShare; \ No newline at end of file -- Gitee From 76a84856bab9a5e525d6f098291c139e983e9bb2 Mon Sep 17 00:00:00 2001 From: niudongyao Date: Thu, 29 Sep 2022 15:58:20 +0800 Subject: [PATCH 028/438] =?UTF-8?q?api=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: niudongyao --- .idea/.gitignore | 8 -------- .idea/interface_sdk-js.iml | 8 -------- .idea/modules.xml | 8 -------- .idea/vcs.xml | 6 ------ 4 files changed, 30 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/interface_sdk-js.iml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 73f69e0958..0000000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml -# Editor-based HTTP Client requests -/httpRequests/ diff --git a/.idea/interface_sdk-js.iml b/.idea/interface_sdk-js.iml deleted file mode 100644 index bc2cd87409..0000000000 --- a/.idea/interface_sdk-js.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 732dc43fc9..0000000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7f4c..0000000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file -- Gitee From ae5ce6147efa6c0bc005c0b5c068663a21626bc8 Mon Sep 17 00:00:00 2001 From: dboy190 Date: Thu, 29 Sep 2022 16:03:11 +0800 Subject: [PATCH 029/438] api bugfix Signed-off-by: dboy190 --- api/@ohos.data.distributedData.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.data.distributedData.d.ts b/api/@ohos.data.distributedData.d.ts index 733000b591..4880dfb235 100644 --- a/api/@ohos.data.distributedData.d.ts +++ b/api/@ohos.data.distributedData.d.ts @@ -3047,7 +3047,7 @@ declare namespace distributedData { * @param deviceIds Indicates the list of IDs of devices whose * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. * {@code DeviceKVStore} databases are to be synchronized. - * @param query Indicates the {@code Query} object. + * @param query Indicates the {@code QueryV9} object. * @param mode Indicates the synchronization mode, {@code PUSH}, {@code PULL}, or * {@code PUSH_PULL}. * @permission ohos.permission.DISTRIBUTED_DATASYNC @@ -3057,7 +3057,7 @@ declare namespace distributedData { * @errorcode 15100004 * @errorcode 401 */ - sync(deviceIds: string[], query: Query, mode: SyncMode, delayMs?: number): void; + sync(deviceIds: string[], query: QueryV9, mode: SyncMode, delayMs?: number): void; /** * Register Synchronizes DeviceKVStore databases callback. -- Gitee From d844f36bc1c9a2552e6cc1330fd005d80a00148f Mon Sep 17 00:00:00 2001 From: yanwenhao Date: Fri, 30 Sep 2022 16:06:34 +0800 Subject: [PATCH 030/438] Fix type of VisibilityType Signed-off-by: yanwenhao Change-Id: I373781e0a35730dfe7fdd43722b54968ba036665 --- api/@ohos.application.formInfo.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/@ohos.application.formInfo.d.ts b/api/@ohos.application.formInfo.d.ts index 46c60e5274..d810c792a1 100644 --- a/api/@ohos.application.formInfo.d.ts +++ b/api/@ohos.application.formInfo.d.ts @@ -501,21 +501,21 @@ declare namespace formInfo { * @since 9 * @syscap SystemCapability.Ability.Form */ - interface VisibilityType { + enum VisibilityType { /** * Indicates the type of the form is visible. - * Often used as a condition variable in function OnVisibilityChanged() to specify actions only on forms that are + * Often used as a condition variable in function OnVisibilityChange() to specify actions only on forms that are * changing to visible. * @since 9 */ - FORM_VISIBLE: number, + FORM_VISIBLE = 1, /** * Indicates the type of the form is invisible. - * Often used as a condition variable in function OnVisibilityChanged() to specify actions only on forms that are + * Often used as a condition variable in function OnVisibilityChange() to specify actions only on forms that are * changing to invisible. * @since 9 */ - FORM_INVISIBLE: number + FORM_INVISIBLE, } } export default formInfo; \ No newline at end of file -- Gitee From d5a798266f88b05967132d6b204f83e2cb42f157 Mon Sep 17 00:00:00 2001 From: liu-ganlin Date: Sun, 9 Oct 2022 10:37:59 +0800 Subject: [PATCH 031/438] update container exception information Signed-off-by: liu-ganlin --- api/@ohos.util.ArrayList.d.ts | 74 +++++++++++++++--------------- api/@ohos.util.Deque.d.ts | 22 ++++----- api/@ohos.util.HashMap.d.ts | 36 +++++++-------- api/@ohos.util.HashSet.d.ts | 28 +++++------ api/@ohos.util.LightWeightMap.d.ts | 68 +++++++++++++-------------- api/@ohos.util.LightWeightSet.d.ts | 50 ++++++++++---------- api/@ohos.util.LinkedList.d.ts | 68 +++++++++++++-------------- api/@ohos.util.List.d.ts | 70 ++++++++++++++-------------- api/@ohos.util.PlainArray.d.ts | 64 +++++++++++++------------- api/@ohos.util.Queue.d.ts | 14 +++--- api/@ohos.util.Stack.d.ts | 18 ++++---- api/@ohos.util.TreeMap.d.ts | 46 +++++++++---------- api/@ohos.util.TreeSet.d.ts | 42 ++++++++--------- 13 files changed, 300 insertions(+), 300 deletions(-) diff --git a/api/@ohos.util.ArrayList.d.ts b/api/@ohos.util.ArrayList.d.ts index 3aca051352..547343ffbb 100644 --- a/api/@ohos.util.ArrayList.d.ts +++ b/api/@ohos.util.ArrayList.d.ts @@ -16,7 +16,7 @@ declare class ArrayList { /** * A constructor used to create a ArrayList object. - * @throws {NewTargetIsNullError}: The ArrayList's constructor cannot be directly invoked. + * @throws { BusinessError } 10200012 - The ArrayList's constructor cannot be directly invoked. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -31,7 +31,7 @@ declare class ArrayList { * Appends the specified element to the end of this arraylist. * @param element to be appended to this arraylist * @returns the boolean type, returns true if the addition is successful, and returns false if it fails. - * @throws {ContainerBindError}: The add method cannot be bound. + * @throws { BusinessError } 10200011 - The add method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -42,9 +42,9 @@ declare class ArrayList { * any subsequent elements to the right (adds one to their index). * @param index index at which the specified element is to be inserted * @param element element to be inserted - * @throws {ContainerBindError}: The insert method cannot be bound. - * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length]. Received value is: [index] - * @throws {TypeError}: The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200011 - The insert method cannot be bound. + * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length]. Received value is: [index] + * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -53,7 +53,7 @@ declare class ArrayList { * Check if arraylist contains the specified element * @param element element to be contained * @return the boolean type,if arraylist contains the specified element,return true,else return false - * @throws {ContainerBindError}: The has method cannot be bound. + * @throws { BusinessError } 10200011 - The has method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -63,7 +63,7 @@ declare class ArrayList { * in this arraylist, or -1 if this arraylist does not contain the element. * @param element element to be contained * @return the number type ,returns the lowest index such that or -1 if there is no such index. - * @throws {ContainerBindError}: The getIndexOf method cannot be bound. + * @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -73,9 +73,9 @@ declare class ArrayList { * delete the element, and move the index of all elements to the right of the element forward by one. * @param index the index in the arraylist * @return the T type ,returns undefined if arraylist is empty,If the index is - * @throws {ContainerBindError}: The removeByIndex method cannot be bound. - * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] - * @throws {TypeError}: The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200011 - The removeByIndex method cannot be bound. + * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] + * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -86,7 +86,7 @@ declare class ArrayList { * unchanged. More formally, removes the element with the lowest index * @param element element to remove * @return the boolean type ,If there is no such element, return false - * @throws {ContainerBindError}: The remove method cannot be bound. + * @throws { BusinessError } 10200011 - The remove method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -96,7 +96,7 @@ declare class ArrayList { * or -1 if the arraylist does not contain the element. * @param element element to find * @return the number type - * @throws {ContainerBindError}: The getLastIndexOf method cannot be bound. + * @throws { BusinessError } 10200011 - The getLastIndexOf method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -105,11 +105,11 @@ declare class ArrayList { * Removes from this arraylist all of the elements whose index is between fromIndex,inclusive,and toIndex ,exclusive. * @param fromIndex The starting position of the index, containing the value at that index position * @param toIndex the end of the index, excluding the value at that index - * @throws {ContainerBindError}: The removeByRange method cannot be bound. - * @throws {RangeError}: The value of "fromIndex" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [fromIndex] - * @throws {RangeError}: The value of "toIndex" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [toIndex] - * @throws {TypeError}: The type of "fromIndex" must be number. Received value is: [fromIndex] - * @throws {TypeError}: The type of "toIndex" must be number. Received value is: [toIndex] + * @throws { BusinessError } 10200011 - The removeByRange method cannot be bound. + * @throws { BusinessError } 10200001 - The value of "fromIndex" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [fromIndex] + * @throws { BusinessError } 10200001 - The value of "toIndex" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [toIndex] + * @throws { BusinessError } 401 - The type of "fromIndex" must be number. Received value is: [fromIndex] + * @throws { BusinessError } 401 - The type of "toIndex" must be number. Received value is: [toIndex] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -123,8 +123,8 @@ declare class ArrayList { * @param arrlist (Optional) The arraylist object to which the current element belongs. * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value - * @throws {ContainerBindError}: The replaceAllElements method cannot be bound. - * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 10200011 - The replaceAllElements method cannot be bound. + * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -139,8 +139,8 @@ declare class ArrayList { * @param arrlist (Optional) The arraylist object to which the current element belongs. * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value - * @throws {ContainerBindError}: The forEach method cannot be bound. - * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 10200011 - The forEach method cannot be bound. + * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -155,8 +155,8 @@ declare class ArrayList { * @param firstValue (Optional) previous element * @param secondValue (Optional) next elements * If this parameter is empty, it will default to ASCII sorting - * @throws {ContainerBindError}: The sort method cannot be bound. - * @throws {TypeError}: The type of "comparator" must be callable. Received value is: [comparator] + * @throws { BusinessError } 10200011 - The sort method cannot be bound. + * @throws { BusinessError } 401 - The type of "comparator" must be callable. Received value is: [comparator] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -165,11 +165,11 @@ declare class ArrayList { * Returns a view of the portion of this arraylist between the specified fromIndex,inclusize,and toIndex,exclusive * @param fromIndex The starting position of the index, containing the value at that index position * @param toIndex the end of the index, excluding the value at that index - * @throws {ContainerBindError}: The subArrayList method cannot be bound. - * @throws {RangeError}: The value of "fromIndex" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [fromIndex] - * @throws {RangeError}: The value of "toIndex" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [toIndex] - * @throws {TypeError}: The type of "fromIndex" must be number. Received value is: [fromIndex] - * @throws {TypeError}: The type of "toIndex" must be number. Received value is: [toIndex] + * @throws { BusinessError } 10200011 - The subArrayList method cannot be bound. + * @throws { BusinessError } 10200001 - The value of "fromIndex" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [fromIndex] + * @throws { BusinessError } 10200001 - The value of "toIndex" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [toIndex] + * @throws { BusinessError } 401 - The type of "fromIndex" must be number. Received value is: [fromIndex] + * @throws { BusinessError } 401 - The type of "toIndex" must be number. Received value is: [toIndex] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -177,7 +177,7 @@ declare class ArrayList { /** * Removes all of the elements from this arraylist.The arraylist will * be empty after this call returns.length becomes 0 - * @throws {ContainerBindError}: The clear method cannot be bound. + * @throws { BusinessError } 10200011 - The clear method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -185,7 +185,7 @@ declare class ArrayList { /** * Returns a shallow copy of this instance. (The elements themselves are not copied.) * @return this arraylist instance - * @throws {ContainerBindError}: The clone method cannot be bound. + * @throws { BusinessError } 10200011 - The clone method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -193,7 +193,7 @@ declare class ArrayList { /** * returns the capacity of this arraylist * @return the number type - * @throws {ContainerBindError}: The getCapacity method cannot be bound. + * @throws { BusinessError } 10200011 - The getCapacity method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -201,7 +201,7 @@ declare class ArrayList { /** * convert arraylist to array * @return the Array type - * @throws {ContainerBindError}: The convertToArray method cannot be bound. + * @throws { BusinessError } 10200011 - The convertToArray method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -209,7 +209,7 @@ declare class ArrayList { /** * Determine whether arraylist is empty and whether there is an element * @return the boolean type - * @throws {ContainerBindError}: The isEmpty method cannot be bound. + * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -217,22 +217,22 @@ declare class ArrayList { /** * If the newCapacity provided by the user is greater than or equal to length, * change the capacity of the arraylist to newCapacity, otherwise the capacity will not be changed - * @throws {ContainerBindError}: The increaseCapacityTo method cannot be bound. - * @throws {TypeError}: The type of "newCapacity" must be number. Received value is: [newCapacity] + * @throws { BusinessError } 10200011 - The increaseCapacityTo method cannot be bound. + * @throws { BusinessError } 401 - The type of "newCapacity" must be number. Received value is: [newCapacity] * @since 8 * @syscap SystemCapability.Utils.Lang */ increaseCapacityTo(newCapacity: number): void; /** * Limit the capacity to the current length - * @throws {ContainerBindError}: The trimToCurrentLength method cannot be bound. + * @throws { BusinessError } 10200011 - The trimToCurrentLength method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ trimToCurrentLength(): void; /** * returns an iterator.Each item of the iterator is a Javascript Object - * @throws {ContainerBindError}: The Symbol.iterator method cannot be bound. + * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.Deque.d.ts b/api/@ohos.util.Deque.d.ts index 11a71336ac..3b5e4f2fe0 100644 --- a/api/@ohos.util.Deque.d.ts +++ b/api/@ohos.util.Deque.d.ts @@ -16,7 +16,7 @@ declare class Deque { /** * A constructor used to create a Deque object. - * @throws {NewTargetIsNullError}: The Deque's constructor cannot be directly invoked. + * @throws { BusinessError } 10200012 - The Deque's constructor cannot be directly invoked. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -30,7 +30,7 @@ declare class Deque { /** * Inserts an element into the deque header. * @param element to be appended to this deque - * @throws {ContainerBindError}: The insertFront method cannot be bound. + * @throws { BusinessError } 10200011 - The insertFront method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -38,7 +38,7 @@ declare class Deque { /** * Inserting an element at the end of a deque * @param element to be appended to this deque - * @throws {ContainerBindError}: The insertEnd method cannot be bound. + * @throws { BusinessError } 10200011 - The insertEnd method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -47,7 +47,7 @@ declare class Deque { * Check if deque contains the specified element * @param element element to be contained * @return the boolean type,if deque contains the specified element,return true,else return false - * @throws {ContainerBindError}: The has method cannot be bound. + * @throws { BusinessError } 10200011 - The has method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -55,7 +55,7 @@ declare class Deque { /** * Obtains the header element of a deque. * @return the T type - * @throws {ContainerBindError}: The getFirst method cannot be bound. + * @throws { BusinessError } 10200011 - The getFirst method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -63,7 +63,7 @@ declare class Deque { /** * Obtains the end element of a deque. * @return the T type - * @throws {ContainerBindError}: The getLast method cannot be bound. + * @throws { BusinessError } 10200011 - The getLast method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -71,7 +71,7 @@ declare class Deque { /** * Obtains the header element of a deque and delete the element. * @return the T type - * @throws {ContainerBindError}: The popFirst method cannot be bound. + * @throws { BusinessError } 10200011 - The popFirst method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -79,7 +79,7 @@ declare class Deque { /** * Obtains the end element of a deque and delete the element. * @return the T type - * @throws {ContainerBindError}: The popLast method cannot be bound. + * @throws { BusinessError } 10200011 - The popLast method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -92,8 +92,8 @@ declare class Deque { * @param deque (Optional) The deque object to which the current element belongs. * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value - * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] - * @throws {ContainerBindError}: The forEach method cannot be bound. + * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 10200011 - The forEach method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -101,7 +101,7 @@ declare class Deque { thisArg?: Object): void; /** * returns an iterator.Each item of the iterator is a Javascript Object - * @throws {ContainerBindError}: The Symbol.iterator method cannot be bound. + * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.HashMap.d.ts b/api/@ohos.util.HashMap.d.ts index e90c74aba7..d89d330946 100644 --- a/api/@ohos.util.HashMap.d.ts +++ b/api/@ohos.util.HashMap.d.ts @@ -16,7 +16,7 @@ declare class HashMap { /** * A constructor used to create a HashMap object. - * @throws {NewTargetIsNullError}: The HashMap's constructor cannot be directly invoked. + * @throws { BusinessError } 10200012 - The HashMap's constructor cannot be directly invoked. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -30,7 +30,7 @@ declare class HashMap { /** * Returns whether the Map object contains elements * @return the boolean type - * @throws {ContainerBindError}: The isEmpty method cannot be bound. + * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -39,7 +39,7 @@ declare class HashMap { * Returns whether a key is contained in this map * @param key need to determine whether to include the key * @return the boolean type - * @throws {ContainerBindError}: The hasKey method cannot be bound. + * @throws { BusinessError } 10200011 - The hasKey method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -48,7 +48,7 @@ declare class HashMap { * Returns whether a value is contained in this map * @param value need to determine whether to include the value * @return the boolean type - * @throws {ContainerBindError}: The hasValue method cannot be bound. + * @throws { BusinessError } 10200011 - The hasValue method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -57,7 +57,7 @@ declare class HashMap { * Returns a specified element in a Map object, or null if there is no corresponding element * @param key the index in HashMap * @return value or null - * @throws {ContainerBindError}: The get method cannot be bound. + * @throws { BusinessError } 10200011 - The get method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -65,8 +65,8 @@ declare class HashMap { /** * Adds all element groups in one map to another map * @param map the Map object to add members - * @throws {ContainerBindError}: The setAll method cannot be bound. - * @throws {TypeError}: The type of "map" must be HashMap. Received value is: [map] + * @throws { BusinessError } 10200011 - The setAll method cannot be bound. + * @throws { BusinessError } 401 - The type of "map" must be HashMap. Received value is: [map] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -76,8 +76,8 @@ declare class HashMap { * @param key Added or updated targets * @param value Added or updated value * @returns the map object after set - * @throws {ContainerBindError}: The set method cannot be bound. - * @throws {TypeError}: The type of "key" must be not null. Received value is: [key] + * @throws { BusinessError } 10200011 - The set method cannot be bound. + * @throws { BusinessError } 401 - The type of "key" must be not null. Received value is: [key] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -86,28 +86,28 @@ declare class HashMap { * Remove a specified element from a Map object * @param key Target to be deleted * @return Target mapped value - * @throws {ContainerBindError}: The remove method cannot be bound. + * @throws { BusinessError } 10200011 - The remove method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ remove(key: K): V; /** * Clear all element groups in the map - * @throws {ContainerBindError}: The clear method cannot be bound. + * @throws { BusinessError } 10200011 - The clear method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ clear(): void; /** * Returns a new Iterator object that contains the keys contained in this map - * @throws {ContainerBindError}: The keys method cannot be bound. + * @throws { BusinessError } 10200011 - The keys method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ keys(): IterableIterator; /** * Returns a new Iterator object that contains the values contained in this map - * @throws {ContainerBindError}: The values method cannot be bound. + * @throws { BusinessError } 10200011 - The values method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -117,7 +117,7 @@ declare class HashMap { * @param key Updated targets * @param newValue Updated the target mapped value * @returns the boolean type(Is there a target pointed to by the key) - * @throws {ContainerBindError}: The replace method cannot be bound. + * @throws { BusinessError } 10200011 - The replace method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -125,8 +125,8 @@ declare class HashMap { /** * Executes the given callback function once for each real key in the map. * It does not perform functions on deleted keys - * @throws {ContainerBindError}: The forEach method cannot be bound. - * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 10200011 - The forEach method cannot be bound. + * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -134,14 +134,14 @@ declare class HashMap { thisArg?: Object): void; /** * Returns a new Iterator object that contains the [key, value] pairs for each element in the Map object in insertion order - * @throws {ContainerBindError}: The entries method cannot be bound. + * @throws { BusinessError } 10200011 - The entries method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ entries(): IterableIterator<[K, V]>; /** * returns an iterator.Each item of the iterator is a Javascript Object - * @throws {ContainerBindError}: The Symbol.iterator method cannot be bound. + * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.HashSet.d.ts b/api/@ohos.util.HashSet.d.ts index 478bb206b5..8efc3a7d5b 100644 --- a/api/@ohos.util.HashSet.d.ts +++ b/api/@ohos.util.HashSet.d.ts @@ -16,7 +16,7 @@ declare class HashSet { /** * A constructor used to create a HashSet object. - * @throws {NewTargetIsNullError}: The HashSet's constructor cannot be directly invoked. + * @throws { BusinessError } 10200012 - The HashSet's constructor cannot be directly invoked. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -30,7 +30,7 @@ declare class HashSet { /** * Returns whether the Set object contains elements * @return the boolean type - * @throws {ContainerBindError}: The isEmpty method cannot be bound. + * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -39,8 +39,8 @@ declare class HashSet { * Returns whether the Set object contain s the elements * @param value need to determine whether to include the element * @return the boolean type - * @throws {ContainerBindError}: The has method cannot be bound. - * @throws {TypeError}: The type of "value" must be not null. Received value is: [value] + * @throws { BusinessError } 10200011 - The has method cannot be bound. + * @throws { BusinessError } 401 - The type of "value" must be not null. Received value is: [value] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -49,8 +49,8 @@ declare class HashSet { * If the set does not contain the element, the specified element is added * @param value Added element * @returns the boolean type(Is there contain this element) - * @throws {ContainerBindError}: The add method cannot be bound. - * @throws {TypeError}: The type of "value" must be not null. Received value is: [value] + * @throws { BusinessError } 10200011 - The add method cannot be bound. + * @throws { BusinessError } 401 - The type of "value" must be not null. Received value is: [value] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -59,23 +59,23 @@ declare class HashSet { * Remove a specified element from a Set object * @param value Target to be deleted * @return the boolean type(Is there contain this element) - * @throws {ContainerBindError}: The remove method cannot be bound. - * @throws {TypeError}: The type of "value" must be not null. Received value is: [value] + * @throws { BusinessError } 10200011 - The remove method cannot be bound. + * @throws { BusinessError } 401 - The type of "value" must be not null. Received value is: [value] * @since 8 * @syscap SystemCapability.Utils.Lang */ remove(value: T): boolean; /** * Clears all element groups in a set - * @throws {ContainerBindError}: The clear method cannot be bound. + * @throws { BusinessError } 10200011 - The clear method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ clear(): void; /** * Executes a provided function once for each value in the Set object. - * @throws {ContainerBindError}: The forEach method cannot be bound. - * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 10200011 - The forEach method cannot be bound. + * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -83,21 +83,21 @@ declare class HashSet { thisArg?: Object): void; /** * Returns a new Iterator object that contains the values contained in this set - * @throws {ContainerBindError}: The values method cannot be bound. + * @throws { BusinessError } 10200011 - The values method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ values(): IterableIterator; /** * Returns a new Iterator object that contains the [key, value] pairs for each element in the Set object in insertion order - * @throws {ContainerBindError}: The entries method cannot be bound. + * @throws { BusinessError } 10200011 - The entries method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ entries(): IterableIterator<[T, T]>; /** * returns an iterator.Each item of the iterator is a Javascript Object - * @throws {ContainerBindError}: The Symbol.iterator method cannot be bound. + * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.LightWeightMap.d.ts b/api/@ohos.util.LightWeightMap.d.ts index b542d80b50..5090b2ffcf 100644 --- a/api/@ohos.util.LightWeightMap.d.ts +++ b/api/@ohos.util.LightWeightMap.d.ts @@ -16,7 +16,7 @@ declare class LightWeightMap { /** * A constructor used to create a LightWeightMap object. - * @throws {NewTargetIsNullError}: The LightWeightMap's constructor cannot be directly invoked. + * @throws { BusinessError } 10200012 - The LightWeightMap's constructor cannot be directly invoked. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -31,8 +31,8 @@ declare class LightWeightMap { * Returns whether this map has all the object in a specified map * @param map the Map object to compare * @return the boolean type - * @throws {TypeError}: The type of "map" must be LightWeightMap. Received value is: [map] - * @throws {ContainerBindError}: The hasAll method cannot be bound. + * @throws { BusinessError } 401 - The type of "map" must be LightWeightMap. Received value is: [map] + * @throws { BusinessError } 10200011 - The hasAll method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -41,7 +41,7 @@ declare class LightWeightMap { * Returns whether a key is contained in this map * @param key need to determine whether to include the key * @return the boolean type - * @throws {ContainerBindError}: The hasKey method cannot be bound. + * @throws { BusinessError } 10200011 - The hasKey method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -50,7 +50,7 @@ declare class LightWeightMap { * Returns whether a value is contained in this map * @param value need to determine whether to include the value * @return the boolean type - * @throws {ContainerBindError}: The hasValue method cannot be bound. + * @throws { BusinessError } 10200011 - The hasValue method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -59,15 +59,15 @@ declare class LightWeightMap { * Ensures that the capacity of an LightWeightMap container is greater than or equal to a apecified value, * and that the container has all the original objects after capacity expansion * @param minimumCapacity Minimum capacity to be reserved - * @throws {ContainerBindError}: The increaseCapacityTo method cannot be bound. - * @throws {TypeError}: The type of "minimumCapacity" must be number. Received value is: [minimumCapacity] + * @throws { BusinessError } 10200011 - The increaseCapacityTo method cannot be bound. + * @throws { BusinessError } 401 - The type of "minimumCapacity" must be number. Received value is: [minimumCapacity] * @since 8 * @syscap SystemCapability.Utils.Lang */ increaseCapacityTo(minimumCapacity: number): void; /** * Returns a new Iterator object that contains the [key, value] pairs for each element in the Map object in insertion order - * @throws {ContainerBindError}: The entries method cannot be bound. + * @throws { BusinessError } 10200011 - The entries method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -76,7 +76,7 @@ declare class LightWeightMap { * Returns the value to which the specified key is mapped, or undefined if this map contains no mapping for the key * @param key the index in LightWeightMap * @return value or undefined - * @throws {ContainerBindError}: The get method cannot be bound. + * @throws { BusinessError } 10200011 - The get method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -85,7 +85,7 @@ declare class LightWeightMap { * Obtains the index of the key equal to a specified key in an LightWeightMap container * @param key Looking for goals * @return Subscript corresponding to target - * @throws {ContainerBindError}: The getIndexOfKey method cannot be bound. + * @throws { BusinessError } 10200011 - The getIndexOfKey method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -94,7 +94,7 @@ declare class LightWeightMap { * Obtains the index of the value equal to a specified value in an LightWeightMap container * @param value Looking for goals * @return Subscript corresponding to target - * @throws {ContainerBindError}: The getIndexOfValue method cannot be bound. + * @throws { BusinessError } 10200011 - The getIndexOfValue method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -102,7 +102,7 @@ declare class LightWeightMap { /** * Returns whether the Map object contains elements * @return the boolean type - * @throws {ContainerBindError}: The isEmpty method cannot be bound. + * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -111,16 +111,16 @@ declare class LightWeightMap { * Obtains the key at the loaction identified by index in an LightWeightMap container * @param index Target subscript for search * @return the key of key-value pairs - * @throws {ContainerBindError}: The getKeyAt method cannot be bound. - * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] - * @throws {TypeError}: The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200011 - The getKeyAt method cannot be bound. + * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] + * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ getKeyAt(index: number): K; /** * Obtains a ES6 iterator that contains all the keys of an LightWeightMap container - * @throws {ContainerBindError}: The keys method cannot be bound. + * @throws { BusinessError } 10200011 - The keys method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -128,8 +128,8 @@ declare class LightWeightMap { /** * Adds all element groups in one map to another map * @param map the Map object to add members - * @throws {ContainerBindError}: The setAll method cannot be bound. - * @throws {TypeError}: The type of "map" must be LightWeightMap. Received value is: [map] + * @throws { BusinessError } 10200011 - The setAll method cannot be bound. + * @throws { BusinessError } 401 - The type of "map" must be LightWeightMap. Received value is: [map] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -139,7 +139,7 @@ declare class LightWeightMap { * @param key Added or updated targets * @param value Added or updated value * @returns the map object after set - * @throws {ContainerBindError}: The set method cannot be bound. + * @throws { BusinessError } 10200011 - The set method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -148,7 +148,7 @@ declare class LightWeightMap { * Remove the mapping for this key from this map if present * @param key Target to be deleted * @return Target mapped value - * @throws {ContainerBindError}: The remove method cannot be bound. + * @throws { BusinessError } 10200011 - The remove method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -157,8 +157,8 @@ declare class LightWeightMap { * Deletes a key-value pair at the loaction identified by index from an LightWeightMap container * @param index Target subscript for search * @return the boolean type(Is there a delete value) - * @throws {ContainerBindError}: The removeAt method cannot be bound. - * @throws {TypeError}: The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200011 - The removeAt method cannot be bound. + * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -166,7 +166,7 @@ declare class LightWeightMap { /** * Removes all of the mapping from this map * The map will be empty after this call returns - * @throws {ContainerBindError}: The clear method cannot be bound. + * @throws { BusinessError } 10200011 - The clear method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -176,9 +176,9 @@ declare class LightWeightMap { * @param index Target subscript for search * @param value Updated the target mapped value * @return the boolean type(Is there a value corresponding to the subscript) - * @throws {ContainerBindError}: The setValueAt method cannot be bound. - * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] - * @throws {TypeError}: The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200011 - The setValueAt method cannot be bound. + * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] + * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -186,8 +186,8 @@ declare class LightWeightMap { /** * Executes the given callback function once for each real key in the map. * It does not perform functions on deleted keys - * @throws {ContainerBindError}: The forEach method cannot be bound. - * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 10200011 - The forEach method cannot be bound. + * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -195,14 +195,14 @@ declare class LightWeightMap { thisArg?: Object): void; /** * returns an ES6 iterator.Each item of the iterator is a Javascript Object - * @throws {ContainerBindError}: The Symbol.iterator method cannot be bound. + * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ [Symbol.iterator](): IterableIterator<[K, V]>; /** * Obtains a string that contains all the keys and values in an LightWeightMap container - * @throws {ContainerBindError}: The toString method cannot be bound. + * @throws { BusinessError } 10200011 - The toString method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -211,16 +211,16 @@ declare class LightWeightMap { * Obtains the value identified by index in an LightWeightMap container * @param index Target subscript for search * @return the value of key-value pairs - * @throws {ContainerBindError}: The getValueAt method cannot be bound. - * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] - * @throws {TypeError}: The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200011 - The getValueAt method cannot be bound. + * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] + * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ getValueAt(index: number): V; /** * Returns an iterator of the values contained in this map - * @throws {ContainerBindError}: The values method cannot be bound. + * @throws { BusinessError } 10200011 - The values method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.LightWeightSet.d.ts b/api/@ohos.util.LightWeightSet.d.ts index 7c8dc838b0..1ea28f53e0 100644 --- a/api/@ohos.util.LightWeightSet.d.ts +++ b/api/@ohos.util.LightWeightSet.d.ts @@ -16,7 +16,7 @@ declare class LightWeightSet { /** * A constructor used to create a LightWeightSet object. - * @throws {NewTargetIsNullError}: The LightWeightSet's constructor cannot be directly invoked. + * @throws { BusinessError } 10200012 - The LightWeightSet's constructor cannot be directly invoked. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -31,7 +31,7 @@ declare class LightWeightSet { * If the set does not contain the element, the specified element is added * @param value Added element * @returns the boolean type(Is there contain this element) - * @throws {ContainerBindError}: The add method cannot be bound. + * @throws { BusinessError } 10200011 - The add method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -40,8 +40,8 @@ declare class LightWeightSet { * Adds all the objects in a specified LightWeightSet container to the current LightWeightSet container * @param set the Set object to provide the added element * @returns the boolean type(Is there any new data added successfully) - * @throws {ContainerBindError}: The addAll method cannot be bound. - * @throws {TypeError}: The type of "set" must be LightWeightSet. Received value is: [set] + * @throws { BusinessError } 10200011 - The addAll method cannot be bound. + * @throws { BusinessError } 401 - The type of "set" must be LightWeightSet. Received value is: [set] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -50,8 +50,8 @@ declare class LightWeightSet { * Returns whether this set has all the object in a specified set * @param set the Set object to compare * @return the boolean type - * @throws {ContainerBindError}: The hasAll method cannot be bound. - * @throws {TypeError}: The type of "set" must be LightWeightSet. Received value is: [set] + * @throws { BusinessError } 10200011 - The hasAll method cannot be bound. + * @throws { BusinessError } 401 - The type of "set" must be LightWeightSet. Received value is: [set] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -60,7 +60,7 @@ declare class LightWeightSet { * Checks whether an LightWeightSet container has a specified key * @param key need to determine whether to include the key * @return the boolean type - * @throws {ContainerBindError}: The has method cannot be bound. + * @throws { BusinessError } 10200011 - The has method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -69,7 +69,7 @@ declare class LightWeightSet { * Checks whether an the objects of an LightWeighSet containeer are of the same type as a specified Object LightWeightSet * @param obj need to determine whether to include the obj * @return the boolean type - * @throws {ContainerBindError}: The equal method cannot be bound. + * @throws { BusinessError } 10200011 - The equal method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -78,9 +78,9 @@ declare class LightWeightSet { * Ensures that the capacity of an LightWeightSet container is greater than or equal to a apecified value, * and that the container has all the original objects after capacity expansion * @param minimumCapacity Minimum capacity to be reserved - * @throws {ContainerBindError}: The increaseCapacityTo method cannot be bound. - * @throws {TypeError}: The type of "minimumCapacity" must be number. Received value is: [minimumCapacity] - * @throws {RangeError}: The value of "minimumCapacity" is out of range. It must be > [currentCapacity]. Received value is: [minimumCapacity] + * @throws { BusinessError } 10200011 - The increaseCapacityTo method cannot be bound. + * @throws { BusinessError } 401 - The type of "minimumCapacity" must be number. Received value is: [minimumCapacity] + * @throws { BusinessError } 10200001 - The value of "minimumCapacity" is out of range. It must be > [currentCapacity]. Received value is: [minimumCapacity] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -89,7 +89,7 @@ declare class LightWeightSet { * Obtains the index of s key of a specified Object type in an LightWeightSet container * @param key Looking for goals * @return Subscript corresponding to target - * @throws {ContainerBindError}: The getIndexOf method cannot be bound. + * @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -98,7 +98,7 @@ declare class LightWeightSet { * Deletes an object of a specified Object type from an LightWeightSet container * @param key Target to be deleted * @return Target element - * @throws {ContainerBindError}: The remove method cannot be bound. + * @throws { BusinessError } 10200011 - The remove method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -107,8 +107,8 @@ declare class LightWeightSet { * Deletes an object at the loaction identified by index from an LightWeightSet container * @param index Target subscript for search * @return the boolean type(Is there a delete value) - * @throws {ContainerBindError}: The removeAt method cannot be bound. - * @throws {TypeError}: The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200011 - The removeAt method cannot be bound. + * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -116,7 +116,7 @@ declare class LightWeightSet { /** * Removes all of the mapping from this map * The map will be empty after this call returns - * @throws {ContainerBindError}: The clear method cannot be bound. + * @throws { BusinessError } 10200011 - The clear method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -124,8 +124,8 @@ declare class LightWeightSet { /** * Executes the given callback function once for each real key in the map. * It does not perform functions on deleted keys - * @throws {ContainerBindError}: The forEach method cannot be bound. - * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 10200011 - The forEach method cannot be bound. + * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -133,7 +133,7 @@ declare class LightWeightSet { thisArg?: Object): void; /** * returns an ES6 iterator.Each item of the iterator is a Javascript Object - * @throws {ContainerBindError}: The Symbol.iterator method cannot be bound. + * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -146,7 +146,7 @@ declare class LightWeightSet { toString(): String; /** * Obtains an Array that contains all the objects of an LightWeightSet container. - * @throws {ContainerBindError}: The toArray method cannot be bound. + * @throws { BusinessError } 10200011 - The toArray method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -155,29 +155,29 @@ declare class LightWeightSet { * Obtains the object at the location identified by index in an LightWeightSet container * @param index Target subscript for search * @return the value of key-value pairs - * @throws {ContainerBindError}: The getValueAt method cannot be bound. - * @throws {TypeError}: The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200011 - The getValueAt method cannot be bound. + * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ getValueAt(index: number): T; /** * Returns a ES6 iterator of the values contained in this Set - * @throws {ContainerBindError}: The values method cannot be bound. + * @throws { BusinessError } 10200011 - The values method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ values(): IterableIterator; /** * Returns a Iterator object that contains the [key, value] pairs for each element in the Set object in insertion order - * @throws {ContainerBindError}: The entries method cannot be bound. + * @throws { BusinessError } 10200011 - The entries method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ entries(): IterableIterator<[T, T]>; /** * Returns whether the set object contains elements - * @throws {ContainerBindError}: The isEmpty method cannot be bound. + * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.LinkedList.d.ts b/api/@ohos.util.LinkedList.d.ts index e6166e5a26..6c6bd9df94 100644 --- a/api/@ohos.util.LinkedList.d.ts +++ b/api/@ohos.util.LinkedList.d.ts @@ -16,7 +16,7 @@ declare class LinkedList { /** * A constructor used to create a LinkedList object. - * @throws {NewTargetIsNullError}: The LinkedList's constructor cannot be directly invoked. + * @throws { BusinessError } 10200012 - The LinkedList's constructor cannot be directly invoked. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -31,7 +31,7 @@ declare class LinkedList { * Appends the specified element to the end of this linkedlist. * @param element to be appended to this linkedlist * @returns the boolean type, returns true if the addition is successful, and returns false if it fails. - * @throws {ContainerBindError}: The add method cannot be bound. + * @throws { BusinessError } 10200011 - The add method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -40,9 +40,9 @@ declare class LinkedList { * Inserts the specified element at the specified position in this linkedlist. * @param index index at which the specified element is to be inserted * @param element element to be inserted - * @throws {ContainerBindError}: The insert method cannot be bound. - * @throws {TypeError}: The type of "index" must be number. Received value is: [index] - * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length]. Received value is: [index] + * @throws { BusinessError } 10200011 - The insert method cannot be bound. + * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length]. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -52,8 +52,8 @@ declare class LinkedList { * or returns undefined if this linkedlist is empty * @param index specified position * @return the T type - * @throws {ContainerBindError}: The get method cannot be bound. - * @throws {TypeError}: The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200011 - The get method cannot be bound. + * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -61,7 +61,7 @@ declare class LinkedList { /** * Inserts the specified element at the beginning of this LinkedList. * @param element the element to add - * @throws {ContainerBindError}: The addFirst method cannot be bound. + * @throws { BusinessError } 10200011 - The addFirst method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -69,8 +69,8 @@ declare class LinkedList { /** * Retrieves and removes the head (first element) of this linkedlist. * @return the head of this list - * @throws {ContainerBindError}: The removeFirst method cannot be bound. - * @throws {ContainerIsEmptyError} Container is Empty. + * @throws { BusinessError } 10200011 - The removeFirst method cannot be bound. + * @throws { BusinessError } 10200010 - Container is Empty. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -78,8 +78,8 @@ declare class LinkedList { /** * Removes and returns the last element from this linkedlist. * @return the head of this list - * @throws {ContainerBindError}: The removeLast method cannot be bound. - * @throws {ContainerIsEmptyError} Container is Empty. + * @throws { BusinessError } 10200011 - The removeLast method cannot be bound. + * @throws { BusinessError } 10200010 - Container is Empty. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -88,7 +88,7 @@ declare class LinkedList { * Check if linkedlist contains the specified element * @param element element to be contained * @return the boolean type,if linkedList contains the specified element,return true,else return false - * @throws {ContainerBindError}: The has method cannot be bound. + * @throws { BusinessError } 10200011 - The has method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -98,7 +98,7 @@ declare class LinkedList { * in this linkedlist, or -1 if this linkedlist does not contain the element. * @param element element to be contained * @return the number type ,returns the lowest index such that or -1 if there is no such index. - * @throws {ContainerBindError}: The getIndexOf method cannot be bound. + * @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -108,9 +108,9 @@ declare class LinkedList { * @param index the index in the linkedlist * @return the T type ,returns undefined if linkedlist is empty,If the index is * out of bounds (greater than or equal to length or less than 0), throw an exception - * @throws {ContainerBindError}: The removeByIndex method cannot be bound. - * @throws {TypeError}: The type of "index" must be number. Received value is: [index] - * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] + * @throws { BusinessError } 10200011 - The removeByIndex method cannot be bound. + * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -121,7 +121,7 @@ declare class LinkedList { * unchanged. More formally, removes the element with the lowest index * @param element element to remove * @return the boolean type ,If there is no such element, return false - * @throws {ContainerBindError}: The remove method cannot be bound. + * @throws { BusinessError } 10200011 - The remove method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -132,8 +132,8 @@ declare class LinkedList { * unchanged. More formally, removes the element with the lowest index * @param element element to remove * @return the boolean type ,If there is no such element, return false - * @throws {ContainerBindError}: The removeFirstFound method cannot be bound. - * @throws {ContainerIsEmptyError} Container is Empty. + * @throws { BusinessError } 10200011 - The removeFirstFound method cannot be bound. + * @throws { BusinessError } 10200010 - Container is Empty. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -144,8 +144,8 @@ declare class LinkedList { * unchanged. More formally, removes the element with the lowest index * @param element element to remove * @return the boolean type ,If there is no such element, return false - * @throws {ContainerBindError}: The removeLastFound method cannot be bound. - * @throws {ContainerIsEmptyError} Container is Empty. + * @throws { BusinessError } 10200011 - The removeLastFound method cannot be bound. + * @throws { BusinessError } 10200010 - Container is Empty. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -155,7 +155,7 @@ declare class LinkedList { * or -1 if the linkedlist does not contain the element. * @param element element to find * @return the number type - * @throws {ContainerBindError}: The getLastIndexOf method cannot be bound. + * @throws { BusinessError } 10200011 - The getLastIndexOf method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -164,7 +164,7 @@ declare class LinkedList { * Returns the first element (the item at index 0) of this linkedlist. * or returns undefined if linkedlist is empty * @return the T type ,returns undefined if linkedList is empty - * @throws {ContainerBindError}: The getFirst method cannot be bound. + * @throws { BusinessError } 10200011 - The getFirst method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -173,7 +173,7 @@ declare class LinkedList { * Returns the Last element (the item at index length-1) of this linkedlist. * or returns undefined if linkedlist is empty * @return the T type ,returns undefined if linkedList is empty - * @throws {ContainerBindError}: The getLast method cannot be bound. + * @throws { BusinessError } 10200011 - The getLast method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -183,9 +183,9 @@ declare class LinkedList { * @param element replaced element * @param index index to find * @return the T type ,returns undefined if linkedList is empty - * @throws {ContainerBindError}: The set method cannot be bound. - * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] - * @throws {TypeError}: The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200011 - The set method cannot be bound. + * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] + * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -199,8 +199,8 @@ declare class LinkedList { * @param LinkedList (Optional) The linkedlist object to which the current element belongs. * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value - * @throws {ContainerBindError}: The forEach method cannot be bound. - * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 10200011 - The forEach method cannot be bound. + * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -209,7 +209,7 @@ declare class LinkedList { /** * Removes all of the elements from this linkedlist.The linkedlist will * be empty after this call returns.length becomes 0 - * @throws {ContainerBindError}: The clear method cannot be bound. + * @throws { BusinessError } 10200011 - The clear method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -217,7 +217,7 @@ declare class LinkedList { /** * Returns a shallow copy of this instance. (The elements themselves are not copied.) * @return this linkedlist instance - * @throws {ContainerBindError}: The clone method cannot be bound. + * @throws { BusinessError } 10200011 - The clone method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -225,14 +225,14 @@ declare class LinkedList { /** * convert linkedlist to array * @return the Array type - * @throws {ContainerBindError}: The convertToArray method cannot be bound. + * @throws { BusinessError } 10200011 - The convertToArray method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ convertToArray(): Array; /** * returns an iterator.Each item of the iterator is a Javascript Object - * @throws {ContainerBindError}: The Symbol.iterator method cannot be bound. + * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.List.d.ts b/api/@ohos.util.List.d.ts index 24822675c3..ef439cb8e6 100644 --- a/api/@ohos.util.List.d.ts +++ b/api/@ohos.util.List.d.ts @@ -16,7 +16,7 @@ declare class List { /** * A constructor used to create a List object. - * @throws {NewTargetIsNullError}: The List's constructor cannot be directly invoked. + * @throws { BusinessError } 10200012 - The List's constructor cannot be directly invoked. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -31,7 +31,7 @@ declare class List { * Appends the specified element to the end of this list. * @param element to be appended to this list * @returns the boolean type, returns true if the addition is successful, and returns false if it fails. - * @throws {ContainerBindError}: The add method cannot be bound. + * @throws { BusinessError } 10200011 - The add method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -40,9 +40,9 @@ declare class List { * Inserts the specified element at the specified position in this list. * @param index index at which the specified element is to be inserted * @param element element to be inserted - * @throws {ContainerBindError}: The insert method cannot be bound. - * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length]. Received value is: [index] - * @throws {TypeError}: The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200011 - The insert method cannot be bound. + * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length]. Received value is: [index] + * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -52,8 +52,8 @@ declare class List { * or returns undefined if this list is empty * @param index specified position * @return the T type - * @throws {ContainerBindError}: The get method cannot be bound. - * @throws {TypeError}: The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200011 - The get method cannot be bound. + * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -62,7 +62,7 @@ declare class List { * Check if list contains the specified element * @param element element to be contained * @return the boolean type,if list contains the specified element,return true,else return false - * @throws {ContainerBindError}: The has method cannot be bound. + * @throws { BusinessError } 10200011 - The has method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -72,7 +72,7 @@ declare class List { * in this list, or -1 if this list does not contain the element. * @param element element to be contained * @return the number type ,returns the lowest index such that or -1 if there is no such index. - * @throws {ContainerBindError}: The getIndexOf method cannot be bound. + * @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -82,9 +82,9 @@ declare class List { * @param index the index in the list * @return the T type ,returns undefined if list is empty,If the index is * out of bounds (greater than or equal to length or less than 0), throw an exception - * @throws {ContainerBindError}: The removeByIndex method cannot be bound. - * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] - * @throws {TypeError}: The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200011 - The removeByIndex method cannot be bound. + * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] + * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -95,7 +95,7 @@ declare class List { * unchanged. More formally, removes the element with the lowest index * @param element element to remove * @return the boolean type ,If there is no such element, return false - * @throws {ContainerBindError}: The remove method cannot be bound. + * @throws { BusinessError } 10200011 - The remove method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -105,7 +105,7 @@ declare class List { * or -1 if the list does not contain the element. * @param element element to find * @return the number type - * @throws {ContainerBindError}: The getLastIndexOf method cannot be bound. + * @throws { BusinessError } 10200011 - The getLastIndexOf method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -114,7 +114,7 @@ declare class List { * Returns the first element (the item at index 0) of this list. * or returns undefined if list is empty * @return the T type ,returns undefined if list is empty - * @throws {ContainerBindError}: The getFirst method cannot be bound. + * @throws { BusinessError } 10200011 - The getFirst method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -123,7 +123,7 @@ declare class List { * Returns the Last element (the item at index length-1) of this list. * or returns undefined if list is empty * @return the T type ,returns undefined if list is empty - * @throws {ContainerBindError}: The getLast method cannot be bound. + * @throws { BusinessError } 10200011 - The getLast method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -133,9 +133,9 @@ declare class List { * @param element replaced element * @param index index to find * @return the T type - * @throws {ContainerBindError}: The set method cannot be bound. - * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] - * @throws {TypeError}: The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200011 - The set method cannot be bound. + * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] + * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -145,7 +145,7 @@ declare class List { * return true, otherwise return false. * @param obj Compare objects * @return the boolean type - * @throws {ContainerBindError}: The equal method cannot be bound. + * @throws { BusinessError } 10200011 - The equal method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -159,8 +159,8 @@ declare class List { * @param List (Optional) The list object to which the current element belongs. * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value - * @throws {ContainerBindError}: The forEach method cannot be bound. - * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 10200011 - The forEach method cannot be bound. + * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -174,8 +174,8 @@ declare class List { * minus firstValue, it returns an list sorted in descending order; * @param firstValue (Optional) previous element * @param secondValue (Optional) next elements - * @throws {TypeError}: The type of "comparator" must be callable. Received value is: [comparator] - * @throws {ContainerBindError}: The sort method cannot be bound. + * @throws { BusinessError } 401 - The type of "comparator" must be callable. Received value is: [comparator] + * @throws { BusinessError } 10200011 - The sort method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -183,7 +183,7 @@ declare class List { /** * Removes all of the elements from this list.The list will * be empty after this call returns.length becomes 0 - * @throws {ContainerBindError}: The clear method cannot be bound. + * @throws { BusinessError } 10200011 - The clear method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -192,11 +192,11 @@ declare class List { * Returns a view of the portion of this list between the specified fromIndex,inclusize,and toIndex,exclusive * @param fromIndex The starting position of the index, containing the value at that index position * @param toIndex the end of the index, excluding the value at that index - * @throws {ContainerBindError}: The getSubList method cannot be bound. - * @throws {RangeError}: The value of "fromIndex" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [fromIndex] - * @throws {RangeError}: The value of "toIndex" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [toIndex] - * @throws {TypeError}: The type of "fromIndex" must be number. Received value is: [fromIndex] - * @throws {TypeError}: The type of "toIndex" must be number. Received value is: [toIndex] + * @throws { BusinessError } 10200011 - The getSubList method cannot be bound. + * @throws { BusinessError } 10200001 - The value of "fromIndex" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [fromIndex] + * @throws { BusinessError } 10200001 - The value of "toIndex" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [toIndex] + * @throws { BusinessError } 401 - The type of "fromIndex" must be number. Received value is: [fromIndex] + * @throws { BusinessError } 401 - The type of "toIndex" must be number. Received value is: [toIndex] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -210,8 +210,8 @@ declare class List { * @param list (Optional) The list object to which the current element belongs. * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value - * @throws {ContainerBindError}: The replaceAllElements method cannot be bound. - * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 10200011 - The replaceAllElements method cannot be bound. + * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -220,7 +220,7 @@ declare class List { /** * convert list to array * @return the Array type - * @throws {ContainerBindError}: The convertToArray method cannot be bound. + * @throws { BusinessError } 10200011 - The convertToArray method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -228,14 +228,14 @@ declare class List { /** * Determine whether list is empty and whether there is an element * @return the boolean type - * @throws {ContainerBindError}: The isEmpty method cannot be bound. + * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ isEmpty(): boolean; /** * returns an iterator.Each item of the iterator is a Javascript Object - * @throws {ContainerBindError}: The Symbol.iterator method cannot be bound. + * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.PlainArray.d.ts b/api/@ohos.util.PlainArray.d.ts index cc9e9622a4..bc4d455752 100644 --- a/api/@ohos.util.PlainArray.d.ts +++ b/api/@ohos.util.PlainArray.d.ts @@ -16,7 +16,7 @@ declare class PlainArray { /** * A constructor used to create a PlainArray object. - * @throws {NewTargetIsNullError}: The PlainArray's constructor cannot be directly invoked. + * @throws { BusinessError } 10200012 - The PlainArray's constructor cannot be directly invoked. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -31,22 +31,22 @@ declare class PlainArray { * Appends a key-value pair to PlainArray * @param key Added the key of key-value * @param value Added the value of key-value - * @throws {ContainerBindError}: The add method cannot be bound. - * @throws {TypeError}: The type of "key" must be number. Received value is: [key] + * @throws { BusinessError } 10200011 - The add method cannot be bound. + * @throws { BusinessError } 401 - The type of "key" must be number. Received value is: [key] * @since 8 * @syscap SystemCapability.Utils.Lang */ add(key: number, value: T): void; /** * Clears the current PlainArray object - * @throws {ContainerBindError}: The clear method cannot be bound. + * @throws { BusinessError } 10200011 - The clear method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ clear(): void; /** * Obtains a clone of the current PlainArray object - * @throws {ContainerBindError}: The clone method cannot be bound. + * @throws { BusinessError } 10200011 - The clone method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -55,8 +55,8 @@ declare class PlainArray { * Checks whether the current PlainArray object contains the specified key * @param key need to determine whether to include the key * @return the boolean type - * @throws {ContainerBindError}: The has method cannot be bound. - * @throws {TypeError}: The type of "key" must be number. Received value is: [key] + * @throws { BusinessError } 10200011 - The has method cannot be bound. + * @throws { BusinessError } 401 - The type of "key" must be number. Received value is: [key] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -65,8 +65,8 @@ declare class PlainArray { * Queries the value associated with the specified key * @param key Looking for goals * @return the value of key-value pairs - * @throws {ContainerBindError}: The get method cannot be bound. - * @throws {TypeError}: The type of "key" must be number. Received value is: [key] + * @throws { BusinessError } 10200011 - The get method cannot be bound. + * @throws { BusinessError } 401 - The type of "key" must be number. Received value is: [key] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -75,8 +75,8 @@ declare class PlainArray { * Queries the index for a specified key * @param key Looking for goals * @return Subscript corresponding to target - * @throws {ContainerBindError}: The getIndexOfKey method cannot be bound. - * @throws {TypeError}: The type of "key" must be number. Received value is: [key] + * @throws { BusinessError } 10200011 - The getIndexOfKey method cannot be bound. + * @throws { BusinessError } 401 - The type of "key" must be number. Received value is: [key] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -85,7 +85,7 @@ declare class PlainArray { * Queries the index for a specified value * @param value Looking for goals * @return Subscript corresponding to target - * @throws {ContainerBindError}: The getIndexOfValue method cannot be bound. + * @throws { BusinessError } 10200011 - The getIndexOfValue method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -93,7 +93,7 @@ declare class PlainArray { /** * Checks whether the current PlainArray object is empty * @return the boolean type - * @throws {ContainerBindError}: The isEmpty method cannot be bound. + * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -102,8 +102,8 @@ declare class PlainArray { * Queries the key at a specified index * @param index Target subscript for search * @return the key of key-value pairs - * @throws {ContainerBindError}: The getKeyAt method cannot be bound. - * @throws {TypeError}: The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200011 - The getKeyAt method cannot be bound. + * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -112,8 +112,8 @@ declare class PlainArray { * Remove the key-value pair based on a specified key if it exists and return the value * @param key Target to be deleted * @return Target mapped value - * @throws {ContainerBindError}: The remove method cannot be bound. - * @throws {TypeError}: The type of "key" must be number. Received value is: [key] + * @throws { BusinessError } 10200011 - The remove method cannot be bound. + * @throws { BusinessError } 401 - The type of "key" must be number. Received value is: [key] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -122,8 +122,8 @@ declare class PlainArray { * Remove the key-value pair at a specified index if it exists and return the value * @param index Target subscript for search * @return the T type - * @throws {ContainerBindError}: The removeAt method cannot be bound. - * @throws {TypeError}: The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200011 - The removeAt method cannot be bound. + * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -133,9 +133,9 @@ declare class PlainArray { * @param index remove start index * @param size Expected deletion quantity * @return Actual deleted quantity - * @throws {ContainerBindError}: The removeRangeFrom method cannot be bound. - * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] - * @throws {TypeError}: The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200011 - The removeRangeFrom method cannot be bound. + * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] + * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -144,16 +144,16 @@ declare class PlainArray { * Update value on specified index * @param index Target subscript for search * @param value Updated the target mapped value - * @throws {ContainerBindError}: The setValueAt method cannot be bound. - * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] - * @throws {TypeError}: The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200011 - The setValueAt method cannot be bound. + * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] + * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ setValueAt(index: number, value: T): void; /** * Obtains the string representation of the PlainArray object - * @throws {ContainerBindError}: The toString method cannot be bound. + * @throws { BusinessError } 10200011 - The toString method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -162,17 +162,17 @@ declare class PlainArray { * Queries the value at a specified index * @param index Target subscript for search * @return the value of key-value pairs - * @throws {ContainerBindError}: The getValueAt method cannot be bound. - * @throws {RangeError}: The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] - * @throws {TypeError}: The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200011 - The getValueAt method cannot be bound. + * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] + * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] * @since 8 * @syscap SystemCapability.Utils.Lang */ getValueAt(index: number): T; /** * Executes a provided function once for each value in the PlainArray object. - * @throws {ContainerBindError}: The forEach method cannot be bound. - * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 10200011 - The forEach method cannot be bound. + * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -180,7 +180,7 @@ declare class PlainArray { thisArg?: Object): void; /** * returns an iterator.Each item of the iterator is a Javascript Object - * @throws {ContainerBindError}: The Symbol.iterator method cannot be bound. + * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.Queue.d.ts b/api/@ohos.util.Queue.d.ts index 4711a01724..a605ba12f6 100644 --- a/api/@ohos.util.Queue.d.ts +++ b/api/@ohos.util.Queue.d.ts @@ -16,7 +16,7 @@ declare class Queue { /** * A constructor used to create a Queue object. - * @throws {NewTargetIsNullError}: The Queue's constructor cannot be directly invoked. + * @throws { BusinessError } 10200012 - The Queue's constructor cannot be directly invoked. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -32,7 +32,7 @@ declare class Queue { * so immediately without violating capacity restrictions. * @param element to be appended to this queue * @return the boolean type - * @throws {ContainerBindError}: The add method cannot be bound. + * @throws { BusinessError } 10200011 - The add method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -40,7 +40,7 @@ declare class Queue { /** * Obtains the header element of a queue. * @return the T type - * @throws {ContainerBindError}: The getFirst method cannot be bound. + * @throws { BusinessError } 10200011 - The getFirst method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -48,7 +48,7 @@ declare class Queue { /** * Retrieves and removes the head of this queue * @return the T type - * @throws {ContainerBindError}: The pop method cannot be bound. + * @throws { BusinessError } 10200011 - The pop method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -62,8 +62,8 @@ declare class Queue { * @param Queue (Optional) The queue object to which the current element belongs. * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value - * @throws {ContainerBindError}: The forEach method cannot be bound. - * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 10200011 - The forEach method cannot be bound. + * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -71,7 +71,7 @@ declare class Queue { thisArg?: Object): void; /** * returns an iterator.Each item of the iterator is a Javascript Object - * @throws {ContainerBindError}: The Symbol.iterator method cannot be bound. + * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.Stack.d.ts b/api/@ohos.util.Stack.d.ts index 3539b676be..811d1e10fe 100644 --- a/api/@ohos.util.Stack.d.ts +++ b/api/@ohos.util.Stack.d.ts @@ -16,7 +16,7 @@ declare class Stack { /** * A constructor used to create a Stack object. - * @throws {NewTargetIsNullError}: The Stack's constructor cannot be directly invoked. + * @throws { BusinessError } 10200012 - The Stack's constructor cannot be directly invoked. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -30,7 +30,7 @@ declare class Stack { /** * Tests if this stack is empty * @return the boolean type - * @throws {ContainerBindError}: The isEmpty method cannot be bound. + * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -39,7 +39,7 @@ declare class Stack { * Looks at the object at the top of this stack without removing it from the stack * Return undfined if this stack is empty * @return the top value or undefined - * @throws {ContainerBindError}: The peek method cannot be bound. + * @throws { BusinessError } 10200011 - The peek method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -48,7 +48,7 @@ declare class Stack { * Removes the object at the top of this stack and returns that object as the value of this function * an exception if the stack is empty * @returns Stack top value or undefined - * @throws {ContainerBindError}: The pop method cannot be bound. + * @throws { BusinessError } 10200011 - The pop method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -57,7 +57,7 @@ declare class Stack { * Pushes an item onto the top of this stack * @param item to be appended to this Stack * @returns the T type - * @throws {ContainerBindError}: The push method cannot be bound. + * @throws { BusinessError } 10200011 - The push method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -66,7 +66,7 @@ declare class Stack { * Returns the 1-based position where an object is on this stack * @param element Target to be deleted * @returns the T type,If there is no such element, return -1 - * @throws {ContainerBindError}: The locate method cannot be bound. + * @throws { BusinessError } 10200011 - The locate method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -80,8 +80,8 @@ declare class Stack { * @param stack (Optional) The Stack object to which the current element belongs. * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value - * @throws {ContainerBindError}: The forEach method cannot be bound. - * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 10200011 - The forEach method cannot be bound. + * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -89,7 +89,7 @@ declare class Stack { thisArg?: Object): void; /** * returns an ES6 iterator.Each item of the iterator is a Javascript Object - * @throws {ContainerBindError}: The Symbol.iterator method cannot be bound. + * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.TreeMap.d.ts b/api/@ohos.util.TreeMap.d.ts index 9bbc58ca6f..aebdd248c6 100644 --- a/api/@ohos.util.TreeMap.d.ts +++ b/api/@ohos.util.TreeMap.d.ts @@ -20,8 +20,8 @@ declare class TreeMap { * @param comparator (Optional) User-defined comparison functions * @param firstValue (Optional) previous element * @param secondValue (Optional) next element - * @throws {NewTargetIsNullError}: The TreeMap's constructor cannot be directly invoked. - * @throws {TypeError}: The type of "comparator" must be callable. Received value is: [comparator] + * @throws { BusinessError } 10200012 - The TreeMap's constructor cannot be directly invoked. + * @throws { BusinessError } 401 - The type of "comparator" must be callable. Received value is: [comparator] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -35,7 +35,7 @@ declare class TreeMap { /** * Returns whether the Map object contains elements * @return the boolean type - * @throws {ContainerBindError}: The isEmpty method cannot be bound. + * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -44,7 +44,7 @@ declare class TreeMap { * Returns whether a key is contained in this map * @param key need to determine whether to include the key * @return the boolean type - * @throws {ContainerBindError}: The hasKey method cannot be bound. + * @throws { BusinessError } 10200011 - The hasKey method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -53,7 +53,7 @@ declare class TreeMap { * Returns whether a value is contained in this map * @param value need to determine whether to include the value * @return the boolean type - * @throws {ContainerBindError}: The hasValue method cannot be bound. + * @throws { BusinessError } 10200011 - The hasValue method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -62,7 +62,7 @@ declare class TreeMap { * Returns a specified element in a Map object, or null if there is no corresponding element * @param key the index in TreeMap * @return value or null - * @throws {ContainerBindError}: The get method cannot be bound. + * @throws { BusinessError } 10200011 - The get method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -71,7 +71,7 @@ declare class TreeMap { * Obtains the first sorted key in the treemap. * Or returns undefined if tree map is empty * @return value or undefined - * @throws {ContainerBindError}: The getFirstKey method cannot be bound. + * @throws { BusinessError } 10200011 - The getFirstKey method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -80,7 +80,7 @@ declare class TreeMap { * Obtains the last sorted key in the treemap. * Or returns undefined if tree map is empty * @return value or undefined - * @throws {ContainerBindError}: The getLastKey method cannot be bound. + * @throws { BusinessError } 10200011 - The getLastKey method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -88,8 +88,8 @@ declare class TreeMap { /** * Adds all element groups in one map to another map * @param map the Map object to add members - * @throws {ContainerBindError}: The setAll method cannot be bound. - * @throws {TypeError}: The type of "map" must be TreeMap. Received value is: [map] + * @throws { BusinessError } 10200011 - The setAll method cannot be bound. + * @throws { BusinessError } 401 - The type of "map" must be TreeMap. Received value is: [map] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -99,8 +99,8 @@ declare class TreeMap { * @param key Added or updated targets * @param value Added or updated value * @returns the map object after set - * @throws {ContainerBindError}: The set method cannot be bound. - * @throws {TypeError}: The type of "key" must be not null. Received value is: [key] + * @throws { BusinessError } 10200011 - The set method cannot be bound. + * @throws { BusinessError } 401 - The type of "key" must be not null. Received value is: [key] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -108,7 +108,7 @@ declare class TreeMap { /** * Remove a specified element from a Map object * @param key Target to be deleted - * @throws {ContainerBindError}: The remove method cannot be bound. + * @throws { BusinessError } 10200011 - The remove method cannot be bound. * @return Target mapped value * @since 8 * @syscap SystemCapability.Utils.Lang @@ -116,7 +116,7 @@ declare class TreeMap { remove(key: K): V; /** * Clear all element groups in the map - * @throws {ContainerBindError}: The clear method cannot be bound. + * @throws { BusinessError } 10200011 - The clear method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -125,7 +125,7 @@ declare class TreeMap { * Returns the greatest element smaller than or equal to the specified key * if the key does not exist, undefied is returned * @param key Objective of comparison - * @throws {ContainerBindError}: The getLowerKey method cannot be bound. + * @throws { BusinessError } 10200011 - The getLowerKey method cannot be bound. * @return key or undefined * @since 8 * @syscap SystemCapability.Utils.Lang @@ -136,21 +136,21 @@ declare class TreeMap { * if the key does not exist, undefied is returned * @param key Objective of comparison * @return key or undefined - * @throws {ContainerBindError}: The getHigherKey method cannot be bound. + * @throws { BusinessError } 10200011 - The getHigherKey method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ getHigherKey(key: K): K; /** * Returns a new Iterator object that contains the keys contained in this map - * @throws {ContainerBindError}: The keys method cannot be bound. + * @throws { BusinessError } 10200011 - The keys method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ keys(): IterableIterator; /** * Returns a new Iterator object that contains the values contained in this map - * @throws {ContainerBindError}: The values method cannot be bound. + * @throws { BusinessError } 10200011 - The values method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -160,7 +160,7 @@ declare class TreeMap { * @param key Updated targets * @param value Updated the target mapped value * @returns the boolean type(Is there a target pointed to by the key) - * @throws {ContainerBindError}: The replace method cannot be bound. + * @throws { BusinessError } 10200011 - The replace method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -168,8 +168,8 @@ declare class TreeMap { /** * Executes the given callback function once for each real key in the map. * It does not perform functions on deleted keys - * @throws {ContainerBindError}: The forEach method cannot be bound. - * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 10200011 - The forEach method cannot be bound. + * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -177,14 +177,14 @@ declare class TreeMap { thisArg?: Object): void; /** * Returns a new Iterator object that contains the [key, value] pairs for each element in the Map object in insertion order - * @throws {ContainerBindError}: The entries method cannot be bound. + * @throws { BusinessError } 10200011 - The entries method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ entries(): IterableIterator<[K, V]>; /** * returns an ES6 iterator.Each item of the iterator is a Javascript Object - * @throws {ContainerBindError}: The Symbol.iterator method cannot be bound. + * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.TreeSet.d.ts b/api/@ohos.util.TreeSet.d.ts index eabec4bb9a..c1c9e26a1a 100644 --- a/api/@ohos.util.TreeSet.d.ts +++ b/api/@ohos.util.TreeSet.d.ts @@ -19,8 +19,8 @@ declare class TreeSet { * @param comparator (Optional) User-defined comparison functions * @param firstValue (Optional) previous element * @param secondValue (Optional) next element - * @throws {NewTargetIsNullError}: The TreeSet's constructor cannot be directly invoked. - * @throws {TypeError}: The type of "comparator" must be callable. Received value is: [comparator] + * @throws { BusinessError } 10200012 - The TreeSet's constructor cannot be directly invoked. + * @throws { BusinessError } 401 - The type of "comparator" must be callable. Received value is: [comparator] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -34,7 +34,7 @@ declare class TreeSet { /** * Returns whether the Set object contains elements * @return the boolean type - * @throws {ContainerBindError}: The isEmpty method cannot be bound. + * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -43,7 +43,7 @@ declare class TreeSet { * Returns whether the Set object contain s the elements * @param value need to determine whether to include the element * @return the boolean type - * @throws {ContainerBindError}: The has method cannot be bound. + * @throws { BusinessError } 10200011 - The has method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -52,8 +52,8 @@ declare class TreeSet { * If the set does not contain the element, the specified element is added * @param value Added element * @returns the boolean type(Is there contain this element) - * @throws {TypeError}: The type of "value" must be not null. Received value is: [value] - * @throws {ContainerBindError}: The add method cannot be bound. + * @throws { BusinessError } 401 - The type of "value" must be not null. Received value is: [value] + * @throws { BusinessError } 10200011 - The add method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -62,14 +62,14 @@ declare class TreeSet { * Remove a specified element from a Set object * @param value Target to be deleted * @return the boolean type(Is there contain this element) - * @throws {ContainerBindError}: The remove method cannot be bound. + * @throws { BusinessError } 10200011 - The remove method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ remove(value: T): boolean; /** * Clears all element groups in a set - * @throws {ContainerBindError}: The clear method cannot be bound. + * @throws { BusinessError } 10200011 - The clear method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -77,7 +77,7 @@ declare class TreeSet { /** * Gets the first elements in a set * @return value or undefined - * @throws {ContainerBindError}: The getFirstValue method cannot be bound. + * @throws { BusinessError } 10200011 - The getFirstValue method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -85,7 +85,7 @@ declare class TreeSet { /** * Gets the last elements in a set * @return value or undefined - * @throws {ContainerBindError}: The getLastValue method cannot be bound. + * @throws { BusinessError } 10200011 - The getLastValue method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -95,8 +95,8 @@ declare class TreeSet { * if the key does not exist, undefied is returned * @param key Objective of comparison * @return key or undefined - * @throws {ContainerBindError}: The getLowerValue method cannot be bound. - * @throws {TypeError}: The type of "key" must be not null. Received value is: [key] + * @throws { BusinessError } 10200011 - The getLowerValue method cannot be bound. + * @throws { BusinessError } 401 - The type of "key" must be not null. Received value is: [key] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -106,8 +106,8 @@ declare class TreeSet { * if the key does not exist, undefied is returned * @param key Objective of comparison * @return key or undefined - * @throws {ContainerBindError}: The getHigherValue method cannot be bound. - * @throws {TypeError}: The type of "key" must be not null. Received value is: [key] + * @throws { BusinessError } 10200011 - The getHigherValue method cannot be bound. + * @throws { BusinessError } 401 - The type of "key" must be not null. Received value is: [key] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -115,7 +115,7 @@ declare class TreeSet { /** * Return and delete the first element, returns undefined if tree set is empty * @return first value or undefined - * @throws {ContainerBindError}: The popFirst method cannot be bound. + * @throws { BusinessError } 10200011 - The popFirst method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -123,15 +123,15 @@ declare class TreeSet { /** * Return and delete the last element, returns undefined if tree set is empty * @return last value or undefined - * @throws {ContainerBindError}: The popLast method cannot be bound. + * @throws { BusinessError } 10200011 - The popLast method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ popLast(): T; /** * Executes a provided function once for each value in the Set object. - * @throws {ContainerBindError}: The forEach method cannot be bound. - * @throws {TypeError}: The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 10200011 - The forEach method cannot be bound. + * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -139,21 +139,21 @@ declare class TreeSet { thisArg?: Object): void; /** * Returns a new Iterator object that contains the values contained in this set - * @throws {ContainerBindError}: The values method cannot be bound. + * @throws { BusinessError } 10200011 - The values method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ values(): IterableIterator; /** * Returns a new Iterator object that contains the [key, value] pairs for each element in the Set object in insertion order - * @throws {ContainerBindError}: The entries method cannot be bound. + * @throws { BusinessError } 10200011 - The entries method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ entries(): IterableIterator<[T, T]>; /** * returns an ES6 iterator.Each item of the iterator is a Javascript Object - * @throws {ContainerBindError}: The Symbol.iterator method cannot be bound. + * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ -- Gitee From e1ab9bc221595d0b54178f0d66265bc44d9ac2c9 Mon Sep 17 00:00:00 2001 From: limeng Date: Sun, 9 Oct 2022 10:42:08 +0800 Subject: [PATCH 032/438] Change the name of flow_item Signed-off-by: limeng --- api/@internal/component/ets/{flow_Item.d.ts => flow_item.d.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename api/@internal/component/ets/{flow_Item.d.ts => flow_item.d.ts} (100%) diff --git a/api/@internal/component/ets/flow_Item.d.ts b/api/@internal/component/ets/flow_item.d.ts similarity index 100% rename from api/@internal/component/ets/flow_Item.d.ts rename to api/@internal/component/ets/flow_item.d.ts -- Gitee From f5d144dae2f1287594aebdcd85c3bd3c0fda77f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BB=96=E5=BA=B7=E5=BA=B7?= Date: Sun, 9 Oct 2022 14:19:20 +0800 Subject: [PATCH 033/438] =?UTF-8?q?reminderAgent=E6=96=B0=E5=A2=9Ejs?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=EF=BC=8C=E9=80=82=E9=85=8D=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 廖康康 --- api/@ohos.reminderAgent.d.ts | 108 ++++++- api/@ohos.reminderAgentManager.d.ts | 484 ++++++++++++++++++++++++++++ 2 files changed, 591 insertions(+), 1 deletion(-) create mode 100644 api/@ohos.reminderAgentManager.d.ts diff --git a/api/@ohos.reminderAgent.d.ts b/api/@ohos.reminderAgent.d.ts index d6d9878513..189240f524 100644 --- a/api/@ohos.reminderAgent.d.ts +++ b/api/@ohos.reminderAgent.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"), * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -24,6 +24,8 @@ import { NotificationSlot } from './notification/notificationSlot'; * @since 7 * @syscap SystemCapability.Notification.ReminderAgent * @import reminderAgent from '@ohos.reminderAgent'; + * @deprecated since 9 + * @useinstead reminderAgentManager */ declare namespace reminderAgent { /** @@ -35,6 +37,8 @@ declare namespace reminderAgent { * @param reminderReq Indicates the reminder instance to publish. * @param callback Indicates the callback function. * @returns reminder id. + * @deprecated since 9 + * @useinstead reminderAgentManager.publishReminder */ function publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback): void; function publishReminder(reminderReq: ReminderRequest): Promise; @@ -46,6 +50,8 @@ declare namespace reminderAgent { * @syscap SystemCapability.Notification.ReminderAgent * @param reminderId Indicates the reminder id. * @param callback Indicates the callback function. + * @deprecated since 9 + * @useinstead reminderAgentManager.cancelReminder */ function cancelReminder(reminderId: number, callback: AsyncCallback): void; function cancelReminder(reminderId: number): Promise; @@ -56,6 +62,8 @@ declare namespace reminderAgent { * @since 7 * @syscap SystemCapability.Notification.ReminderAgent * @param callback Indicates the callback function. + * @deprecated since 9 + * @useinstead reminderAgentManager.getValidReminders */ function getValidReminders(callback: AsyncCallback>): void; function getValidReminders(): Promise>; @@ -66,6 +74,8 @@ declare namespace reminderAgent { * @since 7 * @syscap SystemCapability.Notification.ReminderAgent * @param callback Indicates the callback function. + * @deprecated since 9 + * @useinstead reminderAgentManager.cancelAllReminders */ function cancelAllReminders(callback: AsyncCallback): void; function cancelAllReminders(): Promise; @@ -77,6 +87,8 @@ declare namespace reminderAgent { * @syscap SystemCapability.Notification.ReminderAgent * @param slot Indicates the slot. * @param callback Indicates the callback function. + * @deprecated since 9 + * @useinstead reminderAgentManager.addNotificationSlot */ function addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback): void; function addNotificationSlot(slot: NotificationSlot): Promise; @@ -88,6 +100,8 @@ declare namespace reminderAgent { * @syscap SystemCapability.Notification.ReminderAgent * @param slotType Indicates the type of the slot. * @param callback Indicates the callback function. + * @deprecated since 9 + * @useinstead reminderAgentManager.removeNotificationSlot */ function removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback): void; function removeNotificationSlot(slotType: notification.SlotType): Promise; @@ -97,12 +111,16 @@ declare namespace reminderAgent { * * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ActionButtonType */ export enum ActionButtonType { /** * Button for closing the reminder. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ActionButtonType.ACTION_BUTTON_TYPE_CLOSE */ ACTION_BUTTON_TYPE_CLOSE = 0, @@ -110,6 +128,8 @@ declare namespace reminderAgent { * Button for snoozing the reminder. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ActionButtonType.ACTION_BUTTON_TYPE_SNOOZE */ ACTION_BUTTON_TYPE_SNOOZE = 1 } @@ -119,12 +139,16 @@ declare namespace reminderAgent { * * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderType */ export enum ReminderType { /** * Countdown reminder. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderType.REMINDER_TYPE_TIMER */ REMINDER_TYPE_TIMER = 0, @@ -132,6 +156,8 @@ declare namespace reminderAgent { * Calendar reminder. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderType.REMINDER_TYPE_CALENDAR */ REMINDER_TYPE_CALENDAR = 1, @@ -139,6 +165,8 @@ declare namespace reminderAgent { * Alarm reminder. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderType.REMINDER_TYPE_ALARM */ REMINDER_TYPE_ALARM = 2 } @@ -148,12 +176,16 @@ declare namespace reminderAgent { * * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ActionButton */ interface ActionButton { /** * Text on the button. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ActionButton.title */ title: string; @@ -161,6 +193,8 @@ declare namespace reminderAgent { * Button type. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ActionButton.type */ type: ActionButtonType; } @@ -171,12 +205,16 @@ declare namespace reminderAgent { * * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.WantAgent */ interface WantAgent { /** * Name of the package redirected to when the reminder notification is clicked. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.WantAgent.pkgName */ pkgName: string; @@ -184,6 +222,8 @@ declare namespace reminderAgent { * Name of the ability that is redirected to when the reminder notification is clicked. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.WantAgent.abilityName */ abilityName: string; } @@ -193,12 +233,16 @@ declare namespace reminderAgent { * * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.MaxScreenWantAgent */ interface MaxScreenWantAgent { /** * Name of the package that is automatically started when the reminder arrives and the device is not in use. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.MaxScreenWantAgent.pkgName */ pkgName: string; @@ -206,6 +250,8 @@ declare namespace reminderAgent { * Name of the ability that is automatically started when the reminder arrives and the device is not in use. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.MaxScreenWantAgent.abilityName */ abilityName: string; } @@ -215,12 +261,16 @@ declare namespace reminderAgent { * * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequest */ interface ReminderRequest { /** * Type of the reminder. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequest.reminderType */ reminderType: ReminderType; @@ -229,6 +279,8 @@ declare namespace reminderAgent { * (The parameter is optional. Up to two buttons are supported). * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequest.actionButton */ actionButton?: [ActionButton?, ActionButton?]; @@ -236,6 +288,8 @@ declare namespace reminderAgent { * Information about the ability that is redirected to when the notification is clicked. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequest.wantAgent */ wantAgent?: WantAgent; @@ -244,6 +298,8 @@ declare namespace reminderAgent { * If the device is in use, a notification will be displayed. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequest.maxScreenWantAgent */ maxScreenWantAgent?: MaxScreenWantAgent; @@ -251,6 +307,8 @@ declare namespace reminderAgent { * Ringing duration. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequest.ringDuration */ ringDuration?: number; @@ -258,6 +316,8 @@ declare namespace reminderAgent { * Number of reminder snooze times. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequest.snoozeTimes */ snoozeTimes?: number; @@ -265,6 +325,8 @@ declare namespace reminderAgent { * Reminder snooze interval. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequest.timeInterval */ timeInterval?: number; @@ -272,6 +334,8 @@ declare namespace reminderAgent { * Reminder title. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequest.title */ title?: string; @@ -279,6 +343,8 @@ declare namespace reminderAgent { * Reminder content. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequest.content */ content?: string; @@ -286,6 +352,8 @@ declare namespace reminderAgent { * Content to be displayed when the reminder is expired. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequest.expiredContent */ expiredContent?: string; @@ -293,6 +361,8 @@ declare namespace reminderAgent { * Content to be displayed when the reminder is snoozing. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequest.snoozeContent */ snoozeContent?: string; @@ -300,6 +370,8 @@ declare namespace reminderAgent { * notification id. If there are reminders with the same ID, the later one will overwrite the earlier one. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequest.notificationId */ notificationId?: number; @@ -307,15 +379,23 @@ declare namespace reminderAgent { * Type of the slot used by the reminder. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequest.slotType */ slotType?: notification.SlotType; } + /** + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequestCalendar + */ interface ReminderRequestCalendar extends ReminderRequest { /** * Reminder time. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequestCalendar.dateTime */ dateTime: LocalDateTime; @@ -323,6 +403,8 @@ declare namespace reminderAgent { * Month in which the reminder repeats. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequestCalendar.repeatMonths */ repeatMonths?: Array; @@ -330,6 +412,8 @@ declare namespace reminderAgent { * Date on which the reminder repeats. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequestCalendar.repeatDays */ repeatDays?: Array; } @@ -339,12 +423,16 @@ declare namespace reminderAgent { * * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequestAlarm */ interface ReminderRequestAlarm extends ReminderRequest { /** * Hour portion of the reminder time. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequestAlarm.hour */ hour: number; @@ -352,6 +440,8 @@ declare namespace reminderAgent { * minute portion of the remidner time. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequestAlarm.minute */ minute: number; @@ -359,6 +449,8 @@ declare namespace reminderAgent { * Days of a week when the reminder repeates. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequestAlarm.daysOfWeek */ daysOfWeek?: Array; } @@ -368,6 +460,8 @@ declare namespace reminderAgent { * * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequestTimer */ interface ReminderRequestTimer extends ReminderRequest { triggerTimeInSeconds: number; @@ -378,6 +472,8 @@ declare namespace reminderAgent { * value of year. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequestTimer.year */ year: number; @@ -385,6 +481,8 @@ declare namespace reminderAgent { * value of month. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequestTimer.month */ month: number; @@ -392,6 +490,8 @@ declare namespace reminderAgent { * value of day. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequestTimer.day */ day: number; @@ -399,6 +499,8 @@ declare namespace reminderAgent { * value of hour. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequestTimer.hour */ hour: number; @@ -406,6 +508,8 @@ declare namespace reminderAgent { * value of minute. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequestTimer.minute */ minute: number; @@ -413,6 +517,8 @@ declare namespace reminderAgent { * value of second. * @since 7 * @syscap SystemCapability.Notification.ReminderAgent + * @deprecated since 9 + * @useinstead reminderAgentManager.ReminderRequestTimer.second */ second?: number; } diff --git a/api/@ohos.reminderAgentManager.d.ts b/api/@ohos.reminderAgentManager.d.ts new file mode 100644 index 0000000000..2dfd44868d --- /dev/null +++ b/api/@ohos.reminderAgentManager.d.ts @@ -0,0 +1,484 @@ +/* + * 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 { AsyncCallback } from './basic'; +import notification from './@ohos.notification'; +import { NotificationSlot } from './notification/notificationSlot'; + +/** + * Providers static methods for managing reminders, including publishing or canceling a reminder. + * adding or removing a notification slot, and obtaining or cancelling all reminders of the current application. + * + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + * @import reminderAgentManager from '@ohos.reminderAgentManager'; + */ +declare namespace reminderAgentManager { + /** + * Publishes a scheduled reminder. + * + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + * @permission ohos.permission.PUBLISH_AGENT_REMINDER + * @param { ReminderRequest } reminderReq - Indicates the reminder instance to publish. + * @param { AsyncCallback } callback - Indicates the callback function. + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback): void; + + /** + * Publishes a scheduled reminder. + * + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + * @permission ohos.permission.PUBLISH_AGENT_REMINDER + * @param { ReminderRequest } reminderReq - Indicates the reminder instance to publish. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @returns { Promise } The reminder id. + */ + function publishReminder(reminderReq: ReminderRequest): Promise; + + /** + * Cancels a reminder. + * + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + * @param { number } reminderId - Indicates the reminder id. + * @param { AsyncCallback } callback - Indicates the callback function. + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function cancelReminder(reminderId: number, callback: AsyncCallback): void; + + /** + * Cancels a reminder. + * + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + * @param { number } reminderId - Indicates the reminder id. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @returns { Promise } The promise returned by the function. + */ + function cancelReminder(reminderId: number): Promise; + + /** + * Obtains all the valid reminders of current application. + * + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + * @param { AsyncCallback> } callback - Indicates the callback function. + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function getValidReminders(callback: AsyncCallback>): void; + + /** + * Obtains all the valid reminders of current application. + * + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + * @throws { BusinessError } If the input parameter is not valid parameter. + * @returns { Promise> } The promise returned by the function. + */ + function getValidReminders(): Promise>; + + /** + * Cancels all the reminders of current application. + * + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + * @param { AsyncCallback } callback - Indicates the callback function. + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function cancelAllReminders(callback: AsyncCallback): void; + + /** + * Cancels all the reminders of current application. + * + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + * @throws { BusinessError } If the input parameter is not valid parameter. + * @returns { Promise } The promise returned by the function. + */ + function cancelAllReminders(): Promise; + + /** + * Add notification slot. + * + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + * @param { NotificationSlot } slot - Indicates the slot. + * @param { AsyncCallback } callback - Indicates the callback function. + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback): void; + + /** + * Add notification slot. + * + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + * @param { NotificationSlot } slot - Indicates the slot. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @returns { Promise } The promise returned by the function. + */ + function addNotificationSlot(slot: NotificationSlot): Promise; + + /** + * Deletes a created notification slot based on the slot type. + * + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + * @param { notification.SlotType } slotType Indicates the type of the slot. + * @param { AsyncCallback } callback - Indicates the callback function. + * @throws { BusinessError } If the input parameter is not valid parameter. + */ + function removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback): void; + + /** + * Deletes a created notification slot based on the slot type. + * + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + * @param { notification.SlotType } slotType Indicates the type of the slot. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @returns { Promise } The promise returned by the function. + */ + function removeNotificationSlot(slotType: notification.SlotType): Promise; + + /** + * Declares action button type. + * + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + export enum ActionButtonType { + /** + * Button for closing the reminder. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + ACTION_BUTTON_TYPE_CLOSE = 0, + + /** + * Button for snoozing the reminder. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + ACTION_BUTTON_TYPE_SNOOZE = 1 + } + + /** + * Declares reminder type. + * + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + export enum ReminderType { + /** + * Countdown reminder. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + REMINDER_TYPE_TIMER = 0, + + /** + * Calendar reminder. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + REMINDER_TYPE_CALENDAR = 1, + + /** + * Alarm reminder. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + REMINDER_TYPE_ALARM = 2 + } + + /** + * Action button information. The button will show on displayed reminder. + * + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + interface ActionButton { + /** + * Text on the button. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + title: string; + + /** + * Button type. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + type: ActionButtonType; + } + + /** + * Want agent information. + * It will switch to target ability when you click the displayed reminder. + * + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + interface WantAgent { + /** + * Name of the package redirected to when the reminder notification is clicked. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + pkgName: string; + + /** + * Name of the ability that is redirected to when the reminder notification is clicked. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + abilityName: string; + } + + /** + * Max screen want agent information. + * + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + interface MaxScreenWantAgent { + /** + * Name of the package that is automatically started when the reminder arrives and the device is not in use. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + pkgName: string; + + /** + * Name of the ability that is automatically started when the reminder arrives and the device is not in use. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + abilityName: string; + } + + /** + * Reminder Common information. + * + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + interface ReminderRequest { + /** + * Type of the reminder. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + reminderType: ReminderType; + + /** + * Action button displayed on the reminder notification. + * (The parameter is optional. Up to two buttons are supported). + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + actionButton?: [ActionButton?, ActionButton?]; + + /** + * Information about the ability that is redirected to when the notification is clicked. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + wantAgent?: WantAgent; + + /** + * Information about the ability that is automatically started when the reminder arrives. + * If the device is in use, a notification will be displayed. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + maxScreenWantAgent?: MaxScreenWantAgent; + + /** + * Ringing duration. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + ringDuration?: number; + + /** + * Number of reminder snooze times. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + snoozeTimes?: number; + + /** + * Reminder snooze interval. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + timeInterval?: number; + + /** + * Reminder title. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + title?: string; + + /** + * Reminder content. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + content?: string; + + /** + * Content to be displayed when the reminder is expired. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + expiredContent?: string; + + /** + * Content to be displayed when the reminder is snoozing. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + snoozeContent?: string; + + /** + * notification id. If there are reminders with the same ID, the later one will overwrite the earlier one. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + notificationId?: number; + + /** + * Type of the slot used by the reminder. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + slotType?: notification.SlotType; + } + + interface ReminderRequestCalendar extends ReminderRequest { + /** + * Reminder time. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + dateTime: LocalDateTime; + + /** + * Month in which the reminder repeats. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + repeatMonths?: Array; + + /** + * Date on which the reminder repeats. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + repeatDays?: Array; + } + + /** + * Alarm reminder information. + * + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + interface ReminderRequestAlarm extends ReminderRequest { + /** + * Hour portion of the reminder time. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + hour: number; + + /** + * minute portion of the reminder time. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + minute: number; + + /** + * Days of a week when the reminder repeates. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + daysOfWeek?: Array; + } + + /** + * CountDown reminder information. + * + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + interface ReminderRequestTimer extends ReminderRequest { + triggerTimeInSeconds: number; + } + + interface LocalDateTime { + /** + * value of year. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + year: number; + + /** + * value of month. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + month: number; + + /** + * value of day. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + day: number; + + /** + * value of hour. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + hour: number; + + /** + * value of minute. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + minute: number; + + /** + * value of second. + * @since 9 + * @syscap SystemCapability.Notification.ReminderAgent + */ + second?: number; + } +} +export default reminderAgentManager; -- Gitee From af548c7f8645bd8f5fd11125f9c3b9aa09c2c487 Mon Sep 17 00:00:00 2001 From: niudongyao Date: Sun, 9 Oct 2022 14:21:24 +0800 Subject: [PATCH 034/438] api errorcode Signed-off-by: niudongyao --- .idea/interface_sdk-js.iml | 8 ++ .idea/modules.xml | 8 ++ .idea/vcs.xml | 6 ++ .idea/workspace.xml | 66 +++++++++++++ api/@ohos.data.dataShare.d.ts | 168 +--------------------------------- 5 files changed, 90 insertions(+), 166 deletions(-) create mode 100644 .idea/interface_sdk-js.iml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml diff --git a/.idea/interface_sdk-js.iml b/.idea/interface_sdk-js.iml new file mode 100644 index 0000000000..bc2cd87409 --- /dev/null +++ b/.idea/interface_sdk-js.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000000..732dc43fc9 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000000..94a25f7f4c --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000000..fc09323844 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1664437584931 + + + + + + + + + \ No newline at end of file diff --git a/api/@ohos.data.dataShare.d.ts b/api/@ohos.data.dataShare.d.ts index 10d8314da3..969a702d5b 100644 --- a/api/@ohos.data.dataShare.d.ts +++ b/api/@ohos.data.dataShare.d.ts @@ -20,19 +20,6 @@ import dataSharePredicates from './@ohos.data.dataSharePredicates'; import { ValuesBucket } from './@ohos.data.ValuesBucket'; declare namespace dataShare { - /** - * Obtains the dataShareHelper. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @systemapi - * @param context Indicates the application context. - * @param uri Indicates the path of the file to open. - * @return Returns the dataShareHelper. - * @StageModelOnly - */ - function createDataShareHelper(context: Context, uri: string, callback: AsyncCallback): void; - function createDataShareHelper(context: Context, uri: string): Promise; - /** * Obtains the dataShareHelper. * @since 9 @@ -46,8 +33,8 @@ declare namespace dataShare { * @errorcode 401 * @StageModelOnly */ - function createDataShareHelperV9(context: Context, uri: string, callback: AsyncCallback): void; - function createDataShareHelperV9(context: Context, uri: string): Promise; + function createDataShareHelper(context: Context, uri: string, callback: AsyncCallback): void; + function createDataShareHelper(context: Context, uri: string): Promise; /** * DataShareHelper @@ -83,157 +70,6 @@ declare namespace dataShare { */ off(type: 'dataChange', uri: string, callback?: AsyncCallback): void; - /** - * Inserts a single data record into the database. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @systemapi - * @param uri Indicates the path of the data to operate. - * @param value Indicates the data record to insert. If this parameter is null, a blank row will be inserted. - * @return Returns the index of the inserted data record. - * @StageModelOnly - */ - insert(uri: string, value: ValuesBucket, callback: AsyncCallback): void; - insert(uri: string, value: ValuesBucket): Promise; - - /** - * Deletes one or more data records from the database. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @systemapi - * @param uri Indicates the path of the data to operate. - * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. - * @return Returns the number of data records deleted. - * @StageModelOnly - */ - delete(uri: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; - delete(uri: string, predicates: dataSharePredicates.DataSharePredicates): Promise; - - /** - * Queries data in the database. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @systemapi - * @param uri Indicates the path of data to query. - * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. - * @param columns Indicates the columns to query. If this parameter is null, all columns are queried. - * @return Returns the query result. - * @StageModelOnly - */ - query(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array, callback: AsyncCallback): void; - query(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array): Promise; - - /** - * Updates data records in the database. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @systemapi - * @param uri Indicates the path of data to update. - * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. - * @param value Indicates the data to update. This parameter can be null. - * @return Returns the number of data records updated. - * @StageModelOnly - */ - update(uri: string, predicates: dataSharePredicates.DataSharePredicates, value: ValuesBucket, callback: AsyncCallback): void; - update(uri: string, predicates: dataSharePredicates.DataSharePredicates, value: ValuesBucket): Promise; - - /** - * Inserts multiple data records into the database. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @systemapi - * @param uri Indicates the path of the data to operate. - * @param values Indicates the data records to insert. - * @return Returns the number of data records inserted. - * @StageModelOnly - */ - batchInsert(uri: string, values: Array, callback: AsyncCallback): void; - batchInsert(uri: string, values: Array): Promise; - - /** - * Converts the given {@code uri} that refers to the DataShare into a normalized {@link ohos.utils.net.Uri}. - * A normalized uri can be used across devices, persisted, backed up, and restored. - *

To transfer a normalized uri from another environment to the current environment, you should call this - * method again to re-normalize the uri for the current environment or call {@link #denormalizeUri(Uri)} - * to convert it to a denormalized uri that can be used only in the current environment. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @systemapi - * @param uri Indicates the {@link ohos.utils.net.Uri} object to normalize. - * @return Returns the normalized {@code Uri} object if the DataShare supports uri normalization; - * returns {@code null} otherwise. - * @throws DataShareRemoteException Throws this exception if the remote process exits. - * @throws NullPointerException Throws this exception if {@code uri} is null. - * @see #denormalizeUri - * @StageModelOnly - */ - normalizeUri(uri: string, callback: AsyncCallback): void; - normalizeUri(uri: string): Promise; - - /** - * Converts the given normalized {@code uri} generated by {@link #normalizeUri(Uri)} into a denormalized one. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @systemapi - * @param uri Indicates the {@link ohos.utils.net.Uri} object to denormalize. - * @return Returns the denormalized {@code Uri} object if the denormalization is successful; returns the - * original {@code Uri} passed to this method if there is nothing to do; returns {@code null} if the data - * identified by the normalized {@code Uri} cannot be found in the current environment. - * @throws DataShareRemoteException Throws this exception if the remote process exits. - * @throws NullPointerException Throws this exception if {@code uri} is null. - * @see #normalizeUri - * @StageModelOnly - */ - denormalizeUri(uri: string, callback: AsyncCallback): void; - denormalizeUri(uri: string): Promise; - - /** - * Notifies the registered observers of a change to the data resource specified by Uri. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @systemapi - * @param uri Indicates the {@link ohos.utils.net.Uri} object to notifyChange. - * @return - - * @StageModelOnly - */ - notifyChange(uri: string, callback: AsyncCallback): void; - notifyChange(uri: string): Promise; - } - - /** - * DataShareHelperV9 - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @systemapi - * @StageModelOnly - */ - interface DataShareHelperV9 { - /** - * Registers an observer to observe data specified by the given uri. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @systemapi - * @param type dataChange. - * @param uri Indicates the path of the data to operate. - * @param callback Indicates the callback when dataChange. - * @return - - * @StageModelOnly - */ - on(type: 'dataChange', uri: string, callback: AsyncCallback): void; - - /** - * Deregisters an observer used for monitoring data specified by the given uri. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer - * @systemapi - * @param type dataChange. - * @param uri Indicates the path of the data to operate. - * @param callback Indicates the registered callback. - * @return - - * @StageModelOnly - */ - off(type: 'dataChange', uri: string, callback?: AsyncCallback): void; - /** * Inserts a single data record into the database. * @since 9 -- Gitee From a0e1424a79933d25149d31ade1b8c6b8b986ac21 Mon Sep 17 00:00:00 2001 From: niudongyao Date: Sun, 9 Oct 2022 14:22:04 +0800 Subject: [PATCH 035/438] api errorcode Signed-off-by: niudongyao --- .idea/interface_sdk-js.iml | 8 ----- .idea/modules.xml | 8 ----- .idea/vcs.xml | 6 ---- .idea/workspace.xml | 66 -------------------------------------- 4 files changed, 88 deletions(-) delete mode 100644 .idea/interface_sdk-js.iml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml diff --git a/.idea/interface_sdk-js.iml b/.idea/interface_sdk-js.iml deleted file mode 100644 index bc2cd87409..0000000000 --- a/.idea/interface_sdk-js.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 732dc43fc9..0000000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7f4c..0000000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index fc09323844..0000000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1664437584931 - - - - - - - - - \ No newline at end of file -- Gitee From 8aee0cbd5407ffe3a3e64d842f60f0161c087733 Mon Sep 17 00:00:00 2001 From: du-zhihai Date: Mon, 10 Oct 2022 09:59:50 +0800 Subject: [PATCH 036/438] =?UTF-8?q?continuationManager=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: du-zhihai Change-Id: I524469e0d3a4dac59dab5c7ce07a5d98749a7200 --- ...ohos.continuation.continuationManager.d.ts | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/api/@ohos.continuation.continuationManager.d.ts b/api/@ohos.continuation.continuationManager.d.ts index 9b9cbe3304..fb081b509d 100644 --- a/api/@ohos.continuation.continuationManager.d.ts +++ b/api/@ohos.continuation.continuationManager.d.ts @@ -30,8 +30,10 @@ declare namespace continuationManager { * Called when the user selects devices from the candidate device list. * You can implement your own processing logic in this callback to initiate the hop process. * - * @param type deviceConnect. + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param type deviceSelected. * @return callback Indicates the information about the selected devices. + * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 16600001 - The system ability work abnormally. * @throws { BusinessError } 16600002 - The specified token or callback has not registered. @@ -39,15 +41,17 @@ declare namespace continuationManager { * @syscap SystemCapability.Ability.DistributedAbilityManager * @since 9 */ - function on(type: "deviceConnect", token: number, callback: Callback>): void; - function off(type: "deviceConnect", token: number): void; + function on(type: "deviceSelected", token: number, callback: Callback>): void; + function off(type: "deviceSelected", token: number): void; /** * Called when devices are disconnected from the continuation manager service. * You can implement your own processing logic in this callback, such as notifying the user of the disconnection. * - * @param type deviceDisconnect. + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param type deviceUnselected. * @return callback Indicates the ID of the disconnected devices. + * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 16600001 - The system ability work abnormally. * @throws { BusinessError } 16600002 - The specified token or callback has not registered. @@ -55,8 +59,8 @@ declare namespace continuationManager { * @syscap SystemCapability.Ability.DistributedAbilityManager * @since 9 */ - function on(type: "deviceDisconnect", token: number, callback: Callback>): void; - function off(type: "deviceDisconnect", token: number): void; + function on(type: "deviceUnselected", token: number, callback: Callback>): void; + function off(type: "deviceUnselected", token: number): void; /** * Called when the user selects a device from the candidate device list. @@ -149,9 +153,11 @@ declare namespace continuationManager { * Registers an ability to be hopped with the continuation manager service and obtains the registration token * assigned to the ability. * + * @permission ohos.permission.DISTRIBUTED_DATASYNC * @param options Indicates the {@link ExtraParams} object containing the extra parameters used to filter * the list of available devices. * @return callback Indicates the callback to be invoked when the continuation manager service is connected. + * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 16600001 - The system ability work abnormally. * @throws { BusinessError } 16600003 - The number of token registration times has reached the upper limit. @@ -166,8 +172,10 @@ declare namespace continuationManager { * Unregisters a specified ability from the continuation manager service based on the token obtained during ability * registration. * + * @permission ohos.permission.DISTRIBUTED_DATASYNC * @param token Indicates the registration token of the ability. * @return callback Indicates the callback to be invoked when the continuation manager service is connected. + * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 16600001 - The system ability work abnormally. * @throws { BusinessError } 16600002 - The specified token or callback has not registered. @@ -180,10 +188,12 @@ declare namespace continuationManager { /** * Updates the connection state of the device where the specified ability is successfully hopped. * + * @permission ohos.permission.DISTRIBUTED_DATASYNC * @param token Indicates the registration token of the ability. * @param deviceId Indicates the ID of the device whose connection state is to be updated. * @param status Indicates the connection state to update. * @return callback Indicates the callback to be invoked when the continuation manager service is connected. + * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 16600001 - The system ability work abnormally. * @throws { BusinessError } 16600002 - The specified token or callback has not registered. @@ -196,10 +206,12 @@ declare namespace continuationManager { /** * Start to manage the devices that can be selected for continuation. * + * @permission ohos.permission.DISTRIBUTED_DATASYNC * @param token Indicates the registration token of the ability. * @param options Indicates the extraParams object containing the extra parameters used to filter * the list of available devices. This parameter can be null. * @return callback Indicates the callback to be invoked when the continuation manager service is connected. + * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 16600001 - The system ability work abnormally. * @throws { BusinessError } 16600002 - The specified token or callback has not registered. -- Gitee From 1e3beaff1f544340789d5616bfb82b95fa83a3b7 Mon Sep 17 00:00:00 2001 From: limeng Date: Mon, 10 Oct 2022 10:06:28 +0800 Subject: [PATCH 037/438] update by commits Signed-off-by: limeng --- api/@internal/component/ets/flow_item.d.ts | 2 +- api/@internal/component/ets/water_flow.d.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/@internal/component/ets/flow_item.d.ts b/api/@internal/component/ets/flow_item.d.ts index fcfc6f1ebb..801acb1a9b 100644 --- a/api/@internal/component/ets/flow_item.d.ts +++ b/api/@internal/component/ets/flow_item.d.ts @@ -19,7 +19,7 @@ */ interface FlowItemInterface { /** - * Return to get flowItem. + * Construct the flow item. * @since 9 */ (): FlowItemAttribute; diff --git a/api/@internal/component/ets/water_flow.d.ts b/api/@internal/component/ets/water_flow.d.ts index d3e1e13d04..c5387a22c5 100644 --- a/api/@internal/component/ets/water_flow.d.ts +++ b/api/@internal/component/ets/water_flow.d.ts @@ -37,7 +37,7 @@ declare interface WaterFlowOptions { */ interface WaterFlowInterface { /** - * WaterFlow is returned when the parameter is transferred. only support api: scrollToIndex + * WaterFlow is returned when the parameter is transferred. Only support api: scrollToIndex * @since 9 */ (options?: WaterFlowOptions): WaterFlowAttribute; @@ -60,25 +60,25 @@ declare class WaterFlowAttribute extends CommonMethod { itemConstraintSize(value: ConstraintSizeOptions): WaterFlowAttribute; /** - * Lets you set the number of rows in the current waterflow。 + * Set the number of rows in the current waterflow. * @since 9 */ rowsTemplate(value: string): WaterFlowAttribute; /** - * Allows you to set the spacing between columns. + * Set the spacing between columns. * @since 9 */ columnsGap(value: Length): WaterFlowAttribute; /** - * Lets you set the spacing between rows. + * Set the spacing between rows. * @since 9 */ rowsGap(value: Length): WaterFlowAttribute; /** - * control WaterFlowDirection of the WaterFlow. + * Control layout direction of the WaterFlow. * @since 9 */ layoutDirection(value: FlexDirection): WaterFlowAttribute; -- Gitee From a740dab862805cccdfca4e407adfa84c00c2e66e Mon Sep 17 00:00:00 2001 From: niudongyao Date: Mon, 10 Oct 2022 10:18:03 +0800 Subject: [PATCH 038/438] api errorcode Signed-off-by: niudongyao --- .idea/vcs.xml | 6 ++++ .idea/workspace.xml | 68 +++++++++++++++++++++++++++++++++++ api/@ohos.data.dataShare.d.ts | 5 --- 3 files changed, 74 insertions(+), 5 deletions(-) create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000000..94a25f7f4c --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000000..76ea6ee76f --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1664437584931 + + + + + + + + + \ No newline at end of file diff --git a/api/@ohos.data.dataShare.d.ts b/api/@ohos.data.dataShare.d.ts index 969a702d5b..38369801a8 100644 --- a/api/@ohos.data.dataShare.d.ts +++ b/api/@ohos.data.dataShare.d.ts @@ -79,7 +79,6 @@ declare namespace dataShare { * @param value Indicates the data record to insert. If this parameter is null, a blank row will be inserted. * @return Returns the index of the inserted data record. * @throws {BusinessError} if process failed - * @errorcode 15700000 * @errorcode 401 * @StageModelOnly */ @@ -95,7 +94,6 @@ declare namespace dataShare { * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. * @return Returns the number of data records deleted. * @throws {BusinessError} if process failed - * @errorcode 15700000 * @errorcode 401 * @StageModelOnly */ @@ -112,7 +110,6 @@ declare namespace dataShare { * @param columns Indicates the columns to query. If this parameter is null, all columns are queried. * @return Returns the query result. * @throws {BusinessError} if process failed - * @errorcode 15700000 * @errorcode 401 * @StageModelOnly */ @@ -129,7 +126,6 @@ declare namespace dataShare { * @param value Indicates the data to update. This parameter can be null. * @return Returns the number of data records updated. * @throws {BusinessError} if process failed - * @errorcode 15700000 * @errorcode 401 * @StageModelOnly */ @@ -145,7 +141,6 @@ declare namespace dataShare { * @param values Indicates the data records to insert. * @return Returns the number of data records inserted. * @throws {BusinessError} if process failed - * @errorcode 15700000 * @errorcode 401 * @StageModelOnly */ -- Gitee From e427636324d003cda907b3cd3a208862e5d5e60b Mon Sep 17 00:00:00 2001 From: niudongyao Date: Mon, 10 Oct 2022 10:18:25 +0800 Subject: [PATCH 039/438] api errorcode Signed-off-by: niudongyao --- .idea/vcs.xml | 6 ---- .idea/workspace.xml | 68 --------------------------------------------- 2 files changed, 74 deletions(-) delete mode 100644 .idea/vcs.xml delete mode 100644 .idea/workspace.xml diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7f4c..0000000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 76ea6ee76f..0000000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1664437584931 - - - - - - - - - \ No newline at end of file -- Gitee From 96442b73b608d185c0690ebe3c720eefde421142 Mon Sep 17 00:00:00 2001 From: dboy190 Date: Mon, 10 Oct 2022 10:31:54 +0800 Subject: [PATCH 040/438] fix errorcode Signed-off-by: dboy190 --- api/@ohos.data.distributedData.d.ts | 51 ----------------------------- 1 file changed, 51 deletions(-) diff --git a/api/@ohos.data.distributedData.d.ts b/api/@ohos.data.distributedData.d.ts index 4880dfb235..b5e5087313 100644 --- a/api/@ohos.data.distributedData.d.ts +++ b/api/@ohos.data.distributedData.d.ts @@ -809,7 +809,6 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @returns Returns a key-value pair. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100004 * @errorcode 15100006 */ @@ -1744,7 +1743,6 @@ declare namespace distributedData { * Spaces before and after the key will be cleared. * @param value Indicates the string value, which must be less than 4 MB as a UTF-8 byte array. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100006 * @errorcode 401 @@ -1761,7 +1759,6 @@ declare namespace distributedData { * @param value Indicates the data record to put. * Spaces before and after the key will be cleared. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100006 * @errorcode 401 @@ -1777,7 +1774,6 @@ declare namespace distributedData { * @param key Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. * Spaces before and after the key will be cleared. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100004 * @errorcode 15100006 @@ -1794,7 +1790,6 @@ declare namespace distributedData { * @param predicates Indicates the datasharePredicates. * Spaces before and after the key will be cleared. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100004 * @errorcode 15100006 @@ -1810,7 +1805,6 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param file Indicates the name that saves the database backup. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100005 * @errorcode 15100006 * @errorcode 401 @@ -1825,7 +1819,6 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param file Indicates the name that saves the database file. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100005 * @errorcode 15100006 * @errorcode 401 @@ -1856,7 +1849,6 @@ declare namespace distributedData { * @throws {BusinessError} if process failed. * @errorcode 15100001 * @errorcode 15100006 - * @errorcode 15100007 * @errorcode 401 */ on(event: 'dataChange', type: SubscribeType, listener: Callback): void; @@ -1878,7 +1870,6 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100006 * @errorcode 401 */ @@ -1901,7 +1892,6 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param entries Indicates the key-value pairs to be inserted in batches. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100006 * @errorcode 401 @@ -1916,7 +1906,6 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param keys Indicates the key-value pairs to be deleted in batches. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100004 * @errorcode 15100006 @@ -1933,7 +1922,6 @@ declare namespace distributedData { * @since 9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100006 */ startTransaction(callback: AsyncCallback): void; @@ -1946,7 +1934,6 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param callback * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100006 */ commit(callback: AsyncCallback): void; @@ -1958,7 +1945,6 @@ declare namespace distributedData { * @since 9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100006 */ rollback(callback: AsyncCallback): void; @@ -1972,7 +1958,6 @@ declare namespace distributedData { * @param enabled Specifies whether to enable synchronization. The value true means to enable * synchronization, and false means the opposite. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ enableSync(enabled: boolean, callback: AsyncCallback): void; @@ -1988,7 +1973,6 @@ declare namespace distributedData { * @param localLabels Indicates the synchronization labels of the local device. * @param remoteSupportLabels Indicates the labels of the devices with which data will be synchronized. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ setSyncRange(localLabels: string[], remoteSupportLabels: string[], callback: AsyncCallback): void; @@ -2258,7 +2242,6 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100004 * @errorcode 15100006 @@ -2276,7 +2259,6 @@ declare namespace distributedData { * @param keyPrefix Indicates the key prefix to match. * @returns Returns the list of all key-value pairs that match the specified key prefix. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100006 * @errorcode 401 @@ -2293,7 +2275,6 @@ declare namespace distributedData { * @param query Indicates the {@code QueryV9} object. * @returns Returns the list of key-value pairs matching the specified {@code QueryV9} object. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100005 * @errorcode 15100006 @@ -2314,7 +2295,6 @@ declare namespace distributedData { * @import N/A * @param keyPrefix Indicates the key prefix to match. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100006 * @errorcode 401 @@ -2330,7 +2310,6 @@ declare namespace distributedData { * @import N/A * @param query Indicates the {@code QueryV9} object. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100006 * @errorcode 401 @@ -2347,7 +2326,6 @@ declare namespace distributedData { * @param predicates Indicates the datasharePredicates. * Spaces before and after the key will be cleared. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100006 * @errorcode 401 @@ -2363,7 +2341,6 @@ declare namespace distributedData { * @import N/A * @param resultSet Indicates the {@code KvStoreResultSet} object to close. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; @@ -2378,7 +2355,6 @@ declare namespace distributedData { * @param query Indicates the {@code QueryV9} object. * @returns Returns the number of results matching the specified {@code QueryV9} object. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100006 * @errorcode 401 @@ -2394,7 +2370,6 @@ declare namespace distributedData { * @import N/A * @param deviceId Indicates the device to be removed data. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100006 * @errorcode 401 */ @@ -2411,7 +2386,6 @@ declare namespace distributedData { * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. * @permission ohos.permission.DISTRIBUTED_DATASYNC * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100004 * @errorcode 401 @@ -2429,7 +2403,6 @@ declare namespace distributedData { * @param query Indicates the {@code QueryV9} object. * @permission ohos.permission.DISTRIBUTED_DATASYNC * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100004 * @errorcode 401 @@ -2447,7 +2420,6 @@ declare namespace distributedData { * @throws {BusinessError} if process failed. * @errorcode 15100001 * @errorcode 15100006 - * @errorcode 15100007 * @errorcode 401 */ on(event: 'dataChange', type: SubscribeType, listener: Callback): void; @@ -2469,7 +2441,6 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100006 * @errorcode 401 */ @@ -2492,7 +2463,6 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param defaultAllowedDelayMs Indicates the default delay allowed for the database synchronization, in milliseconds. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback): void; @@ -2505,7 +2475,6 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @returns SecurityLevel {@code SecurityLevel} the security level of the database. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100006 */ getSecurityLevel(callback: AsyncCallback): void; @@ -2806,7 +2775,6 @@ declare namespace distributedData { * @param key Indicates the key of the value to be queried. * @return Returns the value matching the given criteria. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100004 * @errorcode 15100006 @@ -2824,7 +2792,6 @@ declare namespace distributedData { * @param keyPrefix Indicates the key prefix to match. * @returns Returns the list of all key-value pairs meeting the given criteria. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100006 * @errorcode 401 @@ -2840,7 +2807,6 @@ declare namespace distributedData { * @param query Indicates the {@code QueryV9} object. * @returns Returns the list of key-value pairs matching the specified {@code QueryV9} object. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100005 * @errorcode 15100006 @@ -2858,7 +2824,6 @@ declare namespace distributedData { * @param query Indicates the {@code QueryV9} object. * @returns Returns the list of key-value pairs matching the specified {@code QueryV9} object. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100005 * @errorcode 15100006 @@ -2881,7 +2846,6 @@ declare namespace distributedData { * @param keyPrefix Indicates the key prefix to match. * @returns Returns the {@code KvStoreResultSet} objects. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100006 * @errorcode 401 @@ -2897,7 +2861,6 @@ declare namespace distributedData { * @param query Indicates the {@code QueryV9} object. * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code QueryV9} object. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100006 * @errorcode 401 @@ -2914,7 +2877,6 @@ declare namespace distributedData { * @param query Indicates the {@code QueryV9} object. * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code QueryV9} object. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100006 * @errorcode 401 @@ -2931,7 +2893,6 @@ declare namespace distributedData { * @systemapi * Spaces before and after the key will be cleared. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100006 * @errorcode 401 @@ -2948,7 +2909,6 @@ declare namespace distributedData { * @param deviceId Indicates the ID of the device to which the results belong. * Spaces before and after the key will be cleared. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100006 * @errorcode 401 @@ -2963,7 +2923,6 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param resultSet Indicates the {@code KvStoreResultSet} object to close. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; @@ -2977,7 +2936,6 @@ declare namespace distributedData { * @param query Indicates the {@code QueryV9} object. * @returns Returns the number of results matching the specified {@code QueryV9} object. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100006 * @errorcode 401 @@ -2994,7 +2952,6 @@ declare namespace distributedData { * @param query Indicates the {@code QueryV9} object. * @returns Returns the number of results matching the specified {@code QueryV9} object. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100006 * @errorcode 401 @@ -3011,7 +2968,6 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deviceId Identifies the device whose data is to be removed. The value cannot be the current device ID. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100006 * @errorcode 401 */ @@ -3031,7 +2987,6 @@ declare namespace distributedData { * {@code PUSH_PULL}. * @permission ohos.permission.DISTRIBUTED_DATASYNC * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100004 * @errorcode 401 @@ -3052,7 +3007,6 @@ declare namespace distributedData { * {@code PUSH_PULL}. * @permission ohos.permission.DISTRIBUTED_DATASYNC * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100003 * @errorcode 15100004 * @errorcode 401 @@ -3082,7 +3036,6 @@ declare namespace distributedData { * @throws {BusinessError} if process failed. * @errorcode 15100001 * @errorcode 15100006 - * @errorcode 15100007 * @errorcode 401 */ on(event: 'dataChange', type: SubscribeType, listener: Callback): void; @@ -3094,7 +3047,6 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100006 * @errorcode 401 */ @@ -3267,7 +3219,6 @@ declare namespace distributedData { * and different applications can share the same value. * @return Returns a {@code KVStoreV9}, or {@code SingleKVStoreV9}. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100002 * @errorcode 15100003 * @errorcode 401 @@ -3306,7 +3257,6 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param storeId Identifies the {@code KvStoreV9} database to delete. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 15100004 * @errorcode 401 */ @@ -3321,7 +3271,6 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @returns Returns the storeId of all created {@code KvStore} databases. * @throws {BusinessError} if process failed. - * @errorcode 15100001 * @errorcode 401 */ getAllKVStoreId(appId: string, callback: AsyncCallback): void; -- Gitee From 9d894472917afa613f9c88d9e176e25bfa8fa3c4 Mon Sep 17 00:00:00 2001 From: wangyang2022 Date: Mon, 10 Oct 2022 11:10:04 +0800 Subject: [PATCH 041/438] =?UTF-8?q?distributedMissionManager=20continueMis?= =?UTF-8?q?sion=E5=85=A5=E5=8F=82=E5=90=8D=E5=8F=98=E6=9B=B4=20Signed-off-?= =?UTF-8?q?by:=20wangyang2022=20=20Change-Id:=20Ib?= =?UTF-8?q?c40af40bb364c0e408b169fd2a958cf0863b4b2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/application/ContinueDeviceInfo.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/application/ContinueDeviceInfo.d.ts b/api/application/ContinueDeviceInfo.d.ts index d6402c3d06..e557838b04 100644 --- a/api/application/ContinueDeviceInfo.d.ts +++ b/api/application/ContinueDeviceInfo.d.ts @@ -44,10 +44,10 @@ */ missionId: number; /** - * Indicates the extended params. + * Indicates the extended param. * * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @since 9 */ - wantParams: {[key: string]: any}; + wantParam: {[key: string]: any}; } \ No newline at end of file -- Gitee From 2fb662acdbf4879e67c40eb8b03be0586720321c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E6=80=A1?= Date: Mon, 10 Oct 2022 06:57:24 +0000 Subject: [PATCH 042/438] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱天怡 --- ...esourceschedule.backgroundTaskManager.d.ts | 59 ++++++- ...ohos.resourceschedule.usageStatistics.d.ts | 150 +++++++++++++++--- api/@ohos.resourceschedule.workScheduler.d.ts | 35 +++- 3 files changed, 211 insertions(+), 33 deletions(-) diff --git a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts index f50521a6bd..a3f7c1a711 100644 --- a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts +++ b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts @@ -48,7 +48,13 @@ declare namespace backgroundTaskManager { * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @param requestId Indicates the identifier of the delay request. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 9800001 - Memory operation failed. + * @throws { BusinessError } 9800002 - Parcel operation failed. + * @throws { BusinessError } 9800003 - Inner transact failed. + * @throws { BusinessError } 9800004 - System service operation failed. + * @throws { BusinessError } 9900001 - Caller information verification failed. + * @throws { BusinessError } 9900002 - Background task verification failed. */ function cancelSuspendDelay(requestId: number): void; @@ -58,7 +64,13 @@ declare namespace backgroundTaskManager { * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @param requestId Indicates the identifier of the delay request. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 9800001 - Memory operation failed. + * @throws { BusinessError } 9800002 - Parcel operation failed. + * @throws { BusinessError } 9800003 - Inner transact failed. + * @throws { BusinessError } 9800004 - System service operation failed. + * @throws { BusinessError } 9900001 - Caller information verification failed. + * @throws { BusinessError } 9900002 - Background task verification failed. * @return The remaining delay time */ function getRemainingDelayTime(requestId: number, callback: AsyncCallback): void; @@ -71,7 +83,13 @@ declare namespace backgroundTaskManager { * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @param reason Indicates the reason for delayed transition to the suspended state. * @param callback The callback delay time expired. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 9800001 - Memory operation failed. + * @throws { BusinessError } 9800002 - Parcel operation failed. + * @throws { BusinessError } 9800003 - Inner transact failed. + * @throws { BusinessError } 9800004 - System service operation failed. + * @throws { BusinessError } 9900001 - Caller information verification failed. + * @throws { BusinessError } 9900002 - Background task verification failed. * @return Info of delay request */ function requestSuspendDelay(reason: string, callback: Callback): DelaySuspendInfo; @@ -86,7 +104,15 @@ declare namespace backgroundTaskManager { * @param context app running context. * @param bgMode Indicates which background mode to request. * @param wantAgent Indicates which ability to start when user click the notification bar. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 9800001 - Memory operation failed. + * @throws { BusinessError } 9800002 - Parcel operation failed. + * @throws { BusinessError } 9800003 - Inner transact failed. + * @throws { BusinessError } 9800004 - System service operation failed. + * @throws { BusinessError } 9800005 - Background task verification failed. + * @throws { BusinessError } 9800006 - Notification verification failed. + * @throws { BusinessError } 9800007 - Task storage failed. */ function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback): void; function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise; @@ -97,7 +123,15 @@ declare namespace backgroundTaskManager { * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @param context app running context. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 9800001 - Memory operation failed. + * @throws { BusinessError } 9800002 - Parcel operation failed. + * @throws { BusinessError } 9800003 - Inner transact failed. + * @throws { BusinessError } 9800004 - System service operation failed. + * @throws { BusinessError } 9800005 - Background task verification failed. + * @throws { BusinessError } 9800006 - Notification verification failed. + * @throws { BusinessError } 9800007 - Task storage failed. */ function stopBackgroundRunning(context: Context, callback: AsyncCallback): void; function stopBackgroundRunning(context: Context): Promise; @@ -107,7 +141,13 @@ declare namespace backgroundTaskManager { * * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 9800001 - Memory operation failed. + * @throws { BusinessError } 9800002 - Parcel operation failed. + * @throws { BusinessError } 9800003 - Inner transact failed. + * @throws { BusinessError } 9800004 - System service operation failed. + * @throws { BusinessError } 18700001 - Caller information verification failed. * @systemapi Hide this for inner system use. */ function applyEfficiencyResources(request: EfficiencyResourcesRequest): void; @@ -118,6 +158,13 @@ declare namespace backgroundTaskManager { * @since 9 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply * @systemapi Hide this for inner system use. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 9800001 - Memory operation failed. + * @throws { BusinessError } 9800002 - Parcel operation failed. + * @throws { BusinessError } 9800003 - Inner transact failed. + * @throws { BusinessError } 9800004 - System service operation failed. + * @throws { BusinessError } 18700001 - Caller information verification failed. */ function resetAllEfficiencyResources(): void; diff --git a/api/@ohos.resourceschedule.usageStatistics.d.ts b/api/@ohos.resourceschedule.usageStatistics.d.ts index 79f63d1442..a2932023a5 100644 --- a/api/@ohos.resourceschedule.usageStatistics.d.ts +++ b/api/@ohos.resourceschedule.usageStatistics.d.ts @@ -262,7 +262,13 @@ declare namespace usageStatistics { * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @param bundleName Indicates the bundle name of the application to query. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC Communication failed. * @return Returns {@code true} if the application is idle in a particular period; * returns {@code false} otherwise. The time range of the particular period is defined by the system, * which may be hours or days. @@ -278,7 +284,15 @@ declare namespace usageStatistics { * * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC Communication failed. + * @throws { BusinessError } 10000005 - Application is not installed. + * @throws { BusinessError } 10100002 - Get Application group info failed. * @return Returns the app group of the calling application. */ function queryAppGroup(callback: AsyncCallback): void; @@ -303,7 +317,15 @@ declare namespace usageStatistics { * @systemapi Hide this for inner system use. * @param begin Indicates the start time of the query period, in milliseconds. * @param end Indicates the end time of the query period, in milliseconds. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC Communication failed. + * @throws { BusinessError } 10000006 - Get application info failed. + * @throws { BusinessError } 10000007 - Get system or actual time failed. * @return Returns the {@link BundleStatsMap} objects containing the usage information about each bundle. */ function queryBundleStatsInfos(begin: number, end: number, callback: AsyncCallback): void; @@ -354,7 +376,15 @@ declare namespace usageStatistics { * {@link #BY_WEEKLY}, {@link #BY_MONTHLY}, or {@link #BY_ANNUALLY}. * @param begin Indicates the start time of the query period, in milliseconds. * @param end Indicates the end time of the query period, in milliseconds. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC Communication failed. + * @throws { BusinessError } 10000006 - Get application info failed. + * @throws { BusinessError } 10000007 - Get system or actual time failed. * @return Returns the list of {@link BundleStatsInfo} objects containing the usage information about each bundle. */ function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback>): void; @@ -369,7 +399,15 @@ declare namespace usageStatistics { * @systemapi Hide this for inner system use. * @param begin Indicates the start time of the query period, in milliseconds. * @param end Indicates the end time of the query period, in milliseconds. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC Communication failed. + * @throws { BusinessError } 10000006 - Get application info failed. + * @throws { BusinessError } 10000007 - Get system or actual time failed. * @return Returns the list of {@link BundleEvents} objects containing the state data of all bundles. */ function queryBundleEvents(begin: number, end: number, callback: AsyncCallback>): void; @@ -382,7 +420,15 @@ declare namespace usageStatistics { * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @param begin Indicates the start time of the query period, in milliseconds. * @param end Indicates the end time of the query period, in milliseconds. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC Communication failed. + * @throws { BusinessError } 10000006 - Get application info failed. + * @throws { BusinessError } 10000007 - Get system or actual time failed. * @return Returns the {@link BundleEvents} object Array containing the state data of the current bundle. */ function queryCurrentBundleEvents(begin: number, end: number, callback: AsyncCallback>): void; @@ -396,7 +442,15 @@ declare namespace usageStatistics { * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @systemapi Hide this for inner system use. * @param maxNum Indicates max record number in result, max value is 1000, default value is 1000. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC Communication failed. + * @throws { BusinessError } 10000006 - Get application info failed. + * @throws { BusinessError } 10000007 - Get system or actual time failed. * @return Returns the {@link HapModuleInfo} object Array containing the usage data of the modules. */ function queryModuleUsageRecords(maxNum: number, callback: AsyncCallback>): void; @@ -409,7 +463,15 @@ declare namespace usageStatistics { * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @systemapi Hide this for inner system use. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC Communication failed. + * @throws { BusinessError } 10000006 - Get application info failed. + * @throws { BusinessError } 10000007 - Get system or actual time failed. * @return Returns the {@link HapModuleInfo} object Array containing the usage data of the modules. */ function queryModuleUsageRecords(callback: AsyncCallback>): void; @@ -426,11 +488,19 @@ declare namespace usageStatistics { * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @systemapi Hide this for inner system use. * @param bundleName, name of the application. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC Communication failed. + * @throws { BusinessError } 10000005 - Application is not installed. + * @throws { BusinessError } 10100002 - Get Application group info failed. * @return Returns the usage priority group of the calling application. */ - function queryAppGroup(bundleName? : string, callback: AsyncCallback): void; - function queryAppGroup(bundleName? : string): Promise; + function queryAppGroup(bundleName : string, callback: AsyncCallback): void; + function queryAppGroup(bundleName : string): Promise; /** * Declares group type. @@ -480,7 +550,14 @@ declare namespace usageStatistics { * @systemapi Hide this for inner system use. * @param bundleName, name of the application. * @param newGroup, the group of the application whose name is bundleName. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC Communication failed. + * @throws { BusinessError } 10100001 - Application group operation repeated. */ function setAppGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void; function setAppGroup(bundleName: string, newGroup: GroupType): Promise; @@ -492,12 +569,19 @@ declare namespace usageStatistics { * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @systemapi Hide this for inner system use. - * @param Callback, callback when application group change,return the BundleActiveGroupCallbackInfo. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @param Callback, callback when application group change,return the AppGroupCallbackInfo. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC Communication failed. + * @throws { BusinessError } 10100001 - Application group operation repeated. * @return Returns AppGroupCallbackInfo when the group of bundle changed. */ - function registerAppGroupCallBack(callback: Callback, callback: AsyncCallback): void; - function registerAppGroupCallBack(callback: Callback): Promise; + function registerAppGroupCallBack(groupCallback: Callback, callback: AsyncCallback): void; + function registerAppGroupCallBack(groupCallback: Callback): Promise; /** * unRegister callback from service. @@ -506,12 +590,19 @@ declare namespace usageStatistics { * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @systemapi Hide this for inner system use. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC Communication failed. + * @throws { BusinessError } 10100001 - Application group operation repeated. */ function unRegisterAppGroupCallBack(callback: AsyncCallback): void; function unRegisterAppGroupCallBack(): Promise; - /* + /** * Queries system event states data within a specified period identified by the start and end time. * * @since 9 @@ -520,7 +611,15 @@ declare namespace usageStatistics { * @systemapi Hide this for inner system use. * @param begin Indicates the start time of the query period, in milliseconds. * @param end Indicates the end time of the query period, in milliseconds. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC Communication failed. + * @throws { BusinessError } 10000006 - Get application info failed. + * @throws { BusinessError } 10000007 - Get system or actual time failed. * @return Returns the {@link DeviceEventStats} object Array containing the event states data. */ function queryDeviceEventStates(begin: number, end: number, callback: AsyncCallback>): void; @@ -535,12 +634,19 @@ declare namespace usageStatistics { * @systemapi Hide this for inner system use. * @param begin Indicates the start time of the query period, in milliseconds. * @param end Indicates the end time of the query period, in milliseconds. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC Communication failed. + * @throws { BusinessError } 10000006 - Get application info failed. + * @throws { BusinessError } 10000007 - Get system or actual time failed. * @return Returns the {@link DeviceEventStats} object Array containing the event states data. */ function queryNotificationNumber(begin: number, end: number, callback: AsyncCallback>): void; function queryNotificationNumber(begin: number, end: number): Promise>; } -export default usageStatistics; - +export default usageStatistics; \ No newline at end of file diff --git a/api/@ohos.resourceschedule.workScheduler.d.ts b/api/@ohos.resourceschedule.workScheduler.d.ts index 62152bdbba..0bc914b45f 100644 --- a/api/@ohos.resourceschedule.workScheduler.d.ts +++ b/api/@ohos.resourceschedule.workScheduler.d.ts @@ -106,7 +106,12 @@ declare namespace workScheduler { * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly * @param work The info of work. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 9700001 - Memory operation failed. + * @throws { BusinessError } 9700002 - Parcel operation failed. + * @throws { BusinessError } 9700003 - System service operation failed. + * @throws { BusinessError } 9700004 - Check workInfo failed. + * @throws { BusinessError } 9700005 - StartWork failed. */ function startWork(work: WorkInfo): void; @@ -118,7 +123,11 @@ declare namespace workScheduler { * @StageModelOnly * @param work The info of work. * @param needCancel True if need to be canceled after being stopped, otherwise false. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 9700001 - Memory operation failed. + * @throws { BusinessError } 9700002 - Parcel operation failed. + * @throws { BusinessError } 9700003 - System service operation failed. + * @throws { BusinessError } 9700004 - Check workInfo failed. */ function stopWork(work: WorkInfo, needCancel?: boolean): void; @@ -129,7 +138,11 @@ declare namespace workScheduler { * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly * @param workId The id of work. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 9700001 - Memory operation failed. + * @throws { BusinessError } 9700002 - Parcel operation failed. + * @throws { BusinessError } 9700003 - System service operation failed. + * @throws { BusinessError } 9700004 - Check workInfo failed. */ function getWorkStatus(workId: number, callback: AsyncCallback): void; function getWorkStatus(workId: number): Promise; @@ -140,7 +153,10 @@ declare namespace workScheduler { * @since 9 * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 9700001 - Memory operation failed. + * @throws { BusinessError } 9700002 - Parcel operation failed. + * @throws { BusinessError } 9700003 - System service operation failed. * @return the work info list. */ function obtainAllWorks(callback: AsyncCallback): Array; @@ -152,6 +168,11 @@ declare namespace workScheduler { * @since 9 * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 9700001 - Memory operation failed. + * @throws { BusinessError } 9700002 - Parcel operation failed. + * @throws { BusinessError } 9700003 - System service operation failed. + * @throws { BusinessError } 9700004 - Check workInfo failed. */ function stopAndClearWorks(): void; @@ -162,7 +183,11 @@ declare namespace workScheduler { * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly * @param workId The id of work. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 9700001 - Memory operation failed. + * @throws { BusinessError } 9700002 - Parcel operation failed. + * @throws { BusinessError } 9700003 - System service operation failed. + * @throws { BusinessError } 9700004 - Check workInfo failed. * @return true if last work running is timeout, otherwise false. */ function isLastWorkTimeOut(workId: number, callback: AsyncCallback): boolean; -- Gitee From c0bdb20b5f9e6e68531a72e0a3b0eef6128faf80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E6=80=A1?= Date: Mon, 10 Oct 2022 07:02:01 +0000 Subject: [PATCH 043/438] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱天怡 --- api/@ohos.resourceschedule.usageStatistics.d.ts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/api/@ohos.resourceschedule.usageStatistics.d.ts b/api/@ohos.resourceschedule.usageStatistics.d.ts index a2932023a5..41ebbc94fa 100644 --- a/api/@ohos.resourceschedule.usageStatistics.d.ts +++ b/api/@ohos.resourceschedule.usageStatistics.d.ts @@ -75,17 +75,6 @@ declare namespace usageStatistics { * in milliseconds. */ infosEndTime?: number; - - /** - * Merges a specified {@link BundleActiveInfo} object with this {@link BundleActiveInfo} object. - * The bundle name of both objects must be the same. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App - * @param toMerge Indicates the {@link BundleActiveInfo} object to merge. - * if the bundle names of the two {@link BundleActiveInfo} objects are different. - */ - merge(toMerge: BundleStatsInfo): void; } /** -- Gitee From 7c60acdb2758dc48dfe3ad3e4fc65b28c8e7cd42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E6=80=A1?= Date: Mon, 10 Oct 2022 07:06:12 +0000 Subject: [PATCH 044/438] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱天怡 --- api/@ohos.resourceschedule.usageStatistics.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/@ohos.resourceschedule.usageStatistics.d.ts b/api/@ohos.resourceschedule.usageStatistics.d.ts index 41ebbc94fa..b60fdf4103 100644 --- a/api/@ohos.resourceschedule.usageStatistics.d.ts +++ b/api/@ohos.resourceschedule.usageStatistics.d.ts @@ -258,6 +258,7 @@ declare namespace usageStatistics { * @throws { BusinessError } 10000002 - Parcel operation failed. * @throws { BusinessError } 10000003 - System service operation failed. * @throws { BusinessError } 10000004 - IPC Communication failed. + * @throws { BusinessError } 10000006 - Get application info failed. * @return Returns {@code true} if the application is idle in a particular period; * returns {@code false} otherwise. The time range of the particular period is defined by the system, * which may be hours or days. @@ -281,6 +282,7 @@ declare namespace usageStatistics { * @throws { BusinessError } 10000003 - System service operation failed. * @throws { BusinessError } 10000004 - IPC Communication failed. * @throws { BusinessError } 10000005 - Application is not installed. + * @throws { BusinessError } 10000006 - Get application info failed. * @throws { BusinessError } 10100002 - Get Application group info failed. * @return Returns the app group of the calling application. */ @@ -546,6 +548,7 @@ declare namespace usageStatistics { * @throws { BusinessError } 10000002 - Parcel operation failed. * @throws { BusinessError } 10000003 - System service operation failed. * @throws { BusinessError } 10000004 - IPC Communication failed. + * @throws { BusinessError } 10000006 - Get application info failed. * @throws { BusinessError } 10100001 - Application group operation repeated. */ function setAppGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void; -- Gitee From 62908028c2e29708f3917178d9ebe383ef6f0b3f Mon Sep 17 00:00:00 2001 From: cold_yixiu Date: Mon, 10 Oct 2022 15:16:12 +0800 Subject: [PATCH 045/438] camera interface change Signed-off-by: cold_yixiu --- api/@ohos.multimedia.camera.d.ts | 1453 +++++++++++++++++++++++------- 1 file changed, 1104 insertions(+), 349 deletions(-) diff --git a/api/@ohos.multimedia.camera.d.ts b/api/@ohos.multimedia.camera.d.ts index 18c9ad1114..96ad8c90d0 100644 --- a/api/@ohos.multimedia.camera.d.ts +++ b/api/@ohos.multimedia.camera.d.ts @@ -59,19 +59,105 @@ declare namespace camera { * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - CAMERA_STATUS_DISAPPEAR, + CAMERA_STATUS_DISAPPEAR = 1, /** * Available status. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - CAMERA_STATUS_AVAILABLE, + CAMERA_STATUS_AVAILABLE = 2, /** * Unavailable status. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - CAMERA_STATUS_UNAVAILABLE + CAMERA_STATUS_UNAVAILABLE = 3 + } + + /** + * 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; + } + + /** + * Frame rate range. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + interface FrameRateRange { + /** + * Min frame rate. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + readonly min: number; + /** + * Max frame rate. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + readonly max: number; + } + + /** + * 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 frameRateRange: FrameRateRange; + } + + /** + * 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; } /** @@ -81,40 +167,58 @@ declare namespace camera { */ interface CameraManager { /** - * Gets all camera descriptions. + * Gets supported camera descriptions. * @param callback Callback used to return the array of supported cameras. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - getCameras(callback: AsyncCallback>): void; + getSupportedCameras(callback: AsyncCallback>): void; /** - * Gets all camera descriptions. + * Gets supported camera descriptions. * @return Promise used to return an array of supported cameras. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - getCameras(): Promise>; + 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; /** - * Creates a CameraInput instance by camera id. - * @param cameraId Camera ID used to create the instance. + * Creates a CameraInput instance by camera. + * @param camera Camera device 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(cameraId: string, callback: AsyncCallback): void; + createCameraInput(camera: CameraDevice, callback: AsyncCallback): void; /** - * Creates a CameraInput instance by camera id. - * @param cameraId Camera ID used to create the instance. + * Creates a CameraInput instance by camera. + * @param camera Camera device 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(cameraId: string): Promise; + createCameraInput(camera: CameraDevice): Promise; /** * Creates a CameraInput instance by camera position and type. @@ -138,6 +242,100 @@ 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 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. @@ -159,7 +357,7 @@ declare namespace camera { * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - camera: Camera; + camera: CameraDevice; /** * Current camera status. * @since 9 @@ -185,13 +383,13 @@ declare namespace camera { * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - CAMERA_POSITION_BACK, + CAMERA_POSITION_BACK = 1, /** * Front position. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - CAMERA_POSITION_FRONT + CAMERA_POSITION_FRONT = 2 } /** @@ -212,28 +410,28 @@ declare namespace camera { * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - CAMERA_TYPE_WIDE_ANGLE, + CAMERA_TYPE_WIDE_ANGLE = 1, /** * Ultra wide camera * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - CAMERA_TYPE_ULTRA_WIDE, + CAMERA_TYPE_ULTRA_WIDE = 2, /** * Telephoto camera * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - CAMERA_TYPE_TELEPHOTO, + CAMERA_TYPE_TELEPHOTO = 3, /** * True depth camera * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - CAMERA_TYPE_TRUE_DEPTH + CAMERA_TYPE_TRUE_DEPTH = 4 } /** @@ -254,22 +452,22 @@ declare namespace camera { * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - CAMERA_CONNECTION_USB_PLUGIN, + CAMERA_CONNECTION_USB_PLUGIN = 1, /** * Remote camera * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - CAMERA_CONNECTION_REMOTE + CAMERA_CONNECTION_REMOTE = 2 } /** - * Camera object. + * Camera device object. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - interface Camera { + interface CameraDevice { /** * Camera id attribute. * @since 9 @@ -317,284 +515,210 @@ declare namespace camera { } /** - * Camera input object. + * Point parameter. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - interface CameraInput { + interface Point { /** - * Gets camera id. - * @param callback Callback used to return the camera ID. + * x co-ordinate * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - getCameraId(callback: AsyncCallback): void; - + x: number; /** - * Gets camera id. - * @return Promise used to return the camera ID. + * y co-ordinate * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - getCameraId(): Promise; + y: number; + } + /** + * Camera input object. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + interface CameraInput { /** - * Check if device has flash light. - * @param callback Callback used to return the flash light support status. + * Open camera. + * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - hasFlash(callback: AsyncCallback): void; + open(callback: AsyncCallback): void; /** - * Check if device has flash light. - * @return Promise used to return the flash light support status. + * Open camera. + * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - hasFlash(): Promise; + open(): Promise; /** - * Checks whether a specified flash mode is supported. - * @param flashMode Flash mode. - * @param callback Callback used to return the flash light support status. + * Close camera. + * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback): void; + close(callback: AsyncCallback): void; /** - * Checks whether a specified flash mode is supported. - * @param flashMode Flash mode - * @return Promise used to return flash mode support status. + * Close camera. + * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - isFlashModeSupported(flashMode: FlashMode): Promise; + close(): Promise; /** - * Gets current flash mode. - * @param callback Callback used to return the current flash mode. + * Releases instance. + * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - getFlashMode(callback: AsyncCallback): void; + release(callback: AsyncCallback): void; /** - * Gets current flash mode. - * @return Promise used to return the flash mode. + * Releases instance. + * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - getFlashMode(): Promise; + release(): Promise; /** - * Sets flash mode. - * @param flashMode Target flash mode. - * @param callback Callback used to return the result. + * Subscribes error event callback. + * @param type Event type. + * @param camera Camera device. + * @param callback Callback used to get the camera input errors. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - setFlashMode(flashMode: FlashMode, callback: AsyncCallback): void; + on(type: 'error', camera: CameraDevice, callback: ErrorCallback): void; + } + /** + * Enum for CameraInput error code. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + enum CameraInputErrorCode { /** - * Sets flash mode. - * @param flashMode Target flash mode. - * @return Promise used to return the result. + * Unknown error. * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core */ - setFlashMode(flashMode: FlashMode): Promise; - + ERROR_UNKNOWN = -1, /** - * Checks whether a specified focus mode is supported. - * @param afMode Focus mode. - * @param callback Callback used to return the device focus support status. + * No permission. * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core */ - isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback): void; - + ERROR_NO_PERMISSION = 0, /** - * Checks whether a specified focus mode is supported. - * @param afMode Focus mode. - * @return Promise used to return the focus mode support status. + * Camera device preempted. * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core */ - isFocusModeSupported(afMode: FocusMode): Promise; - + ERROR_DEVICE_PREEMPTED = 1, /** - * Gets current focus mode. - * @param callback Callback used to return the current focus mode. + * Camera device disconnected. * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core */ - getFocusMode(callback: AsyncCallback): void; - + ERROR_DEVICE_DISCONNECTED = 2, /** - * Gets current focus mode. - * @return Promise used to return the focus mode. + * Camera device in use. * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core */ - getFocusMode(): Promise; - + ERROR_DEVICE_IN_USE = 3, /** - * Sets focus mode. - * @param afMode Target focus mode. - * @param callback Callback used to return the result. + * Driver error. * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core */ - setFocusMode(afMode: FocusMode, callback: AsyncCallback): void; + ERROR_DRIVER_ERROR = 4, + } + + /** + * Camera input error object. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + interface CameraInputError extends Error { + code: CameraInputErrorCode; + } + /** + * Enum for camera format type. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + enum CameraFormat { /** - * Sets focus mode. - * @param afMode Target focus mode. - * @return Promise used to return the result. + * YUV 420 Format. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - setFocusMode(afMode: FocusMode): Promise; + CAMERA_FORMAT_YUV_420_SP = 1003, /** - * Gets all supported zoom ratio range. - * @param callback Callback used to return the zoom ratio range. + * JPEG Format. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - getZoomRatioRange(callback: AsyncCallback>): void; + CAMERA_FORMAT_JPEG = 2000 + } + /** + * Enum for flash mode. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + enum FlashMode { /** - * Gets all supported zoom ratio range. - * @return Promise used to return the zoom ratio range. + * Close mode. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - getZoomRatioRange(): Promise>; - + FLASH_MODE_CLOSE = 0, /** - * Gets zoom ratio. - * @param callback Callback used to return the current zoom ratio value. + * Open mode. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - getZoomRatio(callback: AsyncCallback): void; - + FLASH_MODE_OPEN = 1, /** - * Gets zoom ratio. - * @return Promise used to return the zoom ratio value. + * Auto mode. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - getZoomRatio(): Promise; - + FLASH_MODE_AUTO = 2, /** - * Sets zoom ratio. - * @param zoomRatio Target zoom ratio. - * @param callback Callback used to return the result. + * Always open mode. * @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; - - /** - * 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; + FLASH_MODE_ALWAYS_OPEN = 3 } /** - * Enum for CameraInput error code. + * Enum for exposure mode. * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core */ - enum CameraInputErrorCode { + enum ExposureMode { /** - * Unknown error. + * Lock exposure mode. * @since 9 */ - ERROR_UNKNOWN = -1 - } - - /** - * Camera input error object. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - interface CameraInputError extends Error { - code: CameraInputErrorCode; - } - - /** - * Enum for flash mode. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - enum FlashMode { - /** - * Close mode. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - FLASH_MODE_CLOSE = 0, + EXPOSURE_MODE_LOCKED = 0, /** - * Open mode. + * Auto exposure mode. * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core - */ - FLASH_MODE_OPEN, - /** - * Auto mode. - * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core */ - FLASH_MODE_AUTO, - /** - * Always open mode. + EXPOSURE_MODE_AUTO = 1, + /** + * Continuous automatic exposure. * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core */ - FLASH_MODE_ALWAYS_OPEN + EXPOSURE_MODE_CONTINUOUS_AUTO = 2 } /** @@ -614,19 +738,19 @@ declare namespace camera { * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - FOCUS_MODE_CONTINUOUS_AUTO, + FOCUS_MODE_CONTINUOUS_AUTO = 1, /** * Auto mode. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - FOCUS_MODE_AUTO, + FOCUS_MODE_AUTO = 2, /** * Locked mode. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - FOCUS_MODE_LOCKED + FOCUS_MODE_LOCKED = 3 } /** @@ -646,32 +770,69 @@ declare namespace camera { * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - FOCUS_STATE_FOCUSED, + FOCUS_STATE_FOCUSED = 1, /** * Unfocused state. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - FOCUS_STATE_UNFOCUSED + FOCUS_STATE_UNFOCUSED = 2 } /** - * Gets a CaptureSession instance. - * @param context Current application context. - * @param callback Callback used to return the CaptureSession instance. + * Enum for exposure state. * @since 9 - * @syscap SystemCapability.Multimedia.Camera.Core */ - function createCaptureSession(context: Context, callback: AsyncCallback): void; + enum ExposureState { + /** + * Scan state. + * @since 8 + */ + EXPOSURE_STATE_SCAN = 0, + /** + * Converged state. + * @since 8 + */ + EXPOSURE_STATE_CONVERGED = 1 + } /** - * Gets a CaptureSession instance. - * @param context Current application context. - * @return Promise used to return the CaptureSession instance. + * Enum for video stabilization mode. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - function createCaptureSession(context: Context): Promise; + 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 = 1, + /** + * MIDDLE mode means algorithms can achieve better effects than LOW mode. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + MIDDLE = 2, + /** + * HIGH mode means algorithms can achieve better effects than MIDDLE mode. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + HIGH = 3, + /** + * Camera HDF can select mode automatically. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + AUTO = 4 + } /** * Capture session object. @@ -730,178 +891,532 @@ declare namespace camera { addInput(cameraInput: CameraInput): Promise; /** - * Adds a camera preview output. - * @param previewOutput Target camera preview 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(previewOutput: PreviewOutput, callback: AsyncCallback): void; + removeInput(cameraInput: CameraInput, callback: AsyncCallback): void; /** - * Adds a camera preview output. - * @param previewOutput Target camera preview 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(previewOutput: PreviewOutput): Promise; + removeInput(cameraInput: CameraInput): Promise; /** - * Adds a camera photo output. - * @param photoOutput Target camera photo output to add. + * Adds a camera output. + * @param cameraOutput Target camera output to add. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - addOutput(photoOutput: PhotoOutput, callback: AsyncCallback): void; + addOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void; /** - * Adds a camera photo output. - * @param photoOutput Target camera photo output to add. + * Adds a camera output. + * @param cameraOutput Target camera output to add. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - addOutput(photoOutput: PhotoOutput): Promise; + addOutput(cameraOutput: CameraOutput): Promise; /** - * Adds a camera video output. - * @param videoOutput Target camera video output to add. + * Removes a camera output. + * @param previewOutput Target camera output to remove. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - addOutput(videoOutput: VideoOutput, callback: AsyncCallback): void; + removeOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void; /** - * Adds a camera video output. - * @param videoOutput Target camera video output to add. + * Removes a camera output. + * @param previewOutput Target camera output to remove. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - addOutput(videoOutput: VideoOutput): Promise; + removeOutput(cameraOutput: CameraOutput): Promise; /** - * Removes a camera input. - * @param cameraInput Target camera input to remove. + * Starts capture session. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - removeInput(cameraInput: CameraInput, callback: AsyncCallback): void; + start(callback: AsyncCallback): void; /** - * Removes a camera input. - * @param cameraInput Target camera input to remove. + * Starts capture session. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - removeInput(cameraInput: CameraInput): Promise; + start(): Promise; /** - * Removes a camera preview output. - * @param previewOutput Target camera preview output to remove. + * Stops capture session. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - removeOutput(previewOutput: PreviewOutput, callback: AsyncCallback): void; + stop(callback: AsyncCallback): void; /** - * Removes a camera preview output. - * @param previewOutput Target camera preview output to remove. + * Stops capture session. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - removeOutput(previewOutput: PreviewOutput): Promise; + stop(): Promise; /** - * Removes a camera photo output. - * @param photoOutput Target camera photo output to remove. + * Release capture session instance. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - removeOutput(photoOutput: PhotoOutput, callback: AsyncCallback): void; + release(callback: AsyncCallback): void; /** - * Removes a camera photo output. - * @param photoOutput Target camera photo output to remove. + * Release capture session instance. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - removeOutput(photoOutput: PhotoOutput): Promise; + 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; /** - * Removes a camera video output. - * @param videoOutput Target camera video output to remove. + * Sets flash mode. + * @param flashMode Target flash mode. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - removeOutput(videoOutput: VideoOutput, callback: AsyncCallback): void; + setFlashMode(flashMode: FlashMode, callback: AsyncCallback): void; /** - * Removes a camera video output. - * @param videoOutput Target camera video output to remove. + * Sets flash mode. + * @param flashMode Target flash mode. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - removeOutput(videoOutput: VideoOutput): Promise; + setFlashMode(flashMode: FlashMode): Promise; /** - * Starts capture session. + * 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; + + /** + * 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; + + /** + * 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 */ - start(callback: AsyncCallback): void; + 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; /** - * Starts capture session. + * 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 */ - start(): Promise; + setExposureBias(exposureBias: number): Promise; /** - * Stops capture session. + * 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 */ - stop(callback: AsyncCallback): void; + setFocusMode(afMode: FocusMode, callback: AsyncCallback): void; /** - * Stops capture session. + * Sets focus mode. + * @param afMode Target focus mode. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - stop(): Promise; + setFocusMode(afMode: FocusMode): Promise; /** - * Release capture session instance. + * Sets focus point. + * @param point Target focus point. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - release(callback: AsyncCallback): void; + setFocusPoint(point: Point, callback: AsyncCallback): void; /** - * Release capture session instance. + * Sets focus point. + * @param afMode Target focus point. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - release(): Promise; + 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 + */ + isVideoStabilizationModeSupported(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 + */ + isVideoStabilizationModeSupported(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. @@ -919,7 +1434,21 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core */ enum CaptureSessionErrorCode { - ERROR_UNKNOWN = -1 + /** + * Unknown error. + * @since 9 + */ + ERROR_UNKNOWN = -1, + /** + * Insufficient resources. + * @since 9 + */ + ERROR_INSUFFICIENT_RESOURCES = 0, + /** + * Timeout error. + * @since 9 + */ + ERROR_TIMEOUT = 1, } /** @@ -932,44 +1461,65 @@ declare namespace camera { } /** - * Creates a PreviewOutput instance. - * @param surfaceId Surface object id used in camera preview output. - * @param callback Callback used to return the PreviewOutput instance. + * Camera output object. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - function createPreviewOutput(surfaceId: string, callback: AsyncCallback): void; + interface CameraOutput { + /** + * Release output instance. + * @param callback Callback used to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + release(callback: AsyncCallback): void; - /** - * 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; + /** + * Release output instance. + * @return Promise used to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + release(): Promise; + } /** * Preview output object. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - interface PreviewOutput { + interface PreviewOutput extends CameraOutput { /** - * Release output instance. + * Start output instance. * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - release(callback: AsyncCallback): void; + start(callback: AsyncCallback): void; /** - * Release output instance. + * Start output instance. * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - release(): Promise; + start(): Promise; + + /** + * Stop output instance. + * @param callback Callback used to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + stop(callback: AsyncCallback): void; + + /** + * Stop output instance. + * @return Promise used to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + stop(): Promise; /** * Subscribes frame start event callback. @@ -1005,7 +1555,11 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core */ enum PreviewOutputErrorCode { - ERROR_UNKNOWN = -1 + /** + * Unknown error. + * @since 9 + */ + ERROR_UNKNOWN = -1, } /** @@ -1017,24 +1571,6 @@ 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 @@ -1070,6 +1606,26 @@ 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 @@ -1088,14 +1644,14 @@ declare namespace camera { * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - QUALITY_LEVEL_MEDIUM, + QUALITY_LEVEL_MEDIUM = 1, /** * Low image quality. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - QUALITY_LEVEL_LOW + QUALITY_LEVEL_LOW = 2 } /** @@ -1109,12 +1665,27 @@ 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; } /** @@ -1122,7 +1693,7 @@ declare namespace camera { * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - interface PhotoOutput { + interface PhotoOutput extends CameraOutput { /** * Start capture output. * @param callback Callback used to return the result. @@ -1150,20 +1721,20 @@ declare namespace camera { capture(setting?: PhotoCaptureSetting): Promise; /** - * Release output instance. - * @param callback Callback used to return the result. + * Check whether to support mirror photo. + * @param callback Callback used to return the mirror support status. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - release(callback: AsyncCallback): void; + isMirrorSupported(callback: AsyncCallback): void; /** - * Release output instance. - * @return Promise used to return the result. + * Check whether to support mirror photo. + * @return Promise used to return the mirror support status. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ - release(): Promise; + isMirrorSupported(): Promise; /** * Subscribes capture start event callback. @@ -1248,7 +1819,26 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core */ enum PhotoOutputErrorCode { - ERROR_UNKNOWN = -1 + /** + * Unknown error. + * @since 9 + */ + ERROR_UNKNOWN = -1, + /** + * Driver error. + * @since 9 + */ + ERROR_DRIVER_ERROR = 0, + /** + * Insufficient resources. + * @since 9 + */ + ERROR_INSUFFICIENT_RESOURCES = 1, + /** + * Timeout error. + * @since 9 + */ + ERROR_TIMEOUT = 2 } /** @@ -1260,30 +1850,12 @@ 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 { + interface VideoOutput extends CameraOutput { /** * Start video output. * @param callback Callback used to return the result. @@ -1292,7 +1864,7 @@ declare namespace camera { */ start(callback: AsyncCallback): void; - /** + /** * Start video output. * @return Promise used to return the result. * @since 9 @@ -1316,22 +1888,6 @@ declare namespace camera { */ stop(): Promise; - /** - * 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; - /** * Subscribes frame start event callback. * @param type Event type. @@ -1366,7 +1922,16 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core */ enum VideoOutputErrorCode { - ERROR_UNKNOWN = -1 + /** + * Unknown error. + * @since 9 + */ + ERROR_UNKNOWN = -1, + /** + * Driver error. + * @since 9 + */ + ERROR_DRIVER_ERROR = 0 } /** @@ -1377,6 +1942,196 @@ declare namespace camera { 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 + * @param callback Callback used to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + start(callback: AsyncCallback): void; + + /** + * Start output metadata + * @return Promise used to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + start(): Promise; + + /** + * Stop output metadata + * @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; + + /** + * Subscribes to metadata objects available event callback. + * @param type Event type. + * @param callback Callback used to get the available metadata objects. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + on(type: 'metadataObjectsAvailable', 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 metadata 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 = 0 + } + + /** + * Metadata output error object. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + interface MetadataOutputError extends Error { + code: MetadataOutputErrorCode; + } } export default camera; -- Gitee From 09c874bf2fbb5b3becc3d7e7b39765dd290c8140 Mon Sep 17 00:00:00 2001 From: ltdong Date: Mon, 10 Oct 2022 13:01:02 +0000 Subject: [PATCH 046/438] update api/@ohos.data.rdb.d.ts. Signed-off-by: ltdong --- api/@ohos.data.rdb.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index c127ca55fd..f086b6a560 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -60,7 +60,8 @@ declare namespace rdb { * @param version Indicates the database version for upgrade or downgrade. * @return Returns an RDB store {@link ohos.data.rdb.RdbStore}. * @throws {BusinessError} if process failed - * @errorcode 14800004 + * @errorcode 14800010 Invalid database name + * @errorcode 14800011 Database corrupted * @errorcode 401 */ function getRdbStoreV9(context: Context, config: StoreConfig, version: number, callback: AsyncCallback): void; @@ -89,7 +90,7 @@ declare namespace rdb { * @param name Indicates the database name. * @return Returns true if the database is deleted; returns false otherwise. * @throws {BusinessError} if process failed - * @errorcode 14800004 + * @errorcode 14800010 Invalid database name * @errorcode 401 */ function deleteRdbStoreV9(context: Context, name: string, callback: AsyncCallback): void; -- Gitee From d41655e7b6eac4d1a7b757a491b42d1f1be7be20 Mon Sep 17 00:00:00 2001 From: ltdong Date: Mon, 10 Oct 2022 13:21:09 +0000 Subject: [PATCH 047/438] update api/data/rdb/resultSet.d.ts. Signed-off-by: ltdong --- api/data/rdb/resultSet.d.ts | 45 ++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/api/data/rdb/resultSet.d.ts b/api/data/rdb/resultSet.d.ts index cc5fe23567..10f553a523 100755 --- a/api/data/rdb/resultSet.d.ts +++ b/api/data/rdb/resultSet.d.ts @@ -374,8 +374,7 @@ export default interface ResultSetV9 { * @param columnName Indicates the name of the specified column in the result set. * @return Returns the index of the specified column. * @throws {BusinessError} if process failed - * @errorcode 14800003 - * @errorcode 401 + * @errorcode 401 Parameter error. */ getColumnIndex(columnName: string): number; @@ -388,8 +387,8 @@ export default interface ResultSetV9 { * @param columnIndex Indicates the index of the specified column in the result set. * @return Returns the name of the specified column. * @throws {BusinessError} if process failed - * @errorcode 14800003 - * @errorcode 401 + * @errorcode 14800012 The result set is empty or the specified location is invalid. + * @errorcode 401 Parameter error. */ getColumnName(columnIndex: number): string; @@ -404,8 +403,8 @@ export default interface ResultSetV9 { * @return Returns true if the result set is moved successfully and does not go beyond the range; * returns false otherwise. * @throws {BusinessError} if process failed - * @errorcode 14800002 - * @errorcode 401 + * @errorcode 14800012 The result set is empty or the specified location is invalid. + * @errorcode 401 Parameter error. */ goTo(offset: number): boolean; @@ -418,8 +417,8 @@ export default interface ResultSetV9 { * @param rowIndex Indicates the index of the specified row, which starts from 0. * @return Returns true if the result set is moved successfully; returns false otherwise. * @throws {BusinessError} if process failed - * @errorcode 14800002 - * @errorcode 401 + * @errorcode 14800012 The result set is empty or the specified location is invalid. + * @errorcode 401 Parameter error. */ goToRow(position: number): boolean; @@ -432,7 +431,7 @@ export default interface ResultSetV9 { * @return Returns true if the result set is moved successfully; * returns false otherwise, for example, if the result set is empty. * @throws {BusinessError} if process failed - * @errorcode 14800002 + * @errorcode 14800012 The result set is empty or the specified location is invalid. */ goToFirstRow(): boolean; @@ -445,7 +444,7 @@ export default interface ResultSetV9 { * @return Returns true if the result set is moved successfully; * returns false otherwise, for example, if the result set is empty. * @throws {BusinessError} if process failed - * @errorcode 14800002 + * @errorcode 14800012 The result set is empty or the specified location is invalid. */ goToLastRow(): boolean; @@ -458,7 +457,7 @@ export default interface ResultSetV9 { * @return Returns true if the result set is moved successfully; * returns false otherwise, for example, if the result set is already in the last row. * @throws {BusinessError} if process failed - * @errorcode 14800002 + * @errorcode 14800012 The result set is empty or the specified location is invalid. */ goToNextRow(): boolean; @@ -471,7 +470,7 @@ export default interface ResultSetV9 { * @return Returns true if the result set is moved successfully; * returns false otherwise, for example, if the result set is already in the first row. * @throws {BusinessError} if process failed - * @errorcode 14800002 + * @errorcode 14800012 The result set is empty or the specified location is invalid. */ goToPreviousRow(): boolean; @@ -485,8 +484,8 @@ export default interface ResultSetV9 { * @param columnIndex Indicates the specified column index, which starts from 0. * @return Returns the value of the specified column as a byte array. * @throws {BusinessError} if process failed - * @errorcode 14800003 - * @errorcode 401 + * @errorcode 14800013 The column value is null or the column type is incompatible. + * @errorcode 401 Parameter error. */ getBlob(columnIndex: number): Uint8Array; @@ -500,8 +499,8 @@ export default interface ResultSetV9 { * @param columnIndex Indicates the specified column index, which starts from 0. * @return Returns the value of the specified column as a string. * @throws {BusinessError} if process failed - * @errorcode 14800003 - * @errorcode 401 + * @errorcode 14800013 The column value is null or the column type is incompatible. + * @errorcode 401 Parameter error. */ getString(columnIndex: number): string; @@ -515,8 +514,8 @@ export default interface ResultSetV9 { * @param columnIndex Indicates the specified column index, which starts from 0. * @return Returns the value of the specified column as a long. * @throws {BusinessError} if process failed - * @errorcode 14800003 - * @errorcode 401 + * @errorcode 14800013 The column value is null or the column type is incompatible. + * @errorcode 401 Parameter error. */ getLong(columnIndex: number): number; @@ -530,8 +529,8 @@ export default interface ResultSetV9 { * @param columnIndex Indicates the specified column index, which starts from 0. * @return Returns the value of the specified column as a double. * @throws {BusinessError} if process failed - * @errorcode 14800003 - * @errorcode 401 + * @errorcode 14800013 The column value is null or the column type is incompatible. + * @errorcode 401 Parameter error. */ getDouble(columnIndex: number): number; @@ -545,8 +544,8 @@ export default interface ResultSetV9 { * @return Returns true if the value of the specified column in the current row is null; * returns false otherwise. * @throws {BusinessError} if process failed - * @errorcode 14800003 - * @errorcode 401 + * @errorcode 14800013 The column value is null or the column type is incompatible. + * @errorcode 401 Parameter error. */ isColumnNull(columnIndex: number): boolean; @@ -558,7 +557,7 @@ export default interface ResultSetV9 { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @return Returns true if the result set is closed; returns false otherwise. * @throws {BusinessError} if process failed - * @errorcode 14800002 + * @errorcode 14800012 The result set is empty or the specified location is invalid. */ close(): void; } \ No newline at end of file -- Gitee From 6b7a013eda78a9f67de5256c8e9230d8675fc8f7 Mon Sep 17 00:00:00 2001 From: ltdong Date: Mon, 10 Oct 2022 13:23:26 +0000 Subject: [PATCH 048/438] update api/data/rdb/resultSet.d.ts. Signed-off-by: ltdong --- api/data/rdb/resultSet.d.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/data/rdb/resultSet.d.ts b/api/data/rdb/resultSet.d.ts index 10f553a523..9bdb3f9511 100755 --- a/api/data/rdb/resultSet.d.ts +++ b/api/data/rdb/resultSet.d.ts @@ -374,6 +374,7 @@ export default interface ResultSetV9 { * @param columnName Indicates the name of the specified column in the result set. * @return Returns the index of the specified column. * @throws {BusinessError} if process failed + * @errorcode 14800013 The column value is null or the column type is incompatible. * @errorcode 401 Parameter error. */ getColumnIndex(columnName: string): number; @@ -387,7 +388,7 @@ export default interface ResultSetV9 { * @param columnIndex Indicates the index of the specified column in the result set. * @return Returns the name of the specified column. * @throws {BusinessError} if process failed - * @errorcode 14800012 The result set is empty or the specified location is invalid. + * @errorcode 14800013 The column value is null or the column type is incompatible. * @errorcode 401 Parameter error. */ getColumnName(columnIndex: number): string; -- Gitee From 767366326926ec73669b9c8cb5f23204534cc8fe Mon Sep 17 00:00:00 2001 From: ltdong Date: Mon, 10 Oct 2022 13:39:28 +0000 Subject: [PATCH 049/438] update api/@ohos.data.rdb.d.ts. Signed-off-by: ltdong --- api/@ohos.data.rdb.d.ts | 159 +++++++++++++--------------------------- 1 file changed, 51 insertions(+), 108 deletions(-) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index f086b6a560..08401044d1 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -62,7 +62,7 @@ declare namespace rdb { * @throws {BusinessError} if process failed * @errorcode 14800010 Invalid database name * @errorcode 14800011 Database corrupted - * @errorcode 401 + * @errorcode 401 Parameter error. */ function getRdbStoreV9(context: Context, config: StoreConfig, version: number, callback: AsyncCallback): void; function getRdbStoreV9(context: Context, config: StoreConfig, version: number): Promise; @@ -91,7 +91,7 @@ declare namespace rdb { * @return Returns true if the database is deleted; returns false otherwise. * @throws {BusinessError} if process failed * @errorcode 14800010 Invalid database name - * @errorcode 401 + * @errorcode 401 Parameter error. */ function deleteRdbStoreV9(context: Context, name: string, callback: AsyncCallback): void; function deleteRdbStoreV9(context: Context, name: string): Promise; @@ -410,8 +410,7 @@ declare namespace rdb { * @param values Indicates the row of data to be inserted into the table. * @return Returns the row ID if the operation is successful; returns -1 otherwise. * @throws {BusinessError} if process failed - * @errorcode 14800004 - * @errorcode 401 + * @errorcode 401 Parameter error. */ insert(table: string, values: ValuesBucket, callback: AsyncCallback): void; insert(table: string, values: ValuesBucket): Promise; @@ -425,8 +424,7 @@ declare namespace rdb { * @param values Indicates the rows of data to be inserted into the table. * @return Returns the number of values that were inserted if the operation is successful; returns -1 otherwise. * @throws {BusinessError} if process failed - * @errorcode 14800004 - * @errorcode 401 + * @errorcode 401 Parameter error. */ batchInsert(table: string, values: Array, callback: AsyncCallback): void; batchInsert(table: string, values: Array): Promise; @@ -440,8 +438,7 @@ declare namespace rdb { * @param predicates Indicates the specified update condition by the instance object of RdbPredicatesV9. * @return Returns the number of affected rows. * @throws {BusinessError} if process failed - * @errorcode 14800004 - * @errorcode 401 + * @errorcode 401 Parameter error. */ update(values: ValuesBucket, predicates: RdbPredicatesV9, callback: AsyncCallback): void; update(values: ValuesBucket, predicates: RdbPredicatesV9): Promise; @@ -457,8 +454,7 @@ declare namespace rdb { * @param predicates Indicates the specified update condition by the instance object of DataSharePredicates. * @return Returns the number of affected rows. * @throws {BusinessError} if process failed - * @errorcode 14800004 - * @errorcode 401 + * @errorcode 401 Parameter error. */ update(table: string, values: ValuesBucket, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; update(table: string, values: ValuesBucket, predicates: dataSharePredicates.DataSharePredicates): Promise; @@ -471,8 +467,7 @@ declare namespace rdb { * @param predicates Indicates the specified delete condition by the instance object of RdbPredicatesV9. * @return Returns the number of affected rows. * @throws {BusinessError} if process failed - * @errorcode 14800004 - * @errorcode 401 + * @errorcode 401 Parameter error. */ delete(predicates: RdbPredicatesV9, callback: AsyncCallback): void; delete(predicates: RdbPredicatesV9): Promise; @@ -487,8 +482,7 @@ declare namespace rdb { * @param predicates Indicates the specified delete condition by the instance object of DataSharePredicates. * @return Returns the number of affected rows. * @throws {BusinessError} if process failed - * @errorcode 14800004 - * @errorcode 401 + * @errorcode 401 Parameter error. */ delete(table: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; delete(table: string, predicates: dataSharePredicates.DataSharePredicates): Promise; @@ -502,8 +496,7 @@ declare namespace rdb { * @param columns Indicates the columns to query. If the value is null, the query applies to all columns. * @return Returns a ResultSetV9 object if the operation is successful; * @throws {BusinessError} if process failed - * @errorcode 14800004 - * @errorcode 401 + * @errorcode 401 Parameter error. */ query(predicates: RdbPredicatesV9, columns: Array, callback: AsyncCallback): void; query(predicates: RdbPredicatesV9, columns?: Array): Promise; @@ -519,8 +512,7 @@ declare namespace rdb { * @param columns Indicates the columns to query. If the value is null, the query applies to all columns. * @return Returns a ResultSet object if the operation is successful; * @throws {BusinessError} if process failed - * @errorcode 14800004 - * @errorcode 401 + * @errorcode 401 Parameter error. */ query(table: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array, callback: AsyncCallback): void; query(table: string, predicates: dataSharePredicates.DataSharePredicates, columns?: Array): Promise; @@ -536,8 +528,7 @@ declare namespace rdb { * @param columns Indicates the columns to remote query. If the value is null, the remote query applies to all columns. * @return Returns a ResultSetV9 object if the operation is successful; * @throws {BusinessError} if process failed - * @errorcode 14800004 - * @errorcode 401 + * @errorcode 401 Parameter error. */ remoteQuery(device: string, table: string, predicates: RdbPredicatesV9, columns: Array, callback: AsyncCallback): void; remoteQuery(device: string, table: string, predicates: RdbPredicatesV9, columns: Array): Promise; @@ -551,8 +542,7 @@ declare namespace rdb { * @param bindArgs Indicates the values of the parameters in the SQL statement. The values are strings. * @return Returns a ResultSetV9 object if the operation is successful; * @throws {BusinessError} if process failed - * @errorcode 14800004 - * @errorcode 401 + * @errorcode 401 Parameter error. */ querySql(sql: string, bindArgs: Array, callback: AsyncCallback): void; querySql(sql: string, bindArgs?: Array): Promise; @@ -565,8 +555,7 @@ declare namespace rdb { * @param sql Indicates the SQL statement to execute. * @param bindArgs Indicates the values of the parameters in the SQL statement. The values are strings. * @throws {BusinessError} if process failed - * @errorcode 14800004 - * @errorcode 401 + * @errorcode 401 Parameter error. */ executeSql(sql: string, bindArgs: Array, callback: AsyncCallback): void; executeSql(sql: string, bindArgs?: Array): Promise; @@ -577,7 +566,6 @@ declare namespace rdb { * @since 9 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @throws {BusinessError} if process failed - * @errorcode 14800004 */ beginTransaction():void; @@ -587,7 +575,6 @@ declare namespace rdb { * @since 9 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @throws {BusinessError} if process failed - * @errorcode 14800004 */ commit():void; @@ -597,7 +584,6 @@ declare namespace rdb { * @since 9 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @throws {BusinessError} if process failed - * @errorcode 14800004 */ rollBack():void; @@ -608,8 +594,7 @@ declare namespace rdb { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @param destName Indicates the name that saves the database backup. * @throws {BusinessError} if process failed - * @errorcode 14800004 - * @errorcode 401 + * @errorcode 401 Parameter error. */ backup(destName:string, callback: AsyncCallback):void; backup(destName:string): Promise; @@ -621,8 +606,7 @@ declare namespace rdb { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @param srcName Indicates the name that saves the database file. * @throws {BusinessError} if process failed - * @errorcode 14800004 - * @errorcode 401 + * @errorcode 401 Parameter error. */ restore(srcName:string, callback: AsyncCallback):void; restore(srcName:string): Promise; @@ -635,9 +619,7 @@ declare namespace rdb { * @param tables the tables name you want to set * @permission ohos.permission.DISTRIBUTED_DATASYNC * @throws {BusinessError} if process failed - * @errorcode 14900001 - * @errorcode 201 - * @errorcode 401 + * @errorcode 401 Parameter error. */ setDistributedTables(tables: Array, callback: AsyncCallback): void; setDistributedTables(tables: Array): Promise; @@ -653,9 +635,7 @@ declare namespace rdb { * @permission ohos.permission.DISTRIBUTED_DATASYNC * @return the distributed table name. * @throws {BusinessError} if process failed - * @errorcode 14900001 - * @errorcode 201 - * @errorcode 401 + * @errorcode 401 Parameter error. */ obtainDistributedTableName(device: string, table: string, callback: AsyncCallback): void; obtainDistributedTableName(device: string, table: string): Promise; @@ -670,9 +650,7 @@ declare namespace rdb { * @param callback Indicates the callback used to send the synchronization result to the caller. * @permission ohos.permission.DISTRIBUTED_DATASYNC * @throws {BusinessError} if process failed - * @errorcode 14900001 - * @errorcode 201 - * @errorcode 401 + * @errorcode 401 Parameter error. */ sync(mode: SyncMode, predicates: RdbPredicatesV9, callback: AsyncCallback>): void; sync(mode: SyncMode, predicates: RdbPredicatesV9): Promise>; @@ -687,9 +665,7 @@ declare namespace rdb { * @param observer Indicates the observer of data change events in the distributed database. * @permission ohos.permission.DISTRIBUTED_DATASYNC * @throws {BusinessError} if process failed - * @errorcode 14900001 - * @errorcode 201 - * @errorcode 401 + * @errorcode 401 Parameter error. */ on(event: 'dataChange', type: SubscribeType, observer: Callback>): void; @@ -702,9 +678,7 @@ declare namespace rdb { * @param observer Indicates the data change observer already registered. * @permission ohos.permission.DISTRIBUTED_DATASYNC * @throws {BusinessError} if process failed - * @errorcode 14900001 - * @errorcode 201 - * @errorcode 401 + * @errorcode 401 Parameter error. */ off(event:'dataChange', type: SubscribeType, observer: Callback>): void; } @@ -1124,8 +1098,7 @@ declare namespace rdb { * @since 9 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ constructor(name: string) @@ -1138,8 +1111,7 @@ declare namespace rdb { * @param devices Indicates specified remote devices. * @return Returns the RdbPredicatesV9 self. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ inDevices(devices: Array): RdbPredicatesV9; @@ -1151,8 +1123,7 @@ declare namespace rdb { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @return Returns the RdbPredicatesV9 self. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ inAllDevices(): RdbPredicatesV9; @@ -1167,8 +1138,7 @@ declare namespace rdb { * @param value Indicates the value to match with the RdbPredicatesV9. * @return Returns the RdbPredicatesV9 that match the specified field. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ equalTo(field: string, value: ValueType): RdbPredicatesV9; @@ -1183,8 +1153,7 @@ declare namespace rdb { * @param value Indicates the value to match with the RdbPredicatesV9. * @return Returns the RdbPredicatesV9 that match the specified field. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ notEqualTo(field: string, value: ValueType): RdbPredicatesV9; @@ -1196,8 +1165,7 @@ declare namespace rdb { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @return Returns the RdbPredicatesV9 with the left parenthesis. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ beginWrap(): RdbPredicatesV9; @@ -1210,8 +1178,7 @@ declare namespace rdb { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @return Returns the RdbPredicatesV9 with the right parenthesis. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ endWrap(): RdbPredicatesV9; @@ -1223,8 +1190,7 @@ declare namespace rdb { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @return Returns the RdbPredicatesV9 with the or condition. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ or(): RdbPredicatesV9; @@ -1236,8 +1202,7 @@ declare namespace rdb { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @return Returns the RdbPredicatesV9 with the and condition. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ and(): RdbPredicatesV9; @@ -1252,8 +1217,7 @@ declare namespace rdb { * @param value Indicates the value to match with the RdbPredicatesV9. * @return Returns the RdbPredicatesV9 that match the specified field. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ contains(field: string, value: string): RdbPredicatesV9; @@ -1268,8 +1232,7 @@ declare namespace rdb { * @param value Indicates the value to match with the RdbPredicatesV9. * @return Returns the RdbPredicatesV9 that match the specified field. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ beginsWith(field: string, value: string): RdbPredicatesV9; @@ -1284,8 +1247,7 @@ declare namespace rdb { * @param value Indicates the value to match with the RdbPredicatesV9. * @return Returns the RdbPredicatesV9 that match the specified field. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ endsWith(field: string, value: string): RdbPredicatesV9; @@ -1298,8 +1260,7 @@ declare namespace rdb { * @param field Indicates the column name in the database table. * @return Returns the RdbPredicatesV9 that match the specified field. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ isNull(field: string): RdbPredicatesV9; @@ -1312,8 +1273,7 @@ declare namespace rdb { * @param field Indicates the column name in the database table. * @return Returns the RdbPredicatesV9 that match the specified field. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ isNotNull(field: string): RdbPredicatesV9; @@ -1329,8 +1289,7 @@ declare namespace rdb { * is a wildcard (like * in a regular expression). * @return Returns the RdbPredicatesV9 that match the specified field. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ like(field: string, value: string): RdbPredicatesV9; @@ -1345,8 +1304,7 @@ declare namespace rdb { * @param value Indicates the value to match with RdbPredicatesV9. * @return Returns the SQL statement with the specified RdbPredicatesV9. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ glob(field: string, value: string): RdbPredicatesV9; @@ -1360,8 +1318,7 @@ declare namespace rdb { * @param high Indicates the maximum value. * @return Returns the SQL query statement with the specified RdbPredicatesV9. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ between(field: string, low: ValueType, high: ValueType): RdbPredicatesV9; @@ -1376,8 +1333,7 @@ declare namespace rdb { * @param high Indicates the maximum value to match with DataAbilityPredicates. * @return Returns the SQL query statement with the specified RdbPredicatesV9. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ notBetween(field: string, low: ValueType, high: ValueType): RdbPredicatesV9; @@ -1390,8 +1346,7 @@ declare namespace rdb { * @param value Indicates the String field. * @return Returns the SQL query statement with the specified RdbPredicatesV9. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ greaterThan(field: string, value: ValueType): RdbPredicatesV9; @@ -1404,8 +1359,7 @@ declare namespace rdb { * @param value Indicates the String field. * @return Returns the SQL query statement with the specified RdbPredicatesV9. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ lessThan(field: string, value: ValueType): RdbPredicatesV9; @@ -1418,8 +1372,7 @@ declare namespace rdb { * @param value Indicates the String field. * @return Returns the SQL query statement with the specified RdbPredicatesV9. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ greaterThanOrEqualTo(field: string, value: ValueType): RdbPredicatesV9; @@ -1432,8 +1385,7 @@ declare namespace rdb { * @param value Indicates the String field. * @return Returns the SQL query statement with the specified RdbPredicatesV9. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ lessThanOrEqualTo(field: string, value: ValueType): RdbPredicatesV9; @@ -1446,8 +1398,7 @@ declare namespace rdb { * @param field Indicates the column name for sorting the return list. * @return Returns the SQL query statement with the specified RdbPredicatesV9. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ orderByAsc(field: string): RdbPredicatesV9; @@ -1460,8 +1411,7 @@ declare namespace rdb { * @param field Indicates the column name for sorting the return list. * @return Returns the SQL query statement with the specified RdbPredicatesV9. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ orderByDesc(field: string): RdbPredicatesV9; @@ -1472,8 +1422,7 @@ declare namespace rdb { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @return Returns the SQL query statement with the specified RdbPredicatesV9. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ distinct(): RdbPredicatesV9; @@ -1485,8 +1434,7 @@ declare namespace rdb { * @param value Indicates the max length of the return list. * @return Returns the SQL query statement with the specified RdbPredicatesV9. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ limitAs(value: number): RdbPredicatesV9; @@ -1499,8 +1447,7 @@ declare namespace rdb { * @param rowOffset Indicates the start position of the returned result. The value is a positive integer. * @return Returns the SQL query statement with the specified AbsPredicates. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ offsetAs(rowOffset: number): RdbPredicatesV9; @@ -1512,8 +1459,7 @@ declare namespace rdb { * @param fields Indicates the specified columns by which query results are grouped. * @return Returns the RdbPredicatesV9 with the specified columns by which query results are grouped. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ groupBy(fields: Array): RdbPredicatesV9; @@ -1526,8 +1472,7 @@ declare namespace rdb { * @param indexName Indicates the name of the index column. * @return Returns RdbPredicatesV9 with the specified index column. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ indexedBy(field: string): RdbPredicatesV9; @@ -1541,8 +1486,7 @@ declare namespace rdb { * @param values Indicates the values to match with RdbPredicatesV9. * @return Returns RdbPredicatesV9 that matches the specified field. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ in(field: string, value: Array): RdbPredicatesV9; @@ -1556,8 +1500,7 @@ declare namespace rdb { * @param values Indicates the values to match with RdbPredicatesV9. * @return Returns RdbPredicatesV9 that matches the specified field. * @throws {BusinessError} if process failed - * @errorcode 14800005 - * @errorcode 401 + * @errorcode 401 Parameter error. */ notIn(field: string, value: Array): RdbPredicatesV9; } -- Gitee From 81114be618a9c74e292c3963e076b2f423d5c701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BB=96=E5=BA=B7=E5=BA=B7?= Date: Tue, 11 Oct 2022 09:51:04 +0800 Subject: [PATCH 050/438] =?UTF-8?q?reminderAgent=E6=96=B0=E5=A2=9Ejs?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=EF=BC=8C=E9=80=82=E9=85=8D=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 廖康康 --- api/@ohos.reminderAgentManager.d.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/api/@ohos.reminderAgentManager.d.ts b/api/@ohos.reminderAgentManager.d.ts index 2dfd44868d..a004497c6e 100644 --- a/api/@ohos.reminderAgentManager.d.ts +++ b/api/@ohos.reminderAgentManager.d.ts @@ -34,7 +34,7 @@ declare namespace reminderAgentManager { * @permission ohos.permission.PUBLISH_AGENT_REMINDER * @param { ReminderRequest } reminderReq - Indicates the reminder instance to publish. * @param { AsyncCallback } callback - Indicates the callback function. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. */ function publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback): void; @@ -45,7 +45,7 @@ declare namespace reminderAgentManager { * @syscap SystemCapability.Notification.ReminderAgent * @permission ohos.permission.PUBLISH_AGENT_REMINDER * @param { ReminderRequest } reminderReq - Indicates the reminder instance to publish. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @returns { Promise } The reminder id. */ function publishReminder(reminderReq: ReminderRequest): Promise; @@ -57,7 +57,7 @@ declare namespace reminderAgentManager { * @syscap SystemCapability.Notification.ReminderAgent * @param { number } reminderId - Indicates the reminder id. * @param { AsyncCallback } callback - Indicates the callback function. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. */ function cancelReminder(reminderId: number, callback: AsyncCallback): void; @@ -67,7 +67,7 @@ declare namespace reminderAgentManager { * @since 9 * @syscap SystemCapability.Notification.ReminderAgent * @param { number } reminderId - Indicates the reminder id. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @returns { Promise } The promise returned by the function. */ function cancelReminder(reminderId: number): Promise; @@ -78,7 +78,7 @@ declare namespace reminderAgentManager { * @since 9 * @syscap SystemCapability.Notification.ReminderAgent * @param { AsyncCallback> } callback - Indicates the callback function. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. */ function getValidReminders(callback: AsyncCallback>): void; @@ -87,7 +87,7 @@ declare namespace reminderAgentManager { * * @since 9 * @syscap SystemCapability.Notification.ReminderAgent - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @returns { Promise> } The promise returned by the function. */ function getValidReminders(): Promise>; @@ -98,7 +98,7 @@ declare namespace reminderAgentManager { * @since 9 * @syscap SystemCapability.Notification.ReminderAgent * @param { AsyncCallback } callback - Indicates the callback function. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. */ function cancelAllReminders(callback: AsyncCallback): void; @@ -107,7 +107,7 @@ declare namespace reminderAgentManager { * * @since 9 * @syscap SystemCapability.Notification.ReminderAgent - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @returns { Promise } The promise returned by the function. */ function cancelAllReminders(): Promise; @@ -119,7 +119,7 @@ declare namespace reminderAgentManager { * @syscap SystemCapability.Notification.ReminderAgent * @param { NotificationSlot } slot - Indicates the slot. * @param { AsyncCallback } callback - Indicates the callback function. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. */ function addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback): void; @@ -129,7 +129,7 @@ declare namespace reminderAgentManager { * @since 9 * @syscap SystemCapability.Notification.ReminderAgent * @param { NotificationSlot } slot - Indicates the slot. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @returns { Promise } The promise returned by the function. */ function addNotificationSlot(slot: NotificationSlot): Promise; @@ -141,7 +141,7 @@ declare namespace reminderAgentManager { * @syscap SystemCapability.Notification.ReminderAgent * @param { notification.SlotType } slotType Indicates the type of the slot. * @param { AsyncCallback } callback - Indicates the callback function. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. */ function removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback): void; @@ -151,7 +151,7 @@ declare namespace reminderAgentManager { * @since 9 * @syscap SystemCapability.Notification.ReminderAgent * @param { notification.SlotType } slotType Indicates the type of the slot. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @returns { Promise } The promise returned by the function. */ function removeNotificationSlot(slotType: notification.SlotType): Promise; -- Gitee From dd360cffff4ca9b4c530a2ddbc6a2928b461d48e Mon Sep 17 00:00:00 2001 From: aqxyjay Date: Tue, 6 Sep 2022 14:57:14 +0800 Subject: [PATCH 051/438] feat: js api support errors Signed-off-by: aqxyjay --- api/@ohos.batteryInfo.d.ts | 2 +- api/@ohos.batteryStatistics.d.ts | 35 +++-- api/@ohos.brightness.d.ts | 22 +-- api/@ohos.power.d.ts | 229 ++++++++++++++++++------------- api/@ohos.runningLock.d.ts | 111 ++++++++++++++- api/@ohos.thermal.d.ts | 52 +++++-- 6 files changed, 322 insertions(+), 129 deletions(-) diff --git a/api/@ohos.batteryInfo.d.ts b/api/@ohos.batteryInfo.d.ts index 3a27e57498..108844a7a1 100644 --- a/api/@ohos.batteryInfo.d.ts +++ b/api/@ohos.batteryInfo.d.ts @@ -241,7 +241,7 @@ declare namespace batteryInfo { } /** - * Etra key code of common event COMMON_EVENT_BATTERY_CHANGED. + * Extra key code of common event COMMON_EVENT_BATTERY_CHANGED. * * @syscap SystemCapability.PowerManager.BatteryManager.Core * @since 9 diff --git a/api/@ohos.batteryStatistics.d.ts b/api/@ohos.batteryStatistics.d.ts index 2af0b585ed..78663c3eb5 100755 --- a/api/@ohos.batteryStatistics.d.ts +++ b/api/@ohos.batteryStatistics.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from "./basic"; +import {AsyncCallback, BusinessError} from "./basic"; /** * Provides methods to get power consumption information. @@ -61,18 +61,28 @@ declare namespace batteryStats { /** * Obtains the power consumption information list. * - * @return Returns power consumption information list of a device. + * @return {Promise>} Power consumption information list. * @systemapi * @since 8 */ function getBatteryStats(): Promise>; + + /** + * Obtains the power consumption information list. + * + * @param {AsyncCallback} callback Indicates the callback of power consumption information list. + * @throws {BusinessError} 401 If the callback is not valid. + * @systemapi + * @since 8 + */ function getBatteryStats(callback: AsyncCallback>): void; /** * Obtains power consumption information(Mah) for a given uid. * - * @param uid Indicates the uid. - * @return Returns power consumption information(Mah). + * @param {number} uid Indicates the uid. + * @return {number} Power consumption information(Mah). + * @throws {BusinessError} 101 If connecting to the service failed. * @systemapi * @since 8 */ @@ -81,8 +91,9 @@ declare namespace batteryStats { /** * Obtains power consumption information(Percent) for a given uid. * - * @param uid Indicates the uid. - * @return Returns power consumption information(Percent). + * @param {number} uid Indicates the uid. + * @return {number} Power consumption information(Percent). + * @throws {BusinessError} 101 If connecting to the service failed. * @systemapi * @since 8 */ @@ -91,8 +102,10 @@ declare namespace batteryStats { /** * Obtains power consumption information(Mah) for a given type. * - * @param ConsumptionType Indicates the hardware type. - * @return Returns power consumption information(Mah). + * @param {ConsumptionType} type Indicates the hardware type. + * @return {number} Power consumption information(Mah). + * @throws {BusinessError} 101 If connecting to the service failed. + * @throws {BusinessError} 401 If the type is not valid. * @systemapi * @since 8 */ @@ -101,8 +114,10 @@ declare namespace batteryStats { /** * Obtains power consumption information(Percent) for a given type. * - * @param ConsumptionType Indicates the hardware type. - * @return Returns power consumption information(Percent). + * @param {ConsumptionType} type Indicates the hardware type. + * @return {number} Power consumption information(Percent). + * @throws {BusinessError} 101 If connecting to the service failed. + * @throws {BusinessError} 401 If the type is not valid. * @systemapi * @since 8 */ diff --git a/api/@ohos.brightness.d.ts b/api/@ohos.brightness.d.ts index adb007cd2c..b667bdd844 100644 --- a/api/@ohos.brightness.d.ts +++ b/api/@ohos.brightness.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; +import {BusinessError} from './basic'; /** * Provides interfaces to control the power of display. @@ -23,13 +23,15 @@ import { AsyncCallback } from './basic'; * @since 7 */ declare namespace brightness { - /** - * Sets the screen brightness. - * - * @param value Brightness value, ranging from 0 to 255. - * @systemapi - * @since 7 - */ - function setValue(value: number): void; + /** + * Sets the screen brightness. + * + * @param {number} value Brightness value, ranging from 0 to 255. + * @throws {BusinessError} 101 If connecting to the service failed. + * @throws {BusinessError} 401 If the value is not valid. + * @systemapi + * @since 7 + */ + function setValue(value: number): void; } export default brightness; diff --git a/api/@ohos.power.d.ts b/api/@ohos.power.d.ts index 40a4bf2999..28f0e03e30 100644 --- a/api/@ohos.power.d.ts +++ b/api/@ohos.power.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback} from './basic'; +import {AsyncCallback, BusinessError} from './basic'; /** * Provides interfaces to manage power. @@ -22,103 +22,148 @@ import {AsyncCallback} from './basic'; * @since 7 */ declare namespace power { - /** - * Shuts down the system. - * - *

This method requires the ohos.permission.REBOOT permission. - * - * @param reason Indicates the shutdown reason. - * @permission ohos.permission.REBOOT - * @systemapi - * @since 7 - */ - function shutdownDevice(reason: string): void; + /** + * Shuts down the system. + * + *

This method requires the ohos.permission.REBOOT permission. + * + * @permission ohos.permission.REBOOT + * @param {string} reason Indicates the shutdown reason. + * @throws {BusinessError} 101 If connecting to the service failed. + * @throws {BusinessError} 201 If the permission is denied. + * @systemapi + * @since 7 + */ + function shutdown(reason: string): void; - /** - * Restarts the system. - * - *

This method requires the ohos.permission.REBOOT permission. - * - * @param reason Indicates the restart reason. For example, "updater" means to enter the updater mode - * after the restart. If the parameter is not specified, the system enters the normal mode after the restart. - * @permission ohos.permission.REBOOT - * @since 7 - */ - function rebootDevice(reason: string): void; + /** + * Restarts the system. + * + *

This method requires the ohos.permission.REBOOT permission. + * + * @param reason Indicates the restart reason. For example, "updater" indicates entering the updater mode + * after the restart. If the parameter is not specified, the system enters the normal mode after the restart. + * @permission ohos.permission.REBOOT + * @since 7 + * @deprecated since 9 + */ + function rebootDevice(reason: string): void; - /** - * Checks whether the screen of a device is on or off. - * - * @return Returns true if the screen is on; returns false otherwise. - * @since 7 - */ - function isScreenOn(callback: AsyncCallback): void; - function isScreenOn(): Promise; + /** + * Restarts the system. + * + *

This method requires the ohos.permission.REBOOT permission. + * + * @permission ohos.permission.REBOOT + * @param {string} reason Indicates the restart reason. For example, "updater" indicates entering the updater mode + * after the restart. If the parameter is not specified, the system enters the normal mode after the restart. + * @throws {BusinessError} 101 If connecting to the service failed. + * @throws {BusinessError} 201 If the permission is denied. + * @systemapi + * @since 9 + */ + function reboot(reason: string): void; - /** - * Wakes up the device to turn on the screen. - * - * @param detail Indicates the detailed wakeup information. - * @systemapi - * @since 9 - */ - function wakeupDevice(detail: string): void; + /** + * Checks whether the screen of a device is on or off. + * + * @return Returns true if the screen is on; returns false otherwise. + * @since 7 + * @deprecated since 9 + * @useinstead {@link isScreenOn} + */ + function isScreenOn(callback: AsyncCallback): void; + function isScreenOn(): Promise; - /** - * Suspends the device to turn off the screen. - * - * @systemapi - * @since 9 - */ - function suspendDevice(): void; + /** + * Checks whether the screen of a device is on or off. + * + * @return Returns true if the screen is on; returns false otherwise. + * @throws {BusinessError} If connecting to the service failed. + * @since 9 + */ + function isScreenOn(): boolean; - /** - * Obtains the power mode of the current device. For details, see {@link DevicePowerMode}. - * - * @return Returns the power mode of current device . - * @permission ohos.permission.POWER_OPTIMIZATION - * @since 9 - */ - function getPowerMode(callback: AsyncCallback): void; - function getPowerMode(): Promise; + /** + * Wakes up the device to turn on the screen. + * + * @param {string} detail Indicates the detail information who request wakeup. + * @throws {BusinessError} 101 If connecting to the service failed. + * @systemapi + * @since 9 + */ + function wakeup(detail: string): void; - /** - * Sets the power mode of current device. For details, see {@link DevicePowerMode}. - * - * @param mode Indicates the power mode to set. - * @permission ohos.permission.POWER_OPTIMIZATION - * @systemapi - * @since 9 - */ - function setPowerMode(mode: DevicePowerMode, callback: AsyncCallback): void; - function setPowerMode(mode: DevicePowerMode): Promise; + /** + * Suspends the device to turn off the screen. + * + * @throws {BusinessError} 101 If connecting to the service failed. + * @systemapi + * @since 9 + */ + function suspend(): void; - /** - * Power mode of a device. - * @syscap SystemCapability.PowerManager.PowerManager.Core - * @since 9 - */ - export enum DevicePowerMode { - /** - * Normal power mode - * @since 9 - */ - MODE_NORMAL = 600, - /** - * Power save mode - * @since 9 - */ - MODE_POWER_SAVE, - /** - * Performance power mode - * @since 9 - */ - MODE_PERFORMANCE, - /** - * Extreme power save mode - * @since 9 - */ - MODE_EXTREME_POWER_SAVE - } + /** + * Obtains the power mode of the current device. For details, see {@link DevicePowerMode}. + * + * @permission ohos.permission.POWER_OPTIMIZATION + * @return The power mode {@link DevicePowerMode} of current device . + * @throws {BusinessError} 101 If connecting to the service failed. + * @throws {BusinessError} 201 If the permission is denied. + * @since 9 + */ + function getPowerMode(): DevicePowerMode; + + /** + * Obtains the power mode of the current device. For details, see {@link DevicePowerMode}. + * + * @permission ohos.permission.POWER_OPTIMIZATION + * @param {DevicePowerMode} mode Indicates power mode {@link DevicePowerMode} to set. + * @param {AsyncCallback} callback Indicates the callback of setting the power mode. + * @throws {BusinessError} 401 If mode or callback is not valid. + * @systemapi + * @since 9 + */ + function setPowerMode(mode: DevicePowerMode, callback: AsyncCallback): void; + + /** + * Sets the power mode of current device. For details, see {@link DevicePowerMode}. + * + * @permission ohos.permission.POWER_OPTIMIZATION + * @param {DevicePowerMode} mode Indicates power mode {@link DevicePowerMode} to set. + * @throws {BusinessError} 401 If mode is not valid. + * @systemapi + * @since 9 + */ + function setPowerMode(mode: DevicePowerMode): Promise; + + /** + * Power mode of a device. + * + * @syscap SystemCapability.PowerManager.PowerManager.Core + * @since 9 + */ + export enum DevicePowerMode { + /** + * Normal power mode + * @since 9 + */ + MODE_NORMAL = 600, + /** + * Power save mode + * @since 9 + */ + MODE_POWER_SAVE, + /** + * Performance power mode + * @since 9 + */ + MODE_PERFORMANCE, + /** + * Extreme power save mode + * @since 9 + */ + MODE_EXTREME_POWER_SAVE + } } export default power; diff --git a/api/@ohos.runningLock.d.ts b/api/@ohos.runningLock.d.ts index d9365fbcf3..98f426d4be 100644 --- a/api/@ohos.runningLock.d.ts +++ b/api/@ohos.runningLock.d.ts @@ -13,16 +13,16 @@ * limitations under the License. */ -import {AsyncCallback} from './basic'; +import {AsyncCallback, BusinessError} from './basic'; /** * Provides a mechanism to prevent the system from hibernating so that the applications can run in the background or * when the screen is off. * - *

{@link createRunningLock} can be called to obtain a {@link RunningLock}. - *

{@link lock} can be called to set the lock duration, during which the system will not hibernate. After the - * lock duration times out, the lock is automatically released and the system hibernates if no other {@link - * RunningLock} is set. + *

{@link create} can be called to obtain a {@link RunningLock}. + *

{@link hold} can be called to set the lock duration, during which the system will not hibernate. After the + * lock duration times out, the lock is automatically released and the system hibernates if no other + * {@link RunningLock} is set. * * @syscap SystemCapability.PowerManager.PowerManager.Core * @since 7 @@ -33,29 +33,66 @@ declare namespace runningLock { * Prevents the system from hibernating and sets the lock duration. * This method requires the ohos.permission.RUNNING_LOCK permission. * + * @permission ohos.permission.RUNNING_LOCK * @param timeout Indicates the lock duration (ms). After the lock duration times out, the lock is automatically * released and the system hibernates if no other {@link RunningLock} is set. - * @permission ohos.permission.RUNNING_LOCK * @since 7 + * @deprecated since 9 + * @useinstead {@link hold} */ lock(timeout: number): void; + /** + * Prevents the system from hibernating and sets the lock duration. + * This method requires the ohos.permission.RUNNING_LOCK permission. + * + * @permission ohos.permission.RUNNING_LOCK + * @param {number} timeout Indicates the lock duration (ms). After the lock duration times out, + * the lock is automatically released and the system hibernates if no other {@link RunningLock} is set. + * @throws {BusinessError} If connecting to the service failed. + * @since 9 + */ + hold(timeout: number): void; + /** * Checks whether a lock is held or in use. * * @return Returns true if the lock is held or in use; returns false if the lock has been released. * @since 7 + * @deprecated since 9 + * @useinstead {@link isHolding} */ isUsed(): boolean; + /** + * Checks whether a lock is held or in use. + * + * @return Returns true if the lock is held or in use; returns false if the lock has been released. + * @throws {BusinessError} If connecting to the service failed. + * @since 9 + */ + isHolding(): boolean; + /** * Release the {@link RunningLock} that prevents the system from hibernating. * This method requires the ohos.permission.RUNNING_LOCK permission. * - * @since 7 * @permission ohos.permission.RUNNING_LOCK + * @since 7 + * @deprecated since 9 + * @useinstead {@link unhold} */ unlock(): void; + + /** + * Release the {@link RunningLock} that prevents the system from hibernating. + * This method requires the ohos.permission.RUNNING_LOCK permission. + * + * @permission ohos.permission.RUNNING_LOCK + * @throws {BusinessError} If connecting to the service failed. + * @since 9 + */ + unhold(): void; } /** @@ -88,9 +125,33 @@ declare namespace runningLock { * @return Returns true if the specified {@link RunningLockType} is supported; * returns false otherwise. * @since 7 + * @deprecated since 9 + * @useinstead {@link iSupported} */ function isRunningLockTypeSupported(type: RunningLockType, callback: AsyncCallback): void; function isRunningLockTypeSupported(type: RunningLockType): Promise; + + /** + * Checks whether the specified {@link RunningLockType} is supported. + * + * @param {RunningLockType} type Indicates the specified {@link RunningLockType}. + * @param {AsyncCallback} callback Indicates the callback of whether the specified {@link RunningLockType} + * is supported. + * @throws {BusinessError} If the type or callback is not valid. + * @since 9 + */ + function iSupported(type: RunningLockType, callback: AsyncCallback): void; + + /** + * Checks whether the specified {@link RunningLockType} is supported. + * + * @param {RunningLockType} type Indicates the specified {@link RunningLockType}. + * @return {Promise} Whether the specified {@link RunningLockType} is supported. + * @throws {BusinessError} If the type is not valid. + * @since 9 + */ + function isSupported(type: RunningLockType): Promise; + /** * Creates a {@link RunningLock} object. * @@ -104,8 +165,44 @@ declare namespace runningLock { * @return Returns the {@link RunningLock} object. * @permission ohos.permission.RUNNING_LOCK * @since 7 + * @deprecated since 9 + * @useinstead {@link create} */ function createRunningLock(name: string, type: RunningLockType, callback: AsyncCallback): void; function createRunningLock(name: string, type: RunningLockType): Promise; + + /** + * Creates a {@link RunningLock} object. + * + *

This method requires the ohos.permission.RUNNING_LOCK permission. + * + *

The {@link RunningLock} object can be used to perform a lock operation to prevent the system from hibernating. + * + * @permission ohos.permission.RUNNING_LOCK + * @param {string} name Indicates the {@link RunningLock} name. A recommended name consists of the package or + * class name and a suffix. + * @param {RunningLockType} type Indicates the {@link RunningLockType}. + * @param {AsyncCallback)} callback Indicates the callback of {@link RunningLock} object. + * @throws {BusinessError} If the name, type or callback is not valid. + * @since 9 + */ + function create(name: string, type: RunningLockType, callback: AsyncCallback): void; + + /** + * Creates a {@link RunningLock} object. + * + *

This method requires the ohos.permission.RUNNING_LOCK permission. + * + *

The {@link RunningLock} object can be used to perform a lock operation to prevent the system from hibernating. + * + * @permission ohos.permission.RUNNING_LOCK + * @param {string} name Indicates the {@link RunningLock} name. A recommended name consists of the package or + * class name and a suffix. + * @param {RunningLockType} type Indicates the {@link RunningLockType}. + * @return {Promise} The {@link RunningLock} object. + * @throws {BusinessError} If the name or type is not valid. + * @since 9 + */ + function create(name: string, type: RunningLockType): Promise; } export default runningLock; diff --git a/api/@ohos.thermal.d.ts b/api/@ohos.thermal.d.ts index eb80bfa5f9..3eb8282141 100644 --- a/api/@ohos.thermal.d.ts +++ b/api/@ohos.thermal.d.ts @@ -13,13 +13,13 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import {AsyncCallback, BusinessError} from './basic'; /** - * Provides thermal level-related callback and query APIs to obtain the information required for + * Provides thermal level-related callback and query APIs to obtain the information required for * temperature control. The APIs are as follows: - * {@link subscribeThermalLevel}: subscribes to callbacks of thermal level changes. - * {@link getThermalLevel}: obtains the thermal level of the system in real time. + * {@link registerThermalLevelCallback}: subscribes to callbacks of thermal level changes. + * {@link getLevel}: obtains the thermal level of the system in real time. * * @syscap SystemCapability.PowerManager.ThermalManager * @since 8 @@ -44,50 +44,84 @@ declare namespace thermal { */ WARM = 2, /** - * The device is heating up. You need to stop all imperceptible services and downgrade + * The device is heating up. You need to stop all imperceptible services and downgrade * or reduce the load of other services. */ HOT = 3, /** - * The device is overheated. You need to stop all imperceptible services and downgrade + * The device is overheated. You need to stop all imperceptible services and downgrade * or reduce the load of major services. */ OVERHEATED = 4, /** - * The device is overheated and is about to enter the emergency state. You need to stop + * The device is overheated and is about to enter the emergency state. You need to stop * all imperceptible services and downgrade major services to the maximum extent. */ WARNING = 5, /** - * The device has entered the emergency state. You need to stop all services except those + * The device has entered the emergency state. You need to stop all services except those * for the emergency help purposes. */ EMERGENCY = 6, } + /** * Subscribes to callbacks of thermal level changes. * * @param callback Callback of thermal level changes. * @return Returns the thermal level. * @since 8 + * @deprecated since 9 + * @useinstead {@link registerThermalLevelCallback} */ function subscribeThermalLevel(callback: AsyncCallback): void; + /** + * Registers to callbacks of thermal level changes. + * + * @param {AsyncCallback} callback Callback of thermal level changes. + * @throws {BusinessError} 401 If callback is not valid. + * @since 9 + */ + function registerThermalLevelCallback(callback: AsyncCallback): void; + /** * Unsubscribes from the callbacks of thermal level changes. * * @param callback Callback of thermal level changes. - * @since 8 + * @deprecated since 9 + * @useinstead {@link unregisterThermalLevelCallback} */ function unsubscribeThermalLevel(callback?: AsyncCallback): void; + /** + * Unregisters from the callbacks of thermal level changes. + * + * @param {AsyncCallback} callback Callback of thermal level changes. + * @throws {BusinessError} 101 If connecting to the service failed. + * @throws {BusinessError} 401 If callback is not valid. + * @since 9 + */ + function unregisterThermalLevelCallback(callback?: AsyncCallback): void; + /** * Obtains the current thermal level. * * @return Returns the thermal level. * @since 8 + * @deprecated since 9 + * @useinstead {@link getLevel} */ function getThermalLevel(): ThermalLevel; + + /** + * Obtains the current thermal level. + * + * @return {ThermalLevel} The thermal level. + * @throws {BusinessError} 101 If connecting to the service failed. + * @since 9 + */ + function getLevel(): ThermalLevel; } export default thermal; -- Gitee From f97c3f44450c79d101f7348bf17fb90fc0a1047b Mon Sep 17 00:00:00 2001 From: aqxyjay Date: Tue, 11 Oct 2022 14:46:52 +0800 Subject: [PATCH 052/438] fix: update system api deprecated version according to the api reference Signed-off-by: aqxyjay --- api/@system.battery.d.ts | 18 +++++----- api/@system.brightness.d.ts | 66 ++++++++++++++++++------------------- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/api/@system.battery.d.ts b/api/@system.battery.d.ts index 9aee8309bf..246a61658b 100755 --- a/api/@system.battery.d.ts +++ b/api/@system.battery.d.ts @@ -16,20 +16,20 @@ /** * @syscap SystemCapability.PowerManager.BatteryManager.Core * @since 3 - * @deprecated since 9 + * @deprecated since 6 */ export interface BatteryResponse { /** * Whether the battery is being charged. * @since 3 - * @deprecated since 9 + * @deprecated since 6 */ charging: boolean; /** * Current battery level, which ranges from 0.00 to 1.00. * @since 3 - * @deprecated since 9 + * @deprecated since 6 */ level: number; } @@ -37,27 +37,27 @@ /** * @syscap SystemCapability.PowerManager.BatteryManager.Core * @since 3 - * @deprecated since 9 + * @deprecated since 6 */ export interface GetStatusOptions { /** * Called when the current charging state and battery level are obtained. * @since 3 - * @deprecated since 9 + * @deprecated since 6 */ success?: (data: BatteryResponse) => void; /** * Called when the current charging state and battery level fail to be obtained. * @since 3 - * @deprecated since 9 + * @deprecated since 6 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. * @since 3 - * @deprecated since 9 + * @deprecated since 6 */ complete?: () => void; } @@ -65,14 +65,14 @@ export interface GetStatusOptions { /** * @syscap SystemCapability.PowerManager.BatteryManager.Core * @since 3 - * @deprecated since 9 + * @deprecated since 6 */ export default class Battery { /** * Obtains the current charging state and battery level. * @param options Options. * @since 3 - * @deprecated since 9 + * @deprecated since 6 */ static getStatus(options?: GetStatusOptions): void; } \ No newline at end of file diff --git a/api/@system.brightness.d.ts b/api/@system.brightness.d.ts index d5c656768d..7f758e7bec 100755 --- a/api/@system.brightness.d.ts +++ b/api/@system.brightness.d.ts @@ -16,13 +16,13 @@ /** * @syscap SystemCapability.PowerManager.DisplayPowerManager * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ export interface BrightnessResponse { /** * Screen brightness, which ranges from 1 to 100. * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ value: number; } @@ -30,27 +30,27 @@ export interface BrightnessResponse { /** * @syscap SystemCapability.PowerManager.DisplayPowerManager * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ export interface GetBrightnessOptions { /** * Called when the current screen brightness is obtained. * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ success?: (data: BrightnessResponse) => void; /** * Called when the current screen brightness fails to be obtained. * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ complete?: () => void; } @@ -58,7 +58,7 @@ export interface GetBrightnessOptions { /** * @syscap SystemCapability.PowerManager.DisplayPowerManager * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ export interface SetBrightnessOptions { /** @@ -68,28 +68,28 @@ export interface SetBrightnessOptions { * If the value contains decimals, the integral part of the value will be used. * For example, if value is 8.1 is set, value 8 will be used. * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ value: number; /** * Called when the setting is successful. * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ success?: () => void; /** * Called when the setting fails. * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ complete?: () => void } @@ -97,7 +97,7 @@ export interface SetBrightnessOptions { /** * @syscap SystemCapability.PowerManager.DisplayPowerManager * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ export interface BrightnessModeResponse { /** @@ -105,7 +105,7 @@ export interface BrightnessModeResponse { * 0: The screen brightness is manually adjusted. * 1: The screen brightness is automatically adjusted. * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ mode: number; } @@ -113,27 +113,27 @@ export interface BrightnessModeResponse { /** * @syscap SystemCapability.PowerManager.DisplayPowerManager * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ export interface GetBrightnessModeOptions { /** * Called when the screen brightness adjustment mode is obtained. * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ success?: (data: BrightnessModeResponse) => void; /** * Called when the screen brightness adjustment mode fails to be obtained. * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ complete?: () => void; } @@ -141,7 +141,7 @@ export interface GetBrightnessModeOptions { /** * @syscap SystemCapability.PowerManager.DisplayPowerManager * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ export interface SetBrightnessModeOptions { /** @@ -149,28 +149,28 @@ export interface SetBrightnessModeOptions { * 0: The screen brightness is manually adjusted. * 1: The screen brightness is automatically adjusted. * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ mode: number; /** * Called when the setting is successful. * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ success?: () => void; /** * Called when the setting fails. * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ complete?: () => void } @@ -178,34 +178,34 @@ export interface SetBrightnessModeOptions { /** * @syscap SystemCapability.PowerManager.DisplayPowerManager * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ export interface SetKeepScreenOnOptions { /** * Whether to always keep the screen on. * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ keepScreenOn: boolean; /** * Called when the setting is successful. * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ success?: () => void; /** * Called when the setting fails. * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ fail?: (data: string, code: number) => void; /** * Called when the execution is completed. * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ complete?: () => void } @@ -213,14 +213,14 @@ export interface SetKeepScreenOnOptions { /** * @syscap SystemCapability.PowerManager.DisplayPowerManager * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ export default class Brightness { /** * Obtains the current screen brightness. * @param options Options. * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ static getValue(options?: GetBrightnessOptions): void; @@ -228,7 +228,7 @@ export default class Brightness { * Sets the screen brightness. * @param options Options. * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ static setValue(options?: SetBrightnessOptions): void; @@ -236,7 +236,7 @@ export default class Brightness { * Obtains the screen brightness adjustment mode. * @param options Options. * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ static getMode(options?: GetBrightnessModeOptions): void; @@ -244,7 +244,7 @@ export default class Brightness { * Sets the screen brightness adjustment mode. * @param options Options. * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ static setMode(options?: SetBrightnessModeOptions): void; @@ -252,7 +252,7 @@ export default class Brightness { * Sets whether to always keey the screen on. * @param options Options. * @since 3 - * @deprecated since 9 + * @deprecated since 7 */ static setKeepScreenOn(options?: SetKeepScreenOnOptions): void; } \ No newline at end of file -- Gitee From 2164f59cff4fac5ed3c05e20fe976c7921f1f19a Mon Sep 17 00:00:00 2001 From: zhutianyi Date: Tue, 11 Oct 2022 14:47:53 +0800 Subject: [PATCH 053/438] =?UTF-8?q?=E6=96=B0=E5=A2=9E@ohos.resourceschedul?= =?UTF-8?q?e.backgroundTaskMgr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhutianyi --- api/@ohos.backgroundTaskManager.d.ts | 24 +++++------ ...s.resourceschedule.backgroundTaskMgr.d.ts} | 42 +++++++++---------- 2 files changed, 33 insertions(+), 33 deletions(-) rename api/{@ohos.resourceschedule.backgroundTaskManager.d.ts => @ohos.resourceschedule.backgroundTaskMgr.d.ts} (92%) diff --git a/api/@ohos.backgroundTaskManager.d.ts b/api/@ohos.backgroundTaskManager.d.ts index a051ce8115..ad94147eb4 100644 --- a/api/@ohos.backgroundTaskManager.d.ts +++ b/api/@ohos.backgroundTaskManager.d.ts @@ -23,7 +23,7 @@ import Context from './application/BaseContext'; * @since 7 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskManager + * @useinstead @ohos.resourceschedule.backgroundTaskMgr */ declare namespace backgroundTaskManager { /** @@ -33,7 +33,7 @@ declare namespace backgroundTaskManager { * @since 7 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskManager.DelaySuspendInfo + * @useinstead @ohos.resourceschedule.backgroundTaskMgr.DelaySuspendInfo */ interface DelaySuspendInfo { /** @@ -53,7 +53,7 @@ declare namespace backgroundTaskManager { * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @param requestId Indicates the identifier of the delay request. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskManager.cancelSuspendDelay + * @useinstead @ohos.resourceschedule.backgroundTaskMgr.cancelSuspendDelay */ function cancelSuspendDelay(requestId: number): void; @@ -65,7 +65,7 @@ declare namespace backgroundTaskManager { * @param requestId Indicates the identifier of the delay request. * @return The remaining delay time * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskManager.getRemainingDelayTime + * @useinstead @ohos.resourceschedule.backgroundTaskMgr.getRemainingDelayTime */ function getRemainingDelayTime(requestId: number, callback: AsyncCallback): void; function getRemainingDelayTime(requestId: number): Promise; @@ -79,7 +79,7 @@ declare namespace backgroundTaskManager { * @param callback The callback delay time expired. * @return Info of delay request * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskManager.requestSuspendDelay + * @useinstead @ohos.resourceschedule.backgroundTaskMgr.requestSuspendDelay */ function requestSuspendDelay(reason: string, callback: Callback): DelaySuspendInfo; @@ -94,7 +94,7 @@ declare namespace backgroundTaskManager { * @param bgMode Indicates which background mode to request. * @param wantAgent Indicates which ability to start when user click the notification bar. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskManager.startBackgroundRunning + * @useinstead @ohos.resourceschedule.backgroundTaskMgr.startBackgroundRunning */ function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback): void; function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise; @@ -106,7 +106,7 @@ declare namespace backgroundTaskManager { * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @param context app running context. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskManager.stopBackgroundRunning + * @useinstead @ohos.resourceschedule.backgroundTaskMgr.stopBackgroundRunning */ function stopBackgroundRunning(context: Context, callback: AsyncCallback): void; function stopBackgroundRunning(context: Context): Promise; @@ -119,7 +119,7 @@ declare namespace backgroundTaskManager { * @return True if efficiency resources apply success, else false. * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskManager.applyEfficiencyResources + * @useinstead @ohos.resourceschedule.backgroundTaskMgr.applyEfficiencyResources */ function applyEfficiencyResources(request: EfficiencyResourcesRequest): boolean; @@ -130,7 +130,7 @@ declare namespace backgroundTaskManager { * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskManager.resetAllEfficiencyResources + * @useinstead @ohos.resourceschedule.backgroundTaskMgr.resetAllEfficiencyResources */ function resetAllEfficiencyResources(): void; @@ -140,7 +140,7 @@ declare namespace backgroundTaskManager { * @since 8 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskManager.BackgroundMode + * @useinstead @ohos.resourceschedule.backgroundTaskMgr.BackgroundMode */ export enum BackgroundMode { /** @@ -226,7 +226,7 @@ declare namespace backgroundTaskManager { * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskManager.ResourceType + * @useinstead @ohos.resourceschedule.backgroundTaskMgr.ResourceType */ export enum ResourceType { /** @@ -273,7 +273,7 @@ declare namespace backgroundTaskManager { * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskManager.EfficiencyResourcesRequest + * @useinstead @ohos.resourceschedule.backgroundTaskMgr.EfficiencyResourcesRequest */ export interface EfficiencyResourcesRequest { /** diff --git a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts b/api/@ohos.resourceschedule.backgroundTaskMgr.d.ts similarity index 92% rename from api/@ohos.resourceschedule.backgroundTaskManager.d.ts rename to api/@ohos.resourceschedule.backgroundTaskMgr.d.ts index a3f7c1a711..6550822599 100644 --- a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts +++ b/api/@ohos.resourceschedule.backgroundTaskMgr.d.ts @@ -21,7 +21,7 @@ import Context from './application/BaseContext'; * Manages background tasks. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.TransientTask */ declare namespace backgroundTaskManager { /** @@ -29,7 +29,7 @@ declare namespace backgroundTaskManager { * * @name DelaySuspendInfo * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.TransientTask */ interface DelaySuspendInfo { /** @@ -46,7 +46,7 @@ declare namespace backgroundTaskManager { * Cancels delayed transition to the suspended state. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.TransientTask * @param requestId Indicates the identifier of the delay request. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 9800001 - Memory operation failed. @@ -62,7 +62,7 @@ declare namespace backgroundTaskManager { * Obtains the remaining time before an application enters the suspended state. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.TransientTask * @param requestId Indicates the identifier of the delay request. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 9800001 - Memory operation failed. @@ -80,7 +80,7 @@ declare namespace backgroundTaskManager { * Requests delayed transition to the suspended state. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.TransientTask * @param reason Indicates the reason for delayed transition to the suspended state. * @param callback The callback delay time expired. * @throws { BusinessError } 401 - Parameter error. @@ -99,7 +99,7 @@ declare namespace backgroundTaskManager { * system will publish a notification related to the this service. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.ContinuousTask * @permission ohos.permission.KEEP_BACKGROUND_RUNNING * @param context app running context. * @param bgMode Indicates which background mode to request. @@ -121,7 +121,7 @@ declare namespace backgroundTaskManager { * Service ability uses this method to request stop running in background. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.ContinuousTask * @param context app running context. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - Parameter error. @@ -140,7 +140,7 @@ declare namespace backgroundTaskManager { * Apply or unapply efficiency resources. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.EfficiencyResourcesApply * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 9800001 - Memory operation failed. @@ -156,7 +156,7 @@ declare namespace backgroundTaskManager { * Reset all efficiency resources apply. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.EfficiencyResourcesApply * @systemapi Hide this for inner system use. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - Parameter error. @@ -172,14 +172,14 @@ declare namespace backgroundTaskManager { * supported background mode. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.ContinuousTask */ export enum BackgroundMode { /** * data transfer mode * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.ContinuousTask */ DATA_TRANSFER = 1, @@ -187,7 +187,7 @@ declare namespace backgroundTaskManager { * audio playback mode * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.ContinuousTask */ AUDIO_PLAYBACK = 2, @@ -195,7 +195,7 @@ declare namespace backgroundTaskManager { * audio recording mode * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.ContinuousTask */ AUDIO_RECORDING = 3, @@ -203,7 +203,7 @@ declare namespace backgroundTaskManager { * location mode * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.ContinuousTask */ LOCATION = 4, @@ -211,7 +211,7 @@ declare namespace backgroundTaskManager { * bluetooth interaction mode * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.ContinuousTask */ BLUETOOTH_INTERACTION = 5, @@ -219,7 +219,7 @@ declare namespace backgroundTaskManager { * multi-device connection mode * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.ContinuousTask */ MULTI_DEVICE_CONNECTION = 6, @@ -227,7 +227,7 @@ declare namespace backgroundTaskManager { * wifi interaction mode * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.ContinuousTask * @systemapi Hide this for inner system use. */ WIFI_INTERACTION = 7, @@ -236,7 +236,7 @@ declare namespace backgroundTaskManager { * Voice over Internet Phone mode * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.ContinuousTask * @systemapi Hide this for inner system use. */ VOIP = 8, @@ -246,7 +246,7 @@ declare namespace backgroundTaskManager { * only supported in particular device * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.ContinuousTask */ TASK_KEEPING = 9, } @@ -255,7 +255,7 @@ declare namespace backgroundTaskManager { * The type of resource. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.EfficiencyResourcesApply * @systemapi Hide this for inner system use. */ export enum ResourceType { @@ -300,7 +300,7 @@ declare namespace backgroundTaskManager { * * @name EfficiencyResourcesRequest * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.EfficiencyResourcesApply * @systemapi Hide this for inner system use. */ export interface EfficiencyResourcesRequest { -- Gitee From cff61e02de11ee26b6de8b5b7ee2d55bf8a5bcdb Mon Sep 17 00:00:00 2001 From: niudongyao Date: Tue, 11 Oct 2022 14:56:48 +0800 Subject: [PATCH 054/438] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 ++++++++++++++ api/@ohos.data.dataShare.d.ts | 167 ++++++++++++++++++++++++---------- 2 files changed, 185 insertions(+), 50 deletions(-) create mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000000..74a477b270 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1664437584931 + + + + + + + + + \ No newline at end of file diff --git a/api/@ohos.data.dataShare.d.ts b/api/@ohos.data.dataShare.d.ts index 38369801a8..af59a2c3f8 100644 --- a/api/@ohos.data.dataShare.d.ts +++ b/api/@ohos.data.dataShare.d.ts @@ -22,129 +22,196 @@ import { ValuesBucket } from './@ohos.data.ValuesBucket'; declare namespace dataShare { /** * Obtains the dataShareHelper. - * @since 9 + * @param { context } Context - Indicates the application context. + * @param { uri } string - Indicates the path of the file to open. + * @param { AsyncCallback } callback - the dataShareHelper. + * @throws { BusinessError } 401 - the parameter check failed. + * @throws { BusinessError } 15700010 - the DataShareHelper is not initialized successfully. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi - * @param context Indicates the application context. - * @param uri Indicates the path of the file to open. - * @return Returns the dataShareHelper. - * @throws {BusinessError} if process failed - * @errorcode 157000010 - * @errorcode 401 * @StageModelOnly + * @since 9 */ function createDataShareHelper(context: Context, uri: string, callback: AsyncCallback): void; + + /** + * Obtains the dataShareHelper. + * @param { context } Context - Indicates the application context. + * @param { uri } string - Indicates the path of the file to open. + * @returns { Promise } the dataShareHelper. + * @throws { BusinessError } 401 - the parameter check failed. + * @throws { BusinessError } 15700010 - the parameter check failed. + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @StageModelOnly + * @since 9 + */ function createDataShareHelper(context: Context, uri: string): Promise; /** * DataShareHelper - * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly + * @since 9 */ interface DataShareHelper { /** * Registers an observer to observe data specified by the given uri. - * @since 9 + * @param { type } 'dataChange' - dataChange. + * @param { uri } string - Indicates the path of the data to operate. + * @param { AsyncCallback } callback - Indicates the callback when dataChange. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi - * @param type dataChange. - * @param uri Indicates the path of the data to operate. - * @param callback Indicates the callback when dataChange. - * @return - * @StageModelOnly + * @since 9 */ on(type: 'dataChange', uri: string, callback: AsyncCallback): void; /** * Deregisters an observer used for monitoring data specified by the given uri. - * @since 9 + * @param { type } 'dataChange' - dataChange. + * @param { uri } string - Indicates the path of the data to operate. + * @param { AsyncCallback } callback - Indicates the callback when dataChange. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi - * @param type dataChange. - * @param uri Indicates the path of the data to operate. - * @param callback Indicates the registered callback. - * @return - * @StageModelOnly + * @since 9 */ off(type: 'dataChange', uri: string, callback?: AsyncCallback): void; /** * Inserts a single data record into the database. - * @since 9 + * @param { uri } string - Indicates the path of the data to operate. + * @param { value } ValueBucket - Indicates the data record to insert. If this parameter is null, a blank row will be inserted. + * @param { AsyncCallback } callback - the index of the inserted data record. + * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi - * @param uri Indicates the path of the data to operate. - * @param value Indicates the data record to insert. If this parameter is null, a blank row will be inserted. - * @return Returns the index of the inserted data record. - * @throws {BusinessError} if process failed - * @errorcode 401 * @StageModelOnly + * @since 9 */ insert(uri: string, value: ValuesBucket, callback: AsyncCallback): void; + + /** + * Inserts a single data record into the database. + * @param { uri } string - Indicates the path of the data to operate. + * @param { value } ValueBucket - Indicates the data record to insert. If this parameter is null, a blank row will be inserted. + * @returns { Promise } the index of the inserted data record. + * @throws { BusinessError } 401 - the parameter check failed. + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @StageModelOnly + * @since 9 + */ insert(uri: string, value: ValuesBucket): Promise; /** * Deletes one or more data records from the database. - * @since 9 + * @param { uri } string - Indicates the path of the data to operate. + * @param { predicates } dataSharePredicates.DataSharePredicates - Indicates filter criteria. You should define the processing logic when this parameter is null. + * @param { AsyncCallback } callback - the number of data records deleted. + * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi - * @param uri Indicates the path of the data to operate. - * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. - * @return Returns the number of data records deleted. - * @throws {BusinessError} if process failed - * @errorcode 401 * @StageModelOnly + * @since 9 */ delete(uri: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; + + /** + * Deletes one or more data records from the database. + * @param { uri } string - Indicates the path of the data to operate. + * @param { predicates } dataSharePredicates.DataSharePredicates - Indicates filter criteria. You should define the processing logic when this parameter is null. + * @returns { Promise } the number of data records deleted. + * @throws { BusinessError } 401 - the parameter check failed. + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @StageModelOnly + * @since 9 + */ delete(uri: string, predicates: dataSharePredicates.DataSharePredicates): Promise; /** * Queries data in the database. - * @since 9 + * @param { uri } string - Indicates the path of data to query. + * @param { predicates } dataSharePredicates.DataSharePredicates - Indicates filter criteria. You should define the processing logic when this parameter is null. + * @param { columns } Array - Indicates the columns to query. If this parameter is null, all columns are queried. + * @param { AsyncCallback } callback - the query result. + * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi - * @param uri Indicates the path of data to query. - * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. - * @param columns Indicates the columns to query. If this parameter is null, all columns are queried. - * @return Returns the query result. - * @throws {BusinessError} if process failed - * @errorcode 401 * @StageModelOnly + * @since 9 */ query(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array, callback: AsyncCallback): void; + + /** + * Queries data in the database. + * @param { uri } string - Indicates the path of data to query. + * @param { predicates } dataSharePredicates.DataSharePredicates - Indicates filter criteria. You should define the processing logic when this parameter is null. + * @param { columns } Array - Indicates the columns to query. If this parameter is null, all columns are queried. + * @returns { Promise } - the query result. + * @throws { BusinessError } 401 - the parameter check failed. + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @StageModelOnly + * @since 9 + */ query(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array): Promise; /** * Updates data records in the database. - * @since 9 + * @param { uri } string - Indicates the path of data to update. + * @param { predicates } dataSharePredicates.DataSharePredicates - Indicates filter criteria. You should define the processing logic when this parameter is null. + * @param { value } ValueBucket - Indicates the data to update. This parameter can be null. + * @param { AsyncCallback } callback - the number of data records updated. + * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi - * @param uri Indicates the path of data to update. - * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. - * @param value Indicates the data to update. This parameter can be null. - * @return Returns the number of data records updated. - * @throws {BusinessError} if process failed - * @errorcode 401 * @StageModelOnly + * @since 9 */ update(uri: string, predicates: dataSharePredicates.DataSharePredicates, value: ValuesBucket, callback: AsyncCallback): void; + + /** + * Updates data records in the database. + * @param { uri } string - Indicates the path of data to update. + * @param { predicates } dataSharePredicates.DataSharePredicates - Indicates filter criteria. You should define the processing logic when this parameter is null. + * @param { value } ValueBucket - Indicates the data to update. This parameter can be null. + * @returns { Promise } the number of data records updated. + * @throws { BusinessError } 401 - the parameter check failed. + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @StageModelOnly + * @since 9 + */ update(uri: string, predicates: dataSharePredicates.DataSharePredicates, value: ValuesBucket): Promise; /** * Inserts multiple data records into the database. - * @since 9 + * @param { uri } string - Indicates the path of the data to operate. + * @param { values } Array - Indicates the data records to insert. + * @param { AsyncCallback } callback - the number of data records inserted. + * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi - * @param uri Indicates the path of the data to operate. - * @param values Indicates the data records to insert. - * @return Returns the number of data records inserted. - * @throws {BusinessError} if process failed - * @errorcode 401 * @StageModelOnly + * @since 9 */ batchInsert(uri: string, values: Array, callback: AsyncCallback): void; + + /** + * Inserts multiple data records into the database. + * @param { uri } string - Indicates the path of the data to operate. + * @param { values } Array - Indicates the data records to insert. + * @returns { Promise } the number of data records inserted. + * @throws { BusinessError } 401 - the parameter check failed. + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @StageModelOnly + * @since 9 + */ batchInsert(uri: string, values: Array): Promise; /** -- Gitee From b476e5f240e5a0a60cca128c27b4ea167eb037e7 Mon Sep 17 00:00:00 2001 From: niudongyao Date: Tue, 11 Oct 2022 14:57:12 +0800 Subject: [PATCH 055/438] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 --------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 74a477b270..0000000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1664437584931 - - - - - - - - - \ No newline at end of file -- Gitee From db71dd91cca7a099869f4688c0d21a5431d18a2a Mon Sep 17 00:00:00 2001 From: niudongyao Date: Tue, 11 Oct 2022 15:03:43 +0800 Subject: [PATCH 056/438] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 +++++++++++++++++++++++++++++++++++ api/@ohos.data.dataShare.d.ts | 7 ++++ 2 files changed, 75 insertions(+) create mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000000..0004705bd8 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1664437584931 + + + + + + + + + \ No newline at end of file diff --git a/api/@ohos.data.dataShare.d.ts b/api/@ohos.data.dataShare.d.ts index af59a2c3f8..8e58a8f527 100644 --- a/api/@ohos.data.dataShare.d.ts +++ b/api/@ohos.data.dataShare.d.ts @@ -19,6 +19,13 @@ import DataShareResultSet from './@ohos.data.DataShareResultSet'; import dataSharePredicates from './@ohos.data.dataSharePredicates'; import { ValuesBucket } from './@ohos.data.ValuesBucket'; +/** +* This module provides the dataShare capability for consumer. +* @syscap SystemCapability.DistributedDataManager.DataShare.Consumer +* @systemapi +* @StageModelOnly +* @since 9 + */ declare namespace dataShare { /** * Obtains the dataShareHelper. -- Gitee From b4317bf15119b2bfabf1d5c9b713b2881a632a2e Mon Sep 17 00:00:00 2001 From: niudongyao Date: Tue, 11 Oct 2022 15:03:57 +0800 Subject: [PATCH 057/438] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 --------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 0004705bd8..0000000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1664437584931 - - - - - - - - - \ No newline at end of file -- Gitee From f773a25181a7a0a55baf01ad50eeaf90c43299d9 Mon Sep 17 00:00:00 2001 From: lengchangjing Date: Mon, 26 Sep 2022 19:28:39 +0800 Subject: [PATCH 058/438] add buffer exception description Signed-off-by: lengchangjing --- api/@ohos.buffer.d.ts | 392 +++++++++++++++++++++--------------------- 1 file changed, 196 insertions(+), 196 deletions(-) diff --git a/api/@ohos.buffer.d.ts b/api/@ohos.buffer.d.ts index 680fb3f376..333557afd1 100644 --- a/api/@ohos.buffer.d.ts +++ b/api/@ohos.buffer.d.ts @@ -1,6 +1,6 @@ /* * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); + * Licensed under the Apache License, Version 2.0 (The type of "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * @@ -32,7 +32,7 @@ declare namespace buffer { * @param [fill=0] A value to pre-fill the new Buffer with * @param [encoding='utf8'] If `fill` is a string, this is its encoding * @return Return a new allocated Buffer - * @throws TypeError: The "size" argument must be of type number and cannot be negative. Received [message] + * @throws {BusinessError} 401 - The type of "size" must be number and the value cannot be negative. Received value is: [size] */ function alloc(size: number, fill?: string | Buffer | number, encoding?: BufferEncoding): Buffer; @@ -42,7 +42,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param size The desired length of the new Buffer * @return Return a new allocated Buffer - * @throws TypeError: The "size" argument must be of type number and cannot be negative. Received [message] + * @throws {BusinessError} 401 - The type of "size" must be number and the value cannot be negative. Received value is: [size] */ function allocUninitializedFromPool(size: number): Buffer; @@ -52,7 +52,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param size The desired length of the new Buffer * @return Return a new allocated Buffer - * @throws TypeError: The "size" argument must be of type number and cannot be negative. Received [message] + * @throws {BusinessError} 401 - The type of "size" must be number and the value cannot be negative. Received value is: [size] */ function allocUninitialized(size: number): Buffer; @@ -65,7 +65,7 @@ declare namespace buffer { * @param string A value to calculate the length of * @param [encoding='utf8'] If `string` is a string, this is its encoding * @return The number of bytes contained within `string` - * @throws TypeError: The "string" argument must be of type string or an instance of Buffer or ArrayBuffer. Received [message] + * @throws {BusinessError} 401 - The type of "string" must be string or Buffer, ArrayBuffer. Received value is: [string] */ function byteLength(string: string | Buffer | TypedArray | DataView | ArrayBuffer | SharedArrayBuffer, encoding?: BufferEncoding): number; @@ -76,9 +76,8 @@ declare namespace buffer { * @param list List of `Buffer` or Uint8Array instances to concatenate * @param totalLength Total length of the `Buffer` instances in `list` when concatenated * @return Return a new allocated Buffer - * @throws TypeError: The "list" argument must be an instance of Array. Received [message] - * @throws TypeError: The "list" argument must be an instance of Array. Received type number ([number]) - * @throws RangeError: The value of "length" is out of range. It must be >= 0 && <= max unsigned int. Received [number] + * @throws {BusinessError} 401 - The type of "list" must be Array. Received value is: [list] + * @throws {BusinessError} 10200001 - The value of "length" is out of range. It must be >= 0 and <= uint32 max. Received value is: [length] */ function concat(list: Buffer[] | Uint8Array[], totalLength?: number): Buffer; @@ -88,7 +87,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param array an array of bytes in the range 0 – 255 * @return Return a new allocated Buffer - * @throws TypeError: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received [message] + * @throws {BusinessError} 401 - The type of "array" must be string or Buffer, ArrayBuffer, Array, Array-like. Received value is: [array] */ function from(array: number[]): Buffer; @@ -100,7 +99,7 @@ declare namespace buffer { * @param [byteOffset = 0] Index of first byte to expose * @param [length = arrayBuffer.byteLength - byteOffset] Number of bytes to expose * @return Return a view of the ArrayBuffer - * @throws TypeError: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received [message] + * @throws {BusinessError} 401 - The type of "arrayBuffer" must be string or Buffer, ArrayBuffer, Array, Array-like. Received value is: [arrayBuffer] */ function from(arrayBuffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): Buffer; @@ -110,7 +109,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param buffer An existing Buffer or Uint8Array from which to copy data * @return Return a new allocated Buffer - * @throws TypeError: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received [message] + * @throws {BusinessError} 401 - The type of "buffer" must be string or Buffer, ArrayBuffer, Array, Array-like. Received value is: [buffer] */ function from(buffer: Buffer | Uint8Array): Buffer; @@ -123,7 +122,7 @@ declare namespace buffer { * @param offsetOrEncoding A byte-offset or encoding * @param length A length * @return Return a new allocated Buffer - * @throws TypeError: Unknown encoding: [encoding] + * @throws {BusinessError} 401 - The type of "encoding" must be BufferEncoding. the encoding [encoding] is unknown */ function from(object: Object, offsetOrEncoding: number | string, length: number): Buffer; @@ -135,7 +134,7 @@ declare namespace buffer { * @param string A string to encode * @param [encoding='utf8'] The encoding of string * @return Return a new Buffer containing string - * @throws TypeError: Unknown encoding: [encoding] + * @throws {BusinessError} 401 - The type of "encoding" must be BufferEncoding. the encoding [encoding] is unknown */ function from(string: String, encoding?: BufferEncoding): Buffer; @@ -166,8 +165,8 @@ declare namespace buffer { * @return 0 is returned if target is the same as buf * 1 is returned if target should come before buf when sorted. * -1 is returned if target should come after buf when sorted. - * @throws TypeError: The "buf1" argument must be an instance of Buffer or Uint8Array. Received [message] - * @throws TypeError: The "buf2" argument must be an instance of Buffer or Uint8Array. Received [message] + * @throws {BusinessError} 401 - The type of "buf1" must be Buffer or Uint8Array. Received value is: [buf1] + * @throws {BusinessError} 401 - The type of "buf2" must be Buffer or Uint8Array. Received value is: [buf2] */ function compare(buf1: Buffer | Uint8Array, buf2: Buffer | Uint8Array): -1 | 0 | 1; @@ -179,8 +178,9 @@ declare namespace buffer { * @param fromEnc The current encoding * @param toEnc To target encoding * @return Returns a new Buffer instance - * @throws TypeError: The "source" argument must be an instance of Buffer or Uint8Array. Received [message] - * @throws Error: Unable to transcode Buffer [U_ILLEGAL_ARGUMENT_ERROR] + * @throws {BusinessError} 401 - The type of "source" must be Buffer or Uint8Array. Received value is: [source] + * @throws {BusinessError} 401 - The type of "fromEnc" must be string. Received value is: [fromEnc] + * @throws {BusinessError} 401 - The type of "toEnc" must be string. Received value is: [toEnc] */ function transcode(source: Buffer | Uint8Array, fromEnc: string, toEnc: string): Buffer; @@ -192,7 +192,7 @@ declare namespace buffer { * Returns the number of bytes in buf * @since 9 * @syscap SystemCapability.Utils.Lang - * @throws TypeError: Cannot set property length of [object Object] which has only a getter + * @throws {BusinessError} 10200013 - Cannot set property length of Buffer which has only a getter */ length: number; @@ -200,7 +200,7 @@ declare namespace buffer { * The underlying ArrayBuffer object based on which this Buffer object is created. * @since 9 * @syscap SystemCapability.Utils.Lang - * @throws TypeError: Cannot set property buffer of [object Object] which has only a getter + * @throws {BusinessError} 10200013 - Cannot set property buffer of Buffer which has only a getter */ buffer: ArrayBuffer; @@ -208,7 +208,7 @@ declare namespace buffer { * The byteOffset of the Buffers underlying ArrayBuffer object * @since 9 * @syscap SystemCapability.Utils.Lang - * @throws TypeError: Cannot set property byteOffset of [object Object] which has only a getter + * @throws {BusinessError} 10200013 - Cannot set property byteOffset of Buffer which has only a getter */ byteOffset: number; @@ -221,9 +221,9 @@ declare namespace buffer { * @param [end = buf.length] Where to stop filling buf (not inclusive) * @param [encoding='utf8'] The encoding for value if value is a string * @return A reference to buf - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 && <= max unsigned int. Received [number] - * @throws RangeError: The value of "end" is out of range. It must be >= 0 && <= [number]. Received [number] - * @throws TypeError: Unknown encoding: [encoding] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= uint32 max. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "end" is out of range. It must be >= 0 and <= [number]. Received value is: [end] + * @throws {BusinessError} 401 - The type of "encoding" must be BufferEncoding. the encoding [encoding] is unknown */ fill(value: string | Buffer | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): Buffer; @@ -240,12 +240,12 @@ declare namespace buffer { * @return 0 is returned if target is the same as buf * 1 is returned if target should come before buf when sorted. * -1 is returned if target should come after buf when sorted. - * @throws TypeError: The "target" argument must be an instance of Buffer or Uint8Array. Received [message] - * @throws TypeError: The "[param]" argument must be of type number. Received [message] - * @throws RangeError: The value of "targetStart" is out of range. It must be >= 0 && <= max unsigned int. Received [number] - * @throws RangeError: The value of "targetEnd" is out of range. It must be >= 0 && <= [number]. Received [number] - * @throws RangeError: The value of "sourceStart" is out of range. It must be >= 0 && <= max unsigned int. Received [number] - * @throws RangeError: The value of "sourceEnd" is out of range. It must be >= 0 && <= [number]. Received [number] + * @throws {BusinessError} 401 - The type of "target" must be Buffer or Uint8Array. Received value is: [target] + * @throws {BusinessError} 401 - The type of "[param]" must be number. Received value is: [param] + * @throws {BusinessError} 10200001 - The value of "targetStart" is out of range. It must be >= 0 and <= uint32 max. Received value is: [targetStart] + * @throws {BusinessError} 10200001 - The value of "targetEnd" is out of range. It must be >= 0 and <= [number]. Received value is: [targetEnd] + * @throws {BusinessError} 10200001 - The value of "sourceStart" is out of range. It must be >= 0 and <= uint32 max. Received value is: [sourceStart] + * @throws {BusinessError} 10200001 - The value of "sourceEnd" is out of range. It must be >= 0 and <= [number]. Received value is: [sourceEnd] */ compare(target: Buffer | Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): -1 | 0 | 1; @@ -259,10 +259,10 @@ declare namespace buffer { * @param [sourceStart = 0] The offset within buf from which to begin copying * @param [sourceEnd = buf.length] The offset within buf at which to stop copying (not inclusive) * @return The number of bytes copied - * @throws TypeError: The "target" argument must be an instance of Buffer or Uint8Array. Received [message] - * @throws RangeError: The value of "targetStart" is out of range. It must be >= 0. Received [number] - * @throws RangeError: The value of "sourceStart" is out of range. It must be >= 0. Received [number] - * @throws RangeError: The value of "sourceEnd" is out of range. It must be >= 0. Received [number] + * @throws {BusinessError} 401 - The type of "target" must be Buffer or Uint8Array. Received value is: [target] + * @throws {BusinessError} 10200001 - The value of "targetStart" is out of range. It must be >= 0. Received value is: [targetStart] + * @throws {BusinessError} 10200001 - The value of "sourceStart" is out of range. It must be >= 0. Received value is: [sourceStart] + * @throws {BusinessError} 10200001 - The value of "sourceEnd" is out of range. It must be >= 0. Received value is: [sourceEnd] */ copy(target: Buffer | Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; @@ -272,7 +272,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param otherBuffer A Buffer or Uint8Array with which to compare buf * @return true or false - * @throws TypeError: The "otherBuffer" argument must be an instance of Buffer or Uint8Array. Received [message] + * @throws {BusinessError} 401 - The type of "otherBuffer" must be Buffer or Uint8Array. Received value is: [otherBuffer] */ equals(otherBuffer: Uint8Array | Buffer): boolean; @@ -284,8 +284,8 @@ declare namespace buffer { * @param [byteOffset = 0] Where to begin searching in buf. If negative, then offset is calculated from the end of buf * @param [encoding='utf8'] If value is a string, this is its encoding * @return true or false - * @throws TypeError: The "value" argument must be one of type number or string or an instance of Buffer or Uint8Array. Received [message] - * @throws TypeError: Unknown encoding: [encoding] + * @throws {BusinessError} 401 - The type of "value" must be number or string, Buffer, Uint8Array. Received value is: [value] + * @throws {BusinessError} 401 - The type of "encoding" must be BufferEncoding. the encoding [encoding] is unknown */ includes(value: string | number | Buffer | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): boolean; @@ -297,8 +297,8 @@ declare namespace buffer { * @param [byteOffset = 0] Where to begin searching in buf * @param [encoding='utf8'] If value is a string, this is the encoding used to determine the binary representation of the string that will be searched for in buf * @return The index of the first occurrence of value in buf, or -1 if buf does not contain value - * @throws TypeError: The "value" argument must be one of type number or string or an instance of Buffer or Uint8Array. Received [message] - * @throws TypeError: Unknown encoding: [encoding] + * @throws {BusinessError} 401 - The type of "value" must be number or string, Buffer, Uint8Array. Received value is: [value] + * @throws {BusinessError} 401 - The type of "encoding" must be BufferEncoding. the encoding [encoding] is unknown */ indexOf(value: string | number | Buffer | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; @@ -331,8 +331,8 @@ declare namespace buffer { * @param [byteOffset = 0] Where to begin searching in buf * @param [encoding='utf8'] If value is a string, this is the encoding used to determine the binary representation of the string that will be searched for in buf * @return The index of the last occurrence of value in buf, or -1 if buf does not contain value - * @throws TypeError: The "value" argument must be one of type number or string or an instance of Buffer or Uint8Array. Received [message] - * @throws TypeError: Unknown encoding: [encoding] + * @throws {BusinessError} 401 - The type of "value" must be number or string, Buffer, Uint8Array. Received value is: [value] + * @throws {BusinessError} 401 - The type of "encoding" must be BufferEncoding. the encoding [encoding] is unknown */ lastIndexOf(value: string | number | Buffer | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; @@ -342,8 +342,8 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 * @return Return a signed, big-endian 64-bit integer - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] */ readBigInt64BE(offset?: number): number; @@ -353,8 +353,8 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 * @return Return a signed, little-endian 64-bit integer - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] */ readBigInt64LE(offset?: number): number; @@ -364,8 +364,8 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 * @return Return a unsigned, big-endian 64-bit integer - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] */ readBigUInt64BE(offset?: number): number; @@ -375,8 +375,8 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 * @return Return a unsigned, little-endian 64-bit integer - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] */ readBigUInt64LE(offset?: number): number; @@ -386,8 +386,8 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 * @return Return a 64-bit, big-endian double - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] */ readDoubleBE(offset?: number): number; @@ -397,8 +397,8 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 * @return Return a 64-bit, little-endian double - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] */ readDoubleLE(offset?: number): number; @@ -408,8 +408,8 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4 * @return Return a 32-bit, big-endian float - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] */ readFloatBE(offset?: number): number; @@ -419,8 +419,8 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4 * @return Return a 32-bit, little-endian float - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] */ readFloatLE(offset?: number): number; @@ -430,8 +430,8 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 1 * @return Return a signed 8-bit integer - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 1. Received [offset] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 1. Received value is: [offset] */ readInt8(offset?: number): number; @@ -441,8 +441,8 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 2 * @return Return a signed, big-endian 16-bit integer - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received [offset] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset] */ readInt16BE(offset?: number): number; @@ -452,8 +452,8 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 2 * @return Return a signed, little-endian 16-bit integer - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received [offset] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset] */ readInt16LE(offset?: number): number; @@ -463,8 +463,8 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4 * @return Return a signed, big-endian 32-bit integer - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] */ readInt32BE(offset?: number): number; @@ -474,8 +474,8 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4 * @return Return a signed, little-endian 32-bit integer - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] */ readInt32LE(offset?: number): number; @@ -487,10 +487,10 @@ declare namespace buffer { * @param offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to read. Must satisfy 0 < byteLength <= 6 * @return - * @throws TypeError: The "byteLength" argument must be of type number. Received [message] - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received [offset] - * @throws RangeError: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received [byteLength] + * @throws {BusinessError} 401 - The type of "byteLength" must be number. Received value is: [byteLength] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received value is: [byteLength] */ readIntBE(offset: number, byteLength: number): number; @@ -502,10 +502,10 @@ declare namespace buffer { * @param offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to read. Must satisfy 0 < byteLength <= 6 * @return - * @throws TypeError: The "byteLength" argument must be of type number. Received [message] - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received [offset] - * @throws RangeError: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received [byteLength] + * @throws {BusinessError} 401 - The type of "byteLength" must be number. Received value is: [byteLength] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received value is: [byteLength] */ readIntLE(offset: number, byteLength: number): number; @@ -515,8 +515,8 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 1 * @return Reads an unsigned 8-bit integer - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 1. Received [offset] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 1. Received value is: [offset] */ readUInt8(offset?: number): number; @@ -526,8 +526,8 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 2 * @return Reads an unsigned, big-endian 16-bit integer - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received [offset] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset] */ readUInt16BE(offset?: number): number; @@ -537,8 +537,8 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 2 * @return Reads an unsigned, little-endian 16-bit integer - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received [offset] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset] */ readUInt16LE(offset?: number): number; @@ -548,8 +548,8 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 4 * @return Reads an unsigned, big-endian 32-bit integer - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] */ readUInt32BE(offset?: number): number; @@ -559,8 +559,8 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 4 * @return Reads an unsigned, little-endian 32-bit integer - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] */ readUInt32LE(offset?: number): number; @@ -572,10 +572,10 @@ declare namespace buffer { * @param offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to read. Must satisfy 0 < byteLength <= 6 * @return - * @throws TypeError: The "byteLength" argument must be of type number. Received [message] - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received [offset] - * @throws RangeError: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received [byteLength] + * @throws {BusinessError} 401 - The type of "byteLength" must be number. Received value is: [byteLength] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received value is: [byteLength] */ readUIntBE(offset: number, byteLength: number): number; @@ -587,10 +587,10 @@ declare namespace buffer { * @param offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to read. Must satisfy 0 < byteLength <= 6 * @return - * @throws TypeError: The "byteLength" argument must be of type number. Received [message] - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received [offset] - * @throws RangeError: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received [byteLength] + * @throws {BusinessError} 401 - The type of "byteLength" must be number. Received value is: [byteLength] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received value is: [byteLength] */ readUIntLE(offset: number, byteLength: number): number; @@ -609,7 +609,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @return A reference to buf - * @throws BufferSizeError: Buffer size must be a multiple of 16-bits + * @throws {BusinessError} 10200009 - Buffer size must be a multiple of 16-bits */ swap16(): Buffer; @@ -618,7 +618,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @return A reference to buf - * @throws BufferSizeError: Buffer size must be a multiple of 32-bits + * @throws {BusinessError} 10200009 - Buffer size must be a multiple of 32-bits */ swap32(): Buffer; @@ -627,7 +627,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @return A reference to buf - * @throws BufferSizeError: Buffer size must be a multiple of 64-bits + * @throws {BusinessError} 10200009 - Buffer size must be a multiple of 64-bits */ swap64(): Buffer; @@ -646,7 +646,7 @@ declare namespace buffer { * @param [encoding='utf8'] The character encoding to use * @param [start = 0] The byte offset to start decoding at * @param [end = buf.length] The byte offset to stop decoding at (not inclusive) - * @throws TypeError: Unknown encoding: [encoding] + * @throws {BusinessError} 401 - The type of "encoding" must be BufferEncoding. the encoding [encoding] is unknown */ toString(encoding?: string, start?: number, end?: number): string; @@ -659,12 +659,12 @@ declare namespace buffer { * @param [length = buf.length - offset] Maximum number of bytes to write (written bytes will not exceed buf.length - offset) * @param [encoding='utf8'] The character encoding of string. * @return Number of bytes written. - * @throws TypeError: The "str" argument must be of type string. Received [message] - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws TypeError: The "length" argument must be of type number. Received [message] - * @throws TypeError: Unknown encoding: [encoding] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 && <= buf.length. Received [offset] - * @throws RangeError: The value of "length" is out of range. It must be >= 0 && <= buf.length. Received [offset] + * @throws {BusinessError} 401 - The type of "str" must be string. Received value is: [str] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - The type of "length" must be number. Received value is: [length] + * @throws {BusinessError} 401 - The type of "encoding" must be BufferEncoding. the encoding [encoding] is unknown + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "length" is out of range. It must be >= 0 and <= buf.length. Received value is: [length] */ write(str: string, offset?: number, length?: number, encoding?: string): number; @@ -675,10 +675,10 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 * @return offset plus the number of bytes written - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws TypeError: The "value" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] - * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2n ** 64n. Received [value] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= -(2n ** 63n) and <= 2n ** 63n. Received value is: [value] */ writeBigInt64BE(value: number, offset?: number): number; @@ -689,10 +689,10 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 * @return offset plus the number of bytes written - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws TypeError: The "value" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] - * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2n ** 64n. Received [value] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= -(2n ** 63n) and <= 2n ** 63n. Received value is: [value] */ writeBigInt64LE(value: number, offset?: number): number; @@ -703,10 +703,10 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 * @return offset plus the number of bytes written - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws TypeError: The "value" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] - * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2n ** 64n. Received [value] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= 0 and <= 2n ** 64n. Received value is: [value] */ writeBigUInt64BE(value: number, offset?: number): number; @@ -717,10 +717,10 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 * @return offset plus the number of bytes written - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws TypeError: The "value" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] - * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2n ** 64n. Received [value] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= 0 and <= 2n ** 64n. Received value is: [value] */ writeBigUInt64LE(value: number, offset?: number): number; @@ -731,9 +731,9 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 * @return offset plus the number of bytes written - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws TypeError: The "value" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] */ writeDoubleBE(value: number, offset?: number): number; @@ -744,9 +744,9 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 * @return offset plus the number of bytes written - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws TypeError: The "value" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received [offset] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] */ writeDoubleLE(value: number, offset?: number): number; @@ -757,9 +757,9 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 4 * @return offset plus the number of bytes written - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws TypeError: The "value" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] */ writeFloatBE(value: number, offset?: number): number; @@ -770,9 +770,9 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 4 * @return offset plus the number of bytes written - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws TypeError: The "value" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] */ writeFloatLE(value: number, offset?: number): number; @@ -783,10 +783,10 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 1 * @return offset plus the number of bytes written - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws TypeError: The "value" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 1. Received [offset] - * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**8 - 1. Received [value] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 1. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= -2**7 and <= 2**7 - 1. Received value is: [value] */ writeInt8(value: number, offset?: number): number; @@ -797,10 +797,10 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 2 * @return offset plus the number of bytes written - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws TypeError: The "value" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received [offset] - * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**16 - 1. Received [value] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= -2**15 and <= 2**15 - 1. Received value is: [value] */ writeInt16BE(value: number, offset?: number): number; @@ -811,10 +811,10 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 2 * @return offset plus the number of bytes written - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws TypeError: The "value" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received [offset] - * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**16 - 1. Received [value] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= -2**15 and <= 2**15 - 1. Received value is: [value] */ writeInt16LE(value: number, offset?: number): number; @@ -825,10 +825,10 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 4 * @return offset plus the number of bytes written - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws TypeError: The "value" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] - * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**32 - 1. Received [value] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= -2**31 and <= 2**31 - 1. Received value is: [value] */ writeInt32BE(value: number, offset?: number): number; @@ -839,10 +839,10 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 4 * @return offset plus the number of bytes written - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws TypeError: The "value" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] - * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**32 - 1. Received [value] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= -2**31 and <= 2**31 - 1. Received value is: [value] */ writeInt32LE(value: number, offset?: number): number; @@ -854,12 +854,12 @@ declare namespace buffer { * @param offset Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to write. Must satisfy 0 < byteLength <= 6 * @return offset plus the number of bytes written - * @throws TypeError: The "byteLength" argument must be of type number. Received [message] - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws TypeError: The "value" argument must be of type number. Received [message] - * @throws RangeError: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received [byteLength] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received [offset] - * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**48 - 1. Received [value] + * @throws {BusinessError} 401 - The type of "byteLength" must be number. Received value is: [byteLength] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] + * @throws {BusinessError} 10200001 - The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received value is: [byteLength] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= -2**47 and <= 2**47 - 1. Received value is: [value] */ writeIntBE(value: number, offset: number, byteLength: number): number; @@ -871,12 +871,12 @@ declare namespace buffer { * @param offset Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to write. Must satisfy 0 < byteLength <= 6 * @return offset plus the number of bytes written - * @throws TypeError: The "byteLength" argument must be of type number. Received [message] - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws TypeError: The "value" argument must be of type number. Received [message] - * @throws RangeError: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received [byteLength] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received [offset] - * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**48 - 1. Received [value] + * @throws {BusinessError} 401 - The type of "byteLength" must be number. Received value is: [byteLength] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] + * @throws {BusinessError} 10200001 - The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received value is: [byteLength] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= -2**47 and <= 2**47 - 1. Received value is: [value] */ writeIntLE(value : number, offset: number, byteLength: number): number; @@ -887,10 +887,10 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 1 * @return offset plus the number of bytes written - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws TypeError: The "value" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 1. Received [offset] - * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**8 - 1. Received [value] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 1. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= 0 and <= 2**8 - 1. Received value is: [value] */ writeUInt8(value: number, offset?: number): number; @@ -901,10 +901,10 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 2 * @return offset plus the number of bytes written - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws TypeError: The "value" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received [offset] - * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**16 - 1. Received [value] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= 0 and <= 2**16 - 1. Received value is: [value] */ writeUInt16BE(value: number, offset?: number): number; @@ -915,10 +915,10 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 2 * @return offset plus the number of bytes written - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws TypeError: The "value" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received [offset] - * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**16 - 1. Received [value] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= 0 and <= 2**16 - 1. Received value is: [value] */ writeUInt16LE(value: number, offset?: number): number; @@ -929,10 +929,10 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 4 * @return offset plus the number of bytes written - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws TypeError: The "value" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] - * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**32 - 1. Received [value] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= 0 and <= 2**32 - 1. Received value is: [value] */ writeUInt32BE(value: number, offset?: number): number; @@ -943,10 +943,10 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 4 * @return offset plus the number of bytes written - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws TypeError: The "value" argument must be of type number. Received [message] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received [offset] - * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**32 - 1. Received [value] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= 0 and <= 2**32 - 1. Received value is: [value] */ writeUInt32LE(value: number, offset?: number): number; @@ -958,12 +958,12 @@ declare namespace buffer { * @param offset Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to write. Must satisfy 0 < byteLength <= 6 * @return offset plus the number of bytes written - * @throws TypeError: The "byteLength" argument must be of type number. Received [message] - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws TypeError: The "value" argument must be of type number. Received [message] - * @throws RangeError: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received [byteLength] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received [offset] - * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**48 - 1. Received [value] + * @throws {BusinessError} 401 - The type of "byteLength" must be number. Received value is: [byteLength] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] + * @throws {BusinessError} 10200001 - The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received value is: [byteLength] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= 0 and <= 2**48 - 1. Received value is: [value] */ writeUIntBE(value: number, offset: number, byteLength: number): number; @@ -975,12 +975,12 @@ declare namespace buffer { * @param offset Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to write. Must satisfy 0 < byteLength <= 6 * @return offset plus the number of bytes written - * @throws TypeError: The "byteLength" argument must be of type number. Received [message] - * @throws TypeError: The "offset" argument must be of type number. Received [message] - * @throws TypeError: The "value" argument must be of type number. Received [message] - * @throws RangeError: The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received [byteLength] - * @throws RangeError: The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received [offset] - * @throws RangeError: The value of "value" is out of range. It must be >= 0 and <= 2**48 - 1. Received [value] + * @throws {BusinessError} 401 - The type of "byteLength" must be number. Received value is: [byteLength] + * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] + * @throws {BusinessError} 10200001 - The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received value is: [byteLength] + * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received value is: [offset] + * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= 0 and <= 2**48 - 1. Received value is: [value] */ writeUIntLE(value: number, offset: number, byteLength: number): number; @@ -996,8 +996,8 @@ declare namespace buffer { * @param options {endings: string, type: string} * endings: One of either 'transparent' or 'native'. * type: The Blob content-type - * @throws TypeError: The "sources" argument must be an instance of Iterable. Received [message] - * @throws TypeError: The "options" argument must be of type object. Received [message] + * @throws {BusinessError} 401 - The type of "sources" must be Iterable. Received value is: [sources] + * @throws {BusinessError} 401 - The type of "options" must be object. Received value is: [options] */ constructor(sources: string[] | ArrayBuffer[] | TypedArray[] | DataView[] | Blob[] , options: Object); -- Gitee From 77cd437ccc97300e798ffe53043a45564ea37c5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E6=80=A1?= Date: Tue, 11 Oct 2022 12:30:10 +0000 Subject: [PATCH 059/438] bugfix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱天怡 --- api/@ohos.bundleState.d.ts | 2 +- api/@ohos.resourceschedule.usageStatistics.d.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/@ohos.bundleState.d.ts b/api/@ohos.bundleState.d.ts index f443844370..a8b04d04fd 100644 --- a/api/@ohos.bundleState.d.ts +++ b/api/@ohos.bundleState.d.ts @@ -558,7 +558,7 @@ declare namespace bundleState { * @param end Indicates the end time of the query period, in milliseconds. * @return Returns the {@link BundleActiveEventState} object Array containing the event states data. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.queryNotificationNumber + * @useinstead @ohos.resourceschedule.usageStatistics.queryNotificationEventStats */ function queryAppNotificationNumber(begin: number, end: number, callback: AsyncCallback>): void; function queryAppNotificationNumber(begin: number, end: number): Promise>; diff --git a/api/@ohos.resourceschedule.usageStatistics.d.ts b/api/@ohos.resourceschedule.usageStatistics.d.ts index b60fdf4103..df43c3e20c 100644 --- a/api/@ohos.resourceschedule.usageStatistics.d.ts +++ b/api/@ohos.resourceschedule.usageStatistics.d.ts @@ -195,7 +195,7 @@ declare namespace usageStatistics { /** * the usage group of the application. */ - appUsageGroup?: number; + appGroup?: number; /** * the bundle name. */ @@ -226,11 +226,11 @@ declare namespace usageStatistics { /* * the usage old group of the application */ - appUsageOldGroup: number; + appOldGroup: number; /* * the usage new group of the application */ - appUsageNewGroup: number; + appNewGroup: number; /* * the use id */ @@ -637,8 +637,8 @@ declare namespace usageStatistics { * @throws { BusinessError } 10000007 - Get system or actual time failed. * @return Returns the {@link DeviceEventStats} object Array containing the event states data. */ - function queryNotificationNumber(begin: number, end: number, callback: AsyncCallback>): void; - function queryNotificationNumber(begin: number, end: number): Promise>; + function queryNotificationEventStats(begin: number, end: number, callback: AsyncCallback>): void; + function queryNotificationEventStats(begin: number, end: number): Promise>; } export default usageStatistics; \ No newline at end of file -- Gitee From f78582a7f665850c4615adef9df3e32bd4f0756a Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Mon, 5 Sep 2022 21:15:02 +0800 Subject: [PATCH 060/438] houhaoyu@huawei.com add pageTransition Signed-off-by: houhaoyu Change-Id: I461e59159337f50377f363e29b11819176281ac7 --- api/@internal/component/ets/common.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index f6fcf56b44..006b0afdde 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -2043,6 +2043,13 @@ declare class CustomComponent extends CommonAttribute { * @since 7 */ onBackPress?(): void; + + /** + * PageTransition Method. + * Implement Animation when enter this page or move to other pages. + * @since 9 + */ + pageTransition?(): void; } /** -- Gitee From 017b9d6b7eff679023defb9a0d6e56de5bbc6b9a Mon Sep 17 00:00:00 2001 From: zhutianyi Date: Tue, 11 Oct 2022 20:55:07 +0800 Subject: [PATCH 061/438] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhutianyi --- api/@ohos.backgroundTaskManager.d.ts | 24 +++++------ ...sourceschedule.backgroundTaskManager.d.ts} | 42 +++++++++---------- 2 files changed, 33 insertions(+), 33 deletions(-) rename api/{@ohos.resourceschedule.backgroundTaskMgr.d.ts => @ohos.resourceschedule.backgroundTaskManager.d.ts} (82%) diff --git a/api/@ohos.backgroundTaskManager.d.ts b/api/@ohos.backgroundTaskManager.d.ts index ad94147eb4..a051ce8115 100644 --- a/api/@ohos.backgroundTaskManager.d.ts +++ b/api/@ohos.backgroundTaskManager.d.ts @@ -23,7 +23,7 @@ import Context from './application/BaseContext'; * @since 7 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskMgr + * @useinstead @ohos.resourceschedule.backgroundTaskManager */ declare namespace backgroundTaskManager { /** @@ -33,7 +33,7 @@ declare namespace backgroundTaskManager { * @since 7 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskMgr.DelaySuspendInfo + * @useinstead @ohos.resourceschedule.backgroundTaskManager.DelaySuspendInfo */ interface DelaySuspendInfo { /** @@ -53,7 +53,7 @@ declare namespace backgroundTaskManager { * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @param requestId Indicates the identifier of the delay request. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskMgr.cancelSuspendDelay + * @useinstead @ohos.resourceschedule.backgroundTaskManager.cancelSuspendDelay */ function cancelSuspendDelay(requestId: number): void; @@ -65,7 +65,7 @@ declare namespace backgroundTaskManager { * @param requestId Indicates the identifier of the delay request. * @return The remaining delay time * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskMgr.getRemainingDelayTime + * @useinstead @ohos.resourceschedule.backgroundTaskManager.getRemainingDelayTime */ function getRemainingDelayTime(requestId: number, callback: AsyncCallback): void; function getRemainingDelayTime(requestId: number): Promise; @@ -79,7 +79,7 @@ declare namespace backgroundTaskManager { * @param callback The callback delay time expired. * @return Info of delay request * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskMgr.requestSuspendDelay + * @useinstead @ohos.resourceschedule.backgroundTaskManager.requestSuspendDelay */ function requestSuspendDelay(reason: string, callback: Callback): DelaySuspendInfo; @@ -94,7 +94,7 @@ declare namespace backgroundTaskManager { * @param bgMode Indicates which background mode to request. * @param wantAgent Indicates which ability to start when user click the notification bar. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskMgr.startBackgroundRunning + * @useinstead @ohos.resourceschedule.backgroundTaskManager.startBackgroundRunning */ function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback): void; function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise; @@ -106,7 +106,7 @@ declare namespace backgroundTaskManager { * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @param context app running context. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskMgr.stopBackgroundRunning + * @useinstead @ohos.resourceschedule.backgroundTaskManager.stopBackgroundRunning */ function stopBackgroundRunning(context: Context, callback: AsyncCallback): void; function stopBackgroundRunning(context: Context): Promise; @@ -119,7 +119,7 @@ declare namespace backgroundTaskManager { * @return True if efficiency resources apply success, else false. * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskMgr.applyEfficiencyResources + * @useinstead @ohos.resourceschedule.backgroundTaskManager.applyEfficiencyResources */ function applyEfficiencyResources(request: EfficiencyResourcesRequest): boolean; @@ -130,7 +130,7 @@ declare namespace backgroundTaskManager { * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskMgr.resetAllEfficiencyResources + * @useinstead @ohos.resourceschedule.backgroundTaskManager.resetAllEfficiencyResources */ function resetAllEfficiencyResources(): void; @@ -140,7 +140,7 @@ declare namespace backgroundTaskManager { * @since 8 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskMgr.BackgroundMode + * @useinstead @ohos.resourceschedule.backgroundTaskManager.BackgroundMode */ export enum BackgroundMode { /** @@ -226,7 +226,7 @@ declare namespace backgroundTaskManager { * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskMgr.ResourceType + * @useinstead @ohos.resourceschedule.backgroundTaskManager.ResourceType */ export enum ResourceType { /** @@ -273,7 +273,7 @@ declare namespace backgroundTaskManager { * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskMgr.EfficiencyResourcesRequest + * @useinstead @ohos.resourceschedule.backgroundTaskManager.EfficiencyResourcesRequest */ export interface EfficiencyResourcesRequest { /** diff --git a/api/@ohos.resourceschedule.backgroundTaskMgr.d.ts b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts similarity index 82% rename from api/@ohos.resourceschedule.backgroundTaskMgr.d.ts rename to api/@ohos.resourceschedule.backgroundTaskManager.d.ts index 6550822599..691aa18916 100644 --- a/api/@ohos.resourceschedule.backgroundTaskMgr.d.ts +++ b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts @@ -21,7 +21,7 @@ import Context from './application/BaseContext'; * Manages background tasks. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.TransientTask + * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.TransientTask */ declare namespace backgroundTaskManager { /** @@ -29,7 +29,7 @@ declare namespace backgroundTaskManager { * * @name DelaySuspendInfo * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.TransientTask + * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.TransientTask */ interface DelaySuspendInfo { /** @@ -46,7 +46,7 @@ declare namespace backgroundTaskManager { * Cancels delayed transition to the suspended state. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.TransientTask + * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.TransientTask * @param requestId Indicates the identifier of the delay request. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 9800001 - Memory operation failed. @@ -62,7 +62,7 @@ declare namespace backgroundTaskManager { * Obtains the remaining time before an application enters the suspended state. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.TransientTask + * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.TransientTask * @param requestId Indicates the identifier of the delay request. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 9800001 - Memory operation failed. @@ -80,7 +80,7 @@ declare namespace backgroundTaskManager { * Requests delayed transition to the suspended state. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.TransientTask + * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.TransientTask * @param reason Indicates the reason for delayed transition to the suspended state. * @param callback The callback delay time expired. * @throws { BusinessError } 401 - Parameter error. @@ -99,7 +99,7 @@ declare namespace backgroundTaskManager { * system will publish a notification related to the this service. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.ContinuousTask * @permission ohos.permission.KEEP_BACKGROUND_RUNNING * @param context app running context. * @param bgMode Indicates which background mode to request. @@ -121,7 +121,7 @@ declare namespace backgroundTaskManager { * Service ability uses this method to request stop running in background. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.ContinuousTask * @param context app running context. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - Parameter error. @@ -140,7 +140,7 @@ declare namespace backgroundTaskManager { * Apply or unapply efficiency resources. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.EfficiencyResourcesApply + * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.EfficiencyResourcesApply * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 9800001 - Memory operation failed. @@ -156,7 +156,7 @@ declare namespace backgroundTaskManager { * Reset all efficiency resources apply. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.EfficiencyResourcesApply + * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.EfficiencyResourcesApply * @systemapi Hide this for inner system use. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - Parameter error. @@ -172,14 +172,14 @@ declare namespace backgroundTaskManager { * supported background mode. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.ContinuousTask */ export enum BackgroundMode { /** * data transfer mode * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.ContinuousTask */ DATA_TRANSFER = 1, @@ -187,7 +187,7 @@ declare namespace backgroundTaskManager { * audio playback mode * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.ContinuousTask */ AUDIO_PLAYBACK = 2, @@ -195,7 +195,7 @@ declare namespace backgroundTaskManager { * audio recording mode * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.ContinuousTask */ AUDIO_RECORDING = 3, @@ -203,7 +203,7 @@ declare namespace backgroundTaskManager { * location mode * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.ContinuousTask */ LOCATION = 4, @@ -211,7 +211,7 @@ declare namespace backgroundTaskManager { * bluetooth interaction mode * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.ContinuousTask */ BLUETOOTH_INTERACTION = 5, @@ -219,7 +219,7 @@ declare namespace backgroundTaskManager { * multi-device connection mode * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.ContinuousTask */ MULTI_DEVICE_CONNECTION = 6, @@ -227,7 +227,7 @@ declare namespace backgroundTaskManager { * wifi interaction mode * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.ContinuousTask * @systemapi Hide this for inner system use. */ WIFI_INTERACTION = 7, @@ -236,7 +236,7 @@ declare namespace backgroundTaskManager { * Voice over Internet Phone mode * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.ContinuousTask * @systemapi Hide this for inner system use. */ VOIP = 8, @@ -246,7 +246,7 @@ declare namespace backgroundTaskManager { * only supported in particular device * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.ContinuousTask */ TASK_KEEPING = 9, } @@ -255,7 +255,7 @@ declare namespace backgroundTaskManager { * The type of resource. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.EfficiencyResourcesApply + * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.EfficiencyResourcesApply * @systemapi Hide this for inner system use. */ export enum ResourceType { @@ -300,7 +300,7 @@ declare namespace backgroundTaskManager { * * @name EfficiencyResourcesRequest * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskMgr.EfficiencyResourcesApply + * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.EfficiencyResourcesApply * @systemapi Hide this for inner system use. */ export interface EfficiencyResourcesRequest { -- Gitee From 485073f1ca665a9a77be9673cf0ad96e473a93c2 Mon Sep 17 00:00:00 2001 From: wangtiantian Date: Tue, 11 Oct 2022 16:08:16 +0800 Subject: [PATCH 062/438] IssueNo:#I5V49P Description: add distributed interface Sig:SIG_ApplicaitonFramework Feature or Bugfix:Bugfix Binary Source:No Signed-off-by: wangtiantian --- api/@ohos.bundle.distributedBundle.d.ts | 185 +++++++++++++++++++++++ api/@ohos.distributedBundle.d.ts | 6 + api/bundle/elementName.d.ts | 2 + api/bundle/remoteAbilityInfo.d.ts | 2 + api/bundleManager/elementName.d.ts | 72 +++++++++ api/bundleManager/remoteAbilityInfo.d.ts | 49 ++++++ 6 files changed, 316 insertions(+) create mode 100644 api/@ohos.bundle.distributedBundle.d.ts create mode 100644 api/bundleManager/elementName.d.ts create mode 100644 api/bundleManager/remoteAbilityInfo.d.ts diff --git a/api/@ohos.bundle.distributedBundle.d.ts b/api/@ohos.bundle.distributedBundle.d.ts new file mode 100644 index 0000000000..76c67d47bd --- /dev/null +++ b/api/@ohos.bundle.distributedBundle.d.ts @@ -0,0 +1,185 @@ +/* + * 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 { AsyncCallback } from './basic'; +import { ElementName } from './bundleManager/elementName'; +import { RemoteAbilityInfo as _RemoteAbilityInfo } from './bundleManager/remoteAbilityInfo'; + +/** + * DistributedBundle manager. + * @namespace distributedBundle + * @syscap SystemCapability.BundleManager.DistributedBundleFramework + * @systemapi + * @since 9 + */ +declare namespace distributedBundle { + /** + * Obtains information about the ability info of the remote device. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { ElementName } elementName - Indicates the elementName. + * @param { AsyncCallback } callback - The callback of getting the ability info of the remote device. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @throws { BusinessError } 17700003 - The specified ability name is not found. + * @throws { BusinessError } 17700007 - The specified device id is not found. + * @throws { BusinessError } 17700027 - The distributed service is not running. + * @syscap SystemCapability.BundleManager.DistributedBundleFramework + * @systemapi + * @since 9 + */ + function getRemoteAbilityInfo(elementName: ElementName, callback: AsyncCallback): void; + + /** + * Obtains information about the ability info of the remote device. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { ElementName } elementName - Indicates the elementName. + * @returns { Promise } Returns the ability info of the remote device. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @throws { BusinessError } 17700003 - The specified ability name is not found. + * @throws { BusinessError } 17700007 - The specified device id is not found. + * @throws { BusinessError } 17700027 - The distributed service is not running. + * @syscap SystemCapability.BundleManager.DistributedBundleFramework + * @systemapi + * @since 9 + */ + function getRemoteAbilityInfo(elementName: ElementName): Promise; + + /** + * Obtains information about the abilities info of the remote device. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { Array } elementNames - Indicates the elementNames, Maximum array length ten. + * @param { AsyncCallback> } callback - the callback of getting the abilities info of the remote device. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @throws { BusinessError } 17700003 - The specified ability name is not found. + * @throws { BusinessError } 17700007 - The specified device id is not found. + * @throws { BusinessError } 17700027 - The distributed service is not running. + * @syscap SystemCapability.BundleManager.DistributedBundleFramework + * @systemapi + * @since 9 + */ + function getRemoteAbilityInfo(elementNames: Array, callback: AsyncCallback>): void; + + /** + * Obtains information about the abilities info of the remote device. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { Array } elementNames - Indicates the elementNames, Maximum array length ten. + * @returns { Promise> } The result of getting the abilities info of the remote device. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @throws { BusinessError } 17700003 - The specified ability name is not found. + * @throws { BusinessError } 17700007 - The specified device id is not found. + * @throws { BusinessError } 17700027 - The distributed service is not running. + * @syscap SystemCapability.BundleManager.DistributedBundleFramework + * @systemapi + * @since 9 + */ + function getRemoteAbilityInfo(elementNames: Array): Promise>; + + /** + * Obtains information about the ability info of the remote device. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { ElementName } elementName - Indicates the elementName. + * @param { string } locale - Indicates the locale info + * @param { AsyncCallback } callback - The callback of getting the ability info of the remote device. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @throws { BusinessError } 17700003 - The specified ability name is not found. + * @throws { BusinessError } 17700007 - The specified device id is not found. + * @throws { BusinessError } 17700027 - The distributed service is not running. + * @syscap SystemCapability.BundleManager.DistributedBundleFramework + * @systemapi + * @since 9 + */ + function getRemoteAbilityInfo(elementName: ElementName, locale: string, callback: AsyncCallback): void; + + /** + * Obtains information about the ability info of the remote device. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { ElementName } elementName - Indicates the elementName. + * @param { string } locale - Indicates the locale info + * @returns { Promise> } The result of getting the ability info of the remote device. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @throws { BusinessError } 17700003 - The specified ability name is not found. + * @throws { BusinessError } 17700007 - The specified device id is not found. + * @throws { BusinessError } 17700027 - The distributed service is not running. + * @syscap SystemCapability.BundleManager.DistributedBundleFramework + * @systemapi + * @since 9 + */ + function getRemoteAbilityInfo(elementName: ElementName, locale: string): Promise; + + /** + * Obtains information about the ability info of the remote device. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { Array } elementNames - Indicates the elementNames, Maximum array length ten. + * @param { string } locale - Indicates the locale info + * @param { AsyncCallback } callback - Returns the abilities info of the remote device. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @throws { BusinessError } 17700003 - The specified ability name is not found. + * @throws { BusinessError } 17700007 - The specified device id is not found. + * @throws { BusinessError } 17700027 - The distributed service is not running. + * @syscap SystemCapability.BundleManager.DistributedBundleFramework + * @systemapi + * @since 9 + */ + function getRemoteAbilityInfo(elementNames: Array, locale: string, callback: AsyncCallback>): void; + + /** + * Obtains information about the abilities info of the remote device. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { Array } elementNames - Indicates the elementNames, Maximum array length ten. + * @param { string } locale - Indicates the locale info + * @returns { Promise> } Returns the abilities info of the remote device. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @throws { BusinessError } 17700003 - The specified ability name is not found. + * @throws { BusinessError } 17700007 - The specified device id is not found. + * @throws { BusinessError } 17700027 - The distributed service is not running. + * @syscap SystemCapability.BundleManager.DistributedBundleFramework + * @systemapi + * @since 9 + */ + function getRemoteAbilityInfo(elementNames: Array, locale: string): Promise>; + + /** + * Contains basic remote ability information. + * @syscap SystemCapability.BundleManager.DistributedBundleFramework + * @systemapi + * @since 9 + */ + export type RemoteAbilityInfo = _RemoteAbilityInfo; +} + +export default distributedBundle; diff --git a/api/@ohos.distributedBundle.d.ts b/api/@ohos.distributedBundle.d.ts index beaf21575a..619ab50a1a 100644 --- a/api/@ohos.distributedBundle.d.ts +++ b/api/@ohos.distributedBundle.d.ts @@ -24,6 +24,8 @@ import { RemoteAbilityInfo as _RemoteAbilityInfo } from './bundle/remoteAbilityI * @syscap SystemCapability.BundleManager.DistributedBundleFramework * @permission NA * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.distributeBundle */ declare namespace distributedBundle { /** @@ -35,6 +37,8 @@ import { RemoteAbilityInfo as _RemoteAbilityInfo } from './bundle/remoteAbilityI * @return Returns the ability info of the remote device. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @systemapi + * @deprecated since 9 + * @useinstead ohos.bundle.distributeBundle#getRemoteAbilityInfo */ function getRemoteAbilityInfo(elementName: ElementName, callback: AsyncCallback): void; function getRemoteAbilityInfo(elementName: ElementName): Promise; @@ -48,6 +52,8 @@ import { RemoteAbilityInfo as _RemoteAbilityInfo } from './bundle/remoteAbilityI * @return Returns the ability infos of the remote device. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @systemapi + * @deprecated since 9 + * @useinstead ohos.bundle.distributeBundle#getRemoteAbilityInfo */ function getRemoteAbilityInfos(elementNames: Array, callback: AsyncCallback>): void; function getRemoteAbilityInfos(elementNames: Array): Promise>; diff --git a/api/bundle/elementName.d.ts b/api/bundle/elementName.d.ts index 3eeff9218e..c03c120ec3 100644 --- a/api/bundle/elementName.d.ts +++ b/api/bundle/elementName.d.ts @@ -22,6 +22,8 @@ * @syscap SystemCapability.BundleManager.BundleFramework * * @permission N/A + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager.ElementName */ export interface ElementName { /** diff --git a/api/bundle/remoteAbilityInfo.d.ts b/api/bundle/remoteAbilityInfo.d.ts index e9a1585c26..176c28d969 100644 --- a/api/bundle/remoteAbilityInfo.d.ts +++ b/api/bundle/remoteAbilityInfo.d.ts @@ -22,6 +22,8 @@ import { ElementName } from './elementName'; * @systemapi * * @permission N/A + * @deprecated since 9 + * @useinstead ohos.bundle.distributedBundle.RemoteAbilityInfo */ export interface RemoteAbilityInfo { /** diff --git a/api/bundleManager/elementName.d.ts b/api/bundleManager/elementName.d.ts new file mode 100644 index 0000000000..612986c3e5 --- /dev/null +++ b/api/bundleManager/elementName.d.ts @@ -0,0 +1,72 @@ +/* + * 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. + */ + +/** + * Contains basic Ability information, which uniquely identifies an ability. + * You can use this class to obtain values of the fields set in an element, + * such as the device ID, bundle name, and ability name. + * @typedef ElementName + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +export interface ElementName { + /** + * Indicates device id + * @type {?string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + deviceId?: string; + + /** + * @default Indicates bundle name + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + bundleName: string; + + /** + * @default Indicates module name + * @type {?string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + moduleName?: string; + + /** + * Indicates ability name + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + abilityName: string; + + /** + * Indicates uri + * @type {?string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + uri?: string; + + /** + * Indicates short name + * @type {?string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + shortName?: string; +} diff --git a/api/bundleManager/remoteAbilityInfo.d.ts b/api/bundleManager/remoteAbilityInfo.d.ts new file mode 100644 index 0000000000..16b91e7641 --- /dev/null +++ b/api/bundleManager/remoteAbilityInfo.d.ts @@ -0,0 +1,49 @@ +/* + * 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 { ElementName } from './elementName'; + +/** + * Contains basic remote ability information. + * @typedef RemoteAbilityInfo + * @syscap SystemCapability.BundleManager.DistributedBundleFramework + * @systemapi + * @since 9 + */ +export interface RemoteAbilityInfo { + /** + * Indicates the ability information + * @type {ElementName} + * @syscap SystemCapability.BundleManager.DistributedBundleFramework + * @since 9 + */ + readonly elementName: ElementName; + + /** + * Indicates the label of the ability + * @type {string} + * @syscap SystemCapability.BundleManager.DistributedBundleFramework + * @since 9 + */ + readonly label: string; + + /** + * Indicates the icon of the ability + * @type {string} + * @syscap SystemCapability.BundleManager.DistributedBundleFramework + * @since 9 + */ + readonly icon: string; +} \ No newline at end of file -- Gitee From 074915c9da99e5b777c9295aa2d70c8ce5d58506 Mon Sep 17 00:00:00 2001 From: wangminmin Date: Wed, 12 Oct 2022 16:30:35 +0800 Subject: [PATCH 063/438] adapter bms permission Signed-off-by: wangminmin --- api/@ohos.data.fileAccess.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/@ohos.data.fileAccess.d.ts b/api/@ohos.data.fileAccess.d.ts index 46b8b6c591..9c31c93412 100644 --- a/api/@ohos.data.fileAccess.d.ts +++ b/api/@ohos.data.fileAccess.d.ts @@ -31,7 +31,7 @@ declare namespace fileAccess { * @syscap SystemCapability.FileManagement.UserFileService * @StageModelOnly * @systemapi - * @permission ohos.permission.FILE_ACCESS_MANAGER + * @permission ohos.permission.FILE_ACCESS_MANAGER and ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @return Returns the wants. */ function getFileAccessAbilityInfo(callback: AsyncCallback>): void; @@ -43,7 +43,7 @@ declare namespace fileAccess { * @syscap SystemCapability.FileManagement.UserFileService * @StageModelOnly * @systemapi - * @permission ohos.permission.FILE_ACCESS_MANAGER + * @permission ohos.permission.FILE_ACCESS_MANAGER and ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param context Indicates the application context. * @return Returns the fileAccessHelper. */ @@ -55,7 +55,7 @@ declare namespace fileAccess { * @syscap SystemCapability.FileManagement.UserFileService * @StageModelOnly * @systemapi - * @permission ohos.permission.FILE_ACCESS_MANAGER + * @permission ohos.permission.FILE_ACCESS_MANAGER and ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param context Indicates the application context. * @param want Represents the connected data provider. * @return Returns the fileAccessHelper. -- Gitee From bcd26af9aad6f51bd4622c32279f13a3001aa899 Mon Sep 17 00:00:00 2001 From: lyj_love_code Date: Mon, 10 Oct 2022 22:08:21 +0800 Subject: [PATCH 064/438] Add error handling for js api Signed-off-by: lyj_love_code --- api/@ohos.hiAppEvent.d.ts | 240 ++--------------- api/@ohos.hiviewdfx.hiAppEvent.d.ts | 388 ++++++++++++++++++++++++++++ 2 files changed, 407 insertions(+), 221 deletions(-) create mode 100644 api/@ohos.hiviewdfx.hiAppEvent.d.ts diff --git a/api/@ohos.hiAppEvent.d.ts b/api/@ohos.hiAppEvent.d.ts index 2d694a38b5..b62cf6f34a 100644 --- a/api/@ohos.hiAppEvent.d.ts +++ b/api/@ohos.hiAppEvent.d.ts @@ -22,6 +22,8 @@ import { AsyncCallback } from './basic'; * * @since 7 * @syscap SystemCapability.HiviewDFX.HiAppEvent + * @deprecated since 9 + * @useinstead ohos.hiviewdfx.hiAppEvent */ declare namespace hiAppEvent { /** @@ -72,7 +74,7 @@ declare namespace hiAppEvent { */ namespace Event { /** - * user login event. + * User login event. * * @since 7 * @syscap SystemCapability.HiviewDFX.HiAppEvent @@ -80,7 +82,7 @@ declare namespace hiAppEvent { const USER_LOGIN: string; /** - * user logout event. + * User logout event. * * @since 7 * @syscap SystemCapability.HiviewDFX.HiAppEvent @@ -88,7 +90,7 @@ declare namespace hiAppEvent { const USER_LOGOUT: string; /** - * distributed service event. + * Distributed service event. * * @since 7 * @syscap SystemCapability.HiviewDFX.HiAppEvent @@ -104,7 +106,7 @@ declare namespace hiAppEvent { */ namespace Param { /** - * user id. + * User id. * * @since 7 * @syscap SystemCapability.HiviewDFX.HiAppEvent @@ -112,7 +114,7 @@ declare namespace hiAppEvent { const USER_ID: string; /** - * distributed service name. + * Distributed service name. * * @since 7 * @syscap SystemCapability.HiviewDFX.HiAppEvent @@ -120,7 +122,7 @@ declare namespace hiAppEvent { const DISTRIBUTED_SERVICE_NAME: string; /** - * distributed service instance id. + * Distributed service instance id. * * @since 7 * @syscap SystemCapability.HiviewDFX.HiAppEvent @@ -129,29 +131,28 @@ declare namespace hiAppEvent { } /** - * write application event. + * Write application event. * * @since 7 - * @deprecated since 9 * @syscap SystemCapability.HiviewDFX.HiAppEvent * @static - * @param {string} eventName application event name. - * @param {EventType} eventType application event type. - * @param {object} keyValues application event key-value pair params. - * @param {AsyncCallback} [callback] callback function. - * @return {void | Promise} no callback return Promise otherwise return void. + * @param {string} eventName Application event name. + * @param {EventType} eventType Application event type. + * @param {object} keyValues Application event key-value pair params. + * @param {AsyncCallback} [callback] Callback function. + * @return {void | Promise} No callback return Promise otherwise return void. */ function write(eventName: string, eventType: EventType, keyValues: object): Promise; function write(eventName: string, eventType: EventType, keyValues: object, callback: AsyncCallback): void; /** - * application event logging configuration interface. + * Application event logging configuration interface. * * @since 7 * @syscap SystemCapability.HiviewDFX.HiAppEvent * @static - * @param {ConfigOption} config application event logging configuration item object. - * @return {boolean} configuration result. + * @param {ConfigOption} config Application event logging configuration item object. + * @return {boolean} Configuration result. */ function configure(config: ConfigOption): boolean; @@ -163,7 +164,7 @@ declare namespace hiAppEvent { */ interface ConfigOption { /** - * configuration item: application event logging switch. + * Configuration item: application event logging switch. * * @since 7 * @syscap SystemCapability.HiviewDFX.HiAppEvent @@ -171,216 +172,13 @@ declare namespace hiAppEvent { disable?: boolean; /** - * configuration item: event file directory storage quota size. + * Configuration item: event file directory storage quota size. * * @since 7 * @syscap SystemCapability.HiviewDFX.HiAppEvent */ maxStorage?: string; } - - /** - * Definition of written application event information. - * - * @since 9 - * @syscap SystemCapability.HiviewDFX.HiAppEvent - */ - interface AppEventInfo { - /** - * The domain of the event. - */ - domain: string; - - /** - * The name of the event. - */ - name: string; - - /** - * The type of the event. - */ - eventType: EventType; - - /** - * The params of the event. - */ - params: object; - } - - /** - * write application event. - * - * @since 9 - * @syscap SystemCapability.HiviewDFX.HiAppEvent - * @static - * @param {AppEventInfo} info application event information to be written. - * @param {AsyncCallback} [callback] callback function. - * @return {void | Promise} no callback return Promise otherwise return void. - */ - function write(info: AppEventInfo): Promise; - function write(info: AppEventInfo, callback: AsyncCallback): void; - - /** - * Definition of the read event package. - * - * @since 9 - * @syscap SystemCapability.HiviewDFX.HiAppEvent - */ - interface AppEventPackage { - /** - * The id of the package. - */ - packageId: number; - - /** - * The number of events contained in the package. - */ - row: number; - - /** - * The total size of events contained in the package. - */ - size: number; - - /** - * The events data contained in the package. - */ - data: string[]; - } - - /** - * Definition of event holder object, which is used to read the event data monitored by the watcher. - * - * @since 9 - * @syscap SystemCapability.HiviewDFX.HiAppEvent - */ - class AppEventPackageHolder { - /** - * Constructor for AppEventPackageHolder. - * - * @since 9 - * @syscap SystemCapability.HiviewDFX.HiAppEvent - * @param {string} watcherName name of the watcher to read. - */ - constructor(watcherName: string); - - /** - * Set the threshold size per read. - * - * @since 9 - * @syscap SystemCapability.HiviewDFX.HiAppEvent - * @param {number} size threshold size. - */ - setSize(size: number): void; - - /** - * Read the event data monitored by the watcher. - * - * @since 9 - * @syscap SystemCapability.HiviewDFX.HiAppEvent - * @return {AppEventPackage} the read event package. - */ - takeNext(): AppEventPackage; - } - - /** - * Definition of the condition for triggering callback when the watcher monitors event data. - * - * @since 9 - * @syscap SystemCapability.HiviewDFX.HiAppEvent - */ - interface TriggerCondition { - /** - * The number of write events that trigger callback. - */ - row?: number; - - /** - * The size of write events that trigger callback. - */ - size?: number; - - /** - * The interval for triggering callback. - */ - timeOut?: number; - } - - /** - * Definition of event filter object, which is used to filter events monitored by the watcher. - * - * @since 9 - * @syscap SystemCapability.HiviewDFX.HiAppEvent - */ - interface AppEventFilter { - /** - * The name of the event domain to be monitored by the watcher. - */ - domain: string; - - /** - * The types of the events to be monitored by the watcher. - */ - eventTypes?: EventType[]; - } - - /** - * Definition of event watcher object, which is used to monitor written event data. - * - * @since 9 - * @syscap SystemCapability.HiviewDFX.HiAppEvent - */ - interface Watcher { - /** - * The name of watcher. - */ - name: string; - - /** - * The condition for triggering callback. - */ - triggerCondition?: TriggerCondition; - - /** - * The event filters for monitoring events. - */ - appEventFilters?: AppEventFilter[]; - - /** - * The callback function of watcher. - */ - onTrigger?: (curRow: number, curSize:number, holder:AppEventPackageHolder) => void; - } - - /** - * Add event watcher. - * - * @since 9 - * @syscap SystemCapability.HiviewDFX.HiAppEvent - * @static - * @param {Watcher} watcher watcher object for monitoring events. - * @return {AppEventPackageHolder} holder object, which is used to read the monitoring data of the watcher. - */ - function addWatcher(watcher: Watcher): AppEventPackageHolder; - - /** - * Remove event watcher. - * - * @since 9 - * @syscap SystemCapability.HiviewDFX.HiAppEvent - * @static - * @param {Watcher} watcher watcher object for monitoring events. - */ - function removeWatcher(watcher: Watcher): void; - - /** - * Clear all local logging data of the application. - * - * @since 9 - * @syscap SystemCapability.HiviewDFX.HiAppEvent - * @static - */ - function clearData(): void; } export default hiAppEvent; \ No newline at end of file diff --git a/api/@ohos.hiviewdfx.hiAppEvent.d.ts b/api/@ohos.hiviewdfx.hiAppEvent.d.ts new file mode 100644 index 0000000000..2f76dd1747 --- /dev/null +++ b/api/@ohos.hiviewdfx.hiAppEvent.d.ts @@ -0,0 +1,388 @@ +/* + * 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 { AsyncCallback } from './basic'; + +/** + * Provides the event logging function for applications to log the fault, statistical, security, + * and user behavior events reported during running. Based on event information, + * you will be able to analyze the running status of applications. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + */ +declare namespace hiAppEvent { + /** + * Enumerate application event types. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + */ + enum EventType { + /** + * Fault event. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + */ + FAULT = 1, + + /** + * Statistic event. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + */ + STATISTIC = 2, + + /** + * Security event. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + */ + SECURITY = 3, + + /** + * User behavior event. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + */ + BEHAVIOR = 4 + } + + /** + * Preset event. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + */ + namespace Event { + /** + * User login event. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + */ + const USER_LOGIN: string; + + /** + * User logout event. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + */ + const USER_LOGOUT: string; + + /** + * Distributed service event. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + */ + const DISTRIBUTED_SERVICE_START: string; + } + + /** + * Preset param. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + */ + namespace Param { + /** + * User id. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + */ + const USER_ID: string; + + /** + * Distributed service name. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + */ + const DISTRIBUTED_SERVICE_NAME: string; + + /** + * Distributed service instance id. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + */ + const DISTRIBUTED_SERVICE_INSTANCE_ID: string; + } + + /** + * Application event logging configuration interface. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + * @static + * @param {ConfigOption} config Application event logging configuration item object. + * @throws {BusinessError} 401 - Parameter error. + * @throws {BusinessError} 11103001 - Invalid max storage quota value. + */ + function configure(config: ConfigOption): void; + + /** + * Describe the options for the configuration. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + */ + interface ConfigOption { + /** + * Configuration item: application event logging switch. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + */ + disable?: boolean; + + /** + * Configuration item: event file directory storage quota size. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + */ + maxStorage?: string; + } + + /** + * Definition of written application event information. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + */ + interface AppEventInfo { + /** + * The domain of the event. + */ + domain: string; + + /** + * The name of the event. + */ + name: string; + + /** + * The type of the event. + */ + eventType: EventType; + + /** + * The params of the event. + */ + params: object; + } + + /** + * Write application event. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + * @static + * @param {AppEventInfo} info Application event information to be written. + * @param {AsyncCallback} [callback] Callback function. + * @throws {BusinessError} 401 - Parameter error. + * @throws {BusinessError} 11100001 - Function is disable. + * @throws {BusinessError} 11101001 - Invalid event domain. + * @throws {BusinessError} 11101002 - Invalid event name. + * @throws {BusinessError} 11101003 - Invalid param num. + * @throws {BusinessError} 11101004 - Invalid string length. + * @throws {BusinessError} 11101005 - Invalid param name. + * @throws {BusinessError} 11101006 - Invalid array length. + */ + function write(info: AppEventInfo): Promise; + function write(info: AppEventInfo, callback: AsyncCallback): void; + + /** + * Definition of the read event package. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + */ + interface AppEventPackage { + /** + * The id of the package. + */ + packageId: number; + + /** + * The number of events contained in the package. + */ + row: number; + + /** + * The total size of events contained in the package. + */ + size: number; + + /** + * The events data contained in the package. + */ + data: string[]; + } + + /** + * Definition of event holder object, which is used to read the event data monitored by the watcher. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + */ + class AppEventPackageHolder { + /** + * Constructor for AppEventPackageHolder. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + * @param {string} watcherName Name of the watcher to read. + */ + constructor(watcherName: string); + + /** + * Set the threshold size per read. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + * @param {number} size Threshold size. + * @throws {BusinessError} 401 - Parameter error. + * @throws {BusinessError} 11104001 - Size must be a positive integer. + */ + setSize(size: number): void; + + /** + * Read the event data monitored by the watcher. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + * @return {AppEventPackage} The read event package. + */ + takeNext(): AppEventPackage; + } + + /** + * Definition of the condition for triggering callback when the watcher monitors event data. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + */ + interface TriggerCondition { + /** + * The number of write events that trigger callback. + */ + row?: number; + + /** + * The size of write events that trigger callback. + */ + size?: number; + + /** + * The interval for triggering callback. + */ + timeOut?: number; + } + + /** + * Definition of event filter object, which is used to filter events monitored by the watcher. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + */ + interface AppEventFilter { + /** + * The name of the event domain to be monitored by the watcher. + */ + domain: string; + + /** + * The types of the events to be monitored by the watcher. + */ + eventTypes?: EventType[]; + } + + /** + * Definition of event watcher object, which is used to monitor written event data. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + */ + interface Watcher { + /** + * The name of watcher. + */ + name: string; + + /** + * The condition for triggering callback. + */ + triggerCondition?: TriggerCondition; + + /** + * The event filters for monitoring events. + */ + appEventFilters?: AppEventFilter[]; + + /** + * The callback function of watcher. + */ + onTrigger?: (curRow: number, curSize:number, holder:AppEventPackageHolder) => void; + } + + /** + * Add event watcher. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + * @static + * @param {Watcher} watcher Watcher object for monitoring events. + * @return {AppEventPackageHolder} Holder object, which is used to read the monitoring data of the watcher. + * @throws {BusinessError} 401 - Parameter error. + * @throws {BusinessError} 11102001 - Invalid watcher name. + * @throws {BusinessError} 11102002 - Invalid filter domain. + * @throws {BusinessError} 11102003 - Row must be a positive integer. + * @throws {BusinessError} 11102004 - Size must be a positive integer. + * @throws {BusinessError} 11102005 - Timeout must be a positive integer. + */ + function addWatcher(watcher: Watcher): AppEventPackageHolder; + + /** + * Remove event watcher. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + * @static + * @param {Watcher} watcher Watcher object for monitoring events. + * @throws {BusinessError} 401 - Parameter error. + * @throws {BusinessError} 11102001 - Invalid watcher name. + */ + function removeWatcher(watcher: Watcher): void; + + /** + * Clear all local logging data of the application. + * + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiAppEvent + * @static + */ + function clearData(): void; +} + +export default hiAppEvent; \ No newline at end of file -- Gitee From 6239c0d2c955098508d0ae8ca72c62e324105aed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwangxiyue=E2=80=9D?= Date: Wed, 12 Oct 2022 21:25:16 +0800 Subject: [PATCH 065/438] modified ohos.data.distributedDataObject.d.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: “wangxiyue” --- api/@ohos.data.distributedDataObject.d.ts | 86 ++++++++++++++++++++++- 1 file changed, 83 insertions(+), 3 deletions(-) diff --git a/api/@ohos.data.distributedDataObject.d.ts b/api/@ohos.data.distributedDataObject.d.ts index ac9d6683f1..16a09b6070 100644 --- a/api/@ohos.data.distributedDataObject.d.ts +++ b/api/@ohos.data.distributedDataObject.d.ts @@ -19,10 +19,11 @@ import {AsyncCallback, Callback} from './basic'; * Provides interfaces to sync distributed object * * @name distributedDataObject - * @since 8 * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject + * @since 8 */ declare namespace distributedDataObject { + /** * Create distributed object * @@ -32,6 +33,17 @@ declare namespace distributedDataObject { */ function createDistributedObject(source: object): DistributedObject; + /** + * Create distributed object + * + * @param { object } source - source Init data of distributed object + * @return Returns the distributed object + * @throws { BusinessError } 401 - the parameter check failed + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject + * @since 9 + */ + function create(source: object): DistributedObjectV9; + /** * Generate a random sessionId * @@ -127,6 +139,73 @@ declare namespace distributedDataObject { * @since 8 */ off(type: 'status', callback?: Callback<{ sessionId: string, deviceId: string, status: 'online' | 'offline' }>): void; + } + + /** + * Object create by {@link create}. + * + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject + * @since 9 + */ + interface DistributedObjectV9 { + + /* + * Change object session + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param sessionId The sessionId to be joined, if empty, leave all session + * @return Operation result, true is success, false is failed + * @throws { BusinessError } 201 - the permissions check failed + * @throws { BusinessError } 401 - the parameter check failed + * @throws { BusinessError } 15400001 - create table failed + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject + * @since 9 + */ + setSessionId(sessionId: string, callback: AsyncCallback): void; + setSessionId(callback: AsyncCallback): void; + setSessionId(sessionId?: string): Promise; + + /** + * On watch of change + * + * @param callback The callback of change + * @throws { BusinessError } 401 - the parameter check failed + * @since 9 + */ + on(type: 'change', callback: Callback<{ sessionId: string, fields: Array }>): void; + + /** + * Off watch of change + * + * @param callback If not null, off the callback, if undefined, off all callbacks + * @throws { BusinessError } 401 - the parameter check failed + * @since 9 + */ + off(type: 'change', callback?: Callback<{ sessionId: string, fields: Array }>): void; + + /** + * On watch of status + * + * @@param { Callback<{ sessionId: string, networkId: string, status: 'online' | 'offline' }> } callback + * callback Indicates the observer of object status changed. + * sessionId: The sessionId of the changed object + * networkId: NetworkId of the changed device + * status: 'online' The object became online on the device and data can be synced to the device + * 'offline' The object became offline on the device and the object can not sync any data + * 'restored' The object restored success + * @throws { BusinessError } 401 - the parameter check failed + * @since 9 + */ + on(type: 'status', callback: Callback<{ sessionId: string, networkId: string, status: 'online' | 'offline' }>): void; + + /** + * Off watch of status + * + * @param callback If not null, off the callback, if undefined, off all callbacks + * @throws { BusinessError } 401 - the parameter check failed + * @since 9 + */ + off(type: 'status', callback?: Callback<{ sessionId: string, deviceId: string, status: 'online' | 'offline' }>): void; /** * Save object, after save object data successfully, the object data will not release when app existed, and resume data on saved device after app existed @@ -136,8 +215,8 @@ declare namespace distributedDataObject { * 1. saved after 24h * 2. app uninstalled * 3. after resume data success, system will auto delete the saved data - * - * @param deviceId Indicates the device that will resume the object data + * @param { string } deviceId - Indicates the device that will resume the object data + * @throws { BusinessError } 401 - the parameter check failed * @since 9 */ save(deviceId: string, callback: AsyncCallback): void; @@ -147,6 +226,7 @@ declare namespace distributedDataObject { * Revoke save object, delete saved object immediately, if object is saved in local device, it will delete saved data on all trusted device * if object is saved in other device, it will delete data in local device. * + * @throws { BusinessError } 401 - the parameter check failed * @since 9 */ revokeSave(callback: AsyncCallback): void; -- Gitee From f80eb22f20cf5a5f7a9a5c20600db07bac49bfac Mon Sep 17 00:00:00 2001 From: zhengjiangliang Date: Thu, 13 Oct 2022 09:05:35 +0800 Subject: [PATCH 066/438] =?UTF-8?q?=E7=AA=97=E5=8F=A3=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=A0=81=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I361187c98ee3c0a55a9ee0245f9e710ec7534f75 Signed-off-by: zhengjiangliang --- api/@ohos.window.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index 1ea88ecd65..842d868fc1 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -615,7 +615,7 @@ declare namespace window { /** * Indicates Parent window id */ - parentId?: string + parentId?: number } /** @@ -627,7 +627,7 @@ declare namespace window { * @throws {BusinessError} 1300001 - If window has created * @throws {BusinessError} 1300006 - If window context is abnormally */ - function createWindow({ name, windowType, ctx, displayId, parentId = "" }: Configuration, callback: AsyncCallback): void; + function createWindow(config: Configuration, callback: AsyncCallback): void; /** * Create a window with a specific configuration @@ -638,7 +638,7 @@ declare namespace window { * @throws {BusinessError} 1300001 - If window has created * @throws {BusinessError} 1300006 - If window context is abnormally */ - function createWindow({ name, windowType, ctx, displayId, parentId = "" }: Configuration): Promise; + function createWindow(config: Configuration): Promise; /** * Create a sub window with a specific id and type, only support 7. -- Gitee From 143fbc8532b502df9dada8a1c530cee6d3d15bf1 Mon Sep 17 00:00:00 2001 From: yangbo Date: Thu, 13 Oct 2022 09:46:12 +0800 Subject: [PATCH 067/438] delete systemapi tag Signed-off-by: yangbo --- api/@ohos.filemanagement.userFileManager.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/api/@ohos.filemanagement.userFileManager.d.ts b/api/@ohos.filemanagement.userFileManager.d.ts index 863d2baa40..ebadef5a84 100644 --- a/api/@ohos.filemanagement.userFileManager.d.ts +++ b/api/@ohos.filemanagement.userFileManager.d.ts @@ -740,7 +740,6 @@ declare namespace userFileManager { * @param uri Uri of asset * @param callback No value returned * @throws {BusinessError} 13900020 - if type uri is not string - * @systemapi */ delete(uri: string, callback: AsyncCallback): void; /** -- Gitee From e3c508915807affd6f6b15760b22acfc4f8f5ee5 Mon Sep 17 00:00:00 2001 From: niudongyao Date: Thu, 13 Oct 2022 09:56:17 +0800 Subject: [PATCH 068/438] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 +++++++++++++++++++++++++++++++++++ api/@ohos.data.dataShare.d.ts | 64 ++++++++++++++++----------------- 2 files changed, 100 insertions(+), 32 deletions(-) create mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000000..53649ef027 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1664437584931 + + + + + + + + + \ No newline at end of file diff --git a/api/@ohos.data.dataShare.d.ts b/api/@ohos.data.dataShare.d.ts index 8e58a8f527..6500ba78ce 100644 --- a/api/@ohos.data.dataShare.d.ts +++ b/api/@ohos.data.dataShare.d.ts @@ -29,8 +29,8 @@ import { ValuesBucket } from './@ohos.data.ValuesBucket'; declare namespace dataShare { /** * Obtains the dataShareHelper. - * @param { context } Context - Indicates the application context. - * @param { uri } string - Indicates the path of the file to open. + * @param { Context } context - Indicates the application context. + * @param { string } uri - Indicates the path of the file to open. * @param { AsyncCallback } callback - the dataShareHelper. * @throws { BusinessError } 401 - the parameter check failed. * @throws { BusinessError } 15700010 - the DataShareHelper is not initialized successfully. @@ -43,8 +43,8 @@ declare namespace dataShare { /** * Obtains the dataShareHelper. - * @param { context } Context - Indicates the application context. - * @param { uri } string - Indicates the path of the file to open. + * @param { Context } context - Indicates the application context. + * @param { string } uri - Indicates the path of the file to open. * @returns { Promise } the dataShareHelper. * @throws { BusinessError } 401 - the parameter check failed. * @throws { BusinessError } 15700010 - the parameter check failed. @@ -65,8 +65,8 @@ declare namespace dataShare { interface DataShareHelper { /** * Registers an observer to observe data specified by the given uri. - * @param { type } 'dataChange' - dataChange. - * @param { uri } string - Indicates the path of the data to operate. + * @param { string } type - must be 'dataChange'. + * @param { string } uri - Indicates the path of the data to operate. * @param { AsyncCallback } callback - Indicates the callback when dataChange. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi @@ -77,8 +77,8 @@ declare namespace dataShare { /** * Deregisters an observer used for monitoring data specified by the given uri. - * @param { type } 'dataChange' - dataChange. - * @param { uri } string - Indicates the path of the data to operate. + * @param { string } type - must be 'dataChange'. + * @param { string } uri - Indicates the path of the data to operate. * @param { AsyncCallback } callback - Indicates the callback when dataChange. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi @@ -89,8 +89,8 @@ declare namespace dataShare { /** * Inserts a single data record into the database. - * @param { uri } string - Indicates the path of the data to operate. - * @param { value } ValueBucket - Indicates the data record to insert. If this parameter is null, a blank row will be inserted. + * @param { string } uri - Indicates the path of the data to operate. + * @param { ValueBucket } value - Indicates the data record to insert. If this parameter is null, a blank row will be inserted. * @param { AsyncCallback } callback - the index of the inserted data record. * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer @@ -102,8 +102,8 @@ declare namespace dataShare { /** * Inserts a single data record into the database. - * @param { uri } string - Indicates the path of the data to operate. - * @param { value } ValueBucket - Indicates the data record to insert. If this parameter is null, a blank row will be inserted. + * @param { string } uri - Indicates the path of the data to operate. + * @param { ValueBucket } value - Indicates the data record to insert. If this parameter is null, a blank row will be inserted. * @returns { Promise } the index of the inserted data record. * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer @@ -115,8 +115,8 @@ declare namespace dataShare { /** * Deletes one or more data records from the database. - * @param { uri } string - Indicates the path of the data to operate. - * @param { predicates } dataSharePredicates.DataSharePredicates - Indicates filter criteria. You should define the processing logic when this parameter is null. + * @param { string } uri - Indicates the path of the data to operate. + * @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria. You should define the processing logic when this parameter is null. * @param { AsyncCallback } callback - the number of data records deleted. * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer @@ -128,8 +128,8 @@ declare namespace dataShare { /** * Deletes one or more data records from the database. - * @param { uri } string - Indicates the path of the data to operate. - * @param { predicates } dataSharePredicates.DataSharePredicates - Indicates filter criteria. You should define the processing logic when this parameter is null. + * @param { string } uri - Indicates the path of the data to operate. + * @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria. You should define the processing logic when this parameter is null. * @returns { Promise } the number of data records deleted. * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer @@ -141,9 +141,9 @@ declare namespace dataShare { /** * Queries data in the database. - * @param { uri } string - Indicates the path of data to query. - * @param { predicates } dataSharePredicates.DataSharePredicates - Indicates filter criteria. You should define the processing logic when this parameter is null. - * @param { columns } Array - Indicates the columns to query. If this parameter is null, all columns are queried. + * @param { string } uri - Indicates the path of data to query. + * @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria. You should define the processing logic when this parameter is null. + * @param { Array } columns - Indicates the columns to query. If this parameter is null, all columns are queried. * @param { AsyncCallback } callback - the query result. * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer @@ -155,9 +155,9 @@ declare namespace dataShare { /** * Queries data in the database. - * @param { uri } string - Indicates the path of data to query. - * @param { predicates } dataSharePredicates.DataSharePredicates - Indicates filter criteria. You should define the processing logic when this parameter is null. - * @param { columns } Array - Indicates the columns to query. If this parameter is null, all columns are queried. + * @param { string } uri - Indicates the path of data to query. + * @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria. You should define the processing logic when this parameter is null. + * @param { Array } columns - Indicates the columns to query. If this parameter is null, all columns are queried. * @returns { Promise } - the query result. * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer @@ -169,9 +169,9 @@ declare namespace dataShare { /** * Updates data records in the database. - * @param { uri } string - Indicates the path of data to update. - * @param { predicates } dataSharePredicates.DataSharePredicates - Indicates filter criteria. You should define the processing logic when this parameter is null. - * @param { value } ValueBucket - Indicates the data to update. This parameter can be null. + * @param { string } uri - Indicates the path of data to update. + * @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria. You should define the processing logic when this parameter is null. + * @param { ValueBucket } value - Indicates the data to update. This parameter can be null. * @param { AsyncCallback } callback - the number of data records updated. * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer @@ -183,9 +183,9 @@ declare namespace dataShare { /** * Updates data records in the database. - * @param { uri } string - Indicates the path of data to update. - * @param { predicates } dataSharePredicates.DataSharePredicates - Indicates filter criteria. You should define the processing logic when this parameter is null. - * @param { value } ValueBucket - Indicates the data to update. This parameter can be null. + * @param { string } uri - Indicates the path of data to update. + * @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria. You should define the processing logic when this parameter is null. + * @param { ValueBucket } value - Indicates the data to update. This parameter can be null. * @returns { Promise } the number of data records updated. * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer @@ -197,8 +197,8 @@ declare namespace dataShare { /** * Inserts multiple data records into the database. - * @param { uri } string - Indicates the path of the data to operate. - * @param { values } Array - Indicates the data records to insert. + * @param { string } uri - Indicates the path of the data to operate. + * @param { Array } values - Indicates the data records to insert. * @param { AsyncCallback } callback - the number of data records inserted. * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer @@ -210,8 +210,8 @@ declare namespace dataShare { /** * Inserts multiple data records into the database. - * @param { uri } string - Indicates the path of the data to operate. - * @param { values } Array - Indicates the data records to insert. + * @param { string } uri - Indicates the path of the data to operate. + * @param { Array } values - Indicates the data records to insert. * @returns { Promise } the number of data records inserted. * @throws { BusinessError } 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer -- Gitee From 3b467f8a3a9c0a90398b00e50f1bec5d9fc118b6 Mon Sep 17 00:00:00 2001 From: niudongyao Date: Thu, 13 Oct 2022 09:56:29 +0800 Subject: [PATCH 069/438] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 --------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 53649ef027..0000000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1664437584931 - - - - - - - - - \ No newline at end of file -- Gitee From ac52ad6285c10aefa34c11a80422b93dce8c2c0b Mon Sep 17 00:00:00 2001 From: niudongyao Date: Thu, 13 Oct 2022 10:14:47 +0800 Subject: [PATCH 070/438] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 +++++++++++++++++++++++++++++++++++ api/@ohos.data.dataShare.d.ts | 63 +++++++++++++++++++++++--------- 2 files changed, 114 insertions(+), 17 deletions(-) create mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000000..dbc96ba6ca --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1664437584931 + + + + + + + + + \ No newline at end of file diff --git a/api/@ohos.data.dataShare.d.ts b/api/@ohos.data.dataShare.d.ts index 6500ba78ce..4abaaa4c1c 100644 --- a/api/@ohos.data.dataShare.d.ts +++ b/api/@ohos.data.dataShare.d.ts @@ -227,47 +227,76 @@ declare namespace dataShare { *

To transfer a normalized uri from another environment to the current environment, you should call this * method again to re-normalize the uri for the current environment or call {@link #denormalizeUri(Uri)} * to convert it to a denormalized uri that can be used only in the current environment. - * @since 9 + * @param { string } uri - Indicates the {@link ohos.utils.net.Uri} object to normalize. + * @param { AsyncCallback } callback - the normalized Uri if the DataShare supports uri normalization; * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi - * @param uri Indicates the {@link ohos.utils.net.Uri} object to normalize. - * @return Returns the normalized {@code Uri} object if the DataShare supports uri normalization; - * returns {@code null} otherwise. - * @throws DataShareRemoteException Throws this exception if the remote process exits. - * @throws NullPointerException Throws this exception if {@code uri} is null. - * @see #denormalizeUri * @StageModelOnly + * @since 9 */ normalizeUri(uri: string, callback: AsyncCallback): void; + + /** + * Converts the given {@code uri} that refers to the DataShare into a normalized {@link ohos.utils.net.Uri}. + * A normalized uri can be used across devices, persisted, backed up, and restored. + *

To transfer a normalized uri from another environment to the current environment, you should call this + * method again to re-normalize the uri for the current environment or call {@link #denormalizeUri(Uri)} + * to convert it to a denormalized uri that can be used only in the current environment. + * @param { string } uri - Indicates the {@link ohos.utils.net.Uri} object to normalize. + * @returns { Promise } the normalized Uri if the DataShare supports uri normalization; + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @StageModelOnly + * @since 9 + */ normalizeUri(uri: string): Promise; /** * Converts the given normalized {@code uri} generated by {@link #normalizeUri(Uri)} into a denormalized one. - * @since 9 + * @param { string } uri - Indicates the {@link ohos.utils.net.Uri} object to denormalize. + * @param { AsyncCallback } callback - the denormalized {@code Uri} object if the denormalization is successful; returns the + * original {@code Uri} passed to this method if there is nothing to do; returns {@code null} if the data + * identified by the normalized {@code Uri} cannot be found in the current environment. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi - * @param uri Indicates the {@link ohos.utils.net.Uri} object to denormalize. - * @return Returns the denormalized {@code Uri} object if the denormalization is successful; returns the + * @StageModelOnly + * @since 9 + */ + denormalizeUri(uri: string, callback: AsyncCallback): void; + + /** + * Converts the given normalized {@code uri} generated by {@link #normalizeUri(Uri)} into a denormalized one. + * @param { string } uri - Indicates the {@link ohos.utils.net.Uri} object to denormalize. + * @returns { Promise } the denormalized {@code Uri} object if the denormalization is successful; returns the * original {@code Uri} passed to this method if there is nothing to do; returns {@code null} if the data * identified by the normalized {@code Uri} cannot be found in the current environment. - * @throws DataShareRemoteException Throws this exception if the remote process exits. - * @throws NullPointerException Throws this exception if {@code uri} is null. - * @see #normalizeUri + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi * @StageModelOnly + * @since 9 */ - denormalizeUri(uri: string, callback: AsyncCallback): void; denormalizeUri(uri: string): Promise; /** * Notifies the registered observers of a change to the data resource specified by Uri. - * @since 9 + * @param { string } uri - Indicates the {@link ohos.utils.net.Uri} object to notifyChange. + * @param { AsyncCallback } callback - callback. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi - * @param uri Indicates the {@link ohos.utils.net.Uri} object to notifyChange. - * @return - * @StageModelOnly + * @since 9 */ notifyChange(uri: string, callback: AsyncCallback): void; + + /** + * Notifies the registered observers of a change to the data resource specified by Uri. + * @param { string } uri - Indicates the {@link ohos.utils.net.Uri} object to notifyChange. + * @returns { Promise } the promise returned by the function. + * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer + * @systemapi + * @StageModelOnly + * @since 9 + */ notifyChange(uri: string): Promise; } } -- Gitee From 1577c7886297e3a32a9e9b522b31fce956e682be Mon Sep 17 00:00:00 2001 From: niudongyao Date: Thu, 13 Oct 2022 10:15:01 +0800 Subject: [PATCH 071/438] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 --------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index dbc96ba6ca..0000000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1664437584931 - - - - - - - - - \ No newline at end of file -- Gitee From 553a4dc7c8b858286bf2f598b183319ae0cdb22f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwangxiyue=E2=80=9D?= Date: Thu, 13 Oct 2022 10:39:06 +0800 Subject: [PATCH 072/438] modified data.distributedDataObject.d.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: “wangxiyue” --- api/@ohos.data.distributedDataObject.d.ts | 97 ++++++++++++++++------- 1 file changed, 69 insertions(+), 28 deletions(-) diff --git a/api/@ohos.data.distributedDataObject.d.ts b/api/@ohos.data.distributedDataObject.d.ts index 16a09b6070..7068ed49a9 100644 --- a/api/@ohos.data.distributedDataObject.d.ts +++ b/api/@ohos.data.distributedDataObject.d.ts @@ -153,56 +153,74 @@ declare namespace distributedDataObject { * Change object session * * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @param sessionId The sessionId to be joined, if empty, leave all session - * @return Operation result, true is success, false is failed - * @throws { BusinessError } 201 - the permissions check failed - * @throws { BusinessError } 401 - the parameter check failed - * @throws { BusinessError } 15400001 - create table failed - * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject + * @param { string } sessionId - sessionId The sessionId to be joined, if empty, leave all session. + * @param { AsyncCallback } callback - Indicates the callback function. + * @throws { BusinessError } 201 - the permissions check failed. + * @throws { BusinessError } 401 - the parameter check failed. + * @throws { BusinessError } 15400001 - create table failed. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. * @since 9 */ setSessionId(sessionId: string, callback: AsyncCallback): void; setSessionId(callback: AsyncCallback): void; + + /* + * Change object session + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC. + * @param { string } sessionId - sessionId The sessionId to be joined, if empty, leave all session. + * @returns { Promise } - return a promise object with void. + * @throws { BusinessError } 201 - the permissions check failed. + * @throws { BusinessError } 401 - the parameter check failed. + * @throws { BusinessError } 15400001 - create table failed. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. + * @since 9 + */ setSessionId(sessionId?: string): Promise; /** * On watch of change - * - * @param callback The callback of change - * @throws { BusinessError } 401 - the parameter check failed + * @param { string } type - event type, fixed as' change ', indicates data change. + * @param { Callback<{ sessionId: string, fields: Array }> } callback + * callback indicates the observer of object data changed. + * @throws { BusinessError } 401 - the parameter check failed. * @since 9 */ on(type: 'change', callback: Callback<{ sessionId: string, fields: Array }>): void; /** * Off watch of change - * - * @param callback If not null, off the callback, if undefined, off all callbacks - * @throws { BusinessError } 401 - the parameter check failed + * @param { string } type - event type, fixed as' change ', indicates data change. + * @param { Callback<{ sessionId: string, fields: Array }> }callback + * callback indicates the observer of object data changed. + * callback If not null, off the callback, if undefined, off all callbacks. + * @throws { BusinessError } 401 - the parameter check failed. * @since 9 */ off(type: 'change', callback?: Callback<{ sessionId: string, fields: Array }>): void; /** * On watch of status - * - * @@param { Callback<{ sessionId: string, networkId: string, status: 'online' | 'offline' }> } callback - * callback Indicates the observer of object status changed. - * sessionId: The sessionId of the changed object - * networkId: NetworkId of the changed device - * status: 'online' The object became online on the device and data can be synced to the device - * 'offline' The object became offline on the device and the object can not sync any data - * 'restored' The object restored success - * @throws { BusinessError } 401 - the parameter check failed + * @param { string } type - event type, fixed as' status', indicates the online and offline of the object. + * @param { Callback<{ sessionId: string, networkId: string, status: 'online' | 'offline' }> } callback + * callback indicates the observer of object status changed. + * sessionId: the sessionId of the changed object. + * networkId: NetworkId of the changed device. + * status: 'online' The object became online on the device and data can be synced to the device. + * 'offline' The object became offline on the device and the object can not sync any data. + * 'restored' The object restored success. + * @throws { BusinessError } 401 - the parameter check failed. * @since 9 */ on(type: 'status', callback: Callback<{ sessionId: string, networkId: string, status: 'online' | 'offline' }>): void; /** * Off watch of status - * - * @param callback If not null, off the callback, if undefined, off all callbacks - * @throws { BusinessError } 401 - the parameter check failed + * @param { string } type - event type, fixed as' status', indicates the online and offline of the object. + * @param { Callback<{ sessionId: string, networkId: string, status: 'online' | 'offline' }> } callback + * callback Indicates the observer of object status changed. + * callback If not null, off the callback, if undefined, off all callbacks. + * @throws { BusinessError } 401 - the parameter check failed. * @since 9 */ off(type: 'status', callback?: Callback<{ sessionId: string, deviceId: string, status: 'online' | 'offline' }>): void; @@ -215,21 +233,44 @@ declare namespace distributedDataObject { * 1. saved after 24h * 2. app uninstalled * 3. after resume data success, system will auto delete the saved data - * @param { string } deviceId - Indicates the device that will resume the object data - * @throws { BusinessError } 401 - the parameter check failed + * @param { string } deviceId - Indicates the device that will resume the object data. + * @param { AsyncCallback } callback - Indicates the callback function. + * @throws { BusinessError } 401 - the parameter check failed. * @since 9 */ save(deviceId: string, callback: AsyncCallback): void; + + /** + * Save object, after save object data successfully, the object data will not release when app existed, and resume data on saved device after app existed + * the saved data secure level is S0, it is not safe, can only save public data, if there is privacy data, you should encrypt it + * + * the saved data will be released when + * 1. saved after 24h + * 2. app uninstalled + * 3. after resume data success, system will auto delete the saved data + * @param { string } deviceId - Indicates the device that will resume the object data. + * @returns { Promise } - the response of revokeSave success. + * @throws { BusinessError } 401 - the parameter check failed. + * @since 9 + */ save(deviceId: string): Promise; /** * Revoke save object, delete saved object immediately, if object is saved in local device, it will delete saved data on all trusted device * if object is saved in other device, it will delete data in local device. - * - * @throws { BusinessError } 401 - the parameter check failed + * @param { AsyncCallback } callback - Indicates the callback function. + * @throws { BusinessError } 401 - the parameter check failed. * @since 9 */ revokeSave(callback: AsyncCallback): void; + + /** + * Revoke save object, delete saved object immediately, if object is saved in local device, it will delete saved data on all trusted device + * if object is saved in other device, it will delete data in local device. + * @returns { Promise } the response of revokeSave success. + * @throws { BusinessError } 401 - the parameter check failed. + * @since 9 + */ revokeSave(): Promise; } } -- Gitee From 132e8bf76d6d13811f79d8e18c547abff8d3780c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwangxiyue=E2=80=9D?= Date: Thu, 13 Oct 2022 10:43:17 +0800 Subject: [PATCH 073/438] =?UTF-8?q?modified=20distributedDataObject=20Sign?= =?UTF-8?q?ed-off-by:=20=E2=80=9Cwangxiyue=E2=80=9D=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/@ohos.data.distributedDataObject.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/@ohos.data.distributedDataObject.d.ts b/api/@ohos.data.distributedDataObject.d.ts index 7068ed49a9..facb2b87fe 100644 --- a/api/@ohos.data.distributedDataObject.d.ts +++ b/api/@ohos.data.distributedDataObject.d.ts @@ -180,6 +180,7 @@ declare namespace distributedDataObject { /** * On watch of change + * * @param { string } type - event type, fixed as' change ', indicates data change. * @param { Callback<{ sessionId: string, fields: Array }> } callback * callback indicates the observer of object data changed. @@ -190,6 +191,7 @@ declare namespace distributedDataObject { /** * Off watch of change + * * @param { string } type - event type, fixed as' change ', indicates data change. * @param { Callback<{ sessionId: string, fields: Array }> }callback * callback indicates the observer of object data changed. @@ -201,6 +203,7 @@ declare namespace distributedDataObject { /** * On watch of status + * * @param { string } type - event type, fixed as' status', indicates the online and offline of the object. * @param { Callback<{ sessionId: string, networkId: string, status: 'online' | 'offline' }> } callback * callback indicates the observer of object status changed. @@ -216,6 +219,7 @@ declare namespace distributedDataObject { /** * Off watch of status + * * @param { string } type - event type, fixed as' status', indicates the online and offline of the object. * @param { Callback<{ sessionId: string, networkId: string, status: 'online' | 'offline' }> } callback * callback Indicates the observer of object status changed. @@ -233,6 +237,7 @@ declare namespace distributedDataObject { * 1. saved after 24h * 2. app uninstalled * 3. after resume data success, system will auto delete the saved data + * * @param { string } deviceId - Indicates the device that will resume the object data. * @param { AsyncCallback } callback - Indicates the callback function. * @throws { BusinessError } 401 - the parameter check failed. @@ -248,6 +253,7 @@ declare namespace distributedDataObject { * 1. saved after 24h * 2. app uninstalled * 3. after resume data success, system will auto delete the saved data + * * @param { string } deviceId - Indicates the device that will resume the object data. * @returns { Promise } - the response of revokeSave success. * @throws { BusinessError } 401 - the parameter check failed. @@ -258,6 +264,7 @@ declare namespace distributedDataObject { /** * Revoke save object, delete saved object immediately, if object is saved in local device, it will delete saved data on all trusted device * if object is saved in other device, it will delete data in local device. + * * @param { AsyncCallback } callback - Indicates the callback function. * @throws { BusinessError } 401 - the parameter check failed. * @since 9 @@ -267,6 +274,7 @@ declare namespace distributedDataObject { /** * Revoke save object, delete saved object immediately, if object is saved in local device, it will delete saved data on all trusted device * if object is saved in other device, it will delete data in local device. + * * @returns { Promise } the response of revokeSave success. * @throws { BusinessError } 401 - the parameter check failed. * @since 9 -- Gitee From 3bde4fa4368466deaf1b45df7bee65a606a27975 Mon Sep 17 00:00:00 2001 From: niudongyao Date: Thu, 13 Oct 2022 10:46:29 +0800 Subject: [PATCH 074/438] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 +++++++++++++++++++++++++++++++++++ api/@ohos.data.dataShare.d.ts | 2 +- 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000000..3f2e93fd5d --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1664437584931 + + + + + + + + + \ No newline at end of file diff --git a/api/@ohos.data.dataShare.d.ts b/api/@ohos.data.dataShare.d.ts index 4abaaa4c1c..10715e93ee 100644 --- a/api/@ohos.data.dataShare.d.ts +++ b/api/@ohos.data.dataShare.d.ts @@ -47,7 +47,7 @@ declare namespace dataShare { * @param { string } uri - Indicates the path of the file to open. * @returns { Promise } the dataShareHelper. * @throws { BusinessError } 401 - the parameter check failed. - * @throws { BusinessError } 15700010 - the parameter check failed. + * @throws { BusinessError } 15700010 - the DataShareHelper is not initialized successfully. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly -- Gitee From a7b0593cbead27fa965672fa889dcf6e64e8235e Mon Sep 17 00:00:00 2001 From: niudongyao Date: Thu, 13 Oct 2022 10:47:05 +0800 Subject: [PATCH 075/438] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 --------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index 3f2e93fd5d..0000000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1664437584931 - - - - - - - - - \ No newline at end of file -- Gitee From 1020d731e805e7360f7bf10047ea336499898032 Mon Sep 17 00:00:00 2001 From: lengchangjing Date: Wed, 12 Oct 2022 17:17:50 +0800 Subject: [PATCH 076/438] modify buffer exception description Signed-off-by: lengchangjing --- api/@ohos.buffer.d.ts | 261 +++++++++++++++--------------------------- 1 file changed, 95 insertions(+), 166 deletions(-) diff --git a/api/@ohos.buffer.d.ts b/api/@ohos.buffer.d.ts index 333557afd1..6314bc96fb 100644 --- a/api/@ohos.buffer.d.ts +++ b/api/@ohos.buffer.d.ts @@ -32,7 +32,7 @@ declare namespace buffer { * @param [fill=0] A value to pre-fill the new Buffer with * @param [encoding='utf8'] If `fill` is a string, this is its encoding * @return Return a new allocated Buffer - * @throws {BusinessError} 401 - The type of "size" must be number and the value cannot be negative. Received value is: [size] + * @throws {BusinessError} 401 - if the input parameters are invalid. */ function alloc(size: number, fill?: string | Buffer | number, encoding?: BufferEncoding): Buffer; @@ -42,7 +42,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param size The desired length of the new Buffer * @return Return a new allocated Buffer - * @throws {BusinessError} 401 - The type of "size" must be number and the value cannot be negative. Received value is: [size] + * @throws {BusinessError} 401 - if the input parameters are invalid. */ function allocUninitializedFromPool(size: number): Buffer; @@ -52,7 +52,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param size The desired length of the new Buffer * @return Return a new allocated Buffer - * @throws {BusinessError} 401 - The type of "size" must be number and the value cannot be negative. Received value is: [size] + * @throws {BusinessError} 401 - if the input parameters are invalid. */ function allocUninitialized(size: number): Buffer; @@ -65,7 +65,7 @@ declare namespace buffer { * @param string A value to calculate the length of * @param [encoding='utf8'] If `string` is a string, this is its encoding * @return The number of bytes contained within `string` - * @throws {BusinessError} 401 - The type of "string" must be string or Buffer, ArrayBuffer. Received value is: [string] + * @throws {BusinessError} 401 - if the input parameters are invalid. */ function byteLength(string: string | Buffer | TypedArray | DataView | ArrayBuffer | SharedArrayBuffer, encoding?: BufferEncoding): number; @@ -76,7 +76,7 @@ declare namespace buffer { * @param list List of `Buffer` or Uint8Array instances to concatenate * @param totalLength Total length of the `Buffer` instances in `list` when concatenated * @return Return a new allocated Buffer - * @throws {BusinessError} 401 - The type of "list" must be Array. Received value is: [list] + * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "length" is out of range. It must be >= 0 and <= uint32 max. Received value is: [length] */ function concat(list: Buffer[] | Uint8Array[], totalLength?: number): Buffer; @@ -87,7 +87,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param array an array of bytes in the range 0 – 255 * @return Return a new allocated Buffer - * @throws {BusinessError} 401 - The type of "array" must be string or Buffer, ArrayBuffer, Array, Array-like. Received value is: [array] + * @throws {BusinessError} 401 - if the input parameters are invalid. */ function from(array: number[]): Buffer; @@ -99,7 +99,8 @@ declare namespace buffer { * @param [byteOffset = 0] Index of first byte to expose * @param [length = arrayBuffer.byteLength - byteOffset] Number of bytes to expose * @return Return a view of the ArrayBuffer - * @throws {BusinessError} 401 - The type of "arrayBuffer" must be string or Buffer, ArrayBuffer, Array, Array-like. Received value is: [arrayBuffer] + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200001 - The value of "[byteOffset/length]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [byteOffset/length] */ function from(arrayBuffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): Buffer; @@ -109,7 +110,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param buffer An existing Buffer or Uint8Array from which to copy data * @return Return a new allocated Buffer - * @throws {BusinessError} 401 - The type of "buffer" must be string or Buffer, ArrayBuffer, Array, Array-like. Received value is: [buffer] + * @throws {BusinessError} 401 - if the input parameters are invalid. */ function from(buffer: Buffer | Uint8Array): Buffer; @@ -122,7 +123,7 @@ declare namespace buffer { * @param offsetOrEncoding A byte-offset or encoding * @param length A length * @return Return a new allocated Buffer - * @throws {BusinessError} 401 - The type of "encoding" must be BufferEncoding. the encoding [encoding] is unknown + * @throws {BusinessError} 401 - if the input parameters are invalid. */ function from(object: Object, offsetOrEncoding: number | string, length: number): Buffer; @@ -134,7 +135,7 @@ declare namespace buffer { * @param string A string to encode * @param [encoding='utf8'] The encoding of string * @return Return a new Buffer containing string - * @throws {BusinessError} 401 - The type of "encoding" must be BufferEncoding. the encoding [encoding] is unknown + * @throws {BusinessError} 401 - if the input parameters are invalid. */ function from(string: String, encoding?: BufferEncoding): Buffer; @@ -165,8 +166,7 @@ declare namespace buffer { * @return 0 is returned if target is the same as buf * 1 is returned if target should come before buf when sorted. * -1 is returned if target should come after buf when sorted. - * @throws {BusinessError} 401 - The type of "buf1" must be Buffer or Uint8Array. Received value is: [buf1] - * @throws {BusinessError} 401 - The type of "buf2" must be Buffer or Uint8Array. Received value is: [buf2] + * @throws {BusinessError} 401 - if the input parameters are invalid. */ function compare(buf1: Buffer | Uint8Array, buf2: Buffer | Uint8Array): -1 | 0 | 1; @@ -178,9 +178,7 @@ declare namespace buffer { * @param fromEnc The current encoding * @param toEnc To target encoding * @return Returns a new Buffer instance - * @throws {BusinessError} 401 - The type of "source" must be Buffer or Uint8Array. Received value is: [source] - * @throws {BusinessError} 401 - The type of "fromEnc" must be string. Received value is: [fromEnc] - * @throws {BusinessError} 401 - The type of "toEnc" must be string. Received value is: [toEnc] + * @throws {BusinessError} 401 - if the input parameters are invalid. */ function transcode(source: Buffer | Uint8Array, fromEnc: string, toEnc: string): Buffer; @@ -221,9 +219,8 @@ declare namespace buffer { * @param [end = buf.length] Where to stop filling buf (not inclusive) * @param [encoding='utf8'] The encoding for value if value is a string * @return A reference to buf - * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= uint32 max. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "end" is out of range. It must be >= 0 and <= [number]. Received value is: [end] - * @throws {BusinessError} 401 - The type of "encoding" must be BufferEncoding. the encoding [encoding] is unknown + * @throws {BusinessError} 10200001 - The value of "[offset/end]" is out of range. It must be >= 0 and <= [right range]. Received value is: [offset/end] + * @throws {BusinessError} 401 - if the input parameters are invalid. */ fill(value: string | Buffer | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): Buffer; @@ -240,12 +237,9 @@ declare namespace buffer { * @return 0 is returned if target is the same as buf * 1 is returned if target should come before buf when sorted. * -1 is returned if target should come after buf when sorted. - * @throws {BusinessError} 401 - The type of "target" must be Buffer or Uint8Array. Received value is: [target] - * @throws {BusinessError} 401 - The type of "[param]" must be number. Received value is: [param] - * @throws {BusinessError} 10200001 - The value of "targetStart" is out of range. It must be >= 0 and <= uint32 max. Received value is: [targetStart] - * @throws {BusinessError} 10200001 - The value of "targetEnd" is out of range. It must be >= 0 and <= [number]. Received value is: [targetEnd] - * @throws {BusinessError} 10200001 - The value of "sourceStart" is out of range. It must be >= 0 and <= uint32 max. Received value is: [sourceStart] - * @throws {BusinessError} 10200001 - The value of "sourceEnd" is out of range. It must be >= 0 and <= [number]. Received value is: [sourceEnd] + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200001 - The value of "[targetStart/targetEnd/sourceStart/sourceEnd]" is out of range. + * It must be >= 0 and <= [right range]. Received value is: [targetStart/targetEnd/sourceStart/sourceEnd] */ compare(target: Buffer | Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): -1 | 0 | 1; @@ -259,10 +253,9 @@ declare namespace buffer { * @param [sourceStart = 0] The offset within buf from which to begin copying * @param [sourceEnd = buf.length] The offset within buf at which to stop copying (not inclusive) * @return The number of bytes copied - * @throws {BusinessError} 401 - The type of "target" must be Buffer or Uint8Array. Received value is: [target] - * @throws {BusinessError} 10200001 - The value of "targetStart" is out of range. It must be >= 0. Received value is: [targetStart] - * @throws {BusinessError} 10200001 - The value of "sourceStart" is out of range. It must be >= 0. Received value is: [sourceStart] - * @throws {BusinessError} 10200001 - The value of "sourceEnd" is out of range. It must be >= 0. Received value is: [sourceEnd] + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200001 - The value of "[targetStart/sourceStart/sourceEnd]" is out of range. It must be >= 0. + * Received value is: [targetStart/sourceStart/sourceEnd] */ copy(target: Buffer | Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number; @@ -272,7 +265,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param otherBuffer A Buffer or Uint8Array with which to compare buf * @return true or false - * @throws {BusinessError} 401 - The type of "otherBuffer" must be Buffer or Uint8Array. Received value is: [otherBuffer] + * @throws {BusinessError} 401 - if the input parameters are invalid. */ equals(otherBuffer: Uint8Array | Buffer): boolean; @@ -284,8 +277,7 @@ declare namespace buffer { * @param [byteOffset = 0] Where to begin searching in buf. If negative, then offset is calculated from the end of buf * @param [encoding='utf8'] If value is a string, this is its encoding * @return true or false - * @throws {BusinessError} 401 - The type of "value" must be number or string, Buffer, Uint8Array. Received value is: [value] - * @throws {BusinessError} 401 - The type of "encoding" must be BufferEncoding. the encoding [encoding] is unknown + * @throws {BusinessError} 401 - if the input parameters are invalid. */ includes(value: string | number | Buffer | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): boolean; @@ -297,8 +289,7 @@ declare namespace buffer { * @param [byteOffset = 0] Where to begin searching in buf * @param [encoding='utf8'] If value is a string, this is the encoding used to determine the binary representation of the string that will be searched for in buf * @return The index of the first occurrence of value in buf, or -1 if buf does not contain value - * @throws {BusinessError} 401 - The type of "value" must be number or string, Buffer, Uint8Array. Received value is: [value] - * @throws {BusinessError} 401 - The type of "encoding" must be BufferEncoding. the encoding [encoding] is unknown + * @throws {BusinessError} 401 - if the input parameters are invalid. */ indexOf(value: string | number | Buffer | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; @@ -331,8 +322,7 @@ declare namespace buffer { * @param [byteOffset = 0] Where to begin searching in buf * @param [encoding='utf8'] If value is a string, this is the encoding used to determine the binary representation of the string that will be searched for in buf * @return The index of the last occurrence of value in buf, or -1 if buf does not contain value - * @throws {BusinessError} 401 - The type of "value" must be number or string, Buffer, Uint8Array. Received value is: [value] - * @throws {BusinessError} 401 - The type of "encoding" must be BufferEncoding. the encoding [encoding] is unknown + * @throws {BusinessError} 401 - if the input parameters are invalid. */ lastIndexOf(value: string | number | Buffer | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; @@ -342,7 +332,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 * @return Return a signed, big-endian 64-bit integer - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] */ readBigInt64BE(offset?: number): number; @@ -353,7 +343,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 * @return Return a signed, little-endian 64-bit integer - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] */ readBigInt64LE(offset?: number): number; @@ -364,7 +354,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 * @return Return a unsigned, big-endian 64-bit integer - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] */ readBigUInt64BE(offset?: number): number; @@ -375,7 +365,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 * @return Return a unsigned, little-endian 64-bit integer - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] */ readBigUInt64LE(offset?: number): number; @@ -386,7 +376,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 * @return Return a 64-bit, big-endian double - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] */ readDoubleBE(offset?: number): number; @@ -397,7 +387,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 * @return Return a 64-bit, little-endian double - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] */ readDoubleLE(offset?: number): number; @@ -408,7 +398,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4 * @return Return a 32-bit, big-endian float - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] */ readFloatBE(offset?: number): number; @@ -419,7 +409,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4 * @return Return a 32-bit, little-endian float - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] */ readFloatLE(offset?: number): number; @@ -430,7 +420,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 1 * @return Return a signed 8-bit integer - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 1. Received value is: [offset] */ readInt8(offset?: number): number; @@ -441,7 +431,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 2 * @return Return a signed, big-endian 16-bit integer - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset] */ readInt16BE(offset?: number): number; @@ -452,7 +442,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 2 * @return Return a signed, little-endian 16-bit integer - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset] */ readInt16LE(offset?: number): number; @@ -463,7 +453,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4 * @return Return a signed, big-endian 32-bit integer - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] */ readInt32BE(offset?: number): number; @@ -474,7 +464,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4 * @return Return a signed, little-endian 32-bit integer - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] */ readInt32LE(offset?: number): number; @@ -487,10 +477,8 @@ declare namespace buffer { * @param offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to read. Must satisfy 0 < byteLength <= 6 * @return - * @throws {BusinessError} 401 - The type of "byteLength" must be number. Received value is: [byteLength] - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received value is: [byteLength] + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ readIntBE(offset: number, byteLength: number): number; @@ -502,10 +490,8 @@ declare namespace buffer { * @param offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to read. Must satisfy 0 < byteLength <= 6 * @return - * @throws {BusinessError} 401 - The type of "byteLength" must be number. Received value is: [byteLength] - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received value is: [byteLength] + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ readIntLE(offset: number, byteLength: number): number; @@ -515,7 +501,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 1 * @return Reads an unsigned 8-bit integer - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 1. Received value is: [offset] */ readUInt8(offset?: number): number; @@ -526,7 +512,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 2 * @return Reads an unsigned, big-endian 16-bit integer - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset] */ readUInt16BE(offset?: number): number; @@ -537,7 +523,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 2 * @return Reads an unsigned, little-endian 16-bit integer - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset] */ readUInt16LE(offset?: number): number; @@ -548,7 +534,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 4 * @return Reads an unsigned, big-endian 32-bit integer - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] */ readUInt32BE(offset?: number): number; @@ -559,7 +545,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 4 * @return Reads an unsigned, little-endian 32-bit integer - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] + * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] */ readUInt32LE(offset?: number): number; @@ -572,10 +558,8 @@ declare namespace buffer { * @param offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to read. Must satisfy 0 < byteLength <= 6 * @return - * @throws {BusinessError} 401 - The type of "byteLength" must be number. Received value is: [byteLength] - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received value is: [byteLength] + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ readUIntBE(offset: number, byteLength: number): number; @@ -587,10 +571,8 @@ declare namespace buffer { * @param offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to read. Must satisfy 0 < byteLength <= 6 * @return - * @throws {BusinessError} 401 - The type of "byteLength" must be number. Received value is: [byteLength] - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received value is: [byteLength] + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ readUIntLE(offset: number, byteLength: number): number; @@ -646,7 +628,7 @@ declare namespace buffer { * @param [encoding='utf8'] The character encoding to use * @param [start = 0] The byte offset to start decoding at * @param [end = buf.length] The byte offset to stop decoding at (not inclusive) - * @throws {BusinessError} 401 - The type of "encoding" must be BufferEncoding. the encoding [encoding] is unknown + * @throws {BusinessError} 401 - if the input parameters are invalid. */ toString(encoding?: string, start?: number, end?: number): string; @@ -659,12 +641,8 @@ declare namespace buffer { * @param [length = buf.length - offset] Maximum number of bytes to write (written bytes will not exceed buf.length - offset) * @param [encoding='utf8'] The character encoding of string. * @return Number of bytes written. - * @throws {BusinessError} 401 - The type of "str" must be string. Received value is: [str] - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] - * @throws {BusinessError} 401 - The type of "length" must be number. Received value is: [length] - * @throws {BusinessError} 401 - The type of "encoding" must be BufferEncoding. the encoding [encoding] is unknown - * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "length" is out of range. It must be >= 0 and <= buf.length. Received value is: [length] + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200001 - The value of "[offset/length]" is out of range. It must be >= 0 and <= buf.length. Received value is: [offset/length] */ write(str: string, offset?: number, length?: number, encoding?: string): number; @@ -675,10 +653,8 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 * @return offset plus the number of bytes written - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] - * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] - * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= -(2n ** 63n) and <= 2n ** 63n. Received value is: [value] + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ writeBigInt64BE(value: number, offset?: number): number; @@ -689,10 +665,8 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 * @return offset plus the number of bytes written - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] - * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] - * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= -(2n ** 63n) and <= 2n ** 63n. Received value is: [value] + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ writeBigInt64LE(value: number, offset?: number): number; @@ -703,10 +677,8 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 * @return offset plus the number of bytes written - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] - * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] - * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= 0 and <= 2n ** 64n. Received value is: [value] + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ writeBigUInt64BE(value: number, offset?: number): number; @@ -717,10 +689,8 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 * @return offset plus the number of bytes written - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] - * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] - * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= 0 and <= 2n ** 64n. Received value is: [value] + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ writeBigUInt64LE(value: number, offset?: number): number; @@ -731,8 +701,7 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 * @return offset plus the number of bytes written - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] - * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] + * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] */ writeDoubleBE(value: number, offset?: number): number; @@ -744,8 +713,7 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 * @return offset plus the number of bytes written - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] - * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] + * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] */ writeDoubleLE(value: number, offset?: number): number; @@ -757,8 +725,7 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 4 * @return offset plus the number of bytes written - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] - * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] + * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] */ writeFloatBE(value: number, offset?: number): number; @@ -770,8 +737,7 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 4 * @return offset plus the number of bytes written - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] - * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] + * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] */ writeFloatLE(value: number, offset?: number): number; @@ -783,10 +749,8 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 1 * @return offset plus the number of bytes written - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] - * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] - * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 1. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= -2**7 and <= 2**7 - 1. Received value is: [value] + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ writeInt8(value: number, offset?: number): number; @@ -797,10 +761,8 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 2 * @return offset plus the number of bytes written - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] - * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] - * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= -2**15 and <= 2**15 - 1. Received value is: [value] + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ writeInt16BE(value: number, offset?: number): number; @@ -811,10 +773,8 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 2 * @return offset plus the number of bytes written - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] - * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] - * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= -2**15 and <= 2**15 - 1. Received value is: [value] + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ writeInt16LE(value: number, offset?: number): number; @@ -825,10 +785,8 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 4 * @return offset plus the number of bytes written - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] - * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] - * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= -2**31 and <= 2**31 - 1. Received value is: [value] + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ writeInt32BE(value: number, offset?: number): number; @@ -839,10 +797,8 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 4 * @return offset plus the number of bytes written - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] - * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] - * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= -2**31 and <= 2**31 - 1. Received value is: [value] + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ writeInt32LE(value: number, offset?: number): number; @@ -854,12 +810,8 @@ declare namespace buffer { * @param offset Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to write. Must satisfy 0 < byteLength <= 6 * @return offset plus the number of bytes written - * @throws {BusinessError} 401 - The type of "byteLength" must be number. Received value is: [byteLength] - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] - * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] - * @throws {BusinessError} 10200001 - The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received value is: [byteLength] - * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= -2**47 and <= 2**47 - 1. Received value is: [value] + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ writeIntBE(value: number, offset: number, byteLength: number): number; @@ -871,12 +823,8 @@ declare namespace buffer { * @param offset Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to write. Must satisfy 0 < byteLength <= 6 * @return offset plus the number of bytes written - * @throws {BusinessError} 401 - The type of "byteLength" must be number. Received value is: [byteLength] - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] - * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] - * @throws {BusinessError} 10200001 - The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received value is: [byteLength] - * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= -2**47 and <= 2**47 - 1. Received value is: [value] + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ writeIntLE(value : number, offset: number, byteLength: number): number; @@ -887,10 +835,8 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 1 * @return offset plus the number of bytes written - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] - * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] - * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 1. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= 0 and <= 2**8 - 1. Received value is: [value] + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ writeUInt8(value: number, offset?: number): number; @@ -901,10 +847,8 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 2 * @return offset plus the number of bytes written - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] - * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] - * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= 0 and <= 2**16 - 1. Received value is: [value] + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ writeUInt16BE(value: number, offset?: number): number; @@ -915,10 +859,8 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 2 * @return offset plus the number of bytes written - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] - * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] - * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= 0 and <= 2**16 - 1. Received value is: [value] + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ writeUInt16LE(value: number, offset?: number): number; @@ -929,10 +871,8 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 4 * @return offset plus the number of bytes written - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] - * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] - * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= 0 and <= 2**32 - 1. Received value is: [value] + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ writeUInt32BE(value: number, offset?: number): number; @@ -943,10 +883,8 @@ declare namespace buffer { * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 4 * @return offset plus the number of bytes written - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] - * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] - * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= 0 and <= 2**32 - 1. Received value is: [value] + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ writeUInt32LE(value: number, offset?: number): number; @@ -958,12 +896,8 @@ declare namespace buffer { * @param offset Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to write. Must satisfy 0 < byteLength <= 6 * @return offset plus the number of bytes written - * @throws {BusinessError} 401 - The type of "byteLength" must be number. Received value is: [byteLength] - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] - * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] - * @throws {BusinessError} 10200001 - The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received value is: [byteLength] - * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= 0 and <= 2**48 - 1. Received value is: [value] + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ writeUIntBE(value: number, offset: number, byteLength: number): number; @@ -975,12 +909,8 @@ declare namespace buffer { * @param offset Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to write. Must satisfy 0 < byteLength <= 6 * @return offset plus the number of bytes written - * @throws {BusinessError} 401 - The type of "byteLength" must be number. Received value is: [byteLength] - * @throws {BusinessError} 401 - The type of "offset" must be number. Received value is: [offset] - * @throws {BusinessError} 401 - The type of "value" must be number. Received value is: [value] - * @throws {BusinessError} 10200001 - The value of "byteLength" is out of range. It must be >= 1 and <= 6. Received value is: [byteLength] - * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - byteLength. Received value is: [offset] - * @throws {BusinessError} 10200001 - The value of "value" is out of range. It must be >= 0 and <= 2**48 - 1. Received value is: [value] + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ writeUIntLE(value: number, offset: number, byteLength: number): number; @@ -996,8 +926,7 @@ declare namespace buffer { * @param options {endings: string, type: string} * endings: One of either 'transparent' or 'native'. * type: The Blob content-type - * @throws {BusinessError} 401 - The type of "sources" must be Iterable. Received value is: [sources] - * @throws {BusinessError} 401 - The type of "options" must be object. Received value is: [options] + * @throws {BusinessError} 401 - if the input parameters are invalid. */ constructor(sources: string[] | ArrayBuffer[] | TypedArray[] | DataView[] | Blob[] , options: Object); -- Gitee From 818075e62637baa36d4065f1a93667c1a180fd48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwangxiyue=E2=80=9D?= Date: Thu, 13 Oct 2022 11:05:43 +0800 Subject: [PATCH 077/438] =?UTF-8?q?modified=20distributedDataObject.d.ts?= =?UTF-8?q?=20Signed-off-by:=20=E2=80=9Cwangxiyue=E2=80=9D=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/@ohos.data.distributedDataObject.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/api/@ohos.data.distributedDataObject.d.ts b/api/@ohos.data.distributedDataObject.d.ts index facb2b87fe..d97f188c4f 100644 --- a/api/@ohos.data.distributedDataObject.d.ts +++ b/api/@ohos.data.distributedDataObject.d.ts @@ -30,6 +30,8 @@ declare namespace distributedDataObject { * @param source Init data of distributed object * @return Returns the distributed object * @since 8 + * @deprecated since 9 + * @useinstead create */ function createDistributedObject(source: object): DistributedObject; @@ -92,8 +94,10 @@ declare namespace distributedDataObject { * * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 8 + * @deprecated since 9 */ interface DistributedObject { + /* * Change object session * @@ -101,6 +105,7 @@ declare namespace distributedDataObject { * @return Operation result, true is success, false is failed * @permission ohos.permission.DISTRIBUTED_DATASYNC * @since 8 + * @deprecated since 9 */ setSessionId(sessionId?: string): boolean; @@ -109,6 +114,7 @@ declare namespace distributedDataObject { * * @param callback The callback of change * @since 8 + * @deprecated since 9 */ on(type: 'change', callback: Callback<{ sessionId: string, fields: Array }>): void; @@ -117,6 +123,7 @@ declare namespace distributedDataObject { * * @param callback If not null, off the callback, if undefined, off all callbacks * @since 8 + * @deprecated since 9 */ off(type: 'change', callback?: Callback<{ sessionId: string, fields: Array }>): void; @@ -129,6 +136,7 @@ declare namespace distributedDataObject { * status: 'online' The object became online on the device and data can be synced to the device * 'offline' The object became offline on the device and the object can not sync any data * @since 8 + * @deprecated since 9 */ on(type: 'status', callback: Callback<{ sessionId: string, networkId: string, status: 'online' | 'offline' }>): void; @@ -137,6 +145,7 @@ declare namespace distributedDataObject { * * @param callback If not null, off the callback, if undefined, off all callbacks * @since 8 + * @deprecated since 9 */ off(type: 'status', callback?: Callback<{ sessionId: string, deviceId: string, status: 'online' | 'offline' }>): void; } -- Gitee From 0494ea0d444f5ae58efa305e517e231d559bdc6e Mon Sep 17 00:00:00 2001 From: niudongyao Date: Thu, 13 Oct 2022 14:25:31 +0800 Subject: [PATCH 078/438] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 ++++++++++++++ api/@ohos.data.dataShare.d.ts | 165 ++++++++++++++++++---------------- 2 files changed, 157 insertions(+), 76 deletions(-) create mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000000..beba9e5e49 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1664437584931 + + + + + + + + + \ No newline at end of file diff --git a/api/@ohos.data.dataShare.d.ts b/api/@ohos.data.dataShare.d.ts index 10715e93ee..0e9248525a 100644 --- a/api/@ohos.data.dataShare.d.ts +++ b/api/@ohos.data.dataShare.d.ts @@ -29,11 +29,11 @@ import { ValuesBucket } from './@ohos.data.ValuesBucket'; declare namespace dataShare { /** * Obtains the dataShareHelper. - * @param { Context } context - Indicates the application context. - * @param { string } uri - Indicates the path of the file to open. - * @param { AsyncCallback } callback - the dataShareHelper. - * @throws { BusinessError } 401 - the parameter check failed. - * @throws { BusinessError } 15700010 - the DataShareHelper is not initialized successfully. + * @param {Context} context - Indicates the application context. + * @param {string} uri - Indicates the path of the file to open. + * @param {AsyncCallback} callback - {DataShareHelper}: the dataShareHelper for consumer. + * @throws {BusinessError} 401 - the parameter check failed. + * @throws {BusinessError} 15700010 - the DataShareHelper is not initialized successfully. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -43,11 +43,11 @@ declare namespace dataShare { /** * Obtains the dataShareHelper. - * @param { Context } context - Indicates the application context. - * @param { string } uri - Indicates the path of the file to open. - * @returns { Promise } the dataShareHelper. - * @throws { BusinessError } 401 - the parameter check failed. - * @throws { BusinessError } 15700010 - the DataShareHelper is not initialized successfully. + * @param {Context} context - Indicates the application context. + * @param {string} uri - Indicates the path of the file to open. + * @returns {Promise} {DataShareHelper}: the dataShareHelper for consumer. + * @throws {BusinessError} 401 - the parameter check failed. + * @throws {BusinessError} 15700010 - the DataShareHelper is not initialized successfully. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -65,9 +65,9 @@ declare namespace dataShare { interface DataShareHelper { /** * Registers an observer to observe data specified by the given uri. - * @param { string } type - must be 'dataChange'. - * @param { string } uri - Indicates the path of the data to operate. - * @param { AsyncCallback } callback - Indicates the callback when dataChange. + * @param {string} type - type must be 'dataChange'. + * @param {string} uri - Indicates the path of the data to operate. + * @param {AsyncCallback} callback - the callback of on. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -77,9 +77,9 @@ declare namespace dataShare { /** * Deregisters an observer used for monitoring data specified by the given uri. - * @param { string } type - must be 'dataChange'. - * @param { string } uri - Indicates the path of the data to operate. - * @param { AsyncCallback } callback - Indicates the callback when dataChange. + * @param {string} type - type must be 'dataChange'. + * @param {string} uri - Indicates the path of the data to operate. + * @param {AsyncCallback} callback - the callback of off. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -89,10 +89,11 @@ declare namespace dataShare { /** * Inserts a single data record into the database. - * @param { string } uri - Indicates the path of the data to operate. - * @param { ValueBucket } value - Indicates the data record to insert. If this parameter is null, a blank row will be inserted. - * @param { AsyncCallback } callback - the index of the inserted data record. - * @throws { BusinessError } 401 - the parameter check failed. + * @param {string} uri - Indicates the path of the data to operate. + * @param {ValueBucket} value - Indicates the data record to insert. If this parameter is null, + * a blank row will be inserted. + * @param {AsyncCallback} callback - {number}: the index of the inserted data record. + * @throws {BusinessError} 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -102,10 +103,11 @@ declare namespace dataShare { /** * Inserts a single data record into the database. - * @param { string } uri - Indicates the path of the data to operate. - * @param { ValueBucket } value - Indicates the data record to insert. If this parameter is null, a blank row will be inserted. - * @returns { Promise } the index of the inserted data record. - * @throws { BusinessError } 401 - the parameter check failed. + * @param {string} uri - Indicates the path of the data to operate. + * @param {ValueBucket} value - Indicates the data record to insert. If this parameter is null, + * a blank row will be inserted. + * @returns {Promise} {number}: the index of the inserted data record. + * @throws {BusinessError} 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -115,10 +117,11 @@ declare namespace dataShare { /** * Deletes one or more data records from the database. - * @param { string } uri - Indicates the path of the data to operate. - * @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria. You should define the processing logic when this parameter is null. - * @param { AsyncCallback } callback - the number of data records deleted. - * @throws { BusinessError } 401 - the parameter check failed. + * @param {string} uri - Indicates the path of the data to operate. + * @param {dataSharePredicates.DataSharePredicates} predicates - Indicates filter criteria. + * You should define the processing logic when this parameter is null. + * @param {AsyncCallback} callback - {number}: the number of data records deleted. + * @throws {BusinessError} 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -128,10 +131,11 @@ declare namespace dataShare { /** * Deletes one or more data records from the database. - * @param { string } uri - Indicates the path of the data to operate. - * @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria. You should define the processing logic when this parameter is null. - * @returns { Promise } the number of data records deleted. - * @throws { BusinessError } 401 - the parameter check failed. + * @param {string} uri - Indicates the path of the data to operate. + * @param {dataSharePredicates.DataSharePredicates} predicates - Indicates filter criteria. + * You should define the processing logic when this parameter is null. + * @returns {Promise} {number}: the number of data records deleted. + * @throws {BusinessError} 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -141,11 +145,13 @@ declare namespace dataShare { /** * Queries data in the database. - * @param { string } uri - Indicates the path of data to query. - * @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria. You should define the processing logic when this parameter is null. - * @param { Array } columns - Indicates the columns to query. If this parameter is null, all columns are queried. - * @param { AsyncCallback } callback - the query result. - * @throws { BusinessError } 401 - the parameter check failed. + * @param {string} uri - Indicates the path of data to query. + * @param {dataSharePredicates.DataSharePredicates} predicates - Indicates filter criteria. + * You should define the processing logic when this parameter is null. + * @param {Array} columns - Indicates the columns to query. + * If this parameter is null, all columns are queried. + * @param {AsyncCallback} callback - {DataShareResultSet}: the query result. + * @throws {BusinessError} 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -155,11 +161,13 @@ declare namespace dataShare { /** * Queries data in the database. - * @param { string } uri - Indicates the path of data to query. - * @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria. You should define the processing logic when this parameter is null. - * @param { Array } columns - Indicates the columns to query. If this parameter is null, all columns are queried. - * @returns { Promise } - the query result. - * @throws { BusinessError } 401 - the parameter check failed. + * @param {string} uri - Indicates the path of data to query. + * @param {dataSharePredicates.DataSharePredicates} predicates - Indicates filter criteria. + * You should define the processing logic when this parameter is null. + * @param {Array} columns - Indicates the columns to query. + * If this parameter is null, all columns are queried. + * @returns {Promise} {DataShareResultSet}: the query result. + * @throws {BusinessError} 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -169,11 +177,12 @@ declare namespace dataShare { /** * Updates data records in the database. - * @param { string } uri - Indicates the path of data to update. - * @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria. You should define the processing logic when this parameter is null. - * @param { ValueBucket } value - Indicates the data to update. This parameter can be null. - * @param { AsyncCallback } callback - the number of data records updated. - * @throws { BusinessError } 401 - the parameter check failed. + * @param {string} uri - Indicates the path of data to update. + * @param {dataSharePredicates.DataSharePredicates} predicates - Indicates filter criteria. + * You should define the processing logic when this parameter is null. + * @param {ValueBucket} value - Indicates the data to update. This parameter can be null. + * @param {AsyncCallback} callback - {number}: the number of data records updated. + * @throws {BusinessError} 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -183,11 +192,12 @@ declare namespace dataShare { /** * Updates data records in the database. - * @param { string } uri - Indicates the path of data to update. - * @param { dataSharePredicates.DataSharePredicates } predicates - Indicates filter criteria. You should define the processing logic when this parameter is null. - * @param { ValueBucket } value - Indicates the data to update. This parameter can be null. - * @returns { Promise } the number of data records updated. - * @throws { BusinessError } 401 - the parameter check failed. + * @param {string} uri - Indicates the path of data to update. + * @param {dataSharePredicates.DataSharePredicates} predicates - Indicates filter criteria. + * You should define the processing logic when this parameter is null. + * @param {ValueBucket} value - Indicates the data to update. This parameter can be null. + * @returns {Promise} {number}: the number of data records updated. + * @throws {BusinessError} 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -197,10 +207,10 @@ declare namespace dataShare { /** * Inserts multiple data records into the database. - * @param { string } uri - Indicates the path of the data to operate. - * @param { Array } values - Indicates the data records to insert. - * @param { AsyncCallback } callback - the number of data records inserted. - * @throws { BusinessError } 401 - the parameter check failed. + * @param {string} uri - Indicates the path of the data to operate. + * @param {Array} values - Indicates the data records to insert. + * @param {AsyncCallback} callback - {number}: the number of data records inserted. + * @throws {BusinessError} 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -210,10 +220,10 @@ declare namespace dataShare { /** * Inserts multiple data records into the database. - * @param { string } uri - Indicates the path of the data to operate. - * @param { Array } values - Indicates the data records to insert. - * @returns { Promise } the number of data records inserted. - * @throws { BusinessError } 401 - the parameter check failed. + * @param {string} uri - Indicates the path of the data to operate. + * @param {Array} values - Indicates the data records to insert. + * @returns {Promise} {number}: the number of data records inserted. + * @throws {BusinessError} 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -227,8 +237,9 @@ declare namespace dataShare { *

To transfer a normalized uri from another environment to the current environment, you should call this * method again to re-normalize the uri for the current environment or call {@link #denormalizeUri(Uri)} * to convert it to a denormalized uri that can be used only in the current environment. - * @param { string } uri - Indicates the {@link ohos.utils.net.Uri} object to normalize. - * @param { AsyncCallback } callback - the normalized Uri if the DataShare supports uri normalization; + * @param {string} uri - Indicates the {@link ohos.utils.net.Uri} object to normalize. + * @param {AsyncCallback} callback - {string}: the normalized Uri, + * if the DataShare supports uri normalization. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -242,8 +253,8 @@ declare namespace dataShare { *

To transfer a normalized uri from another environment to the current environment, you should call this * method again to re-normalize the uri for the current environment or call {@link #denormalizeUri(Uri)} * to convert it to a denormalized uri that can be used only in the current environment. - * @param { string } uri - Indicates the {@link ohos.utils.net.Uri} object to normalize. - * @returns { Promise } the normalized Uri if the DataShare supports uri normalization; + * @param {string} uri - Indicates the {@link ohos.utils.net.Uri} object to normalize. + * @returns {Promise} {string}: the normalized Uri if the DataShare supports uri normalization; * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -253,10 +264,11 @@ declare namespace dataShare { /** * Converts the given normalized {@code uri} generated by {@link #normalizeUri(Uri)} into a denormalized one. - * @param { string } uri - Indicates the {@link ohos.utils.net.Uri} object to denormalize. - * @param { AsyncCallback } callback - the denormalized {@code Uri} object if the denormalization is successful; returns the - * original {@code Uri} passed to this method if there is nothing to do; returns {@code null} if the data - * identified by the normalized {@code Uri} cannot be found in the current environment. + * @param {string} uri - Indicates the {@link ohos.utils.net.Uri} object to denormalize. + * @param {AsyncCallback} callback - {string}: the denormalized {@code Uri} object if + * the denormalization is successful; returns the original {@code Uri} passed to this method if + * there is nothing to do; returns {@code null} if the data identified by the normalized {@code Uri} + * cannot be found in the current environment. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -266,10 +278,11 @@ declare namespace dataShare { /** * Converts the given normalized {@code uri} generated by {@link #normalizeUri(Uri)} into a denormalized one. - * @param { string } uri - Indicates the {@link ohos.utils.net.Uri} object to denormalize. - * @returns { Promise } the denormalized {@code Uri} object if the denormalization is successful; returns the - * original {@code Uri} passed to this method if there is nothing to do; returns {@code null} if the data - * identified by the normalized {@code Uri} cannot be found in the current environment. + * @param {string} uri - Indicates the {@link ohos.utils.net.Uri} object to denormalize. + * @returns {Promise} {string}: the denormalized {@code Uri} object if the denormalization + * is successful; returns the original {@code Uri} passed to this method if there is nothing to do; + * returns {@code null} if the data identified by the normalized {@code Uri} cannot be found in the + * current environment. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -279,8 +292,8 @@ declare namespace dataShare { /** * Notifies the registered observers of a change to the data resource specified by Uri. - * @param { string } uri - Indicates the {@link ohos.utils.net.Uri} object to notifyChange. - * @param { AsyncCallback } callback - callback. + * @param {string} uri - Indicates the {@link ohos.utils.net.Uri} object to notifyChange. + * @param {AsyncCallback} callback - the callback of notifyChange. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly @@ -290,8 +303,8 @@ declare namespace dataShare { /** * Notifies the registered observers of a change to the data resource specified by Uri. - * @param { string } uri - Indicates the {@link ohos.utils.net.Uri} object to notifyChange. - * @returns { Promise } the promise returned by the function. + * @param {string} uri - Indicates the {@link ohos.utils.net.Uri} object to notifyChange. + * @returns {Promise} the promise returned by the function. * @syscap SystemCapability.DistributedDataManager.DataShare.Consumer * @systemapi * @StageModelOnly -- Gitee From 8629760f4778d63d225462811582fe7ec6f0a166 Mon Sep 17 00:00:00 2001 From: niudongyao Date: Thu, 13 Oct 2022 14:25:41 +0800 Subject: [PATCH 079/438] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 --------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index beba9e5e49..0000000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1664437584931 - - - - - - - - - \ No newline at end of file -- Gitee From 2aa05a18209a9226d7e47f980a30ea91e624a6e2 Mon Sep 17 00:00:00 2001 From: niudongyao Date: Thu, 13 Oct 2022 15:00:31 +0800 Subject: [PATCH 080/438] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 +++++++++++++++++++++++++++++++++++ api/@ohos.data.dataShare.d.ts | 9 +++-- 2 files changed, 74 insertions(+), 3 deletions(-) create mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000000..f09822c371 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1664437584931 + + + + + + + + + \ No newline at end of file diff --git a/api/@ohos.data.dataShare.d.ts b/api/@ohos.data.dataShare.d.ts index 0e9248525a..2a55be2efc 100644 --- a/api/@ohos.data.dataShare.d.ts +++ b/api/@ohos.data.dataShare.d.ts @@ -157,7 +157,8 @@ declare namespace dataShare { * @StageModelOnly * @since 9 */ - query(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array, callback: AsyncCallback): void; + query(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array, + callback: AsyncCallback): void; /** * Queries data in the database. @@ -173,7 +174,8 @@ declare namespace dataShare { * @StageModelOnly * @since 9 */ - query(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array): Promise; + query(uri: string, predicates: dataSharePredicates.DataSharePredicates, + columns: Array): Promise; /** * Updates data records in the database. @@ -188,7 +190,8 @@ declare namespace dataShare { * @StageModelOnly * @since 9 */ - update(uri: string, predicates: dataSharePredicates.DataSharePredicates, value: ValuesBucket, callback: AsyncCallback): void; + update(uri: string, predicates: dataSharePredicates.DataSharePredicates, value: ValuesBucket, + callback: AsyncCallback): void; /** * Updates data records in the database. -- Gitee From bc6e400affbb291795f9eefb2b503dc71a65168b Mon Sep 17 00:00:00 2001 From: niudongyao Date: Thu, 13 Oct 2022 15:00:41 +0800 Subject: [PATCH 081/438] api errorcode Signed-off-by: niudongyao --- .idea/workspace.xml | 68 --------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 .idea/workspace.xml diff --git a/.idea/workspace.xml b/.idea/workspace.xml deleted file mode 100644 index f09822c371..0000000000 --- a/.idea/workspace.xml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1664437584931 - - - - - - - - - \ No newline at end of file -- Gitee From 4c611380454ada53c6f3d7e8e41fbe9e4b2bc986 Mon Sep 17 00:00:00 2001 From: dboy190 Date: Thu, 13 Oct 2022 15:06:15 +0800 Subject: [PATCH 082/438] fix errorcodes descption Signed-off-by: dboy190 --- api/@ohos.data.distributedData.d.ts | 1460 ++++++++++++--------------- 1 file changed, 621 insertions(+), 839 deletions(-) diff --git a/api/@ohos.data.distributedData.d.ts b/api/@ohos.data.distributedData.d.ts index b5e5087313..54bb425b82 100644 --- a/api/@ohos.data.distributedData.d.ts +++ b/api/@ohos.data.distributedData.d.ts @@ -20,43 +20,42 @@ import DataShareResultSet from './@ohos.data.DataShareResultSet'; import Context from './application/Context'; /** - * Providers interfaces to creat a {@link KVManager} istances. - * @since 7 + * Providers interfaces to creat a {@link KVManager} or {@link KVManagerV9} istances. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A + * @since 7 */ - declare namespace distributedData { /** - * Provides configuration information for {@link KVManager} instances, + * Provides configuration information for {@link KVManager} or {@link KVManagerV9} instances, * including the caller's package name and distributed network type. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ interface KVManagerConfig { /** * Indicates the user information - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ userInfo: UserInfo; /** * Indicates the bundleName - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ bundleName: string; /** * Indicates the ability or hap context - * @since 9 * @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 + * @since 9 */ context: Context; } @@ -67,24 +66,24 @@ declare namespace distributedData { *

This class provides methods for obtaining the user ID and type, setting the user ID and type, * and checking whether two users are the same. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ interface UserInfo { /** * Indicates the user ID to set - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ userId?: string; /** * Indicates the user type to set - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ userType?: UserType; } @@ -92,72 +91,73 @@ declare namespace distributedData { /** * Enumerates user types. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ enum UserType { /** * Indicates a user that logs in to different devices using the same account. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ SAME_USER_ID = 0 } /** * KVStore constants - * @since 7 + * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ namespace Constants { /** * max key length. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ const MAX_KEY_LENGTH = 1024; /** * max value length. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ const MAX_VALUE_LENGTH = 4194303; /** * max device coordinate key length. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ const MAX_KEY_LENGTH_DEVICE = 896; /** * max store id length. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ const MAX_STORE_ID_LENGTH = 128; /** * max query length. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ const MAX_QUERY_LENGTH = 512000; /** * max batch operation size. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ const MAX_BATCH_SIZE = 128; } @@ -167,83 +167,83 @@ declare namespace distributedData { * *

{@code ValueType} is obtained based on the value. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ enum ValueType { /** * Indicates that the value type is string. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ STRING = 0, /** * Indicates that the value type is int. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ INTEGER = 1, /** * Indicates that the value type is float. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ FLOAT = 2, /** * Indicates that the value type is byte array. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 * */ BYTE_ARRAY = 3, /** * Indicates that the value type is boolean. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 * */ BOOLEAN = 4, /** * Indicates that the value type is double. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ DOUBLE = 5 } /** - * Obtains {@code Value} objects stored in a {@link KVStore} database. + * Obtains {@code Value} objects stored in a {@link KVStore} or {@link KVStoreV9} database. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ interface Value { /** * Indicates value type - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @see ValueType * @type {number} * @memberof Value + * @since 7 */ type: ValueType; /** * Indicates value - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ value: Uint8Array | string | number | boolean; } @@ -251,23 +251,23 @@ declare namespace distributedData { /** * Provides key-value pairs stored in the distributed database. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ interface Entry { /** * Indicates key - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ key: string; /** * Indicates value - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ value: Value; } @@ -275,40 +275,40 @@ declare namespace distributedData { /** * Receives notifications of all data changes, including data insertion, update, and deletion. * - *

If you have subscribed to {@code KVStore}, you will receive data change notifications and obtain the changed data - * from the parameters in callback methods upon data insertion, update, or deletion. + *

If you have subscribed to {@code KVStore} or {@code KVStoreV9}, you will receive data change notifications and + * obtain the changed data from the parameters in callback methods upon data insertion, update, or deletion. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ interface ChangeNotification { /** * Indicates data addition records. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ insertEntries: Entry[]; /** * Indicates data update records. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ updateEntries: Entry[]; /** * Indicates data deletion records. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ deleteEntries: Entry[]; /** * Indicates from device id. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ deviceId: string; } @@ -316,30 +316,30 @@ declare namespace distributedData { /** * Indicates the database synchronization mode. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ enum SyncMode { /** * Indicates that data is only pulled from the remote end. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ PULL_ONLY = 0, /** * Indicates that data is only pushed from the local end. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ PUSH_ONLY = 1, /** * Indicates that data is pushed from the local end, and then pulled from the remote end. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ PUSH_PULL = 2 } @@ -347,83 +347,83 @@ declare namespace distributedData { /** * Describes the subscription type. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ enum SubscribeType { /** * Subscription to local data changes - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ SUBSCRIBE_TYPE_LOCAL = 0, /** * Subscription to remote data changes - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ SUBSCRIBE_TYPE_REMOTE = 1, /** * Subscription to both local and remote data changes - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ SUBSCRIBE_TYPE_ALL = 2, } /** - * Describes the {@code KVStore} type. + * Describes the {@code KVStore} or {@code KVStoreV9}type. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ enum KVStoreType { /** - * Device-collaborated database, as specified by {@code DeviceKVStore} - * @since 7 + * Device-collaborated database, as specified by {@code DeviceKVStore} or {@code DeviceKVStoreV9} * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A + * @since 7 */ DEVICE_COLLABORATION = 0, /** * Single-version database, as specified by {@code SingleKVStore} - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ SINGLE_VERSION = 1, /** * Multi-version database, as specified by {@code MultiKVStore} - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A + * @since 7 */ MULTI_VERSION = 2, } /** - * Describes the {@code KVStore} type. + * Describes the {@code KVStore} or {@code KVStoreV9} type. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ enum SecurityLevel { /** * NO_LEVEL: mains not set the security level. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A + * @since 7 */ NO_LEVEL = 0, @@ -431,9 +431,9 @@ declare namespace distributedData { * S0: mains the db is public. * There is no impact even if the data is leaked. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ S0 = 1, @@ -441,9 +441,9 @@ declare namespace distributedData { * S1: mains the db is low level security * There are some low impact, when the data is leaked. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ S1 = 2, @@ -451,9 +451,9 @@ declare namespace distributedData { * S2: mains the db is middle level security * There are some major impact, when the data is leaked. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ S2 = 3, @@ -461,9 +461,9 @@ declare namespace distributedData { * S3: mains the db is high level security * There are some severity impact, when the data is leaked. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ S3 = 5, @@ -471,72 +471,72 @@ declare namespace distributedData { * S4: mains the db is critical level security * There are some critical impact, when the data is leaked. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ S4 = 6, } /** - * Provides configuration options for creating a {@code KVStore}. + * Provides configuration options for creating a {@code KVStore} or {@code KVStoreV9}. * - *

You can determine whether to create another database if a {@code KVStore} database is missing, - * whether to encrypt the database, and the database type. + *

You can determine whether to create another database if a {@code KVStore} or {@code KVStoreV9} database is + * missing, whether to encrypt the database, and the database type. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ interface Options { /** * Indicates whether to createa database when the database file does not exist - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ createIfMissing?: boolean; /** * Indicates setting whether database files are encrypted - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ encrypt?: boolean; /** * Indicates setting whether to back up database files - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ backup?: boolean; /** * Indicates setting whether database files are automatically synchronized - * @since 7 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ autoSync?: boolean; /** * Indicates setting the databse type - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ kvStoreType?: KVStoreType; /** * Indicates setting the database security level - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ securityLevel?: SecurityLevel; /** * Indicates schema object - * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A + * @since 8 */ schema?: Schema; } @@ -546,44 +546,44 @@ declare namespace distributedData { * * You can create Schema objects and put them in Options when creating or opening the database. * - * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A + * @since 8 */ class Schema { /** * A constructor used to create a Schema instance. * - * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ constructor() /** * Indicates the root json object. * - * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ root: FieldNode; /** * Indicates the string array of json. * - * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ indexes: Array; /** * Indicates the mode of schema. * - * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ mode: number; /** * Indicates the skipsize of schema. * - * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ skip: number; } @@ -597,17 +597,17 @@ declare namespace distributedData { * *

The leaf node must have a value; the non-leaf node must have a child {@code FieldNode}. * - * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A + * @since 8 */ class FieldNode { /** * A constructor used to create a FieldNode instance with the specified field. * name Indicates the field node name. * - * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ constructor(name: string) /** @@ -615,514 +615,516 @@ declare namespace distributedData { * *

Adding a child node makes this node a non-leaf node. Field value will be ignored if it has child node. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @param child The field node to append. + * @param child The field node to append. * @returns Returns true if the child node is successfully added to this {@code FieldNode}; returns false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ appendChild(child: FieldNode): boolean; /** * Indicates the default value of fieldnode. - * - * @since 8 + * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ default: string; /** * Indicates the nullable of database field. - * - * @since 8 + * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ nullable: boolean; /** * Indicates the type of value. - * - * @since 8 + * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ type: number; } /** - * Provide methods to obtain the result set of the {@code KvStore} database. + * Provide methods to obtain the result set of the {@code KvStore} or {@code KvStoreV9} database. * - *

The result set is created by using the {@code getResultSet} method in the {@code DeviceKVStore} class. This interface also provides - * methods for moving the data read position in the result set. + *

The result set is created by using the {@code getResultSet} method in the {@code DeviceKVStore} or + * {@code DeviceKVStoreV9} class. This interface also provides methods for moving the data read position in the result set. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ interface KvStoreResultSet { /** * Obtains the number of lines in a result set. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @returns Returns the number of lines. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ getCount(): number; /** * Obtains the current read position in a result set. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @returns Returns the current read position. The read position starts with 0. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ getPosition(): number; /** * Moves the read position to the first line. * *

If the result set is empty, false is returned. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @returns Returns true if the operation succeeds; return false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ moveToFirst(): boolean; /** * Moves the read position to the last line. * *

If the result set is empty, false is returned. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @returns Returns true if the operation succeeds; return false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ moveToLast(): boolean; /** * Moves the read position to the next line. * *

If the result set is empty or the data in the last line is being read, false is returned. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @returns Returns true if the operation succeeds; return false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ moveToNext(): boolean; /** * Moves the read position to the previous line. * *

If the result set is empty or the data in the first line is being read, false is returned. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @returns Returns true if the operation succeeds; return false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ moveToPrevious(): boolean; /** * Moves the read position by a relative offset to the current position. * - * @since 8 - * @deprecated since 9 - * @useinstead moveV9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param offset Indicates the relative offset to the current position. Anegative offset indicates moving backwards, and a * positive offset indicates moving forewards. Forexample, if the current position is entry 1 and thisoffset is 2, * the destination position will be entry 3; ifthe current position is entry 3 and this offset is -2, * the destination position will be entry 1. The valid final position after moving forwards starts with 0. If the * final position is invalid, false will be returned. * @returns Returns true if the operation succeeds; return false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 + * @deprecated since 9 + * @useinstead moveV9 */ move(offset: number): boolean; /** * Moves the read position by a relative offset to the current position. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param offset Indicates the relative offset to the current position. Anegative offset indicates moving backwards, and a * positive offset indicates moving forewards. Forexample, if the current position is entry 1 and thisoffset is 2, * the destination position will be entry 3; ifthe current position is entry 3 and this offset is -2, * the destination position will be entry 1. The valid final position after moving forwards starts with 0. If the * final position is invalid, false will be returned. * @returns Returns true if the operation succeeds; return false otherwise. - * @throws throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ moveV9(offset: number): boolean; /** * Moves the read position from 0 to an absolute position. * + * @param position Indicates the absolute position. + * @returns Returns true if the operation succeeds; return false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 * @useinstead moveToPositionV9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @param position Indicates the absolute position. - * @returns Returns true if the operation succeeds; return false otherwise. */ moveToPosition(position: number): boolean; /** * Moves the read position from 0 to an absolute position. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param position Indicates the absolute position. * @returns Returns true if the operation succeeds; return false otherwise. - * @throws throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ moveToPositionV9(position: number): boolean; /** * Checks whether the read position is the first line. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @returns Returns true if the read position is the first line; returns false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ isFirst(): boolean; /** * Checks whether the read position is the last line. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @returns Returns true if the read position is the last line; returns false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ isLast(): boolean; /** * Checks whether the read position is before the last line. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @returns Returns true if the read position is before the first line; returns false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ isBeforeFirst(): boolean; /** * Checks whether the read position is after the last line. * - * @since 8 + * @returns Returns true if the read position is after the last line; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @returns Returns true if the read position is after the last line; returns false otherwise. + * @since 8 */ isAfterLast(): boolean; /** * Obtains a key-value pair. * + * @returns Returns a key-value pair. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 * @useinstead getEntryV9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @returns Returns a key-value pair. */ getEntry(): Entry; /** * Obtains a key-value pair. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @returns Returns a key-value pair. - * @throws {BusinessError} if process failed. - * @errorcode 15100004 - * @errorcode 15100006 + * @throws {BusinessError} 15100004 - if the database not exist when delete database or the data not exist when query or delete data. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ getEntryV9(): Entry; } /** * Represents a database query using a predicate. - * + * *

This class provides a constructor used to create a {@code Query} instance, which is used to query data matching specified * conditions in the database. - * + * *

This class also provides methods for adding predicates to the {@code Query} instance. - * + * + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 * @useinstead QueryV9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A */ class Query { /** * A constructor used to create a Query instance. - * - * @since 8 + * * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ - constructor() + constructor() /** * Resets this {@code Query} object. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @returns Returns the reset {@code Query} object. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ reset(): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is equal to the specified long value. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value IIndicates the long value. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ equalTo(field: string, value: number|string|boolean): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is not equal to the specified int value. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the int value. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ notEqualTo(field: string, value: number|string|boolean): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is greater than or equal to the * specified int value. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the int value. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ greaterThan(field: string, value: number|string|boolean): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is less than the specified int value. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the int value. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ lessThan(field: string, value: number|string): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is greater than or equal to the * specified int value. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the int value. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ greaterThanOrEqualTo(field: string, value: number|string): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is less than or equal to the * specified int value. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the int value. - * @returns Returns the {@coed Query} object. + * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ lessThanOrEqualTo(field: string, value: number|string): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is null. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. - * @returns Returns the {@coed Query} object. + * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ isNull(field: string): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is within the specified int value list. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @param valueList Indicates the int value list. - * @returns Returns the {@coed Query} object. + * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ inNumber(field: string, valueList: number[]): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is within the specified string value list. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @param valueList Indicates the string value list. - * @returns Returns the {@coed Query} object. + * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ inString(field: string, valueList: string[]): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is not within the specified int value list. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @param valueList Indicates the int value list. * @returns Returns the {@coed Query} object. - * @throws Throws this exception if input is invalid. + * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ notInNumber(field: string, valueList: number[]): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is not within the specified string value list. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @param valueList Indicates the string value list. - * @returns Returns the {@coed Query} object. - * @throws Throws this exception if input is invalid. + * @returns Returns the {@coed Query} object. + * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ notInString(field: string, valueList: string[]): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is similar to the specified string value. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the string value. - * @returns Returns the {@coed Query} object. - * @throws Throws this exception if input is invalid. + * @returns Returns the {@coed Query} object. + * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ like(field: string, value: string): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is not similar to the specified string value. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the string value. - * @returns Returns the {@coed Query} object. - * @throws Throws this exception if input is invalid. + * @returns Returns the {@coed Query} object. + * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ unlike(field: string, value: string): Query; /** * Constructs a {@code Query} object with the and condition. - * + * *

Multiple predicates should be connected using the and or or condition. - * - * @since 8 + * + * @returns Returns the {@coed Query} object. + * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A - * @returns Returns the {@coed Query} object. + * @since 8 */ and(): Query; /** * Constructs a {@code Query} object with the or condition. - * + * *

Multiple predicates should be connected using the and or or condition. - * - * @since 8 + * + * @returns Returns the {@coed Query} object. + * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A - * @returns Returns the {@coed Query} object. + * @since 8 */ or(): Query; /** * Constructs a {@code Query} object to sort the query results in ascending order. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. - * @returns Returns the {@coed Query} object. - * @throws Throws this exception if input is invalid. + * @returns Returns the {@coed Query} object. + * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ orderByAsc(field: string): Query; /** * Constructs a {@code Query} object to sort the query results in descending order. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @returns Returns the {@coed Query} object. - * @throws Throws this exception if input is invalid. + * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ orderByDesc(field: string): Query; /** * Constructs a {@code Query} object to specify the number of results and the start position. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param total Indicates the number of results. * @param offset Indicates the start position. * @returns Returns the {@coed Query} object. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ limit(total: number, offset: number): Query; /** * Creates a {@code query} condition with a specified field that is not null. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the specified field. * @returns Returns the {@coed Query} object. - * @throws Throws this exception if input is invalid. + * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ isNotNull(field: string): Query; /** * Creates a query condition group with a left bracket. - * + * *

Multiple query conditions in an {@code Query} object can be grouped. The query conditions in a group can be used as a * whole to combine with other query conditions. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @returns Returns the {@coed Query} object. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ beginGroup(): Query; /** * Creates a query condition group with a right bracket. - * + * *

Multiple query conditions in an {@code Query} object can be grouped. The query conditions in a group can be used as a * whole to combine with other query conditions. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @returns Returns the {@coed Query} object. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ endGroup(): Query; /** * Creates a query condition with a specified key prefix. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param prefix Indicates the specified key prefix. * @returns Returns the {@coed Query} object. - * @throws Throws this exception if input is invalid. + * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ prefixKey(prefix: string): Query; /** * Sets a specified index that will be preferentially used for query. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param index Indicates the index to set. * @returns Returns the {@coed Query} object. - * @throws Throws this exception if input is invalid. + * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ setSuggestIndex(index: string): Query; /** * Add device ID key prefix.Used by {@code DeviceKVStore}. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param deviceId Specify device id to query from. * @return Returns the {@code Query} object with device ID prefix added. * @throw Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ deviceId(deviceId:string):Query; /** @@ -1130,11 +1132,11 @@ declare namespace distributedData { * *

The String would be parsed to DB query format. * The String length should be no longer than 500kb. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * + * @return String representing this {@code Query}. * @import N/A - * @return String representing this {@code Query}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ getSqlLike():string; } @@ -1142,199 +1144,188 @@ declare namespace distributedData { /** * Represents a database query using a predicate. * - *

This class provides a constructor used to create a {@code QueryV9} instance, which is used to query data matching specified - * conditions in the database. + *

This class provides a constructor used to create a {@code QueryV9} instance, which is used to query data + * matching specified conditions in the database. * *

This class also provides methods for adding predicates to the {@code QueryV9} instance. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ class QueryV9 { /** * A constructor used to create a Query instance. * - * @since 9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ constructor() /** * Resets this {@code QueryV9} object. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @returns Returns the reset {@code QueryV9} object. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ reset(): QueryV9; /** * Constructs a {@code QueryV9} object to query entries with the specified field whose value is equal to the specified long value. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value IIndicates the long value. * @returns Returns the {@coed QueryV9} object. - * @throws throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ equalTo(field: string, value: number|string|boolean): QueryV9; /** * Constructs a {@code QueryV9} object to query entries with the specified field whose value is not equal to the specified int value. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the int value. * @returns Returns the {@coed QueryV9} object. - * @throws throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ notEqualTo(field: string, value: number|string|boolean): QueryV9; /** * Constructs a {@code QueryV9} object to query entries with the specified field whose value is greater than or equal to the * specified int value. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the int value. * @returns Returns the {@coed QueryV9} object. - * @throws throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ greaterThan(field: string, value: number|string|boolean): QueryV9; /** * Constructs a {@code QueryV9} object to query entries with the specified field whose value is less than the specified int value. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the int value. * @returns Returns the {@coed QueryV9} object. - * @throws throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ lessThan(field: string, value: number|string): QueryV9; /** - * Constructs a {@code QueryV9} object to query entries with the specified field whose value is greater than or equal to the - * specified int value. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * Constructs a {@code QueryV9} object to query entries with the specified field whose value is greater than or + * equal to the specified int value. + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the int value. * @returns Returns the {@coed QueryV9} object. - * @throws throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ greaterThanOrEqualTo(field: string, value: number|string): QueryV9; /** * Constructs a {@code QueryV9} object to query entries with the specified field whose value is less than or equal to the * specified int value. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the int value. * @returns Returns the {@coed QueryV9} object. - * @throws throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ lessThanOrEqualTo(field: string, value: number|string): QueryV9; /** * Constructs a {@code QueryV9} object to query entries with the specified field whose value is null. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param field Indicates the field, which must start with $. and cannot contain ^. * @returns Returns the {@coed QueryV9} object. - * @throws throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ isNull(field: string): QueryV9; /** * Constructs a {@code QueryV9} object to query entries with the specified field whose value is within the specified int value list. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param field Indicates the field, which must start with $. and cannot contain ^. * @param valueList Indicates the int value list. * @returns Returns the {@coed QueryV9} object. - * @throws throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ inNumber(field: string, valueList: number[]): QueryV9; /** * Constructs a {@code QueryV9} object to query entries with the specified field whose value is within the specified string value list. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @param valueList Indicates the string value list. * @returns Returns the {@coed QueryV9} object. - * @throws throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ inString(field: string, valueList: string[]): QueryV9; /** * Constructs a {@code QueryV9} object to query entries with the specified field whose value is not within the specified int value list. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @param valueList Indicates the int value list. * @returns Returns the {@coed QueryV9} object. - * @throws throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ notInNumber(field: string, valueList: number[]): QueryV9; /** * Constructs a {@code QueryV9} object to query entries with the specified field whose value is not within the specified string value list. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param field Indicates the field, which must start with $. and cannot contain ^. * @param valueList Indicates the string value list. * @returns Returns the {@coed QueryV9} object. - * @throws throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ notInString(field: string, valueList: string[]): QueryV9; /** * Constructs a {@code QueryV9} object to query entries with the specified field whose value is similar to the specified string value. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the string value. * @returns Returns the {@coed QueryV9} object. - * @throws throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ like(field: string, value: string): QueryV9; /** * Constructs a {@code QueryV9} object to query entries with the specified field whose value is not similar to the specified string value. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the string value. * @returns Returns the {@coed QueryV9} object. - * @throws throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ unlike(field: string, value: string): QueryV9; /** @@ -1342,10 +1333,10 @@ declare namespace distributedData { * *

Multiple predicates should be connected using the and or or condition. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @returns Returns the {@coed QueryV9} object. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ and(): QueryV9; /** @@ -1353,59 +1344,55 @@ declare namespace distributedData { * *

Multiple predicates should be connected using the and or or condition. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @returns Returns the {@coed QueryV9} object. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ or(): QueryV9; /** * Constructs a {@code QueryV9} object to sort the query results in ascending order. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param field Indicates the field, which must start with $. and cannot contain ^. * @returns Returns the {@coed QueryV9} object. - * @throws throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ orderByAsc(field: string): QueryV9; /** * Constructs a {@code QueryV9} object to sort the query results in descending order. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param field Indicates the field, which must start with $. and cannot contain ^. * @returns Returns the {@coed QueryV9} object. - * @throws throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ orderByDesc(field: string): QueryV9; /** * Constructs a {@code QueryV9} object to specify the number of results and the start position. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param total Indicates the number of results. * @param offset Indicates the start position. * @returns Returns the {@coed QueryV9} object. - * @throws throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ limit(total: number, offset: number): QueryV9; /** * Creates a {@code QueryV9} condition with a specified field that is not null. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param field Indicates the specified field. * @returns Returns the {@coed QueryV9} object. - * @throws throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ isNotNull(field: string): QueryV9; /** @@ -1414,10 +1401,10 @@ declare namespace distributedData { *

Multiple query conditions in an {@code QueryV9} object can be grouped. The query conditions in a group can be used as a * whole to combine with other query conditions. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @returns Returns the {@coed QueryV9} object. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ beginGroup(): QueryV9; /** @@ -1426,46 +1413,43 @@ declare namespace distributedData { *

Multiple query conditions in an {@code QueryV9} object can be grouped. The query conditions in a group can be used as a * whole to combine with other query conditions. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @returns Returns the {@coed QueryV9} object. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ endGroup(): QueryV9; /** * Creates a query condition with a specified key prefix. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param prefix Indicates the specified key prefix. * @returns Returns the {@coed QueryV9} object. - * @throws throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ prefixKey(prefix: string): QueryV9; /** * Sets a specified index that will be preferentially used for query. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param index Indicates the index to set. * @returns Returns the {@coed QueryV9} object. - * @throws throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ setSuggestIndex(index: string): QueryV9; /** * Add device ID key prefix.Used by {@code DeviceKVStore}. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param deviceId Specify device id to query from. * @return Returns the {@code QueryV9} object with device ID prefix added. - * @throws throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ deviceId(deviceId:string):QueryV9; /** @@ -1474,10 +1458,10 @@ declare namespace distributedData { *

The String would be parsed to DB query format. * The String length should be no longer than 500kb. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @return String representing this {@code QueryV9}. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ getSqlLike():string; } @@ -1490,229 +1474,159 @@ declare namespace distributedData { * with input parameter {@code Options}. Distributed database types are defined in {@code KVStoreType}, * including {@code SingleKVStore}. * + * + * @import N/A + * @version 1 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 * @useinstead KVStoreV9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A - * @version 1 */ interface KVStore { /** * Writes a key-value pair of the string type into the {@code KvStore} database. * *

If you do not want to synchronize this key-value pair to other devices, set the write option in the local database. - * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @param key Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. * Spaces before and after the key will be cleared. * @param value Indicates the string value, which must be less than 4 MB as a UTF-8 byte array. - * @throws Throws this exception if any of the following errors - * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and - * {@code DB_ERROR}. + * @throws Throws this exception if any of the following errors + * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 7 */ put(key: string, value: Uint8Array | string | number | boolean, callback: AsyncCallback): void; put(key: string, value: Uint8Array | string | number | boolean): Promise; - /** - * Writes a value of the valuesbucket type into the {@code KvStore} database. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @systemapi - * @param value Indicates the data record to put. - * Spaces before and after the key will be cleared. - * @throws Throws this exception if any of the following errors - * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and - * {@code DB_ERROR}. - */ - putBatch(value: Array, callback: AsyncCallback): void; - putBatch(value: Array): Promise; - /** * Deletes the key-value pair based on a specified key. * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @param key Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. - * Spaces before and after the key will be cleared. - * @throws Throws this exception if any of the following errors - * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and - * {@code DB_ERROR}, and {@code KEY_NOT_FOUND}. - */ - delete(key: string, callback: AsyncCallback): void; - delete(key: string): Promise; - - /** - * Deletes the key-value pair based on a specified key. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @systemapi - * @param predicates Indicates the datasharePredicates. - * Spaces before and after the key will be cleared. - * @throws Throws this exception if any of the following errors - * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and - * {@code DB_ERROR}. - */ - delete(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback); - delete(predicates: dataSharePredicates.DataSharePredicates): Promise; - - /** - * Backs up a database in a specified name. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @param file Indicates the name that saves the database backup. - */ - backup(file:string, callback: AsyncCallback):void; - backup(file:string): Promise; - - /** - * Restores a database from a specified database file. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @param file Indicates the name that saves the database file. - */ - restore(file:string, callback: AsyncCallback):void; - restore(file:string): Promise; - - /** - * Delete a backup files based on a specified name. - * - * @since 9 + * @param key Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. + * Spaces before and after the key will be cleared. + * @throws Throws this exception if any of the following errors + * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and + * {@code DB_ERROR}, and {@code KEY_NOT_FOUND}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @param files list Indicates the name that backup file to delete. + * @since 7 */ - deleteBackup(files:Array, callback: AsyncCallback>):void; - deleteBackup(files:Array): Promise>; + delete(key: string, callback: AsyncCallback): void; + delete(key: string): Promise; /** - * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in + * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in * {@code KvStoreObserver} will be invoked. * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. * @param listener Indicates the observer of data change events in the distributed database. - * @throws Throws this exception if any of the following errors + * @throws Throws this exception if any of the following errors * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 7 */ on(event: 'dataChange', type: SubscribeType, listener: Callback): void; /** * Subscribes from the {@code KvStore} database based on the specified subscribeType and {@code KvStoreObserver}. - * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @throws Throws this exception if any of the following errors + * + * @throws Throws this exception if any of the following errors * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 7 */ on(event: 'syncComplete', syncCallback: Callback>): void; - + /** * Unsubscribes from the {@code KvStore} database based on the specified subscribeType and {@code KvStoreObserver}. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. - * @throws Throws this exception if any of the following errors + * @throws Throws this exception if any of the following errors * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. - */ - off(event:'dataChange', listener?: Callback): void; - - /** - * UnRegister Synchronizes {@code KvStore} database callback. - * @since 9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @param syncCallback Indicates the callback used to send the synchronization result to caller. - * @throws Throws this exception if any of the following errors - * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, - * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. + * @since 8 */ - off(event: 'syncComplete', syncCallback?: Callback>): void; + off(event: 'dataChange', listener?: Callback): void; /** * Inserts key-value pairs into the {@code KvStore} database in batches. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @param entries Indicates the key-value pairs to be inserted in batches. * @throws Throws this exception if a database error occurs. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ putBatch(entries: Entry[], callback: AsyncCallback): void; putBatch(entries: Entry[]): Promise; /** * Deletes key-value pairs in batches from the {@code KvStore} database. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @param keys Indicates the key-value pairs to be deleted in batches. * @throws Throws this exception if a database error occurs. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ deleteBatch(keys: string[], callback: AsyncCallback): void; deleteBatch(keys: string[]): Promise; /** * Starts a transaction operation in the {@code KvStore} database. - * + * *

After the database transaction is started, you can submit or roll back the operation. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @throws Throws this exception if a database error occurs. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ startTransaction(callback: AsyncCallback): void; startTransaction(): Promise; /** * Submits a transaction operation in the {@code KvStore} database. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @param callback + * + * @param callback * @throws Throws this exception if a database error occurs. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ commit(callback: AsyncCallback): void; commit(): Promise; /** * Rolls back a transaction operation in the {@code KvStore} database. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @throws Throws this exception if a database error occurs. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ rollback(callback: AsyncCallback): void; rollback(): Promise; /** * Sets whether to enable synchronization. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @param enabled Specifies whether to enable synchronization. The value true means to enable * synchronization, and false means the opposite. * @throws Throws this exception if an internal service error occurs. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ enableSync(enabled: boolean, callback: AsyncCallback): void; enableSync(enabled: boolean): Promise; /** * Sets synchronization range labels. - * + * *

The labels determine the devices with which data will be synchronized. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @param localLabels Indicates the synchronization labels of the local device. * @param remoteSupportLabels Indicates the labels of the devices with which data will be synchronized. * @throws Throws this exception if an internal service error occurs. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ setSyncRange(localLabels: string[], remoteSupportLabels: string[], callback: AsyncCallback): void; setSyncRange(localLabels: string[], remoteSupportLabels: string[]): Promise; @@ -1726,10 +1640,10 @@ declare namespace distributedData { * with input parameter {@code Options}. Distributed database types are defined in {@code KVStoreType}, * including {@code SingleKVStoreV9}. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @version 1 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ interface KVStoreV9 { /** @@ -1737,15 +1651,14 @@ declare namespace distributedData { * *

If you do not want to synchronize this key-value pair to other devices, set the write option in the local database. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param key Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. * Spaces before and after the key will be cleared. * @param value Indicates the string value, which must be less than 4 MB as a UTF-8 byte array. - * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ put(key: string, value: Uint8Array | string | number | boolean, callback: AsyncCallback): void; put(key: string, value: Uint8Array | string | number | boolean): Promise; @@ -1753,15 +1666,14 @@ declare namespace distributedData { /** * Writes a value of the valuesbucket type into the {@code KvStoreV9} database. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @systemapi * @param value Indicates the data record to put. * Spaces before and after the key will be cleared. - * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @systemapi + * @since 9 */ putBatch(value: Array, callback: AsyncCallback): void; putBatch(value: Array): Promise; @@ -1769,15 +1681,14 @@ declare namespace distributedData { /** * Deletes the key-value pair based on a specified key. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param key Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. * Spaces before and after the key will be cleared. - * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100004 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the database not exist when delete database or the data not exist when query or delete data. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ delete(key: string, callback: AsyncCallback): void; delete(key: string): Promise; @@ -1790,10 +1701,10 @@ declare namespace distributedData { * @param predicates Indicates the datasharePredicates. * Spaces before and after the key will be cleared. * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100004 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the database not exist when delete database or the data not exist when query or delete data. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ delete(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback); delete(predicates: dataSharePredicates.DataSharePredicates): Promise; @@ -1805,9 +1716,9 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param file Indicates the name that saves the database backup. * @throws {BusinessError} if process failed. - * @errorcode 15100005 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100005 - if not support the operation. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ backup(file:string, callback: AsyncCallback):void; backup(file:string): Promise; @@ -1819,9 +1730,9 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param file Indicates the name that saves the database file. * @throws {BusinessError} if process failed. - * @errorcode 15100005 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100005 - if not support the operation. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ restore(file:string, callback: AsyncCallback):void; restore(file:string): Promise; @@ -1833,7 +1744,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param files list Indicates the name that backup file to delete. * @throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. */ deleteBackup(files:Array, callback: AsyncCallback>):void; deleteBackup(files:Array): Promise>; @@ -1847,9 +1758,9 @@ declare namespace distributedData { * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. * @param listener Indicates the observer of data change events in the distributed database. * @throws {BusinessError} if process failed. - * @errorcode 15100001 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100001 - if the database has been subscribed over the max subscription time limit. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ on(event: 'dataChange', type: SubscribeType, listener: Callback): void; @@ -1859,7 +1770,7 @@ declare namespace distributedData { * @since 9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. */ on(event: 'syncComplete', syncCallback: Callback>): void; @@ -1870,8 +1781,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. * @throws {BusinessError} if process failed. - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ off(event:'dataChange', listener?: Callback): void; @@ -1881,7 +1792,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param syncCallback Indicates the callback used to send the synchronization result to caller. * @throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. */ off(event: 'syncComplete', syncCallback?: Callback>): void; @@ -1892,9 +1803,9 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param entries Indicates the key-value pairs to be inserted in batches. * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ putBatch(entries: Entry[], callback: AsyncCallback): void; putBatch(entries: Entry[]): Promise; @@ -1906,10 +1817,10 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param keys Indicates the key-value pairs to be deleted in batches. * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100004 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the database not exist when delete database or the data not exist when query or delete data. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ deleteBatch(keys: string[], callback: AsyncCallback): void; deleteBatch(keys: string[]): Promise; @@ -1922,7 +1833,7 @@ declare namespace distributedData { * @since 9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @throws {BusinessError} if process failed. - * @errorcode 15100006 + * @throws {BusinessError} 15100006 - if the database or result set has been closed. */ startTransaction(callback: AsyncCallback): void; startTransaction(): Promise; @@ -1934,7 +1845,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param callback * @throws {BusinessError} if process failed. - * @errorcode 15100006 + * @throws {BusinessError} 15100006 - if the database or result set has been closed. */ commit(callback: AsyncCallback): void; commit(): Promise; @@ -1945,7 +1856,7 @@ declare namespace distributedData { * @since 9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @throws {BusinessError} if process failed. - * @errorcode 15100006 + * @throws {BusinessError} 15100006 - if the database or result set has been closed. */ rollback(callback: AsyncCallback): void; rollback(): Promise; @@ -1958,7 +1869,7 @@ declare namespace distributedData { * @param enabled Specifies whether to enable synchronization. The value true means to enable * synchronization, and false means the opposite. * @throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. */ enableSync(enabled: boolean, callback: AsyncCallback): void; enableSync(enabled: boolean): Promise; @@ -1968,12 +1879,12 @@ declare namespace distributedData { * *

The labels determine the devices with which data will be synchronized. * - * @since 8 + * @since 9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param localLabels Indicates the synchronization labels of the local device. * @param remoteSupportLabels Indicates the labels of the devices with which data will be synchronized. * @throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. */ setSyncRange(localLabels: string[], remoteSupportLabels: string[], callback: AsyncCallback): void; setSyncRange(localLabels: string[], remoteSupportLabels: string[]): Promise; @@ -1999,7 +1910,7 @@ declare namespace distributedData { interface SingleKVStore extends KVStore { /** * Obtains the {@code String} value of a specified key. - * + * * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A @@ -2012,7 +1923,7 @@ declare namespace distributedData { /** * Obtains all key-value pairs that match a specified key prefix. - * + * * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A @@ -2026,7 +1937,7 @@ declare namespace distributedData { /** * Obtains the list of key-value pairs matching the specified {@code Query} object. - * + * * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A @@ -2044,10 +1955,10 @@ declare namespace distributedData { * {@code KvStoreResultSet} objects at the same time. If you have created four objects, calling this method will return a * failure. Therefore, you are advised to call the closeResultSet method to close unnecessary {@code KvStoreResultSet} objects * in a timely manner. - * + * * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * @import N/A * @param keyPrefix Indicates the key prefix to match. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. @@ -2057,10 +1968,10 @@ declare namespace distributedData { /** * Obtains the {@code KvStoreResultSet} object matching the specified {@code Query} object. - * + * * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * @import N/A * @param query Indicates the {@code Query} object. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. @@ -2068,27 +1979,12 @@ declare namespace distributedData { getResultSet(query: Query, callback: AsyncCallback): void; getResultSet(query: Query): Promise; - /** - * Obtains the KvStoreResultSet object matching the specified Predicate object. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @systemapi - * @param predicates Indicates the datasharePredicates. - * Spaces before and after the key will be cleared. - * @throws Throws this exception if any of the following errors - * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and - * {@code DB_ERROR}. - */ - getResultSet(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; - getResultSet(predicates: dataSharePredicates.DataSharePredicates): Promise; - /** * Closes a {@code KvStoreResultSet} object returned by getResultSet. - * + * * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * @import N/A * @param resultSet Indicates the {@code KvStoreResultSet} object to close. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. @@ -2098,10 +1994,10 @@ declare namespace distributedData { /** * Obtains the number of results matching the specified {@code Query} object. - * + * * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * @import N/A * @param query Indicates the {@code Query} object. * @returns Returns the number of results matching the specified {@code Query} object. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, @@ -2112,7 +2008,7 @@ declare namespace distributedData { /** * void removeDeviceData​({@link String} deviceId) throws {@link KvStoreException} - * + * * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A @@ -2130,42 +2026,13 @@ declare namespace distributedData { * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. * @throws Throws this exception if any of the following errors * @permission ohos.permission.DISTRIBUTED_DATASYNC - * occurs: {@code INVALID_ARGUMENT}, - * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. - */ - sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void - - /** - * Synchronizes the database to the specified devices with the specified delay allowed. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @param deviceIds Indicates the list of devices to which to synchronize the database. - * @param mode Indicates the synchronization mode. The value can be {@code PUSH}, {@code PULL}, or {@code PUSH_PULL}. - * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. - * @param query Indicates the {@code Query} object. - * @throws Throws this exception if any of the following errors - * @permission ohos.permission.DISTRIBUTED_DATASYNC - * occurs: {@code INVALID_ARGUMENT}, + * occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. */ - sync(deviceIds: string[], query: Query, mode: SyncMode, delayMs?: number): void; - - /** - * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in - * {@code KvStoreObserver} will be invoked. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. - * @param listener Indicates the observer of data change events in the distributed database. - * @throws Throws this exception if no {@code SingleKvStore} database is available. - * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. - */ - on(event: 'dataChange', type: SubscribeType, listener: Callback): void; + sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; /** - * Register Synchronizes SingleKvStore databases callback. + * Register Synchronizes SingleKvStore databases callback. *

Sync result is returned through asynchronous callback. * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -2174,17 +2041,6 @@ declare namespace distributedData { */ on(event: 'syncComplete', syncCallback: Callback>): void; - /** - * Unsubscribes from the SingleKvStore database based on the specified subscribeType and {@code KvStoreObserver}. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. - * @throws Throws this exception if any of the following errors - * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, - * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. - */ - off(event:'dataChange', listener?: Callback): void; - /** * UnRegister Synchronizes SingleKvStore databases callback. * @since 8 @@ -2192,11 +2048,10 @@ declare namespace distributedData { * @throws Throws this exception if no {@code SingleKvStore} database is available. */ off(event: 'syncComplete', syncCallback?: Callback>): void; - - + /** * Sets the default delay allowed for database synchronization - * + * * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param defaultAllowedDelayMs Indicates the default delay allowed for the database synchronization, in milliseconds. @@ -2208,7 +2063,7 @@ declare namespace distributedData { /** * Get the security level of the database. - * + * * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @returns SecurityLevel {@code SecurityLevel} the security level of the database. @@ -2242,10 +2097,10 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100004 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the database not exist when delete database or the data not exist when query or delete data. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ get(key: string, callback: AsyncCallback): void; get(key: string): Promise; @@ -2259,9 +2114,9 @@ declare namespace distributedData { * @param keyPrefix Indicates the key prefix to match. * @returns Returns the list of all key-value pairs that match the specified key prefix. * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ getEntries(keyPrefix: string, callback: AsyncCallback): void; getEntries(keyPrefix: string): Promise; @@ -2275,10 +2130,10 @@ declare namespace distributedData { * @param query Indicates the {@code QueryV9} object. * @returns Returns the list of key-value pairs matching the specified {@code QueryV9} object. * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100005 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100005 - if not support the operation. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ getEntries(query: QueryV9, callback: AsyncCallback): void; getEntries(query: QueryV9): Promise; @@ -2295,9 +2150,9 @@ declare namespace distributedData { * @import N/A * @param keyPrefix Indicates the key prefix to match. * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ getResultSet(keyPrefix: string, callback: AsyncCallback): void; getResultSet(keyPrefix: string): Promise; @@ -2310,9 +2165,9 @@ declare namespace distributedData { * @import N/A * @param query Indicates the {@code QueryV9} object. * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ getResultSet(query: QueryV9, callback: AsyncCallback): void; getResultSet(query: QueryV9): Promise; @@ -2326,9 +2181,9 @@ declare namespace distributedData { * @param predicates Indicates the datasharePredicates. * Spaces before and after the key will be cleared. * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ getResultSet(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; getResultSet(predicates: dataSharePredicates.DataSharePredicates): Promise; @@ -2341,7 +2196,7 @@ declare namespace distributedData { * @import N/A * @param resultSet Indicates the {@code KvStoreResultSet} object to close. * @throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. */ closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; closeResultSet(resultSet: KvStoreResultSet): Promise; @@ -2355,9 +2210,9 @@ declare namespace distributedData { * @param query Indicates the {@code QueryV9} object. * @returns Returns the number of results matching the specified {@code QueryV9} object. * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ getResultSize(query: QueryV9, callback: AsyncCallback): void; getResultSize(query: QueryV9): Promise; @@ -2370,8 +2225,8 @@ declare namespace distributedData { * @import N/A * @param deviceId Indicates the device to be removed data. * @throws {BusinessError} if process failed. - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ removeDeviceData(deviceId: string, callback: AsyncCallback): void; removeDeviceData(deviceId: string): Promise; @@ -2386,9 +2241,9 @@ declare namespace distributedData { * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. * @permission ohos.permission.DISTRIBUTED_DATASYNC * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100004 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the database not exist when delete database or the data not exist when query or delete data. + * @throws {BusinessError} 401 - if parameter check failed. */ sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void @@ -2403,9 +2258,9 @@ declare namespace distributedData { * @param query Indicates the {@code QueryV9} object. * @permission ohos.permission.DISTRIBUTED_DATASYNC * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100004 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the database not exist when delete database or the data not exist when query or delete data. + * @throws {BusinessError} 401 - if parameter check failed. */ sync(deviceIds: string[], query: QueryV9, mode: SyncMode, delayMs?: number): void; @@ -2418,9 +2273,9 @@ declare namespace distributedData { * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. * @param listener Indicates the observer of data change events in the distributed database. * @throws {BusinessError} if process failed. - * @errorcode 15100001 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100001 - if the database has been subscribed over the max subscription time limit. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ on(event: 'dataChange', type: SubscribeType, listener: Callback): void; @@ -2431,7 +2286,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param syncCallback Indicates the callback used to send the synchronization result to the caller. * @throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. */ on(event: 'syncComplete', syncCallback: Callback>): void; @@ -2441,8 +2296,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. * @throws {BusinessError} if process failed. - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ off(event:'dataChange', listener?: Callback): void; @@ -2451,7 +2306,7 @@ declare namespace distributedData { * @since 9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. */ off(event: 'syncComplete', syncCallback?: Callback>): void; @@ -2463,7 +2318,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param defaultAllowedDelayMs Indicates the default delay allowed for the database synchronization, in milliseconds. * @throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. */ setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback): void; setSyncParam(defaultAllowedDelayMs: number): Promise; @@ -2471,11 +2326,11 @@ declare namespace distributedData { /** * Get the security level of the database. * - * @since 8 + * @since 9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @returns SecurityLevel {@code SecurityLevel} the security level of the database. * @throws {BusinessError} if process failed. - * @errorcode 15100006 + * @throws {BusinessError} 15100006 - if the database or result set has been closed. */ getSecurityLevel(callback: AsyncCallback): void; getSecurityLevel(): Promise; @@ -2483,12 +2338,12 @@ declare namespace distributedData { /** * Manages distributed data by device in a distributed system. - * + * *

To create a {@code DeviceKVStore} database, you can use the {@link data.distributed.common.KVManager.getKvStore(Options, String)} * method with {@code KvStoreType} set to {@code DEVICE_COLLABORATION} for the input parameter Options. This database manages distributed * data by device, and cannot modify data synchronized from remote devices. When an application writes a key-value pair entry * into the database, the system automatically adds the ID of the device running the application to the key. - * + * * @since 8 * @deprecated since 9 * @useinstead DeviceKVStoreV9 @@ -2512,7 +2367,7 @@ declare namespace distributedData { /** * Obtains all key-value pairs matching a specified device ID and key prefix. - * + * * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deviceId Identifies the device whose data is to be queried. @@ -2526,7 +2381,7 @@ declare namespace distributedData { /** * Obtains the list of key-value pairs matching the specified {@code Query} object. - * + * * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param query Indicates the {@code Query} object. @@ -2539,9 +2394,9 @@ declare namespace distributedData { /** * Obtains the list of key-value pairs matching a specified device ID and {@code Query} object. - * + * * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deviceId Indicates the ID of the device to which the key-value pairs belong. * @param query Indicates the {@code Query} object. * @returns Returns the list of key-value pairs matching the specified {@code Query} object. @@ -2551,12 +2406,12 @@ declare namespace distributedData { /** * Obtains the {@code KvStoreResultSet} object matching the specified device ID and key prefix. - * + * *

The {@code KvStoreResultSet} object can be used to query all key-value pairs that meet the search criteria. Each {@code KvStore} * instance can have a maximum of four {@code KvStoreResultSet} objects at the same time. If you have created four objects, * calling this method will return a failure. Therefore, you are advised to call the closeResultSet method to close unnecessary * {@code KvStoreResultSet} objects in a timely manner. - * + * * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deviceId Identifies the device whose data is to be queried. @@ -2570,7 +2425,7 @@ declare namespace distributedData { /** * Obtains the {@code KvStoreResultSet} object matching the specified {@code Query} object. - * + * * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param query Indicates the {@code Query} object. @@ -2583,7 +2438,7 @@ declare namespace distributedData { /** * Obtains the {@code KvStoreResultSet} object matching a specified device ID and {@code Query} object. - * + * * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deviceId Indicates the ID of the device to which the {@code KvStoreResultSet} object belongs. @@ -2593,39 +2448,9 @@ declare namespace distributedData { getResultSet(deviceId: string, query: Query, callback: AsyncCallback): void; getResultSet(deviceId: string, query: Query): Promise; - /** - * Obtains the KvStoreResultSet object matching the specified Predicate object. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @param predicates Indicates the datasharePredicates. - * @systemapi - * Spaces before and after the key will be cleared. - * @throws Throws this exception if any of the following errors - * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and - * {@code DB_ERROR}. - */ - getResultSet(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; - getResultSet(predicates: dataSharePredicates.DataSharePredicates): Promise; - - /** - * Obtains the KvStoreResultSet object matching a specified Device ID and Predicate object. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @systemapi - * @param predicates Indicates the key. - * @param deviceId Indicates the ID of the device to which the results belong. - * Spaces before and after the key will be cleared. - * @throws Throws this exception if any of the following errors - * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and - * {@code DB_ERROR}. - */ - getResultSet(deviceId: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; - getResultSet(deviceId: string, predicates: dataSharePredicates.DataSharePredicates): Promise; - /** * Closes a {@code KvStoreResultSet} object returned by getResultSet. - * + * * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param resultSet Indicates the {@code KvStoreResultSet} object to close. @@ -2637,7 +2462,7 @@ declare namespace distributedData { /** * Obtains the number of results matching the specified {@code Query} object. - * + * * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param query Indicates the {@code Query} object. @@ -2650,7 +2475,7 @@ declare namespace distributedData { /** * Obtains the number of results matching a specified device ID and {@code Query} object. - * + * * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deviceId Indicates the ID of the device to which the results belong. @@ -2664,7 +2489,7 @@ declare namespace distributedData { * Removes data of a specified device from the current database. This method is used to remove only the data * synchronized from remote devices. This operation does not synchronize data to other databases or affect * subsequent data synchronization. - * + * * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deviceId Identifies the device whose data is to be removed. The value cannot be the current device ID. @@ -2673,7 +2498,7 @@ declare namespace distributedData { */ removeDeviceData(deviceId: string, callback: AsyncCallback): void; removeDeviceData(deviceId: string): Promise; - + /** * Synchronizes {@code DeviceKVStore} databases. * @@ -2690,26 +2515,9 @@ declare namespace distributedData { */ sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; - /** - * Synchronizes {@code DeviceKVStore} databases. - * - *

This method returns immediately and sync result will be returned through asynchronous callback. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @param deviceIds Indicates the list of IDs of devices whose - * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. - * {@code DeviceKVStore} databases are to be synchronized. - * @param query Indicates the {@code Query} object. - * @param mode Indicates the synchronization mode, {@code PUSH}, {@code PULL}, or - * {@code PUSH_PULL}. - * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @throws Throws this exception if no DeviceKVStore database is available. - */ - sync(deviceIds: string[], query: Query, mode: SyncMode, delayMs?: number): void; - /** * Register Synchronizes DeviceKVStore databases callback. - * + * *

Sync result is returned through asynchronous callback. * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -2717,32 +2525,6 @@ declare namespace distributedData { * @throws Throws this exception if no DeviceKVStore database is available. */ on(event: 'syncComplete', syncCallback: Callback>): void; - - /** - * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in - * {@code KvStoreObserver} will be invoked. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. - * @param listener Indicates the observer of data change events in the distributed database. - * @throws Throws this exception if any of the following errors - * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, - * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. - */ - on(event: 'dataChange', type: SubscribeType, listener: Callback): void; - - /** - * Unsubscribes from the DeviceKVStore database based on the specified subscribeType and {@code KvStoreObserver}. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. - * @throws Throws this exception if any of the following errors - * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, - * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. - */ - off(event:'dataChange', listener?: Callback): void; /** * UnRegister Synchronizes DeviceKVStore databases callback. @@ -2775,10 +2557,10 @@ declare namespace distributedData { * @param key Indicates the key of the value to be queried. * @return Returns the value matching the given criteria. * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100004 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the database not exist when delete database or the data not exist when query or delete data. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ get(deviceId: string, key: string, callback: AsyncCallback): void; get(deviceId: string, key: string): Promise; @@ -2792,9 +2574,9 @@ declare namespace distributedData { * @param keyPrefix Indicates the key prefix to match. * @returns Returns the list of all key-value pairs meeting the given criteria. * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ getEntries(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; getEntries(deviceId: string, keyPrefix: string): Promise; @@ -2807,10 +2589,10 @@ declare namespace distributedData { * @param query Indicates the {@code QueryV9} object. * @returns Returns the list of key-value pairs matching the specified {@code QueryV9} object. * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100005 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100005 - if not support the operation. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ getEntries(query: QueryV9, callback: AsyncCallback): void; getEntries(query: QueryV9): Promise; @@ -2824,10 +2606,10 @@ declare namespace distributedData { * @param query Indicates the {@code QueryV9} object. * @returns Returns the list of key-value pairs matching the specified {@code QueryV9} object. * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100005 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100005 - if not support the operation. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ getEntries(deviceId: string, query: QueryV9, callback: AsyncCallback): void; getEntries(deviceId: string, query: QueryV9): Promise; @@ -2846,9 +2628,9 @@ declare namespace distributedData { * @param keyPrefix Indicates the key prefix to match. * @returns Returns the {@code KvStoreResultSet} objects. * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ getResultSet(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; getResultSet(deviceId: string, keyPrefix: string): Promise; @@ -2861,9 +2643,9 @@ declare namespace distributedData { * @param query Indicates the {@code QueryV9} object. * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code QueryV9} object. * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ getResultSet(query: QueryV9, callback: AsyncCallback): void; getResultSet(query: QueryV9): Promise; @@ -2877,9 +2659,9 @@ declare namespace distributedData { * @param query Indicates the {@code QueryV9} object. * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code QueryV9} object. * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ getResultSet(deviceId: string, query: QueryV9, callback: AsyncCallback): void; getResultSet(deviceId: string, query: QueryV9): Promise; @@ -2893,9 +2675,9 @@ declare namespace distributedData { * @systemapi * Spaces before and after the key will be cleared. * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ getResultSet(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; getResultSet(predicates: dataSharePredicates.DataSharePredicates): Promise; @@ -2909,9 +2691,9 @@ declare namespace distributedData { * @param deviceId Indicates the ID of the device to which the results belong. * Spaces before and after the key will be cleared. * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ getResultSet(deviceId: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; getResultSet(deviceId: string, predicates: dataSharePredicates.DataSharePredicates): Promise; @@ -2923,7 +2705,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param resultSet Indicates the {@code KvStoreResultSet} object to close. * @throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. */ closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; closeResultSet(resultSet: KvStoreResultSet): Promise; @@ -2936,9 +2718,9 @@ declare namespace distributedData { * @param query Indicates the {@code QueryV9} object. * @returns Returns the number of results matching the specified {@code QueryV9} object. * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ getResultSize(query: QueryV9, callback: AsyncCallback): void; getResultSize(query: QueryV9): Promise; @@ -2952,9 +2734,9 @@ declare namespace distributedData { * @param query Indicates the {@code QueryV9} object. * @returns Returns the number of results matching the specified {@code QueryV9} object. * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ getResultSize(deviceId: string, query: QueryV9, callback: AsyncCallback): void; getResultSize(deviceId: string, query: QueryV9): Promise; @@ -2968,8 +2750,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deviceId Identifies the device whose data is to be removed. The value cannot be the current device ID. * @throws {BusinessError} if process failed. - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ removeDeviceData(deviceId: string, callback: AsyncCallback): void; removeDeviceData(deviceId: string): Promise; @@ -2987,9 +2769,9 @@ declare namespace distributedData { * {@code PUSH_PULL}. * @permission ohos.permission.DISTRIBUTED_DATASYNC * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100004 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the database not exist when delete database or the data not exist when query or delete data. + * @throws {BusinessError} 401 - if parameter check failed. */ sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; @@ -3007,9 +2789,9 @@ declare namespace distributedData { * {@code PUSH_PULL}. * @permission ohos.permission.DISTRIBUTED_DATASYNC * @throws {BusinessError} if process failed. - * @errorcode 15100003 - * @errorcode 15100004 - * @errorcode 401 + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the database not exist when delete database or the data not exist when query or delete data. + * @throws {BusinessError} 401 - if parameter check failed. */ sync(deviceIds: string[], query: QueryV9, mode: SyncMode, delayMs?: number): void; @@ -3021,7 +2803,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param syncCallback Indicates the callback used to send the synchronization result to the caller. * @throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. */ on(event: 'syncComplete', syncCallback: Callback>): void; @@ -3034,9 +2816,9 @@ declare namespace distributedData { * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. * @param listener Indicates the observer of data change events in the distributed database. * @throws {BusinessError} if process failed. - * @errorcode 15100001 - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100001 - if the database has been subscribed over the max subscription time limit. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ on(event: 'dataChange', type: SubscribeType, listener: Callback): void; @@ -3047,8 +2829,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. * @throws {BusinessError} if process failed. - * @errorcode 15100006 - * @errorcode 401 + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 401 - if parameter check failed. */ off(event:'dataChange', listener?: Callback): void; @@ -3057,7 +2839,7 @@ declare namespace distributedData { * @since 9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. */ off(event: 'syncComplete', syncCallback?: Callback>): void; } @@ -3068,7 +2850,7 @@ declare namespace distributedData { *

You must pass {@link KVManagerConfig} to provide configuration information * for creating the {@link KVManager} instance. * - * @since 9 + * @since 7 * @deprecated since 9 * @useinstead createKVManagerV9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -3092,7 +2874,7 @@ declare namespace distributedData { * including the user information and package name. * @return Returns the {@code KVManagerV9} instance. * @throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. */ function createKVManagerV9(config: KVManagerConfig, callback: AsyncCallback): void; function createKVManagerV9(config: KVManagerConfig): Promise; @@ -3100,7 +2882,7 @@ declare namespace distributedData { /** * Provides interfaces to manage a {@code KVStore} database, including obtaining, closing, and deleting the {@code KVStore}. * - * @since 9 + * @since 7 * @deprecated since 9 * @useinstead KVManagerV9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -3219,9 +3001,9 @@ declare namespace distributedData { * and different applications can share the same value. * @return Returns a {@code KVStoreV9}, or {@code SingleKVStoreV9}. * @throws {BusinessError} if process failed. - * @errorcode 15100002 - * @errorcode 15100003 - * @errorcode 401 + * @throws {BusinessError} 15100002 - if open existed database with changed options. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 401 - if parameter check failed. */ getKVStore(storeId: string, options: Options): Promise; getKVStore(storeId: string, options: Options, callback: AsyncCallback): void; @@ -3241,7 +3023,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param kvStore Indicates the {@code KvStoreV9} database to close. * @throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. */ closeKVStore(appId: string, storeId: string, kvStore: KVStoreV9, callback: AsyncCallback): void; closeKVStore(appId: string, storeId: string, kvStore: KVStoreV9): Promise; @@ -3257,8 +3039,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param storeId Identifies the {@code KvStoreV9} database to delete. * @throws {BusinessError} if process failed. - * @errorcode 15100004 - * @errorcode 401 + * @throws {BusinessError} 15100004 - if the database not exist when delete database or the data not exist when query or delete data. + * @throws {BusinessError} 401 - if parameter check failed. */ deleteKVStore(appId: string, storeId: string, callback: AsyncCallback): void; deleteKVStore(appId: string, storeId: string): Promise; @@ -3271,7 +3053,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @returns Returns the storeId of all created {@code KvStore} databases. * @throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. */ getAllKVStoreId(appId: string, callback: AsyncCallback): void; getAllKVStoreId(appId: string): Promise; @@ -3283,7 +3065,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deathCallback device change callback {@code DeviceChangeCallback} * @throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. */ on(event: 'distributedDataServiceDie', deathCallback: Callback): void; @@ -3294,7 +3076,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deathCallback device change callback {@code DeviceChangeCallback} which has been registered. * @throws {BusinessError} if process failed. - * @errorcode 401 + * @throws {BusinessError} 401 - if parameter check failed. */ off(event: 'distributedDataServiceDie', deathCallback?: Callback): void; } -- Gitee From e32b86e14573533f66b1afade377b849b9c804f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwangxiyue=E2=80=9D?= Date: Thu, 13 Oct 2022 15:07:05 +0800 Subject: [PATCH 083/438] =?UTF-8?q?modified:=20=20=20api/@ohos.data.distri?= =?UTF-8?q?butedDataObject.d.ts=20Signed-off-by:=20=E2=80=9Cwangxiyue?= =?UTF-8?q?=E2=80=9D=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/@ohos.data.distributedDataObject.d.ts | 253 ++++++++++++++-------- 1 file changed, 159 insertions(+), 94 deletions(-) diff --git a/api/@ohos.data.distributedDataObject.d.ts b/api/@ohos.data.distributedDataObject.d.ts index d97f188c4f..d239819360 100644 --- a/api/@ohos.data.distributedDataObject.d.ts +++ b/api/@ohos.data.distributedDataObject.d.ts @@ -16,19 +16,19 @@ import {AsyncCallback, Callback} from './basic'; /** - * Provides interfaces to sync distributed object + * Provides interfaces to sync distributed object. * - * @name distributedDataObject - * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. * @since 8 */ declare namespace distributedDataObject { /** - * Create distributed object + * Create distributed object. * - * @param source Init data of distributed object - * @return Returns the distributed object + * @param {object} source - source Init data of distributed object. + * @returns {DistributedObject} - return the distributed object. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. * @since 8 * @deprecated since 9 * @useinstead create @@ -36,36 +36,41 @@ declare namespace distributedDataObject { function createDistributedObject(source: object): DistributedObject; /** - * Create distributed object + * Create distributed object. * - * @param { object } source - source Init data of distributed object - * @return Returns the distributed object - * @throws { BusinessError } 401 - the parameter check failed - * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject + * @param {object} source - source Init data of distributed object. + * @returns {DistributedObjectV9} - return the distributed object. + * @throws {BusinessError} 401 - the parameter check failed. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. * @since 9 */ function create(source: object): DistributedObjectV9; /** - * Generate a random sessionId + * Generate a random sessionId. * - * @return Returns the random sessionId + * @returns {string} - return generated sessionId. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. * @since 8 */ function genSessionId(): string; /** + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. * @since 9 */ interface SaveSuccessResponse { + /** * sessionId of saved object + * * @since 9 */ sessionId: string; /** * version of saved object, can compare with DistributedObject.__version + * * @since 9 */ version: number; @@ -74,16 +79,21 @@ declare namespace distributedDataObject { * deviceid that data saved * data is "local", means save in local device * otherwise, means the networkId of device + * * @since 9 */ deviceId: string; } /** + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. * @since 9 */ interface RevokeSaveSuccessResponse { + /** + * the sessionId of the changed object. + * * @since 9 */ sessionId: string; @@ -92,7 +102,7 @@ declare namespace distributedDataObject { /** * Object create by {@link createDistributedObject}. * - * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. * @since 8 * @deprecated since 9 */ @@ -101,9 +111,10 @@ declare namespace distributedDataObject { /* * Change object session * - * @param sessionId The sessionId to be joined, if empty, leave all session - * @return Operation result, true is success, false is failed * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param {string} sessionId - sessionId The sessionId to be joined, if empty, leave all session. + * @returns {boolean} - return a result of function. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. * @since 8 * @deprecated since 9 */ @@ -111,8 +122,13 @@ declare namespace distributedDataObject { /** * On watch of change - * - * @param callback The callback of change + * + * @param {string} type - event type, fixed as' change ', indicates data change. + * @param {Callback<{sessionId: string, fields: Array}>} callback + * indicates the observer of object data changed. + * {string} sessionId - the sessionId of the changed object. + * {Array} fields - changed data. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. * @since 8 * @deprecated since 9 */ @@ -120,8 +136,14 @@ declare namespace distributedDataObject { /** * Off watch of change - * - * @param callback If not null, off the callback, if undefined, off all callbacks + * + * @param {string} type - event type, fixed as' change ', indicates data change. + * @param {Callback<{sessionId: string, fields: Array}>} callback + * indicates the observer of object data changed. + * {string} sessionId - the sessionId of the changed object. + * {Array} fields - changed data. + * callback If not null, off the callback, if undefined, off all callbacks. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. * @since 8 * @deprecated since 9 */ @@ -129,25 +151,40 @@ declare namespace distributedDataObject { /** * On watch of status - * - * @param callback Indicates the observer of object status changed. - * sessionId: The sessionId of the changed object - * networkId: NetworkId of the changed device - * status: 'online' The object became online on the device and data can be synced to the device - * 'offline' The object became offline on the device and the object can not sync any data + * + * @param {string} type - event type, fixed as' status', indicates the online and offline of the object. + * @param {Callback<{sessionId: string, networkId: string, status: 'online' | 'offline'}>} callback + * indicates the observer of object status changed. + * {string} sessionId - the sessionId of the changed object. + * {string} networkId - networkId of the changed device. + * {string} status + * 'online' The object became online on the device and data can be synced to the device. + * 'offline' The object became offline on the device and the object can not sync any data. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. * @since 8 * @deprecated since 9 */ - on(type: 'status', callback: Callback<{ sessionId: string, networkId: string, status: 'online' | 'offline' }>): void; + on(type: 'status', + callback: Callback<{ sessionId: string, networkId: string, status: 'online' | 'offline' }>): void; /** * Off watch of status - * - * @param callback If not null, off the callback, if undefined, off all callbacks + * + * @param {string} type - event type, fixed as' status', indicates the online and offline of the object. + * @param {Callback<{sessionId: string, networkId: string, status: 'online' | 'offline'}>} callback + * Indicates the observer of object status changed. + * {string} sessionId - the sessionId of the changed object. + * {string} networkId - networkId of the changed device. + * {string} status + * 'online' The object became online on the device and data can be synced to the device. + * 'offline' The object became offline on the device and the object can not sync any data. + * callback If not null, off the callback, if undefined, off all callbacks. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. * @since 8 * @deprecated since 9 */ - off(type: 'status', callback?: Callback<{ sessionId: string, deviceId: string, status: 'online' | 'offline' }>): void; + off(type: 'status', + callback?: Callback<{ sessionId: string, deviceId: string, status: 'online' | 'offline' }>): void; } /** @@ -159,14 +196,14 @@ declare namespace distributedDataObject { interface DistributedObjectV9 { /* - * Change object session + * Change object session. * - * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @param { string } sessionId - sessionId The sessionId to be joined, if empty, leave all session. - * @param { AsyncCallback } callback - Indicates the callback function. - * @throws { BusinessError } 201 - the permissions check failed. - * @throws { BusinessError } 401 - the parameter check failed. - * @throws { BusinessError } 15400001 - create table failed. + * @permission ohos.permission.DISTRIBUTED_DATASYNC. + * @param {string} sessionId - sessionId The sessionId to be joined, if empty, leave all session. + * @param {AsyncCallback} callback - the callback of setSessionId. + * @throws {BusinessError} 201 - the permissions check failed. + * @throws {BusinessError} 401 - the parameter check failed. + * @throws {BusinessError} 15400001 - create table failed. * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. * @since 9 */ @@ -174,118 +211,146 @@ declare namespace distributedDataObject { setSessionId(callback: AsyncCallback): void; /* - * Change object session + * Change object session. * * @permission ohos.permission.DISTRIBUTED_DATASYNC. - * @param { string } sessionId - sessionId The sessionId to be joined, if empty, leave all session. - * @returns { Promise } - return a promise object with void. - * @throws { BusinessError } 201 - the permissions check failed. - * @throws { BusinessError } 401 - the parameter check failed. - * @throws { BusinessError } 15400001 - create table failed. + * @param {string} sessionId - sessionId The sessionId to be joined, if empty, leave all session. + * @returns {Promise} - the promise returned by the function. + * @throws {BusinessError} 201 - the permissions check failed. + * @throws {BusinessError} 401 - the parameter check failed. + * @throws {BusinessError} 15400001 - create table failed. * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. * @since 9 */ setSessionId(sessionId?: string): Promise; /** - * On watch of change + * On watch of change. * - * @param { string } type - event type, fixed as' change ', indicates data change. - * @param { Callback<{ sessionId: string, fields: Array }> } callback - * callback indicates the observer of object data changed. - * @throws { BusinessError } 401 - the parameter check failed. + * @param {string} type - event type, fixed as' change ', indicates data change. + * @param {Callback<{sessionId: string, fields: Array}>} callback + * indicates the observer of object data changed. + * {string} sessionId - the sessionId of the changed object. + * {Array} fields - changed data. + * sessionId the sessionId of the changed object. + * @throws {BusinessError} 401 - the parameter check failed. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. * @since 9 */ on(type: 'change', callback: Callback<{ sessionId: string, fields: Array }>): void; /** - * Off watch of change + * Off watch of change. * - * @param { string } type - event type, fixed as' change ', indicates data change. - * @param { Callback<{ sessionId: string, fields: Array }> }callback - * callback indicates the observer of object data changed. + * @param {string} type - event type, fixed as' change ', indicates data change. + * @param {Callback<{sessionId: string, fields: Array}>} callback + * indicates the observer of object data changed. + * {string} sessionId - the sessionId of the changed object. + * {Array} fields - changed data. * callback If not null, off the callback, if undefined, off all callbacks. - * @throws { BusinessError } 401 - the parameter check failed. + * @throws {BusinessError} 401 - the parameter check failed. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. * @since 9 */ off(type: 'change', callback?: Callback<{ sessionId: string, fields: Array }>): void; /** - * On watch of status + * On watch of status. * - * @param { string } type - event type, fixed as' status', indicates the online and offline of the object. - * @param { Callback<{ sessionId: string, networkId: string, status: 'online' | 'offline' }> } callback - * callback indicates the observer of object status changed. - * sessionId: the sessionId of the changed object. - * networkId: NetworkId of the changed device. - * status: 'online' The object became online on the device and data can be synced to the device. - * 'offline' The object became offline on the device and the object can not sync any data. - * 'restored' The object restored success. - * @throws { BusinessError } 401 - the parameter check failed. + * @param {string} type - event type, fixed as' status', indicates the online and offline of the object. + * @param {Callback<{ sessionId: string, networkId: string, status: 'online' | 'offline' }>} callback + * indicates the observer of object status changed. + * {string} sessionId - the sessionId of the changed object. + * {string} networkId - networkId of the changed device. + * {string} status + * 'online' The object became online on the device and data can be synced to the device. + * 'offline' The object became offline on the device and the object can not sync any data. + * 'restored' The object restored success. + * @throws {BusinessError} 401 - the parameter check failed. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. * @since 9 */ - on(type: 'status', callback: Callback<{ sessionId: string, networkId: string, status: 'online' | 'offline' }>): void; + on(type: 'status', + callback: Callback<{ sessionId: string, networkId: string, status: 'online' | 'offline' }>): void; /** - * Off watch of status - * - * @param { string } type - event type, fixed as' status', indicates the online and offline of the object. - * @param { Callback<{ sessionId: string, networkId: string, status: 'online' | 'offline' }> } callback - * callback Indicates the observer of object status changed. + * Off watch of status. + * + * @param {string} type - event type, fixed as' status', indicates the online and offline of the object. + * @param {Callback<{sessionId: string, networkId: string, status: 'online' | 'offline'}>} callback + * Indicates the observer of object status changed. + * {string} sessionId - the sessionId of the changed object. + * {string} networkId - networkId of the changed device. + * {string} status + * 'online' The object became online on the device and data can be synced to the device. + * 'offline' The object became offline on the device and the object can not sync any data. * callback If not null, off the callback, if undefined, off all callbacks. - * @throws { BusinessError } 401 - the parameter check failed. + * @throws {BusinessError} 401 - the parameter check failed. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. * @since 9 */ - off(type: 'status', callback?: Callback<{ sessionId: string, deviceId: string, status: 'online' | 'offline' }>): void; + off(type: 'status', + callback?: Callback<{ sessionId: string, deviceId: string, status: 'online' | 'offline' }>): void; /** - * Save object, after save object data successfully, the object data will not release when app existed, and resume data on saved device after app existed - * the saved data secure level is S0, it is not safe, can only save public data, if there is privacy data, you should encrypt it + * Save object, after save object data successfully, the object data will not release when app existed, + * and resume data on saved device after app existed. + * the saved data secure level is S0, it is not safe, can only save public data, if there is privacy data, + * you should encrypt it * * the saved data will be released when - * 1. saved after 24h - * 2. app uninstalled - * 3. after resume data success, system will auto delete the saved data + * 1. saved after 24h. + * 2. app uninstalled. + * 3. after resume data success, system will auto delete the saved data. * - * @param { string } deviceId - Indicates the device that will resume the object data. - * @param { AsyncCallback } callback - Indicates the callback function. - * @throws { BusinessError } 401 - the parameter check failed. + * @param {string} deviceId - Indicates the device that will resume the object data. + * @param {AsyncCallback} callback + * {SaveSuccessResponse}: the response of save. + * @throws {BusinessError} 401 - the parameter check failed. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. * @since 9 */ save(deviceId: string, callback: AsyncCallback): void; /** - * Save object, after save object data successfully, the object data will not release when app existed, and resume data on saved device after app existed - * the saved data secure level is S0, it is not safe, can only save public data, if there is privacy data, you should encrypt it + * Save object, after save object data successfully, the object data will not release when app existed, + * and resume data on saved device after app existed. + * the saved data secure level is S0, it is not safe, can only save public data, if there is privacy data, + * you should encrypt it. * * the saved data will be released when - * 1. saved after 24h - * 2. app uninstalled - * 3. after resume data success, system will auto delete the saved data + * 1. saved after 24h. + * 2. app uninstalled. + * 3. after resume data success, system will auto delete the saved data. * - * @param { string } deviceId - Indicates the device that will resume the object data. - * @returns { Promise } - the response of revokeSave success. - * @throws { BusinessError } 401 - the parameter check failed. + * @param {string} deviceId - Indicates the device that will resume the object data. + * @returns {Promise} {SaveSuccessResponse}: the response of save. + * @throws {BusinessError} 401 - the parameter check failed. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. * @since 9 */ save(deviceId: string): Promise; /** - * Revoke save object, delete saved object immediately, if object is saved in local device, it will delete saved data on all trusted device + * Revoke save object, delete saved object immediately, if object is saved in local device, + * it will delete saved data on all trusted device. * if object is saved in other device, it will delete data in local device. * - * @param { AsyncCallback } callback - Indicates the callback function. - * @throws { BusinessError } 401 - the parameter check failed. + * @param {AsyncCallback} callback + * {RevokeSaveSuccessResponse}: the response of revokeSave. + * @throws {BusinessError} 401 - the parameter check failed. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. * @since 9 */ revokeSave(callback: AsyncCallback): void; /** - * Revoke save object, delete saved object immediately, if object is saved in local device, it will delete saved data on all trusted device + * Revoke save object, delete saved object immediately, if object is saved in local device, + * it will delete saved data on all trusted device. * if object is saved in other device, it will delete data in local device. - * - * @returns { Promise } the response of revokeSave success. - * @throws { BusinessError } 401 - the parameter check failed. + * @returns {Promise} {RevokeSaveSuccessResponse}: the response of revokeSave. + * @throws {BusinessError} 401 - the parameter check failed. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. * @since 9 */ revokeSave(): Promise; -- Gitee From e220eb7f8125c784dcf1ca459b5ff1ea33bd75de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwangxiyue=E2=80=9D?= Date: Thu, 13 Oct 2022 16:31:34 +0800 Subject: [PATCH 084/438] =?UTF-8?q?modified:=20=20=20api/@ohos.data.distri?= =?UTF-8?q?butedDataObject.d.ts=20Signed-off-by:=20=E2=80=9Cwangxiyue?= =?UTF-8?q?=E2=80=9D=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/@ohos.data.distributedDataObject.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/@ohos.data.distributedDataObject.d.ts b/api/@ohos.data.distributedDataObject.d.ts index d239819360..26cf1c3811 100644 --- a/api/@ohos.data.distributedDataObject.d.ts +++ b/api/@ohos.data.distributedDataObject.d.ts @@ -14,6 +14,7 @@ */ import {AsyncCallback, Callback} from './basic'; +import Context from './application/Context'; /** * Provides interfaces to sync distributed object. @@ -38,13 +39,14 @@ declare namespace distributedDataObject { /** * Create distributed object. * + * @param {Context} context - Indicates the application context. * @param {object} source - source Init data of distributed object. * @returns {DistributedObjectV9} - return the distributed object. * @throws {BusinessError} 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. * @since 9 */ - function create(source: object): DistributedObjectV9; + function create(context: Context, source: object): DistributedObjectV9; /** * Generate a random sessionId. -- Gitee From 5f4c40ef1e351bcf3bd51159e44cf19175ac505f Mon Sep 17 00:00:00 2001 From: dboy190 Date: Thu, 13 Oct 2022 16:44:50 +0800 Subject: [PATCH 085/438] fix d.ts by new standard Signed-off-by: dboy190 --- api/@ohos.data.distributedData.d.ts | 654 +++++++++++++--------------- 1 file changed, 305 insertions(+), 349 deletions(-) diff --git a/api/@ohos.data.distributedData.d.ts b/api/@ohos.data.distributedData.d.ts index 54bb425b82..df8c5411d5 100644 --- a/api/@ohos.data.distributedData.d.ts +++ b/api/@ohos.data.distributedData.d.ts @@ -807,7 +807,7 @@ declare namespace distributedData { * Obtains a key-value pair. * * @returns Returns a key-value pair. - * @throws {BusinessError} 15100004 - if the database not exist when delete database or the data not exist when query or delete data. + * @throws {BusinessError} 15100004 - if the data not exist when get entry. * @throws {BusinessError} 15100006 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 @@ -1654,9 +1654,9 @@ declare namespace distributedData { * @param key Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. * Spaces before and after the key will be cleared. * @param value Indicates the string value, which must be less than 4 MB as a UTF-8 byte array. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1668,9 +1668,9 @@ declare namespace distributedData { * * @param value Indicates the data record to put. * Spaces before and after the key will be cleared. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @systemapi * @since 9 @@ -1683,10 +1683,10 @@ declare namespace distributedData { * * @param key Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. * Spaces before and after the key will be cleared. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100004 - if the database not exist when delete database or the data not exist when query or delete data. + * @throws {BusinessError} 15100004 - if the data not exist when delete data. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1695,16 +1695,17 @@ declare namespace distributedData { /** * Deletes the key-value pair based on a specified key. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @systemapi + * * @param predicates Indicates the datasharePredicates. * Spaces before and after the key will be cleared. - * @throws {BusinessError} if process failed. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100004 - if the database not exist when delete database or the data not exist when query or delete data. + * @throws {BusinessError} 15100004 - if the data not exist when delete data. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @systemapi + * @since 9 + */ delete(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback); delete(predicates: dataSharePredicates.DataSharePredicates): Promise; @@ -1712,13 +1713,12 @@ declare namespace distributedData { /** * Backs up a database in a specified name. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param file Indicates the name that saves the database backup. - * @throws {BusinessError} if process failed. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100005 - if not support the operation. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ backup(file:string, callback: AsyncCallback):void; backup(file:string): Promise; @@ -1726,13 +1726,12 @@ declare namespace distributedData { /** * Restores a database from a specified database file. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param file Indicates the name that saves the database file. - * @throws {BusinessError} if process failed. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100005 - if not support the operation. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ restore(file:string, callback: AsyncCallback):void; restore(file:string): Promise; @@ -1740,11 +1739,10 @@ declare namespace distributedData { /** * Delete a backup files based on a specified name. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param files list Indicates the name that backup file to delete. - * @throws {BusinessError} if process failed. * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ deleteBackup(files:Array, callback: AsyncCallback>):void; deleteBackup(files:Array): Promise>; @@ -1753,59 +1751,55 @@ declare namespace distributedData { * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in * {@code KvStoreObserver} will be invoked. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. * @param listener Indicates the observer of data change events in the distributed database. - * @throws {BusinessError} if process failed. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100001 - if the database has been subscribed over the max subscription time limit. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ on(event: 'dataChange', type: SubscribeType, listener: Callback): void; /** * Subscribes from the {@code KvStoreV9} database based on the specified subscribeType and {@code KvStoreObserver}. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @throws {BusinessError} if process failed. * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ on(event: 'syncComplete', syncCallback: Callback>): void; /** * Unsubscribes from the {@code KvStoreV9} database based on the specified subscribeType and {@code KvStoreObserver}. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. - * @throws {BusinessError} if process failed. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ off(event:'dataChange', listener?: Callback): void; /** * UnRegister Synchronizes {@code KvStoreV9} database callback. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @param syncCallback Indicates the callback used to send the synchronization result to caller. - * @throws {BusinessError} if process failed. * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ off(event: 'syncComplete', syncCallback?: Callback>): void; /** * Inserts key-value pairs into the {@code KvStoreV9} database in batches. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param entries Indicates the key-value pairs to be inserted in batches. - * @throws {BusinessError} if process failed. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ putBatch(entries: Entry[], callback: AsyncCallback): void; putBatch(entries: Entry[]): Promise; @@ -1813,14 +1807,13 @@ declare namespace distributedData { /** * Deletes key-value pairs in batches from the {@code KvStoreV9} database. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param keys Indicates the key-value pairs to be deleted in batches. - * @throws {BusinessError} if process failed. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100004 - if the database not exist when delete database or the data not exist when query or delete data. + * @throws {BusinessError} 15100004 - if the data not exist when delete data. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ deleteBatch(keys: string[], callback: AsyncCallback): void; deleteBatch(keys: string[]): Promise; @@ -1830,10 +1823,9 @@ declare namespace distributedData { * *

After the database transaction is started, you can submit or roll back the operation. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @throws {BusinessError} if process failed. * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ startTransaction(callback: AsyncCallback): void; startTransaction(): Promise; @@ -1841,11 +1833,10 @@ declare namespace distributedData { /** * Submits a transaction operation in the {@code KvStoreV9} database. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param callback - * @throws {BusinessError} if process failed. * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ commit(callback: AsyncCallback): void; commit(): Promise; @@ -1853,10 +1844,9 @@ declare namespace distributedData { /** * Rolls back a transaction operation in the {@code KvStoreV9} database. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @throws {BusinessError} if process failed. * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ rollback(callback: AsyncCallback): void; rollback(): Promise; @@ -1864,12 +1854,11 @@ declare namespace distributedData { /** * Sets whether to enable synchronization. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param enabled Specifies whether to enable synchronization. The value true means to enable * synchronization, and false means the opposite. - * @throws {BusinessError} if process failed. * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ enableSync(enabled: boolean, callback: AsyncCallback): void; enableSync(enabled: boolean): Promise; @@ -1879,12 +1868,11 @@ declare namespace distributedData { * *

The labels determine the devices with which data will be synchronized. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param localLabels Indicates the synchronization labels of the local device. * @param remoteSupportLabels Indicates the labels of the devices with which data will be synchronized. - * @throws {BusinessError} if process failed. * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ setSyncRange(localLabels: string[], remoteSupportLabels: string[], callback: AsyncCallback): void; setSyncRange(localLabels: string[], remoteSupportLabels: string[]): Promise; @@ -1900,23 +1888,23 @@ declare namespace distributedData { * The {@code SingleKVStore} database does not support * synchronous transactions, or data search using snapshots. * + * @import N/A + * @version 1 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 * @useinstead SingleKVStoreV9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A - * @version 1 */ interface SingleKVStore extends KVStore { /** * Obtains the {@code String} value of a specified key. * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param key Indicates the key of the boolean value to be queried. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}, and {@code KEY_NOT_FOUND}. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 7 */ get(key: string, callback: AsyncCallback): void; get(key: string): Promise; @@ -1924,13 +1912,13 @@ declare namespace distributedData { /** * Obtains all key-value pairs that match a specified key prefix. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param keyPrefix Indicates the key prefix to match. * @returns Returns the list of all key-value pairs that match the specified key prefix. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ getEntries(keyPrefix: string, callback: AsyncCallback): void; getEntries(keyPrefix: string): Promise; @@ -1938,13 +1926,13 @@ declare namespace distributedData { /** * Obtains the list of key-value pairs matching the specified {@code Query} object. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param query Indicates the {@code Query} object. * @returns Returns the list of key-value pairs matching the specified {@code Query} object. * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ getEntries(query: Query, callback: AsyncCallback): void; getEntries(query: Query): Promise; @@ -1956,12 +1944,12 @@ declare namespace distributedData { * failure. Therefore, you are advised to call the closeResultSet method to close unnecessary {@code KvStoreResultSet} objects * in a timely manner. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param keyPrefix Indicates the key prefix to match. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ getResultSet(keyPrefix: string, callback: AsyncCallback): void; getResultSet(keyPrefix: string): Promise; @@ -1969,12 +1957,12 @@ declare namespace distributedData { /** * Obtains the {@code KvStoreResultSet} object matching the specified {@code Query} object. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param query Indicates the {@code Query} object. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ getResultSet(query: Query, callback: AsyncCallback): void; getResultSet(query: Query): Promise; @@ -1982,12 +1970,12 @@ declare namespace distributedData { /** * Closes a {@code KvStoreResultSet} object returned by getResultSet. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param resultSet Indicates the {@code KvStoreResultSet} object to close. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; closeResultSet(resultSet: KvStoreResultSet): Promise; @@ -1995,13 +1983,13 @@ declare namespace distributedData { /** * Obtains the number of results matching the specified {@code Query} object. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param query Indicates the {@code Query} object. * @returns Returns the number of results matching the specified {@code Query} object. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ getResultSize(query: Query, callback: AsyncCallback): void; getResultSize(query: Query): Promise; @@ -2009,9 +1997,9 @@ declare namespace distributedData { /** * void removeDeviceData​({@link String} deviceId) throws {@link KvStoreException} * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ removeDeviceData(deviceId: string, callback: AsyncCallback): void; removeDeviceData(deviceId: string): Promise; @@ -2019,8 +2007,6 @@ declare namespace distributedData { /** * Synchronizes the database to the specified devices with the specified delay allowed. * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param deviceIds Indicates the list of devices to which to synchronize the database. * @param mode Indicates the synchronization mode. The value can be {@code PUSH}, {@code PULL}, or {@code PUSH_PULL}. * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. @@ -2028,35 +2014,39 @@ declare namespace distributedData { * @permission ohos.permission.DISTRIBUTED_DATASYNC * occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 7 */ sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; /** * Register Synchronizes SingleKvStore databases callback. *

Sync result is returned through asynchronous callback. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @param syncCallback Indicates the callback used to send the synchronization result to the caller. * @throws Throws this exception if no {@code SingleKvStore} database is available. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ on(event: 'syncComplete', syncCallback: Callback>): void; /** * UnRegister Synchronizes SingleKvStore databases callback. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @throws Throws this exception if no {@code SingleKvStore} database is available. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ off(event: 'syncComplete', syncCallback?: Callback>): void; /** * Sets the default delay allowed for database synchronization * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param defaultAllowedDelayMs Indicates the default delay allowed for the database synchronization, in milliseconds. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback): void; setSyncParam(defaultAllowedDelayMs: number): Promise; @@ -2064,11 +2054,11 @@ declare namespace distributedData { /** * Get the security level of the database. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @returns SecurityLevel {@code SecurityLevel} the security level of the database. * @throws Throws this exception if any of the following errors occurs:{@code SERVER_UNAVAILABLE}, * {@code IPC_ERROR}, and {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ getSecurityLevel(callback: AsyncCallback): void; getSecurityLevel(): Promise; @@ -2084,23 +2074,22 @@ declare namespace distributedData { * The {@code SingleKVStoreV9} database does not support * synchronous transactions, or data search using snapshots. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @version 1 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ interface SingleKVStoreV9 extends KVStoreV9 { /** * Obtains the {@code String} value of a specified key. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A - * @throws {BusinessError} if process failed. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100004 - if the database not exist when delete database or the data not exist when query or delete data. + * @throws {BusinessError} 15100004 - if the data not exist when query data. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ get(key: string, callback: AsyncCallback): void; get(key: string): Promise; @@ -2108,15 +2097,14 @@ declare namespace distributedData { /** * Obtains all key-value pairs that match a specified key prefix. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param keyPrefix Indicates the key prefix to match. * @returns Returns the list of all key-value pairs that match the specified key prefix. - * @throws {BusinessError} if process failed. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ getEntries(keyPrefix: string, callback: AsyncCallback): void; getEntries(keyPrefix: string): Promise; @@ -2124,35 +2112,33 @@ declare namespace distributedData { /** * Obtains the list of key-value pairs matching the specified {@code QueryV9} object. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param query Indicates the {@code QueryV9} object. * @returns Returns the list of key-value pairs matching the specified {@code QueryV9} object. - * @throws {BusinessError} if process failed. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100005 - if not support the operation. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ getEntries(query: QueryV9, callback: AsyncCallback): void; getEntries(query: QueryV9): Promise; /** - * Obtains the result sets with a specified prefix from a {@code KvStoreV9} database. The {@code KvStoreResultSet} object can be used to - * query all key-value pairs that meet the search criteria. Each {@code KvStoreV9} instance can have a maximum of four - * {@code KvStoreResultSet} objects at the same time. If you have created four objects, calling this method will return a - * failure. Therefore, you are advised to call the closeResultSet method to close unnecessary {@code KvStoreResultSet} objects - * in a timely manner. + * Obtains the result sets with a specified prefix from a {@code KvStoreV9} database. The {@code KvStoreResultSet} + * object can be used to query all key-value pairs that meet the search criteria. Each {@code KvStoreV9} + * instance can have a maximum of four {@code KvStoreResultSet} objects at the same time. If you have created + * four objects, calling this method will return a failure. Therefore, you are advised to call the closeResultSet + * method to close unnecessary {@code KvStoreResultSet} objects in a timely manner. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param keyPrefix Indicates the key prefix to match. - * @throws {BusinessError} if process failed. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ getResultSet(keyPrefix: string, callback: AsyncCallback): void; getResultSet(keyPrefix: string): Promise; @@ -2160,14 +2146,13 @@ declare namespace distributedData { /** * Obtains the {@code KvStoreResultSet} object matching the specified {@code QueryV9} object. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param query Indicates the {@code QueryV9} object. - * @throws {BusinessError} if process failed. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ getResultSet(query: QueryV9, callback: AsyncCallback): void; getResultSet(query: QueryV9): Promise; @@ -2175,15 +2160,14 @@ declare namespace distributedData { /** * Obtains the KvStoreResultSet object matching the specified Predicate object. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @systemapi * @param predicates Indicates the datasharePredicates. * Spaces before and after the key will be cleared. - * @throws {BusinessError} if process failed. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @systemapi + * @since 9 */ getResultSet(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; getResultSet(predicates: dataSharePredicates.DataSharePredicates): Promise; @@ -2191,12 +2175,11 @@ declare namespace distributedData { /** * Closes a {@code KvStoreResultSet} object returned by getResultSet. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param resultSet Indicates the {@code KvStoreResultSet} object to close. - * @throws {BusinessError} if process failed. * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; closeResultSet(resultSet: KvStoreResultSet): Promise; @@ -2204,15 +2187,14 @@ declare namespace distributedData { /** * Obtains the number of results matching the specified {@code QueryV9} object. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param query Indicates the {@code QueryV9} object. * @returns Returns the number of results matching the specified {@code QueryV9} object. - * @throws {BusinessError} if process failed. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ getResultSize(query: QueryV9, callback: AsyncCallback): void; getResultSize(query: QueryV9): Promise; @@ -2220,13 +2202,12 @@ declare namespace distributedData { /** * void removeDeviceData​({@link String} deviceId) throws {@link KvStoreException} * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param deviceId Indicates the device to be removed data. - * @throws {BusinessError} if process failed. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ removeDeviceData(deviceId: string, callback: AsyncCallback): void; removeDeviceData(deviceId: string): Promise; @@ -2234,33 +2215,31 @@ declare namespace distributedData { /** * Synchronizes the database to the specified devices with the specified delay allowed. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @permission ohos.permission.DISTRIBUTED_DATASYNC * @param deviceIds Indicates the list of devices to which to synchronize the database. * @param mode Indicates the synchronization mode. The value can be {@code PUSH}, {@code PULL}, or {@code PUSH_PULL}. * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. - * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @throws {BusinessError} if process failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100004 - if the database not exist when delete database or the data not exist when query or delete data. * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the database not exist when sync data. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void /** * Synchronizes the database to the specified devices with the specified delay allowed. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @permission ohos.permission.DISTRIBUTED_DATASYNC * @param deviceIds Indicates the list of devices to which to synchronize the database. * @param mode Indicates the synchronization mode. The value can be {@code PUSH}, {@code PULL}, or {@code PUSH_PULL}. * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. * @param query Indicates the {@code QueryV9} object. - * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @throws {BusinessError} if process failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100004 - if the database not exist when delete database or the data not exist when query or delete data. * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the database not exist when sync data. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ sync(deviceIds: string[], query: QueryV9, mode: SyncMode, delayMs?: number): void; @@ -2268,45 +2247,44 @@ declare namespace distributedData { * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in * {@code KvStoreObserver} will be invoked. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. * @param listener Indicates the observer of data change events in the distributed database. - * @throws {BusinessError} if process failed. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100001 - if the database has been subscribed over the max subscription time limit. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ on(event: 'dataChange', type: SubscribeType, listener: Callback): void; /** * Register Synchronizes SingleKvStore databases callback. *

Sync result is returned through asynchronous callback. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @param syncCallback Indicates the callback used to send the synchronization result to the caller. - * @throws {BusinessError} if process failed. * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ on(event: 'syncComplete', syncCallback: Callback>): void; /** * Unsubscribes from the SingleKvStore database based on the specified subscribeType and {@code KvStoreObserver}. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. - * @throws {BusinessError} if process failed. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ off(event:'dataChange', listener?: Callback): void; /** * UnRegister Synchronizes SingleKvStore databases callback. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @throws {BusinessError} if process failed. + * * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ off(event: 'syncComplete', syncCallback?: Callback>): void; @@ -2314,11 +2292,10 @@ declare namespace distributedData { /** * Sets the default delay allowed for database synchronization * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param defaultAllowedDelayMs Indicates the default delay allowed for the database synchronization, in milliseconds. - * @throws {BusinessError} if process failed. * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback): void; setSyncParam(defaultAllowedDelayMs: number): Promise; @@ -2326,11 +2303,10 @@ declare namespace distributedData { /** * Get the security level of the database. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @returns SecurityLevel {@code SecurityLevel} the security level of the database. - * @throws {BusinessError} if process failed. * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ getSecurityLevel(callback: AsyncCallback): void; getSecurityLevel(): Promise; @@ -2344,23 +2320,23 @@ declare namespace distributedData { * data by device, and cannot modify data synchronized from remote devices. When an application writes a key-value pair entry * into the database, the system automatically adds the ID of the device running the application to the key. * + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 * @deprecated since 9 * @useinstead DeviceKVStoreV9 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @import N/A */ interface DeviceKVStore extends KVStore { /** * Obtains the {@code String} value matching a specified device ID and key. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deviceId Indicates the device to be queried. * @param key Indicates the key of the value to be queried. * @return Returns the value matching the given criteria. * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}, and {@code KEY_NOT_FOUND}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ get(deviceId: string, key: string, callback: AsyncCallback): void; get(deviceId: string, key: string): Promise; @@ -2368,13 +2344,13 @@ declare namespace distributedData { /** * Obtains all key-value pairs matching a specified device ID and key prefix. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deviceId Identifies the device whose data is to be queried. * @param keyPrefix Indicates the key prefix to match. * @returns Returns the list of all key-value pairs meeting the given criteria. * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ getEntries(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; getEntries(deviceId: string, keyPrefix: string): Promise; @@ -2382,24 +2358,24 @@ declare namespace distributedData { /** * Obtains the list of key-value pairs matching the specified {@code Query} object. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param query Indicates the {@code Query} object. * @returns Returns the list of key-value pairs matching the specified {@code Query} object. * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ getEntries(query: Query, callback: AsyncCallback): void; getEntries(query: Query): Promise; /** * Obtains the list of key-value pairs matching a specified device ID and {@code Query} object. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * * @param deviceId Indicates the ID of the device to which the key-value pairs belong. * @param query Indicates the {@code Query} object. * @returns Returns the list of key-value pairs matching the specified {@code Query} object. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ getEntries(deviceId: string, query: Query, callback: AsyncCallback): void; getEntries(deviceId: string, query: Query): Promise; @@ -2412,13 +2388,13 @@ declare namespace distributedData { * calling this method will return a failure. Therefore, you are advised to call the closeResultSet method to close unnecessary * {@code KvStoreResultSet} objects in a timely manner. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deviceId Identifies the device whose data is to be queried. * @param keyPrefix Indicates the key prefix to match. * @returns Returns the {@code KvStoreResultSet} objects. * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ getResultSet(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; getResultSet(deviceId: string, keyPrefix: string): Promise; @@ -2426,12 +2402,12 @@ declare namespace distributedData { /** * Obtains the {@code KvStoreResultSet} object matching the specified {@code Query} object. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param query Indicates the {@code Query} object. * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code Query} object. * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ getResultSet(query: Query, callback: AsyncCallback): void; getResultSet(query: Query): Promise; @@ -2439,11 +2415,11 @@ declare namespace distributedData { /** * Obtains the {@code KvStoreResultSet} object matching a specified device ID and {@code Query} object. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deviceId Indicates the ID of the device to which the {@code KvStoreResultSet} object belongs. * @param query Indicates the {@code Query} object. * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code Query} object. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ getResultSet(deviceId: string, query: Query, callback: AsyncCallback): void; getResultSet(deviceId: string, query: Query): Promise; @@ -2451,11 +2427,11 @@ declare namespace distributedData { /** * Closes a {@code KvStoreResultSet} object returned by getResultSet. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param resultSet Indicates the {@code KvStoreResultSet} object to close. * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; closeResultSet(resultSet: KvStoreResultSet): Promise; @@ -2463,12 +2439,12 @@ declare namespace distributedData { /** * Obtains the number of results matching the specified {@code Query} object. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param query Indicates the {@code Query} object. * @returns Returns the number of results matching the specified {@code Query} object. * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ getResultSize(query: Query, callback: AsyncCallback): void; getResultSize(query: Query): Promise; @@ -2476,11 +2452,11 @@ declare namespace distributedData { /** * Obtains the number of results matching a specified device ID and {@code Query} object. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deviceId Indicates the ID of the device to which the results belong. * @param query Indicates the {@code Query} object. * @returns Returns the number of results matching the specified {@code Query} object. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ getResultSize(deviceId: string, query: Query, callback: AsyncCallback): void; getResultSize(deviceId: string, query: Query): Promise; @@ -2490,11 +2466,11 @@ declare namespace distributedData { * synchronized from remote devices. This operation does not synchronize data to other databases or affect * subsequent data synchronization. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deviceId Identifies the device whose data is to be removed. The value cannot be the current device ID. * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ removeDeviceData(deviceId: string, callback: AsyncCallback): void; removeDeviceData(deviceId: string): Promise; @@ -2503,15 +2479,16 @@ declare namespace distributedData { * Synchronizes {@code DeviceKVStore} databases. * *

This method returns immediately and sync result will be returned through asynchronous callback. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC * @param deviceIds Indicates the list of IDs of devices whose * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. * {@code DeviceKVStore} databases are to be synchronized. * @param mode Indicates the synchronization mode, {@code PUSH}, {@code PULL}, or * {@code PUSH_PULL}. - * @permission ohos.permission.DISTRIBUTED_DATASYNC * @throws Throws this exception if no DeviceKVStore database is available. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; @@ -2519,18 +2496,20 @@ declare namespace distributedData { * Register Synchronizes DeviceKVStore databases callback. * *

Sync result is returned through asynchronous callback. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @param syncCallback Indicates the callback used to send the synchronization result to the caller. * @throws Throws this exception if no DeviceKVStore database is available. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ on(event: 'syncComplete', syncCallback: Callback>): void; /** * UnRegister Synchronizes DeviceKVStore databases callback. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @throws Throws this exception if no DeviceKVStore database is available. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ off(event: 'syncComplete', syncCallback?: Callback>): void; } @@ -2543,24 +2522,23 @@ declare namespace distributedData { * data by device, and cannot modify data synchronized from remote devices. When an application writes a key-value pair entry * into the database, the system automatically adds the ID of the device running the application to the key. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 */ interface DeviceKVStoreV9 extends KVStoreV9 { /** * Obtains the {@code String} value matching a specified device ID and key. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deviceId Indicates the device to be queried. * @param key Indicates the key of the value to be queried. * @return Returns the value matching the given criteria. - * @throws {BusinessError} if process failed. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100004 - if the database not exist when delete database or the data not exist when query or delete data. + * @throws {BusinessError} 15100004 - if the data not exist when query data. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 */ get(deviceId: string, key: string, callback: AsyncCallback): void; get(deviceId: string, key: string): Promise; @@ -2568,15 +2546,14 @@ declare namespace distributedData { /** * Obtains all key-value pairs matching a specified device ID and key prefix. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deviceId Identifies the device whose data is to be queried. * @param keyPrefix Indicates the key prefix to match. * @returns Returns the list of all key-value pairs meeting the given criteria. - * @throws {BusinessError} if process failed. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 */ getEntries(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; getEntries(deviceId: string, keyPrefix: string): Promise; @@ -2584,15 +2561,14 @@ declare namespace distributedData { /** * Obtains the list of key-value pairs matching the specified {@code QueryV9} object. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param query Indicates the {@code QueryV9} object. * @returns Returns the list of key-value pairs matching the specified {@code QueryV9} object. - * @throws {BusinessError} if process failed. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100005 - if not support the operation. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 */ getEntries(query: QueryV9, callback: AsyncCallback): void; getEntries(query: QueryV9): Promise; @@ -2600,16 +2576,15 @@ declare namespace distributedData { /** * Obtains the list of key-value pairs matching a specified device ID and {@code QueryV9} object. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deviceId Indicates the ID of the device to which the key-value pairs belong. * @param query Indicates the {@code QueryV9} object. * @returns Returns the list of key-value pairs matching the specified {@code QueryV9} object. - * @throws {BusinessError} if process failed. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100005 - if not support the operation. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 */ getEntries(deviceId: string, query: QueryV9, callback: AsyncCallback): void; getEntries(deviceId: string, query: QueryV9): Promise; @@ -2622,15 +2597,14 @@ declare namespace distributedData { * calling this method will return a failure. Therefore, you are advised to call the closeResultSet method to close unnecessary * {@code KvStoreResultSet} objects in a timely manner. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deviceId Identifies the device whose data is to be queried. * @param keyPrefix Indicates the key prefix to match. * @returns Returns the {@code KvStoreResultSet} objects. - * @throws {BusinessError} if process failed. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 */ getResultSet(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; getResultSet(deviceId: string, keyPrefix: string): Promise; @@ -2638,14 +2612,13 @@ declare namespace distributedData { /** * Obtains the {@code KvStoreResultSet} object matching the specified {@code QueryV9} object. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param query Indicates the {@code QueryV9} object. * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code QueryV9} object. - * @throws {BusinessError} if process failed. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 */ getResultSet(query: QueryV9, callback: AsyncCallback): void; getResultSet(query: QueryV9): Promise; @@ -2653,15 +2626,14 @@ declare namespace distributedData { /** * Obtains the {@code KvStoreResultSet} object matching a specified device ID and {@code QueryV9} object. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deviceId Indicates the ID of the device to which the {@code KvStoreResultSet} object belongs. * @param query Indicates the {@code QueryV9} object. * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code QueryV9} object. - * @throws {BusinessError} if process failed. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 */ getResultSet(deviceId: string, query: QueryV9, callback: AsyncCallback): void; getResultSet(deviceId: string, query: QueryV9): Promise; @@ -2669,31 +2641,28 @@ declare namespace distributedData { /** * Obtains the KvStoreResultSet object matching the specified Predicate object. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param predicates Indicates the datasharePredicates. - * @systemapi - * Spaces before and after the key will be cleared. - * @throws {BusinessError} if process failed. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @systemapi + * @since 9 */ getResultSet(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; getResultSet(predicates: dataSharePredicates.DataSharePredicates): Promise; /** * Obtains the KvStoreResultSet object matching a specified Device ID and Predicate object. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @systemapi + * * @param predicates Indicates the key. * @param deviceId Indicates the ID of the device to which the results belong. - * Spaces before and after the key will be cleared. - * @throws {BusinessError} if process failed. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @systemapi + * @since 9 */ getResultSet(deviceId: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; getResultSet(deviceId: string, predicates: dataSharePredicates.DataSharePredicates): Promise; @@ -2701,11 +2670,10 @@ declare namespace distributedData { /** * Closes a {@code KvStoreResultSet} object returned by getResultSet. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param resultSet Indicates the {@code KvStoreResultSet} object to close. - * @throws {BusinessError} if process failed. * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 */ closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; closeResultSet(resultSet: KvStoreResultSet): Promise; @@ -2713,14 +2681,13 @@ declare namespace distributedData { /** * Obtains the number of results matching the specified {@code QueryV9} object. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param query Indicates the {@code QueryV9} object. * @returns Returns the number of results matching the specified {@code QueryV9} object. - * @throws {BusinessError} if process failed. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 */ getResultSize(query: QueryV9, callback: AsyncCallback): void; getResultSize(query: QueryV9): Promise; @@ -2728,15 +2695,14 @@ declare namespace distributedData { /** * Obtains the number of results matching a specified device ID and {@code Query} object. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deviceId Indicates the ID of the device to which the results belong. * @param query Indicates the {@code QueryV9} object. * @returns Returns the number of results matching the specified {@code QueryV9} object. - * @throws {BusinessError} if process failed. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 */ getResultSize(deviceId: string, query: QueryV9, callback: AsyncCallback): void; getResultSize(deviceId: string, query: QueryV9): Promise; @@ -2746,12 +2712,11 @@ declare namespace distributedData { * synchronized from remote devices. This operation does not synchronize data to other databases or affect * subsequent data synchronization. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deviceId Identifies the device whose data is to be removed. The value cannot be the current device ID. - * @throws {BusinessError} if process failed. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 */ removeDeviceData(deviceId: string, callback: AsyncCallback): void; removeDeviceData(deviceId: string): Promise; @@ -2760,18 +2725,17 @@ declare namespace distributedData { * Synchronizes {@code DeviceKVStore} databases. * *

This method returns immediately and sync result will be returned through asynchronous callback. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC * @param deviceIds Indicates the list of IDs of devices whose * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. * {@code DeviceKVStore} databases are to be synchronized. - * @param mode Indicates the synchronization mode, {@code PUSH}, {@code PULL}, or - * {@code PUSH_PULL}. - * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @throws {BusinessError} if process failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100004 - if the database not exist when delete database or the data not exist when query or delete data. + * @param mode Indicates the synchronization mode, {@code PUSH}, {@code PULL}, or {@code PUSH_PULL}. * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the database not exist when sync data. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; @@ -2779,19 +2743,18 @@ declare namespace distributedData { * Synchronizes {@code DeviceKVStore} databases. * *

This method returns immediately and sync result will be returned through asynchronous callback. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC * @param deviceIds Indicates the list of IDs of devices whose * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. * {@code DeviceKVStore} databases are to be synchronized. * @param query Indicates the {@code QueryV9} object. - * @param mode Indicates the synchronization mode, {@code PUSH}, {@code PULL}, or - * {@code PUSH_PULL}. - * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @throws {BusinessError} if process failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100004 - if the database not exist when delete database or the data not exist when query or delete data. + * @param mode Indicates the synchronization mode, {@code PUSH}, {@code PULL}, or {@code PUSH_PULL}. * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the database not exist when sync data. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ sync(deviceIds: string[], query: QueryV9, mode: SyncMode, delayMs?: number): void; @@ -2799,11 +2762,11 @@ declare namespace distributedData { * Register Synchronizes DeviceKVStore databases callback. * *

Sync result is returned through asynchronous callback. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @param syncCallback Indicates the callback used to send the synchronization result to the caller. - * @throws {BusinessError} if process failed. * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ on(event: 'syncComplete', syncCallback: Callback>): void; @@ -2811,35 +2774,33 @@ declare namespace distributedData { * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in * {@code KvStoreObserver} will be invoked. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. * @param listener Indicates the observer of data change events in the distributed database. - * @throws {BusinessError} if process failed. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100001 - if the database has been subscribed over the max subscription time limit. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ on(event: 'dataChange', type: SubscribeType, listener: Callback): void; /** * Unsubscribes from the DeviceKVStore database based on the specified subscribeType and {@code KvStoreObserver}. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. - * @throws {BusinessError} if process failed. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ off(event:'dataChange', listener?: Callback): void; /** * UnRegister Synchronizes DeviceKVStore databases callback. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @throws {BusinessError} if process failed. + * * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ off(event: 'syncComplete', syncCallback?: Callback>): void; } @@ -2850,14 +2811,14 @@ declare namespace distributedData { *

You must pass {@link KVManagerConfig} to provide configuration information * for creating the {@link KVManager} instance. * - * @since 7 - * @deprecated since 9 - * @useinstead createKVManagerV9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param config Indicates the {@link KVStore} configuration information, * including the user information and package name. * @return Returns the {@code KVManager} instance. * @throws Throws exception if input is invalid. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 7 + * @deprecated since 9 + * @useinstead createKVManagerV9 */ function createKVManager(config: KVManagerConfig, callback: AsyncCallback): void; function createKVManager(config: KVManagerConfig): Promise; @@ -2868,13 +2829,12 @@ declare namespace distributedData { *

You must pass {@link KVManagerConfig} to provide configuration information * for creating the {@link KVManagerV9} instance. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param config Indicates the {@link KVStoreV9} configuration information, * including the user information and package name. * @return Returns the {@code KVManagerV9} instance. - * @throws {BusinessError} if process failed. * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ function createKVManagerV9(config: KVManagerConfig, callback: AsyncCallback): void; function createKVManagerV9(config: KVManagerConfig): Promise; @@ -2882,25 +2842,25 @@ declare namespace distributedData { /** * Provides interfaces to manage a {@code KVStore} database, including obtaining, closing, and deleting the {@code KVStore}. * + * @import N/A + * @version 1 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 * @useinstead KVManagerV9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A - * @version 1 */ interface KVManager { /** * Creates and obtains a {@code KVStore} database by specifying {@code Options} and {@code storeId}. * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param options Indicates the options used for creating and obtaining the {@code KVStore} database, * including {@code isCreateIfMissing}, {@code isEncrypt}, and {@code KVStoreType}. * @param storeId Identifies the {@code KVStore} database. * The value of this parameter must be unique for the same application, * and different applications can share the same value. * @return Returns a {@code KVStore}, or {@code SingleKVStore}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 7 */ getKVStore(storeId: string, options: Options): Promise; getKVStore(storeId: string, options: Options, callback: AsyncCallback): void; @@ -2915,14 +2875,14 @@ declare namespace distributedData { * method, release the resources created for the database, for example, {@code KvStoreResultSet} for {@code SingleKvStore}, * otherwise closing the database will fail. If you are attempting to close a database that is already closed, an error * will be returned. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @param kvStore Indicates the {@code KvStore} database to close. * @throws Throws this exception if any of the following errors * occurs:{@code INVALID_ARGUMENT}, {@code ERVER_UNAVAILABLE}, * {@code STORE_NOT_OPEN}, {@code STORE_NOT_FOUND}, {@code DB_ERROR}, * {@code PERMISSION_DENIED}, and {@code IPC_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ closeKVStore(appId: string, storeId: string, kvStore: KVStore, callback: AsyncCallback): void; closeKVStore(appId: string, storeId: string, kvStore: KVStore): Promise; @@ -2934,13 +2894,14 @@ declare namespace distributedData { * *

You can use this method to delete a {@code KvStore} database not in use. After the database is deleted, all its data will be * lost. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @param storeId Identifies the {@code KvStore} database to delete. * @throws Throws this exception if any of the following errors * occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code STORE_NOT_FOUND}, * {@code DB_ERROR}, {@code PERMISSION_DENIED}, and {@code IPC_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ deleteKVStore(appId: string, storeId: string, callback: AsyncCallback): void; deleteKVStore(appId: string, storeId: string): Promise; @@ -2949,12 +2910,12 @@ declare namespace distributedData { * Obtains the storeId of all {@code KvStore} databases that are created by using the {@code getKvStore} method and not deleted by * calling the {@code deleteKvStore} method. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @returns Returns the storeId of all created {@code KvStore} databases. + * @returns Returns the storeId of all created {@code KvStore} databases. * @throws Throws this exception if any of the following errors * occurs: {@code SERVER_UNAVAILABLE}, {@code DB_ERROR}, * {@code PERMISSION_DENIED}, and {@code IPC_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ getAllKVStoreId(appId: string, callback: AsyncCallback): void; getAllKVStoreId(appId: string): Promise; @@ -2962,20 +2923,20 @@ declare namespace distributedData { /** * register DeviceChangeCallback to get notification when device's status changed * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deathCallback device change callback {@code DeviceChangeCallback} * @throws exception maybe occurs. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ on(event: 'distributedDataServiceDie', deathCallback: Callback): void; /** * unRegister DeviceChangeCallback and can not receive notification * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deathCallback device change callback {@code DeviceChangeCallback} which has been registered. * @throws exception maybe occurs. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ off(event: 'distributedDataServiceDie', deathCallback?: Callback): void; } @@ -2983,27 +2944,26 @@ declare namespace distributedData { /** * Provides interfaces to manage a {@code KVStoreV9} database, including obtaining, closing, and deleting the {@code KVStoreV9}. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @version 1 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ interface KVManagerV9 { /** * Creates and obtains a {@code KVStoreV9} database by specifying {@code Options} and {@code storeId}. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param options Indicates the options used for creating and obtaining the {@code KVStoreV9} database, * including {@code isCreateIfMissing}, {@code isEncrypt}, and {@code KVStoreType}. * @param storeId Identifies the {@code KVStoreV9} database. * The value of this parameter must be unique for the same application, * and different applications can share the same value. * @return Returns a {@code KVStoreV9}, or {@code SingleKVStoreV9}. - * @throws {BusinessError} if process failed. + * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100002 - if open existed database with changed options. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ getKVStore(storeId: string, options: Options): Promise; getKVStore(storeId: string, options: Options, callback: AsyncCallback): void; @@ -3014,16 +2974,15 @@ declare namespace distributedData { *

Warning: This method is not thread-safe. If you call this method to stop a KvStore database that is running, your * thread may crash. * - *

The {@code KvStoreV9} database to close must be an object created by using the {@code getKvStoreV9} method. Before using this + *

The {@code KvStoreV9} database to close must be an object created by using the {@code getKvStore} method. Before using this * method, release the resources created for the database, for example, {@code KvStoreResultSet} for {@code SingleKvStoreV9}, * otherwise closing the database will fail. If you are attempting to close a database that is already closed, an error * will be returned. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param kvStore Indicates the {@code KvStoreV9} database to close. - * @throws {BusinessError} if process failed. * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ closeKVStore(appId: string, storeId: string, kvStore: KVStoreV9, callback: AsyncCallback): void; closeKVStore(appId: string, storeId: string, kvStore: KVStoreV9): Promise; @@ -3035,25 +2994,24 @@ declare namespace distributedData { * *

You can use this method to delete a {@code KvStoreV9} database not in use. After the database is deleted, all its data will be * lost. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @param storeId Identifies the {@code KvStoreV9} database to delete. - * @throws {BusinessError} if process failed. - * @throws {BusinessError} 15100004 - if the database not exist when delete database or the data not exist when query or delete data. * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100004 - if the database not exist when delete database. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ deleteKVStore(appId: string, storeId: string, callback: AsyncCallback): void; deleteKVStore(appId: string, storeId: string): Promise; /** - * Obtains the storeId of all {@code KvStoreV9} databases that are created by using the {@code getKvStoreV9} method and not deleted by + * Obtains the storeId of all {@code KvStoreV9} databases that are created by using the {@code getKvStore} method and not deleted by * calling the {@code deleteKvStore} method. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @returns Returns the storeId of all created {@code KvStore} databases. - * @throws {BusinessError} if process failed. + * @returns Returns the storeId of all created {@code KvStoreV9} databases. * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 */ getAllKVStoreId(appId: string, callback: AsyncCallback): void; getAllKVStoreId(appId: string): Promise; @@ -3061,22 +3019,20 @@ declare namespace distributedData { /** * register DeviceChangeCallback to get notification when device's status changed * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deathCallback device change callback {@code DeviceChangeCallback} - * @throws {BusinessError} if process failed. * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 */ on(event: 'distributedDataServiceDie', deathCallback: Callback): void; /** * unRegister DeviceChangeCallback and can not receive notification * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deathCallback device change callback {@code DeviceChangeCallback} which has been registered. - * @throws {BusinessError} if process failed. * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 */ off(event: 'distributedDataServiceDie', deathCallback?: Callback): void; } -- Gitee From 04336959c0ef58cd2e8a545c1fd88590a865a694 Mon Sep 17 00:00:00 2001 From: wangtiantian Date: Sun, 9 Oct 2022 09:40:48 +0800 Subject: [PATCH 086/438] IssueNo:#I5UJZM Description:add freeinstall api Sig:SIG_ApplicaitonFramework Feature or Bugfix:Bugfix Binary Source:No Signed-off-by: wangtiantian --- api/@ohos.bundle.freeInstall.d.ts | 313 ++++++++++++++++++++ api/bundleManager/dispatchInfo.d.ts | 37 +++ api/bundleManager/packInfo.d.ts | 425 ++++++++++++++++++++++++++++ 3 files changed, 775 insertions(+) create mode 100644 api/@ohos.bundle.freeInstall.d.ts create mode 100644 api/bundleManager/dispatchInfo.d.ts create mode 100644 api/bundleManager/packInfo.d.ts diff --git a/api/@ohos.bundle.freeInstall.d.ts b/api/@ohos.bundle.freeInstall.d.ts new file mode 100644 index 0000000000..1d42117b9b --- /dev/null +++ b/api/@ohos.bundle.freeInstall.d.ts @@ -0,0 +1,313 @@ +/* + * 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 { AsyncCallback } from './basic'; +import { DispatchInfo as _DispatchInfo } from './bundleManager/dispatchInfo'; +import * as _PackInfo from './bundleManager/packInfo' + +/** + * Free install bundle manager. + * @namespace freeInstall + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ +declare namespace freeInstall { + /** + * Used to set the enumeration value of upgrading for free installation. + * @enum {number} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ + export enum UpgradeFlag { + /** + * Indicates module not need to be upgraded + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + NOT_UPGRADE = 0, + /** + * Indicates single module need to be upgraded + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + SINGLE_UPGRADE = 1, + /** + * Indicates relation module need to be upgraded + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + RELATION_UPGRADE = 2, + } + + /** + * Used to query the enumeration value of bundlePackInfo. + * @enum {number} + * @syscap SystemCapability.BundleManager.BundleFramework + * @systemapi + * @since 9 + */ + export enum BundlePackFlag { + /** + * Query all package information. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + GET_PACK_INFO_ALL = 0x00000000, + /** + * Query package information + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + GET_PACKAGES = 0x00000001, + /** + * Query the brief information of the package + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + GET_BUNDLE_SUMMARY = 0x00000002, + /** + * Query the brief information of the module. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + GET_MODULE_SUMMARY = 0x00000004, + } + + /** + * Sets wether to upgrade the module. + * @permission ohos.permission.INSTALL_BUNDLE + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { string } moduleName - Indicates the module name of the application. + * @param { UpgradeFlag } upgradeFlag - Indicates upgradeFlag of the application. + * @param { AsyncCallback } callback - The callback of setting module upgrade flag result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @throws { BusinessError } 17700002 - The specified module name is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ + function setHapModuleUpgradeFlag(bundleName: string, moduleName: string, upgradeFlag: UpgradeFlag, callback: AsyncCallback) : void; + + /** + * Sets wether to upgrade the module. + * @permission ohos.permission.INSTALL_BUNDLE + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { string } moduleName - Indicates the module name of the application. + * @param { UpgradeFlag } upgradeFlag - Indicates upgradeFlag of the application. + * @returns { Promise } - Return the result of setting module upgrade flag. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @throws { BusinessError } 17700002 - The specified module name is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ + function setHapModuleUpgradeFlag(bundleName: string, moduleName: string, upgradeFlag: UpgradeFlag): Promise; + + /** + * Checks whether a specified module is removable. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { string } moduleName - Indicates the module name of the application. + * @param { AsyncCallback } callback - The callback of checking module removable result.The result is true if the module is removable, false otherwise. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @throws { BusinessError } 17700002 - The specified module name is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ + function isHapModuleRemovable(bundleName: string, moduleName: string, callback: AsyncCallback): void; + + /** + * Checks whether a specified module is removable. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { string } moduleName - Indicates the module name of the application. + * @returns {Promise} Returns true if the module is removable; returns false otherwise. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @throws { BusinessError } 17700002 - The specified module name is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ + function isHapModuleRemovable(bundleName: string, moduleName: string): Promise; + + /** + * Obtains bundlePackInfo based on bundleName and bundleFlags. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { BundlePackFlag } bundlePackFlag - Indicates the application bundle pack flag to be queried. + * @param { AsyncCallback } callback - The callback of getting the BundlePackInfo object result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ + function getBundlePackInfo(bundleName: string, bundlePackFlag : BundlePackFlag, callback: AsyncCallback): void; + + /** + * Obtains bundlePackInfo based on bundleName and bundleFlags. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { BundlePackFlag } bundlePackFlag - Indicates the application bundle pack flag to be queried. + * @returns {Promise} Returns the BundlePackInfo object. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700001 - The specified bundle name is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ + function getBundlePackInfo(bundleName: string, bundlePackFlag : BundlePackFlag): Promise; + + /** + * Obtains information about the dispatcher version. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { AsyncCallback } callback - The callback of getting the dispatchInfo object for the current ability result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ + function getDispatchInfo(callback: AsyncCallback): void; + + /** + * Obtains information about the dispatcher version. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @returns { Promise } Returns the DispatchInfo object for the current ability. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ + function getDispatchInfo(): Promise; + + /** + * The dispatch info class. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ + export type DispatchInfo = _DispatchInfo; + + /** + * The bundle pack info class. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ + export type BundlePackInfo = _PackInfo.BundlePackInfo; + + /** + * The package info class. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ + export type PackageConfig = _PackInfo.PackageConfig; + + /** + * The package summary class. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ + export type PackageSummary = _PackInfo.PackageSummary; + + /** + * The bundle summary class. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ + export type BundleConfigInfo = _PackInfo.BundleConfigInfo; + + /** + * The extension ability forms class. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ + export type ExtensionAbility = _PackInfo.ExtensionAbility; + + /** + * The module summary of a bundle. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ + export type ModuleConfigInfo = _PackInfo.ModuleConfigInfo; + + /** + * The bundle info summary class. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ + export type ModuleDistroInfo = _PackInfo.ModuleDistroInfo; + + /** + * The ability info of a module. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ + export type ModuleAbilityInfo = _PackInfo.ModuleAbilityInfo; + + /** + * The form info of an ability. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ + export type AbilityFormInfo = _PackInfo.AbilityFormInfo; + + /** + * The bundle version class. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ + export type Version = _PackInfo.Version; + + /** + * The bundle Api version class. + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ + export type ApiVersion = _PackInfo.ApiVersion; +} + +export default freeInstall; diff --git a/api/bundleManager/dispatchInfo.d.ts b/api/bundleManager/dispatchInfo.d.ts new file mode 100644 index 0000000000..9f734e8d90 --- /dev/null +++ b/api/bundleManager/dispatchInfo.d.ts @@ -0,0 +1,37 @@ +/* + * 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. + */ + +/** + * Dispatch info related to free install + * @typedef DispatchInfo + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ +export interface DispatchInfo { + /** + * Indicates the dispatchInfo version + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly version: string; + + /** + * Indicates the free install interface version + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly dispatchAPIVersion: string; +} diff --git a/api/bundleManager/packInfo.d.ts b/api/bundleManager/packInfo.d.ts new file mode 100644 index 0000000000..8c5a359d39 --- /dev/null +++ b/api/bundleManager/packInfo.d.ts @@ -0,0 +1,425 @@ +/* + * 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. + */ + +/** + * The bundle pack info class. + * @typedef BundlePackInfo + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ +export interface BundlePackInfo { + /** + * This contains package information in pack.info + * @type {PackageConfig} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly packages: Array; + + /** + * This contains bundle summary information in pack.info + * @type {PackageSummary} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly summary: PackageSummary; +} + +/** + * PackageConfig: the package info class. + * @typedef PackageConfig + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ +export interface PackageConfig { + /** + * Indicates the device types of this package + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly deviceTypes: Array; + + /** + * Indicates the name of this package + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly name: string; + + /** + * Indicates the module type of this package + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly moduleType: string; + + /** + * Indicates whether this package is delivery and install + * @type {boolean} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly deliveryWithInstall: boolean; +} + +/** + * PackageSummary: the package summary class. + * @typedef PackageSummary + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ +export interface PackageSummary { + /** + * Indicates the bundle config info of this package + * @type {BundleConfigInfo} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly app: BundleConfigInfo; + + /** + * Indicates the modules config info of this package + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly modules: Array; +} + +/** + * BundleConfigInfo: the bundle summary class. + * @typedef BundleConfigInfo + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ +export interface BundleConfigInfo { + /** + * Indicates the name of this bundle + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly bundleName: string; + + /** + * Indicates the bundle version + * @type {Version} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly version: Version; +} + +/** + * ExtensionAbility: the extension ability forms class. + * @typedef ExtensionAbility + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ + export interface ExtensionAbility { + /** + * Indicates the name of this extension ability + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly name: string; + + /** + * Indicates the ability forms info + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly forms: Array; +} + +/** + * ModuleConfigInfo: the module summary of a bundle. + * @typedef ModuleConfigInfo + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ +export interface ModuleConfigInfo { + /** + * Indicates the name of main ability + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly mainAbility: string; + + /** + * Indicates the api version + * @type {ApiVersion} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly apiVersion: ApiVersion; + + /** + * Indicates the devices type + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly deviceTypes: Array; + + /** + * Indicates the module distro info + * @type {ModuleDistroInfo} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly distro: ModuleDistroInfo; + + /** + * Indicates the abilities info of this module + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly abilities: Array; + + /** + * Indicates extension abilities info of this module + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly extensionAbilities: Array; +} + +/** + * ModuleDistroInfo: the bundle info summary class. + * @typedef ModuleDistroInfo + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ +export interface ModuleDistroInfo { + /** + * Indicates whether this package is delivered with install + * @type {boolean} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly deliveryWithInstall: boolean; + + /** + * Indicates whether this package is free install + * @type {boolean} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly installationFree: boolean; + + /** + * Indicates the module name + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly moduleName: string; + + /** + * Indicates the module type + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly moduleType: string; +} + +/** + * ModuleAbilityInfo: the ability info of a module. + * @typedef ModuleAbilityInfo + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ +export interface ModuleAbilityInfo { + /** + * Indicates the name of this module ability + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly name: string; + + /** + * Indicates the label of this module ability + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly label: string; + + /** + * Indicates whether this ability is visible + * @type {boolean} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly visible: boolean; + + /** + * Indicates the ability forms info + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly forms: Array; +} + +/** + * AbilityFormInfo: the form info of an ability. + * @typedef AbilityFormInfo + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ +export interface AbilityFormInfo { + /** + * Indicates the name of this ability + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly name: string; + + /** + * Indicates the type of this ability + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly type: string; + + /** + * Indicates whether this form is enabled update + * @type {boolean} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly updateEnabled: boolean; + + /** + * Indicates the scheduled update time + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly scheduledUpdateTime: string; + + /** + * Indicates the update duration + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly updateDuration: number; + + /** + * Indicates the ability support dimensions + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly supportDimensions: Array; + + /** + * Indicates the ability default dimension + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly defaultDimension: string; +} + +/** + * Version: the bundle version class. + * @typedef Version + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ +export interface Version { + /** + * Indicates the min compatible code of this version + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly minCompatibleVersionCode: number; + + /** + * Indicates the name of this version + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly name: string; + + /** + * Indicates the code of this version + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly code: number; +} + +/** + * ApiVersion: the bundle Api version class. + * @typedef ApiVersion + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @systemapi + * @since 9 + */ +export interface ApiVersion { + /** + * Indicates the release type of the api + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly releaseType: string; + + /** + * Indicates the compatible version code of the api + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly compatible: number; + + /** + * Indicates the target version code of the api + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall + * @since 9 + */ + readonly target: number; +} -- Gitee From d7acbdbcbba84e1adc87aa1a7268dad47424c76c Mon Sep 17 00:00:00 2001 From: cold_yixiu Date: Thu, 13 Oct 2022 17:23:37 +0800 Subject: [PATCH 087/438] camera d.ts fix Signed-off-by: cold_yixiu --- api/@ohos.multimedia.camera.d.ts | 33 +++++++------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/api/@ohos.multimedia.camera.d.ts b/api/@ohos.multimedia.camera.d.ts index 96ad8c90d0..fbe6c9ee52 100644 --- a/api/@ohos.multimedia.camera.d.ts +++ b/api/@ohos.multimedia.camera.d.ts @@ -652,6 +652,13 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core */ enum CameraFormat { + /** + * RGBA 8888 Format. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + CAMERA_FORMAT_RGBA_8888 = 3, + /** * YUV 420 Format. * @since 9 @@ -779,23 +786,6 @@ declare namespace camera { FOCUS_STATE_UNFOCUSED = 2 } - /** - * Enum for exposure state. - * @since 9 - */ - enum ExposureState { - /** - * Scan state. - * @since 8 - */ - EXPOSURE_STATE_SCAN = 0, - /** - * Converged state. - * @since 8 - */ - EXPOSURE_STATE_CONVERGED = 1 - } - /** * Enum for video stabilization mode. * @since 9 @@ -1409,15 +1399,6 @@ declare namespace camera { */ 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. -- Gitee From 9cfcc87f9af3c53aa2837d0f9d78b82449e3f4db Mon Sep 17 00:00:00 2001 From: lutao Date: Thu, 13 Oct 2022 17:59:25 +0800 Subject: [PATCH 088/438] change hichecker js interface Signed-off-by: lutao --- api/@ohos.hichecker.d.ts | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/api/@ohos.hichecker.d.ts b/api/@ohos.hichecker.d.ts index 678b3b6a36..de5335a73f 100644 --- a/api/@ohos.hichecker.d.ts +++ b/api/@ohos.hichecker.d.ts @@ -55,6 +55,7 @@ declare namespace hichecker { * add one or more rule. * @param rule * @since 8 + * @deprecated since 9 * @syscap SystemCapability.HiviewDFX.HiChecker */ function addRule(rule: bigint) : void; @@ -63,6 +64,7 @@ declare namespace hichecker { * remove one or more rule. * @param rule * @since 8 + * @deprecated since 9 * @syscap SystemCapability.HiviewDFX.HiChecker */ function removeRule(rule: bigint) : void; @@ -80,8 +82,37 @@ declare namespace hichecker { * @param rule * @return the result of whether the query rule is added. * @since 8 + * @deprecated since 9 * @syscap SystemCapability.HiviewDFX.HiChecker */ function contains(rule: bigint) : boolean; + + /** + * add one or more rule. + * @param rule + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiChecker + * @throws {error} if the param is invalid + */ + function addRuleV9(rule: bigint) : void; + + /** + * remove one or more rule. + * @param rule + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiChecker + * @throws {error} if the param is invalid + */ + function removeRuleV9(rule: bigint) : void; + + /** + * whether the query rule is added + * @param rule + * @return the result of whether the query rule is added. + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiChecker + * @throws {error} if the param is invalid + */ + function containsV9(rule: bigint) : boolean; } export default hichecker; \ No newline at end of file -- Gitee From a93cb261ef2eec70b4b04d1121b488ffd1df6a0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E6=80=A1?= Date: Thu, 13 Oct 2022 11:20:58 +0000 Subject: [PATCH 089/438] bugfix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱天怡 --- api/@ohos.bundleState.d.ts | 2 +- api/@ohos.resourceschedule.usageStatistics.d.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/@ohos.bundleState.d.ts b/api/@ohos.bundleState.d.ts index a8b04d04fd..21955d409d 100644 --- a/api/@ohos.bundleState.d.ts +++ b/api/@ohos.bundleState.d.ts @@ -542,7 +542,7 @@ declare namespace bundleState { * @param end Indicates the end time of the query period, in milliseconds. * @return Returns the {@link BundleActiveEventState} object Array containing the event states data. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.queryDeviceEventStates + * @useinstead @ohos.resourceschedule.usageStatistics.queryDeviceEventStats */ function queryBundleActiveEventStates(begin: number, end: number, callback: AsyncCallback>): void; function queryBundleActiveEventStates(begin: number, end: number): Promise>; diff --git a/api/@ohos.resourceschedule.usageStatistics.d.ts b/api/@ohos.resourceschedule.usageStatistics.d.ts index df43c3e20c..e0f69a0702 100644 --- a/api/@ohos.resourceschedule.usageStatistics.d.ts +++ b/api/@ohos.resourceschedule.usageStatistics.d.ts @@ -162,7 +162,7 @@ declare namespace usageStatistics { /** * the form usage record list of current module. */ - formRecords: Array; + formRecords: Array; } /** @@ -614,8 +614,8 @@ declare namespace usageStatistics { * @throws { BusinessError } 10000007 - Get system or actual time failed. * @return Returns the {@link DeviceEventStats} object Array containing the event states data. */ - function queryDeviceEventStates(begin: number, end: number, callback: AsyncCallback>): void; - function queryDeviceEventStates(begin: number, end: number): Promise>; + function queryDeviceEventStats(begin: number, end: number, callback: AsyncCallback>): void; + function queryDeviceEventStats(begin: number, end: number): Promise>; /** * Queries app notification number within a specified period identified by the start and end time. -- Gitee From 44da35fb4e531cafbf2c32719298406393eae189 Mon Sep 17 00:00:00 2001 From: xuyong Date: Thu, 13 Oct 2022 19:37:56 +0800 Subject: [PATCH 090/438] =?UTF-8?q?hiSysEvent=20napi=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuyong --- api/@ohos.hiSysEvent.d.ts | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/api/@ohos.hiSysEvent.d.ts b/api/@ohos.hiSysEvent.d.ts index 4e0f662108..495c1362b4 100644 --- a/api/@ohos.hiSysEvent.d.ts +++ b/api/@ohos.hiSysEvent.d.ts @@ -110,6 +110,15 @@ declare namespace hiSysEvent { * @static * @param {SysEventInfo} info system event information to be written. * @param {AsyncCallback} [callback] callback function. + * @throws {BusinessError} 401 - argument is invalid + * @throws {BusinessError} 11200001 - domain is invalid + * @throws {BusinessError} 11200002 - event name is invalid + * @throws {BusinessError} 11200003 - environment is abnormal + * @throws {BusinessError} 11200004 - size of event content is over limit + * @throws {BusinessError} 11200051 - name of param is invalid + * @throws {BusinessError} 11200052 - size of string type param is over limit + * @throws {BusinessError} 11200053 - count of params is over limit + * @throws {BusinessError} 11200054 - size of array type param is over limit * @return {void | Promise} no callback return Promise otherwise return void. * @since 9 */ @@ -277,11 +286,10 @@ declare namespace 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. * @return {void} return void. * @since 9 */ - onQuery: (infos: SysEventInfo[], seqs: number[]) => void; + onQuery: (infos: SysEventInfo[]) => void; /** * notify Querier execute query has finished. @@ -303,10 +311,14 @@ declare namespace hiSysEvent { * @systemapi hide for inner use * @permission ohos.permission.READ_DFX_SYSEVENT * @param {Watcher} watcher watch system event - * @return {number} 0 success, 1 fail + * @throws {BusinessError} 201 - has no permission + * @throws {BusinessError} 401 - argument is invalid + * @throws {BusinessError} 11200101 - count of watchers is over limit + * @throws {BusinessError} 11200102 - count of watch rules is over limit + * @return {void} return void. * @since 9 */ - function addWatcher(watcher: Watcher): number; + function addWatcher(watcher: Watcher): void; /** * remove watcher @@ -315,10 +327,13 @@ declare namespace hiSysEvent { * @systemapi hide for inner use * @permission ohos.permission.READ_DFX_SYSEVENT * @param {Watcher} watcher watch system event - * @return {number} 0 success, 1 fail + * @throws {BusinessError} 201 - has no permission + * @throws {BusinessError} 401 - argument is invalid + * @throws {BusinessError} 11200201 - watcher is not exist + * @return {void} return void. * @since 9 */ - function removeWatcher(watcher: Watcher): number; + function removeWatcher(watcher: Watcher): void; /** * query system event @@ -329,10 +344,16 @@ declare namespace hiSysEvent { * @param {QueryArg} queryArg common arguments of query system event * @param {QueryRule[]} rules rule of query system event * @param {Querier} querier receive query result - * @return {number} 0 success, 1 fail + * @throws {BusinessError} 201 - has no permission + * @throws {BusinessError} 401 - argument is invalid + * @throws {BusinessError} 11200301 - count of query rules is over limit + * @throws {BusinessError} 11200302 - query rule is invalid + * @throws {BusinessError} 11200303 - count of concurrent queries is over limit + * @throws {BusinessError} 11200304 - frequency of event query is over limit + * @return {void} return void. * @since 9 */ - function query(queryArg: QueryArg, rules: QueryRule[], querier: Querier): number; + function query(queryArg: QueryArg, rules: QueryRule[], querier: Querier): void; } -export default hiSysEvent; \ No newline at end of file +export default hiSysEvent; -- Gitee From 0525b1aeed38b476dd725b0888b5d14363c0812c Mon Sep 17 00:00:00 2001 From: ltdong Date: Thu, 13 Oct 2022 12:18:39 +0000 Subject: [PATCH 091/438] update api/@ohos.data.rdb.d.ts. Signed-off-by: ltdong --- api/@ohos.data.rdb.d.ts | 2351 ++++++++++++++++++++++----------------- 1 file changed, 1348 insertions(+), 1003 deletions(-) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index 08401044d1..2a44b7290a 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -22,28 +22,47 @@ import dataSharePredicates from './@ohos.data.dataSharePredicates'; /** * Provides methods for rdbStore create and delete. * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @import import data_rdb from '@ohos.data.rdb'; + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 */ declare namespace rdb { - /** + /** * Obtains an RDB store. * * You can set parameters of the RDB store as required. In general, this method is recommended * to obtain a rdb store. * + * @param {Context} context - Indicates the context of application or capability. + * @param {StoreConfig} config - Indicates the {@link StoreConfig} configuration of the database related to this RDB store. + * @param {number} version - Indicates the database version for upgrade or downgrade. + * @param {AsyncCallback} callback - the RDB store {@link RdbStoreV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @throws {BusinessError} 14800010 - if failed open database by invalid database name + * @throws {BusinessError} 14800011 - if failed open database by database corrupted + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 - * @useinstead getRdbStoreV9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param context Indicates the context of application or capability. - * @param config Indicates the configuration of the database related to this RDB store. The configurations include - * the database path, storage mode, and whether the database is read-only. - * @param version Indicates the database version for upgrade or downgrade. - * @return Returns an RDB store {@link ohos.data.rdb.RdbStore}. */ function getRdbStore(context: Context, config: StoreConfig, version: number, callback: AsyncCallback): void; + + /** + * Obtains an RDB store. + * + * You can set parameters of the RDB store as required. In general, this method is recommended + * to obtain a rdb store. + * + * @param {Context} context - Indicates the context of application or capability. + * @param {StoreConfig} config - Indicates the {@link StoreConfig} configuration of the database related to this RDB store. + * @param {number} version - Indicates the database version for upgrade or downgrade. + * @returns {Promise} the RDB store {@link RdbStoreV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @throws {BusinessError} 14800010 - if failed open database by invalid database name + * @throws {BusinessError} 14800011 - if failed open database by database corrupted + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ function getRdbStore(context: Context, config: StoreConfig, version: number): Promise; /** @@ -52,48 +71,83 @@ declare namespace rdb { * You can set parameters of the RDB store as required. In general, this method is recommended * to obtain a rdb store. * - * @since 9 + * @param {Context} context - Indicates the context of application or capability. + * @param {StoreConfig} config - Indicates the {@link StoreConfig} configuration of the database related to this RDB store. + * @param {number} version - Indicates the database version for upgrade or downgrade. + * @param {AsyncCallback} callback - the RDB store {@link RdbStoreV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @throws {BusinessError} 14800010 - if failed open database by invalid database name + * @throws {BusinessError} 14800011 - if failed open database by database corrupted * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param context Indicates the context of application or capability. - * @param config Indicates the configuration of the database related to this RDB store. The configurations include - * the database path, storage mode, and whether the database is read-only. - * @param version Indicates the database version for upgrade or downgrade. - * @return Returns an RDB store {@link ohos.data.rdb.RdbStore}. - * @throws {BusinessError} if process failed - * @errorcode 14800010 Invalid database name - * @errorcode 14800011 Database corrupted - * @errorcode 401 Parameter error. + * @since 9 */ function getRdbStoreV9(context: Context, config: StoreConfig, version: number, callback: AsyncCallback): void; + + /** + * Obtains an RDB store. + * + * You can set parameters of the RDB store as required. In general, this method is recommended + * to obtain a rdb store. + * + * @param {Context} context - Indicates the context of application or capability. + * @param {StoreConfig} config - Indicates the {@link StoreConfig} configuration of the database related to this RDB store. + * @param {number} version - Indicates the database version for upgrade or downgrade. + * @returns {Promise} the RDB store {@link RdbStoreV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @throws {BusinessError} 14800010 - if failed open database by invalid database name + * @throws {BusinessError} 14800011 - if failed open database by database corrupted + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ function getRdbStoreV9(context: Context, config: StoreConfig, version: number): Promise; - /** + /** * Deletes the database with a specified name. * + * @param {Context} context - Indicates the context of application or capability. + * @param {string} name - Indicates the database name. + * @param {AsyncCallback} callback - the callback of deleteRdbStore. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 - * @useinstead deleteRdbStoreV9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param context Indicates the context of application or capability. - * @param name Indicates the database name. - * @return Returns true if the database is deleted; returns false otherwise. */ function deleteRdbStore(context: Context, name: string, callback: AsyncCallback): void; + /** + * Deletes the database with a specified name. + * + * @param {Context} context - Indicates the context of application or capability. + * @param {string} name - Indicates the database name. + * @returns {Promise} the promise returned by the function. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ function deleteRdbStore(context: Context, name: string): Promise; /** * Deletes the database with a specified name. * + * @param {Context} context - Indicates the context of application or capability. + * @param {string} name - Indicates the database name. + * @param {AsyncCallback} callback - the callback of deleteRdbStore. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @throws {BusinessError} 14800010 - if failed delete database by invalid database name + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param context Indicates the context of application or capability. - * @param name Indicates the database name. - * @return Returns true if the database is deleted; returns false otherwise. - * @throws {BusinessError} if process failed - * @errorcode 14800010 Invalid database name - * @errorcode 401 Parameter error. */ function deleteRdbStoreV9(context: Context, name: string, callback: AsyncCallback): void; + + /** + * Deletes the database with a specified name. + * + * @param {Context} context - Indicates the context of application or capability. + * @param {string} name - Indicates the database name. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @throws {BusinessError} 14800010 - if failed delete database by invalid database name + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ function deleteRdbStoreV9(context: Context, name: string): Promise; /** @@ -135,259 +189,361 @@ declare namespace rdb { */ SUBSCRIBE_TYPE_REMOTE = 0, } - - /** - * Provides methods for managing the relational database (RDB). - * - * This class provides methods for creating, querying, updating, and deleting RDBs. + + /** + * Describes the {@code RdbStoreV9} type. * - * @since 7 - * @deprecated since 9 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @import import data_rdb from '@ohos.data.rdb'; + * @since 9 */ - interface RdbStore { + enum SecurityLevel { /** - * Inserts a row of data into the target table. + * S0: mains the db is public. + * There is no impact even if the data is leaked. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param table Indicates the target table. - * @param values Indicates the row of data to be inserted into the table. - * @return Returns the row ID if the operation is successful; returns -1 otherwise. + * @since 9 */ - insert(table: string, values: ValuesBucket, callback: AsyncCallback): void; - insert(table: string, values: ValuesBucket): Promise; + S0 = 0, /** - * Inserts a batch of data into the target table. + * S1: mains the db is low level security + * There are some low impact, when the data is leaked. * - * @since 9 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param table Indicates the target table. - * @param values Indicates the rows of data to be inserted into the table. - * @return Returns the number of values that were inserted if the operation is successful; returns -1 otherwise. + * @since 9 */ - batchInsert(table: string, values: Array, callback: AsyncCallback): void; - batchInsert(table: string, values: Array): Promise; + S1 = 1, /** - * Updates data in the database based on a a specified instance object of rdbPredicates. + * S2: mains the db is middle level security + * There are some major impact, when the data is leaked. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param values Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. - * @param predicates Indicates the specified update condition by the instance object of RdbPredicates. - * @return Returns the number of affected rows. + * @since 9 */ - update(values: ValuesBucket, predicates: RdbPredicates, callback: AsyncCallback): void; - update(values: ValuesBucket, predicates: RdbPredicates): Promise; + S2 = 2, /** - * Updates data in the database based on a a specified instance object of DataSharePredicates. + * S3: mains the db is high level security + * There are some severity impact, when the data is leaked. * - * @since 9 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @systemapi - * @param table Indicates the target table. - * @param values Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. - * @param predicates Indicates the specified update condition by the instance object of DataSharePredicates. - * @return Returns the number of affected rows. + * @since 9 */ - update(table: string, values: ValuesBucket, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; - update(table: string, values: ValuesBucket, predicates: dataSharePredicates.DataSharePredicates): Promise; - + S3 = 3, + /** - * Deletes data from the database based on a specified instance object of rdbPredicates. + * S4: mains the db is critical level security + * There are some critical impact, when the data is leaked. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param predicates Indicates the specified delete condition by the instance object of RdbPredicates. - * @return Returns the number of affected rows. + * @since 9 */ - delete(predicates: RdbPredicates, callback: AsyncCallback): void; - delete(predicates: RdbPredicates): Promise; + S4 = 4, + } + /** + * Provides methods for managing the relational database (RDB). + * + * This class provides methods for creating, querying, updating, and deleting RDBs. + * + * @import import data_rdb from '@ohos.data.rdb'; + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + interface RdbStore { /** - * Deletes data from the database based on a specified instance object of DataSharePredicates. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @systemapi - * @param table Indicates the target table. - * @param predicates Indicates the specified delete condition by the instance object of DataSharePredicates. - * @return Returns the number of affected rows. - */ - delete(table: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; - delete(table: string, predicates: dataSharePredicates.DataSharePredicates): Promise; + * Inserts a row of data into the target table. + * + * @param {string} table - Indicates the row of data to be inserted into the table. + * @param {ValuesBucket} values - Indicates the row of data {@link ValuesBucket} to be inserted into the table. + * @param {AsyncCallback} callback - the row ID if the operation is successful. returns -1 otherwise. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + insert(table: string, values: ValuesBucket, callback: AsyncCallback): void; + + /** + * Inserts a row of data into the target table. + * + * @param {string} table - Indicates the row of data to be inserted into the table. + * @param {ValuesBucket} values - Indicates the row of data {@link ValuesBucket} to be inserted into the table. + * @returns {Promise} return the row ID if the operation is successful. return -1 otherwise. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + insert(table: string, values: ValuesBucket): Promise; /** - * Queries data in the database based on specified conditions. - * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param predicates Indicates the specified query condition by the instance object of RdbPredicates. - * @param columns Indicates the columns to query. If the value is null, the query applies to all columns. - * @return Returns a ResultSet object if the operation is successful; - */ - query(predicates: RdbPredicates, columns: Array, callback: AsyncCallback): void; - query(predicates: RdbPredicates, columns?: Array): Promise; + * Inserts a batch of data into the target table. + * + * @param {string} table - Indicates the target table. + * @param {Array} values - Indicates the rows of data {@link ValuesBucket} to be inserted into the table. + * @param {AsyncCallback} callback - the number of values that were inserted if the operation is successful. returns -1 otherwise. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + batchInsert(table: string, values: Array, callback: AsyncCallback): void; + + /** + * Inserts a batch of data into the target table. + * + * @param {string} table - Indicates the target table. + * @param {Array} values - Indicates the rows of data {@link ValuesBucket} to be inserted into the table. + * @returns {Promise} return the number of values that were inserted if the operation is successful. returns -1 otherwise. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + batchInsert(table: string, values: Array): Promise; /** - * Queries data in the database based on specified conditions. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @systemapi - * @param table Indicates the target table. - * @param predicates Indicates the specified query condition by the instance object of DataSharePredicates. - * @param columns Indicates the columns to query. If the value is null, the query applies to all columns. - * @return Returns a ResultSet object if the operation is successful; - */ - query(table: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array, callback: AsyncCallback): void; - query(table: string, predicates: dataSharePredicates.DataSharePredicates, columns?: Array): Promise; + * Updates data in the database based on a a specified instance object of RdbPredicates. + * + * @param {ValuesBucket} values - Indicates Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. + * @param {RdbPredicates} predicates - Indicates the specified update condition by the instance object of {@link RdbPredicates}. + * @param {AsyncCallback} callback - the number of affected rows. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + update(values: ValuesBucket, predicates: RdbPredicates, callback: AsyncCallback): void; /** - * Queries remote data in the database based on specified conditions before Synchronizing Data. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param device Indicates specified remote device. - * @param table Indicates the target table. - * @param predicates Indicates the specified remote query condition by the instance object of RdbPredicates. - * @param columns Indicates the columns to remote query. If the value is null, the remote query applies to all columns. - * @return Returns a ResultSet object if the operation is successful; - */ - remoteQuery(device: string, table: string, predicates: RdbPredicates, columns: Array, callback: AsyncCallback): void; - remoteQuery(device: string, table: string, predicates: RdbPredicates, columns: Array): Promise; + * Updates data in the database based on a a specified instance object of RdbPredicates. + * + * @param {ValuesBucket} values - Indicates Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. + * @param {RdbPredicates} predicates - Indicates the specified update condition by the instance object of {@link RdbPredicates}. + * @returns {Promise} return the number of affected rows. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + update(values: ValuesBucket, predicates: RdbPredicates): Promise; + /** + * Deletes data from the database based on a specified instance object of RdbPredicates. + * + * @param {RdbPredicates} predicates - the specified delete condition by the instance object of {@link RdbPredicates}. + * @param {AsyncCallback} callback - the number of affected rows. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + delete(predicates: RdbPredicates, callback: AsyncCallback): void; + + /** + * Deletes data from the database based on a specified instance object of RdbPredicates. + * + * @param {RdbPredicates} predicates - the specified delete condition by the instance object of {@link RdbPredicates}. + * @returns {Promise} return the number of affected rows. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + delete(predicates: RdbPredicates): Promise; /** - * Queries data in the database based on SQL statement. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param sql Indicates the SQL statement to execute. - * @param bindArgs Indicates the values of the parameters in the SQL statement. The values are strings. - * @return Returns a ResultSet object if the operation is successful; - */ + * Queries data in the database based on specified conditions. + * + * @param {RdbPredicates} predicates - the specified query condition by the instance object of {@link RdbPredicates}. + * @param {Array} columns - the columns to query. If the value is empty array, the query applies to all columns. + * @param {AsyncCallback} callback - the {@link ResultSet} object if the operation is successful. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + query(predicates: RdbPredicates, columns: Array, callback: AsyncCallback): void; + + /** + * Queries data in the database based on specified conditions. + * + * @param {RdbPredicates} predicates - the specified query condition by the instance object of {@link RdbPredicates}. + * @param {Array} columns - the columns to query. If the value is null, the query applies to all columns. + * @returns {Promise} return the {@link ResultSet} object if the operation is successful. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + query(predicates: RdbPredicates, columns?: Array): Promise; + + /** + * Deletes data from the database based on a specified instance object of RdbPredicates. + * + * @param {string} sql - Indicates the SQL statement to execute. + * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. + * @returns {Promise} return the {@link ResultSet} object if the operation is successful. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ querySql(sql: string, bindArgs: Array, callback: AsyncCallback): void; + + /** + * Deletes data from the database based on a specified instance object of RdbPredicates. + * + * @param {string} sql - Indicates the SQL statement to execute. + * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. + * @returns {Promise} return the {@link ResultSet} object if the operation is successful. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ querySql(sql: string, bindArgs?: Array): Promise; /** - * Executes an SQL statement that contains specified parameters but returns no value. - * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param sql Indicates the SQL statement to execute. - * @param bindArgs Indicates the values of the parameters in the SQL statement. The values are strings. - */ + * Executes an SQL statement that contains specified parameters but returns no value. + * + * @param {string} sql - Indicates the SQL statement to execute. + * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. + * @param {AsyncCallback} callback - the callback of executeSql. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ executeSql(sql: string, bindArgs: Array, callback: AsyncCallback): void; + + /** + * Executes an SQL statement that contains specified parameters but returns no value. + * + * @param {string} sql - Indicates the SQL statement to execute. + * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. + * @returns {Promise} the promise returned by the function. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ executeSql(sql: string, bindArgs?: Array): Promise; /** - * beginTransaction before excute your sql - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - */ + * beginTransaction before excute your sql. + * + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ beginTransaction():void; /** - * commit the the sql you have excuted. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - */ + * commit the the sql you have excuted. + * + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ commit():void; /** - * roll back the sql you have already excuted - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - */ + * roll back the sql you have already excuted. + * + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ rollBack():void; /** - * Backs up a database in a specified name. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param destName Indicates the name that saves the database backup. - */ - backup(destName:string, callback: AsyncCallback):void; - backup(destName:string): Promise; - - /** - * Restores a database from a specified database file. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param srcName Indicates the name that saves the database file. - */ - restore(srcName:string, callback: AsyncCallback):void; - restore(srcName:string): Promise; - - /** - * Set table to be distributed table. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param tables the tables name you want to set + * Set table to be distributed table. + * * @permission ohos.permission.DISTRIBUTED_DATASYNC - */ + * @param {Array} tables - Indicates the tables name you want to set. + * @param {AsyncCallback} callback - the callback of setDistributedTables. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ setDistributedTables(tables: Array, callback: AsyncCallback): void; + + /** + * Set table to be distributed table. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param {Array} tables - Indicates the tables name you want to set. + * @returns {Promise} the promise returned by the function. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ setDistributedTables(tables: Array): Promise; /** - * Obtain distributed table name of specified remote device according to local table name. + * Obtain distributed table name of specified remote device according to local table name. * When query remote device database, distributed table name is needed. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param device Indicates the remote device. - * @param table Indicates the local table name. + * * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @return the distributed table name. - */ + * @param {string} device - Indicates the remote device. + * @param {AsyncCallback} callback - {string}: the distributed table name. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ obtainDistributedTableName(device: string, table: string, callback: AsyncCallback): void; + + /** + * Obtain distributed table name of specified remote device according to local table name. + * When query remote device database, distributed table name is needed. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param {string} device - Indicates the remote device. + * @returns {Promise} {string}: the distributed table name. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ obtainDistributedTableName(device: string, table: string): Promise; /** - * Sync data between devices - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param mode Indicates the synchronization mode. The value can be PUSH, PULL. - * @param predicates Constraint synchronized data and devices. - * @param callback Indicates the callback used to send the synchronization result to the caller. + * Sync data between devices. + * * @permission ohos.permission.DISTRIBUTED_DATASYNC - */ + * @param {string} device - Indicates the remote device. + * @param {AsyncCallback>} callback - {Array<[string, number]>}: devices sync status array, {string}: device id, {number}: device sync status. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ sync(mode: SyncMode, predicates: RdbPredicates, callback: AsyncCallback>): void; + + /** + * Sync data between devices. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param {string} device - Indicates the remote device. + * @returns {Promise>} {Array<[string, number]>}: devices sync status array, {string}: device id, {number}: device sync status. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ sync(mode: SyncMode, predicates: RdbPredicates): Promise>; /** - * Registers an observer for the database. When data in the distributed database changes, + * Registers an observer for the database. When data in the distributed database changes, * the callback will be invoked. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. - * @param observer Indicates the observer of data change events in the distributed database. - * @permission ohos.permission.DISTRIBUTED_DATASYNC - */ + * + * @param {string} event - Indicates the event must be string 'dataChange'. + * @param {SubscribeType} type - Indicates the subscription type, which is defined in {@link SubscribeType}. + * @param {AsyncCallback>} observer - {Array}: the observer of data change events in the distributed database. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ on(event: 'dataChange', type: SubscribeType, observer: Callback>): void; /** - * Remove specified observer of specified type from the database. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. - * @param observer Indicates the data change observer already registered. - * @permission ohos.permission.DISTRIBUTED_DATASYNC - */ + * Remove specified observer of specified type from the database. + * + * @param {string} event - Indicates the event must be string 'dataChange'. + * @param {SubscribeType} type - Indicates the subscription type, which is defined in {@link SubscribeType}. + * @param {AsyncCallback>} observer - {Array}: the data change observer already registered. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ off(event:'dataChange', type: SubscribeType, observer: Callback>): void; } @@ -396,308 +552,467 @@ declare namespace rdb { * * This class provides methods for creating, querying, updating, and deleting RDBs. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @import import data_rdb from '@ohos.data.rdb'; + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 */ interface RdbStoreV9 { - /** - * Inserts a row of data into the target table. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param table Indicates the target table. - * @param values Indicates the row of data to be inserted into the table. - * @return Returns the row ID if the operation is successful; returns -1 otherwise. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + /** + * Inserts a row of data into the target table. + * + * @param {string} table - Indicates the row of data to be inserted into the table. + * @param {ValuesBucket} values - Indicates the row of data {@link ValuesBucket} to be inserted into the table. + * @param {AsyncCallback} callback - the row ID if the operation is successful. returns -1 otherwise. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ insert(table: string, values: ValuesBucket, callback: AsyncCallback): void; + + /** + * Inserts a row of data into the target table. + * + * @param {string} table - Indicates the row of data to be inserted into the table. + * @param {ValuesBucket} values - Indicates the row of data {@link ValuesBucket} to be inserted into the table. + * @returns {Promise} return the row ID if the operation is successful. return -1 otherwise. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ insert(table: string, values: ValuesBucket): Promise; - /** - * Inserts a batch of data into the target table. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param table Indicates the target table. - * @param values Indicates the rows of data to be inserted into the table. - * @return Returns the number of values that were inserted if the operation is successful; returns -1 otherwise. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + /** + * Inserts a batch of data into the target table. + * + * @param {string} table - Indicates the target table. + * @param {Array} values - Indicates the rows of data {@link ValuesBucket} to be inserted into the table. + * @param {AsyncCallback} callback - the number of values that were inserted if the operation is successful. returns -1 otherwise. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ batchInsert(table: string, values: Array, callback: AsyncCallback): void; + + /** + * Inserts a batch of data into the target table. + * + * @param {string} table - Indicates the target table. + * @param {Array} values - Indicates the rows of data {@link ValuesBucket} to be inserted into the table. + * @returns {Promise} return the number of values that were inserted if the operation is successful. returns -1 otherwise. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ batchInsert(table: string, values: Array): Promise; - /** - * Updates data in the database based on a a specified instance object of RdbPredicatesV9. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param values Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. - * @param predicates Indicates the specified update condition by the instance object of RdbPredicatesV9. - * @return Returns the number of affected rows. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + /** + * Updates data in the database based on a a specified instance object of RdbPredicatesV9. + * + * @param {ValuesBucket} values - Indicates Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. + * @param {RdbPredicatesV9} predicates - Indicates the specified update condition by the instance object of {@link RdbPredicatesV9}. + * @param {AsyncCallback} callback - the number of affected rows. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ update(values: ValuesBucket, predicates: RdbPredicatesV9, callback: AsyncCallback): void; + + /** + * Updates data in the database based on a a specified instance object of RdbPredicatesV9. + * + * @param {ValuesBucket} values - Indicates Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. + * @param {RdbPredicatesV9} predicates - Indicates the specified update condition by the instance object of {@link RdbPredicatesV9}. + * @returns {Promise} return the number of affected rows. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ update(values: ValuesBucket, predicates: RdbPredicatesV9): Promise; - /** - * Updates data in the database based on a a specified instance object of DataSharePredicates. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @systemapi - * @param table Indicates the target table. - * @param values Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. - * @param predicates Indicates the specified update condition by the instance object of DataSharePredicates. - * @return Returns the number of affected rows. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + /** + * Updates data in the database based on a a specified instance object of RdbPredicatesV9. + * + * @param {string} table - Indicates the target table. + * @param {ValuesBucket} values - Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. + * @param {DataSharePredicates} predicates - Indicates the specified update condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. + * @param {AsyncCallback} callback - the number of affected rows. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ update(table: string, values: ValuesBucket, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; + + /** + * Updates data in the database based on a a specified instance object of RdbPredicatesV9. + * + * @param {string} table - Indicates the target table. + * @param {ValuesBucket} values - Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. + * @param {DataSharePredicates} predicates - Indicates the specified update condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. + * @returns {Promise} return the number of affected rows. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ update(table: string, values: ValuesBucket, predicates: dataSharePredicates.DataSharePredicates): Promise; - /** - * Deletes data from the database based on a specified instance object of RdbPredicatesV9. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param predicates Indicates the specified delete condition by the instance object of RdbPredicatesV9. - * @return Returns the number of affected rows. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + /** + * Deletes data from the database based on a specified instance object of RdbPredicatesV9. + * + * @param {RdbPredicatesV9} predicates - the specified delete condition by the instance object of {@link RdbPredicatesV9}. + * @param {AsyncCallback} callback - the number of affected rows. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ delete(predicates: RdbPredicatesV9, callback: AsyncCallback): void; + + /** + * Deletes data from the database based on a specified instance object of RdbPredicatesV9. + * + * @param {RdbPredicatesV9} predicates - the specified delete condition by the instance object of {@link RdbPredicatesV9}. + * @returns {Promise} return the number of affected rows. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ delete(predicates: RdbPredicatesV9): Promise; - /** - * Deletes data from the database based on a specified instance object of DataSharePredicates. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @systemapi - * @param table Indicates the target table. - * @param predicates Indicates the specified delete condition by the instance object of DataSharePredicates. - * @return Returns the number of affected rows. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + /** + * Deletes data from the database based on a specified instance object of RdbPredicatesV9. + * + * @param {string} table - Indicates the target table. + * @param {DataSharePredicates} predicates - the specified delete condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. + * @param {AsyncCallback} callback - the number of affected rows. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ delete(table: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; + + /** + * Deletes data from the database based on a specified instance object of RdbPredicatesV9. + * + * @param {string} table - Indicates the target table. + * @param {DataSharePredicates} predicates - the specified delete condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. + * @param {AsyncCallback} callback - the number of affected rows. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ delete(table: string, predicates: dataSharePredicates.DataSharePredicates): Promise; - /** - * Queries data in the database based on specified conditions. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param predicates Indicates the specified query condition by the instance object of RdbPredicatesV9. - * @param columns Indicates the columns to query. If the value is null, the query applies to all columns. - * @return Returns a ResultSetV9 object if the operation is successful; - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + /** + * Queries data in the database based on specified conditions. + * + * @param {RdbPredicatesV9} predicates - the specified query condition by the instance object of {@link RdbPredicatesV9}. + * @param {Array} columns - the columns to query. If the value is empty array, the query applies to all columns. + * @param {AsyncCallback} callback - the {@link ResultSetV9} object if the operation is successful. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ query(predicates: RdbPredicatesV9, columns: Array, callback: AsyncCallback): void; + + /** + * Queries data in the database based on specified conditions. + * + * @param {RdbPredicatesV9} predicates - the specified query condition by the instance object of {@link RdbPredicatesV9}. + * @param {Array} columns - the columns to query. If the value is null, the query applies to all columns. + * @returns {Promise} return the {@link ResultSetV9} object if the operation is successful. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ query(predicates: RdbPredicatesV9, columns?: Array): Promise; - /** - * Queries data in the database based on specified conditions. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @systemapi - * @param table Indicates the target table. - * @param predicates Indicates the specified query condition by the instance object of DataSharePredicates. - * @param columns Indicates the columns to query. If the value is null, the query applies to all columns. - * @return Returns a ResultSet object if the operation is successful; - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + /** + * Queries data in the database based on specified conditions. + * + * @param {string} table - Indicates the target table. + * @param {dataSharePredicates.DataSharePredicates} predicates - the specified query condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. + * @param {Array} columns - the columns to query. If the value is empty array, the query applies to all columns. + * @param {AsyncCallback} callback - the {@link ResultSetV9} object if the operation is successful. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ query(table: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array, callback: AsyncCallback): void; - query(table: string, predicates: dataSharePredicates.DataSharePredicates, columns?: Array): Promise; /** - * Queries remote data in the database based on specified conditions before Synchronizing Data. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param device Indicates specified remote device. - * @param table Indicates the target table. - * @param predicates Indicates the specified remote query condition by the instance object of RdbPredicatesV9. - * @param columns Indicates the columns to remote query. If the value is null, the remote query applies to all columns. - * @return Returns a ResultSetV9 object if the operation is successful; - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + * Queries data in the database based on specified conditions. + * + * @param {string} table - Indicates the target table. + * @param {dataSharePredicates.DataSharePredicates} predicates - the specified query condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. + * @param {Array} columns - the columns to query. If the value is null, the query applies to all columns. + * @returns {Promise} return the {@link ResultSetV9} object if the operation is successful. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + query(table: string, predicates: dataSharePredicates.DataSharePredicates, columns?: Array): Promise; + + /** + * Queries remote data in the database based on specified conditions before Synchronizing Data. + * + * @param {string} device - Indicates specified remote device. + * @param {string} table - Indicates the target table. + * @param {RdbPredicatesV9} predicates - the specified remote remote query condition by the instance object of {@link RdbPredicatesV9}. + * @param {Array} columns - the columns to remote query. If the value is empty array, the remote query applies to all columns. + * @param {AsyncCallback} callback - the {@link ResultSetV9} object if the operation is successful. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ remoteQuery(device: string, table: string, predicates: RdbPredicatesV9, columns: Array, callback: AsyncCallback): void; + + /** + * Queries remote data in the database based on specified conditions before Synchronizing Data. + * + * @param {string} device - Indicates specified remote device. + * @param {string} table - Indicates the target table. + * @param {RdbPredicatesV9} predicates - the specified remote remote query condition by the instance object of {@link RdbPredicatesV9}. + * @param {Array} columns - the columns to remote query. If the value is empty array, the remote query applies to all columns. + * @returns {Promise} return the {@link ResultSetV9} object if the operation is successful. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ remoteQuery(device: string, table: string, predicates: RdbPredicatesV9, columns: Array): Promise; - /** - * Queries data in the database based on SQL statement. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param sql Indicates the SQL statement to execute. - * @param bindArgs Indicates the values of the parameters in the SQL statement. The values are strings. - * @return Returns a ResultSetV9 object if the operation is successful; - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + /** + * Queries data in the database based on SQL statement. + * + * @param {string} sql - Indicates the SQL statement to execute. + * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. + * @param {AsyncCallback} callback - the {@link ResultSetV9} object if the operation is successful. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ querySql(sql: string, bindArgs: Array, callback: AsyncCallback): void; + + /** + * Deletes data from the database based on a specified instance object of RdbPredicatesV9. + * + * @param {string} sql - Indicates the SQL statement to execute. + * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. + * @returns {Promise} return the {@link ResultSetV9} object if the operation is successful. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ querySql(sql: string, bindArgs?: Array): Promise; - /** - * Executes an SQL statement that contains specified parameters but returns no value. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param sql Indicates the SQL statement to execute. - * @param bindArgs Indicates the values of the parameters in the SQL statement. The values are strings. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + /** + * Executes an SQL statement that contains specified parameters but returns no value. + * + * @param {string} sql - Indicates the SQL statement to execute. + * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. + * @param {AsyncCallback} callback - the callback of executeSql. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ executeSql(sql: string, bindArgs: Array, callback: AsyncCallback): void; + + /** + * Executes an SQL statement that contains specified parameters but returns no value. + * + * @param {string} sql - Indicates the SQL statement to execute. + * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ executeSql(sql: string, bindArgs?: Array): Promise; - /** - * beginTransaction before excute your sql - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @throws {BusinessError} if process failed - */ + /** + * beginTransaction before excute your sql. + * + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ beginTransaction():void; - /** - * commit the the sql you have excuted. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @throws {BusinessError} if process failed - */ + /** + * commit the the sql you have excuted. + * + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ commit():void; /** - * roll back the sql you have already excuted - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @throws {BusinessError} if process failed - */ + * roll back the sql you have already excuted. + * + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ rollBack():void; - /** - * Backs up a database in a specified name. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param destName Indicates the name that saves the database backup. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + /** + * Backs up a database in a specified name. + * + * @param {string} destName - Indicates the name that saves the database backup. + * @param {AsyncCallback} callback - the callback of backup. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ backup(destName:string, callback: AsyncCallback):void; + + /** + * Backs up a database in a specified name. + * + * @param {string} destName - Indicates the name that saves the database backup. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ backup(destName:string): Promise; - /** - * Restores a database from a specified database file. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param srcName Indicates the name that saves the database file. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + /** + * Restores a database from a specified database file. + * + * @param {string} srcName - Indicates the name that saves the database file. + * @param {AsyncCallback} callback - the callback of restore. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ restore(srcName:string, callback: AsyncCallback):void; + + /** + * Restores a database from a specified database file. + * + * @param {string} srcName - Indicates the name that saves the database file. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ restore(srcName:string): Promise; - /** - * Set table to be distributed table. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param tables the tables name you want to set + /** + * Set table to be distributed table. + * * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + * @param {Array} tables - Indicates the tables name you want to set. + * @param {AsyncCallback} callback - the callback of setDistributedTables. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ setDistributedTables(tables: Array, callback: AsyncCallback): void; + + /** + * Set table to be distributed table. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param {Array} tables - Indicates the tables name you want to set. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ setDistributedTables(tables: Array): Promise; - /** - * Obtain distributed table name of specified remote device according to local table name. + /** + * Obtain distributed table name of specified remote device according to local table name. * When query remote device database, distributed table name is needed. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param device Indicates the remote device. - * @param table Indicates the local table name. + * * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @return the distributed table name. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + * @param {string} device - Indicates the remote device. + * @param {AsyncCallback} callback - {string}: the distributed table name. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ obtainDistributedTableName(device: string, table: string, callback: AsyncCallback): void; + + /** + * Obtain distributed table name of specified remote device according to local table name. + * When query remote device database, distributed table name is needed. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param {string} device - Indicates the remote device. + * @returns {Promise} {string}: the distributed table name. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ obtainDistributedTableName(device: string, table: string): Promise; - /** - * Sync data between devices - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param mode Indicates the synchronization mode. The value can be PUSH, PULL. - * @param predicates Constraint synchronized data and devices. - * @param callback Indicates the callback used to send the synchronization result to the caller. + /** + * Sync data between devices. + * * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + * @param {string} device - Indicates the remote device. + * @param {AsyncCallback>} callback - {Array<[string, number]>}: devices sync status array, {string}: device id, {number}: device sync status. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ sync(mode: SyncMode, predicates: RdbPredicatesV9, callback: AsyncCallback>): void; + + /** + * Sync data between devices. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param {string} device - Indicates the remote device. + * @returns {Promise>} {Array<[string, number]>}: devices sync status array, {string}: device id, {number}: device sync status. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ sync(mode: SyncMode, predicates: RdbPredicatesV9): Promise>; - /** - * Registers an observer for the database. When data in the distributed database changes, + /** + * Registers an observer for the database. When data in the distributed database changes, * the callback will be invoked. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. - * @param observer Indicates the observer of data change events in the distributed database. - * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + * + * @param {string} event - Indicates the event must be string 'dataChange'. + * @param {SubscribeType} type - Indicates the subscription type, which is defined in {@link SubscribeType}. + * @param {AsyncCallback>} observer - {Array}: the observer of data change events in the distributed database. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ on(event: 'dataChange', type: SubscribeType, observer: Callback>): void; - /** - * Remove specified observer of specified type from the database. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. - * @param observer Indicates the data change observer already registered. - * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + /** + * Remove specified observer of specified type from the database. + * + * @param {string} event - Indicates the event must be string 'dataChange'. + * @param {SubscribeType} type - Indicates the subscription type, which is defined in {@link SubscribeType}. + * @param {AsyncCallback>} observer - {Array}: the data change observer already registered. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ off(event:'dataChange', type: SubscribeType, observer: Callback>): void; } /** * Indicates possible value types * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @import import data_rdb from '@ohos.data.rdb'; + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 */ type ValueType = number | string | boolean; /** * Values in buckets are stored in key-value pairs * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @import import data_rdb from '@ohos.data.rdb'; + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 */ type ValuesBucket = { [key: string]: ValueType | Uint8Array | null; @@ -706,19 +1021,47 @@ declare namespace rdb { /** * Manages relational database configurations. * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @import import data_rdb from '@ohos.data.rdb'; + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 */ interface StoreConfig { name: string; - - /** + } + + /** + * Manages relational database configurations. + * + * @import import data_rdb from '@ohos.data.rdb'; + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + interface StoreConfigV9 { + /** + * The database name. + * + * @import import data_rdb from '@ohos.data.rdb'; + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + name: string; + + /** * Specifies whether the database is encrypted. * - * @since 9 + * @import import data_rdb from '@ohos.data.rdb'; * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + securityLevel: SecurityLevel; + + /** + * Specifies whether the database is encrypted. + * * @import import data_rdb from '@ohos.data.rdb'; + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 */ encrypt?: boolean; } @@ -726,782 +1069,784 @@ declare namespace rdb { /** * Manages relational database configurations. * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @import import data_rdb from '@ohos.data.rdb'; + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 */ class RdbPredicates { /** - * A parameterized constructor used to create an RdbPredicates instance. - * name Indicates the table name of the database. - * + * A parameterized constructor used to create an RdbPredicates instance. + * + * @param {string} name - Indicates the table name of the database. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @deprecated since 9 */ constructor(name: string) - /** - * Specify remote devices when syncing distributed database. - * - * @note When query database, this function should not be called. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param devices Indicates specified remote devices. - * @return Returns the RdbPredicates self. - */ + /** + * Sync data between devices. + * + * @note When query database, this function should not be called. + * @param {Array} devices - Indicates specified remote devices. + * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ inDevices(devices: Array): RdbPredicates; /** - * Specify all remote devices which connect to local device when syncing distributed database. - * - * @note When query database, this function should not be called. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @return Returns the RdbPredicates self. - */ + * Specify all remote devices which connect to local device when syncing distributed database. + * + * @note When query database, this function should not be called. + * @returns {RdbPredicates} - the {@link RdbPredicates} self. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ inAllDevices(): RdbPredicates; /** - * Configures the RdbPredicates to match the field whose data type is ValueType and value is equal + * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is equal * to a specified value. - * - * @note This method is similar to = of the SQL statement. - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with the RdbPredicates. - * @return Returns the RdbPredicates that match the specified field. - */ + * + * @note This method is similar to = of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. + * @returns {RdbPredicates} - the {@link RdbPredicates} self. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ equalTo(field: string, value: ValueType): RdbPredicates; - /** - * Configures the RdbPredicates to match the field whose data type is ValueType and value is unequal to + /** + * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is unequal to * a specified value. - * - * @note This method is similar to != of the SQL statement. - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with the RdbPredicates. - * @return Returns the RdbPredicates that match the specified field. - */ + * + * @note This method is similar to != of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. + * @returns {RdbPredicates} - the {@link RdbPredicates} self. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ notEqualTo(field: string, value: ValueType): RdbPredicates; /** - * Adds a left parenthesis to the RdbPredicates. - * - * @note This method is similar to ( of the SQL statement and needs to be used together with endWrap(). - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @return Returns the RdbPredicates with the left parenthesis. - */ + * Adds a left parenthesis to the RdbPredicates. + * + * @note This method is similar to ( of the SQL statement and needs to be used together with endWrap(). + * @returns {RdbPredicates} - the {@link RdbPredicates} with the left parenthesis. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ beginWrap(): RdbPredicates; - /** - * Adds a right parenthesis to the RdbPredicates. - * - * @note This method is similar to ) of the SQL statement and needs to be used together + /** + * Adds a right parenthesis to the RdbPredicates. + * + * @note This method is similar to ) of the SQL statement and needs to be used together * with beginWrap(). - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @return Returns the RdbPredicates with the right parenthesis. - */ + * @returns {RdbPredicates} - the {@link RdbPredicates} with the right parenthesis. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ endWrap(): RdbPredicates; /** * Adds an or condition to the RdbPredicates. * * @note This method is similar to or of the SQL statement. - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @return Returns the RdbPredicates with the or condition. + * @return Returns the {@link RdbPredicates} with the or condition. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 */ or(): RdbPredicates; - - /** + /** * Adds an and condition to the RdbPredicates. * - * @note This method is similar to and of the SQL statement. - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @return Returns the RdbPredicates with the and condition. + * @note This method is similar to or of the SQL statement. + * @return Returns the {@link RdbPredicates} with the or condition. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 */ and(): RdbPredicates; /** - * Configures the RdbPredicates to match the field whose data type is string and value + * Configures the RdbPredicates to match the field whose data type is string and value * contains a specified value. - * - * @note This method is similar to contains of the SQL statement. - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with the RdbPredicates. - * @return Returns the RdbPredicates that match the specified field. - */ + * + * @note This method is similar to contains of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. + * @returns {RdbPredicates} - the {@link RdbPredicates} self. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ contains(field: string, value: string): RdbPredicates; /** - * Configures the RdbPredicates to match the field whose data type is string and value starts + * Configures the RdbPredicates to match the field whose data type is string and value starts * with a specified string. - * - * @note This method is similar to value% of the SQL statement. - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with the RdbPredicates. - * @return Returns the RdbPredicates that match the specified field. - */ + * + * @note This method is similar to value% of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. + * @returns {RdbPredicates} - the {@link RdbPredicates} self. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ beginsWith(field: string, value: string): RdbPredicates; /** - * Configures the RdbPredicates to match the field whose data type is string and value + * Configures the RdbPredicates to match the field whose data type is string and value * ends with a specified string. - * - * @note This method is similar to %value of the SQL statement. - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with the RdbPredicates. - * @return Returns the RdbPredicates that match the specified field. - */ + * + * @note This method is similar to %value of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. + * @returns {RdbPredicates} - the {@link RdbPredicates} self. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ endsWith(field: string, value: string): RdbPredicates; /** - * Configures the RdbPredicates to match the fields whose value is null. - * - * @note This method is similar to is null of the SQL statement. - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name in the database table. - * @return Returns the RdbPredicates that match the specified field. - */ + * Configures the RdbPredicates to match the fields whose value is null. + * + * @note This method is similar to is null of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @returns {RdbPredicates} - the {@link RdbPredicates} self. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ isNull(field: string): RdbPredicates; /** - * Configures the RdbPredicates to match the specified fields whose value is not null. - * - * @note This method is similar to is not null of the SQL statement. - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name in the database table. - * @return Returns the RdbPredicates that match the specified field. - */ + * Configures the RdbPredicates to match the specified fields whose value is not null. + * + * @note This method is similar to is not null of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @returns {RdbPredicates} - the {@link RdbPredicates} self. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ isNotNull(field: string): RdbPredicates; /** - * Configures the RdbPredicates to match the fields whose data type is string and value is + * Configures the RdbPredicates to match the fields whose data type is string and value is * similar to a specified string. - * - * @note This method is similar to like of the SQL statement. - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with the RdbPredicates. The percent sign (%) in the value - * is a wildcard (like * in a regular expression). - * @return Returns the RdbPredicates that match the specified field. - */ + * + * @note This method is similar to like of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. + * @returns {RdbPredicates} - the {@link RdbPredicates} that match the specified field. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ like(field: string, value: string): RdbPredicates; /** - * Configures RdbPredicates to match the specified field whose data type is string and the value contains + * Configures RdbPredicates to match the specified field whose data type is string and the value contains * a wildcard. - * - * @note Different from like, the input parameters of this method are case-sensitive. - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with RdbPredicates. - * @return Returns the SQL statement with the specified RdbPredicates. - */ + * + * @note Different from like, the input parameters of this method are case-sensitive. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. + * @returns {RdbPredicates} - the SQL statement with the specified {@link RdbPredicates}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ glob(field: string, value: string): RdbPredicates; /** - * Restricts the value of the field to the range between low value and high value. - * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name. - * @param low Indicates the minimum value. - * @param high Indicates the maximum value. - * @return Returns the SQL query statement with the specified RdbPredicates. - */ + * Configures RdbPredicates to match the specified field whose data type is string and the value contains + * a wildcard. + * + * @param {string} field - Indicates the column name. + * @param {ValueType} low - Indicates the minimum value. + * @param {ValueType} high - Indicates the maximum value. + * @returns {RdbPredicates} - the SQL statement with the specified {@link RdbPredicates}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ between(field: string, low: ValueType, high: ValueType): RdbPredicates; /** - * Configures RdbPredicates to match the specified field whose data type is int and value is + * Configures RdbPredicates to match the specified field whose data type is int and value is * out of a given range. - * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name in the database table. - * @param low Indicates the minimum value to match with DataAbilityPredicates. - * @param high Indicates the maximum value to match with DataAbilityPredicates. - * @return Returns the SQL query statement with the specified RdbPredicates. - */ + * + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} low - Indicates the minimum value. + * @param {ValueType} high - Indicates the maximum value to. + * @returns {RdbPredicates} - the SQL statement with the specified {@link RdbPredicates}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ notBetween(field: string, low: ValueType, high: ValueType): RdbPredicates; /** - * Restricts the value of the field to be greater than the specified value. - * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name. - * @param value Indicates the String field. - * @return Returns the SQL query statement with the specified RdbPredicates. - */ + * Restricts the value of the field to be greater than the specified value. + * + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. + * @returns {RdbPredicates} - the SQL query statement with the specified {@link RdbPredicates}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ greaterThan(field: string, value: ValueType): RdbPredicates; /** - * Restricts the value of the field to be smaller than the specified value. - * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name. - * @param value Indicates the String field. - * @return Returns the SQL query statement with the specified RdbPredicates. - */ + * Restricts the value of the field to be smaller than the specified value. + * + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. + * @returns {RdbPredicates} - the SQL query statement with the specified {@link RdbPredicates}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ lessThan(field: string, value: ValueType): RdbPredicates; /** - * Restricts the value of the field to be greater than or equal to the specified value. - * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name. - * @param value Indicates the String field. - * @return Returns the SQL query statement with the specified RdbPredicates. - */ + * Restricts the value of the field to be greater than or equal to the specified value. + * + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. + * @returns {RdbPredicates} - the SQL query statement with the specified {@link RdbPredicates}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ greaterThanOrEqualTo(field: string, value: ValueType): RdbPredicates; /** - * Restricts the value of the field to be smaller than or equal to the specified value. - * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name. - * @param value Indicates the String field. - * @return Returns the SQL query statement with the specified RdbPredicates. - */ + * Restricts the value of the field to be smaller than or equal to the specified value. + * + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. + * @returns {RdbPredicates} - the SQL query statement with the specified {@link RdbPredicates}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ lessThanOrEqualTo(field: string, value: ValueType): RdbPredicates; /** - * Restricts the ascending order of the return list. When there are several orders, + * Restricts the ascending order of the return list. When there are several orders, * the one close to the head has the highest priority. - * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name for sorting the return list. - * @return Returns the SQL query statement with the specified RdbPredicates. - */ + * + * @param {string} field - Indicates the column name for sorting the return list. + * @returns {RdbPredicates} - the SQL query statement with the specified {@link RdbPredicates}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ orderByAsc(field: string): RdbPredicates; /** - * Restricts the descending order of the return list. When there are several orders, + * Restricts the descending order of the return list. When there are several orders, * the one close to the head has the highest priority. - * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name for sorting the return list. - * @return Returns the SQL query statement with the specified RdbPredicates. - */ + * + * @param {string} field - Indicates the column name for sorting the return list. + * @returns {RdbPredicates} - the SQL query statement with the specified {@link RdbPredicates}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ orderByDesc(field: string): RdbPredicates; /** - * Restricts each row of the query result to be unique. - * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @return Returns the SQL query statement with the specified RdbPredicates. - */ + * Restricts each row of the query result to be unique. + * + * @returns {RdbPredicates} - the SQL query statement with the specified {@link RdbPredicates}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ distinct(): RdbPredicates; /** - * Restricts the max number of return records. - * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param value Indicates the max length of the return list. - * @return Returns the SQL query statement with the specified RdbPredicates. - */ + * Restricts the max number of return records. + * + * @param {number} value - Indicates the max length of the return list. + * @returns {RdbPredicates} - the SQL query statement with the specified {@link RdbPredicates}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ limitAs(value: number): RdbPredicates; /** - * Configures RdbPredicates to specify the start position of the returned result. + * Configures RdbPredicatesV9 to specify the start position of the returned result. * * @note Use this method together with limit(int). - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param rowOffset Indicates the start position of the returned result. The value is a positive integer. - * @return Returns the SQL query statement with the specified AbsPredicates. - */ + * @param {number} rowOffset - Indicates the start position of the returned result. The value is a positive integer. + * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ offsetAs(rowOffset: number): RdbPredicates; /** - * Configures RdbPredicates to group query results by specified columns. + * Configures RdbPredicatesV9 to group query results by specified columns. * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param fields Indicates the specified columns by which query results are grouped. - * @return Returns the RdbPredicates with the specified columns by which query results are grouped. - */ + * @param {Array} fields - Indicates the specified columns by which query results are grouped. + * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ groupBy(fields: Array): RdbPredicates; /** - * Configures RdbPredicates to specify the index column. + * Configures RdbPredicatesV9 to specify the index column. * * @note Before using this method, you need to create an index column. - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param indexName Indicates the name of the index column. - * @return Returns RdbPredicates with the specified index column. - */ + * @param {string} field - Indicates the name of the index column. + * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ indexedBy(field: string): RdbPredicates; /** - * Configures RdbPredicates to match the specified field whose data type is ValueType array and values + * Configures RdbPredicatesV9 to match the specified field whose data type is ValueType array and values * are within a given range. * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name in the database table. - * @param values Indicates the values to match with RdbPredicates. - * @return Returns RdbPredicates that matches the specified field. - */ + * @param {string} field - Indicates the column name in the database table. + * @param {Array} value - Indicates the values to match with {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ in(field: string, value: Array): RdbPredicates; /** - * Configures RdbPredicates to match the specified field whose data type is ValueType array and values + * Configures RdbPredicatesV9 to match the specified field whose data type is ValueType array and values * are out of a given range. * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name in the database table. - * @param values Indicates the values to match with RdbPredicates. - * @return Returns RdbPredicates that matches the specified field. - */ + * @param {string} field - Indicates the column name in the database table. + * @param {Array} value - Indicates the values to match with {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ notIn(field: string, value: Array): RdbPredicates; } /** * Manages relational database configurations. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @import import data_rdb from '@ohos.data.rdb'; + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 */ class RdbPredicatesV9 { - /** - * A parameterized constructor used to create an RdbPredicates instance. - * name Indicates the table name of the database. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + /** + * A parameterized constructor used to create an RdbPredicates instance. + * + * @param {string} name - Indicates the table name of the database. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ constructor(name: string) - /** - * Specify remote devices when syncing distributed database. - * - * @note When query database, this function should not be called. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param devices Indicates specified remote devices. - * @return Returns the RdbPredicatesV9 self. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + /** + * Sync data between devices. + * + * @note When query database, this function should not be called. + * @param {Array} devices - Indicates specified remote devices. + * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ inDevices(devices: Array): RdbPredicatesV9; - /** - * Specify all remote devices which connect to local device when syncing distributed database. - * - * @note When query database, this function should not be called. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @return Returns the RdbPredicatesV9 self. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + /** + * Specify all remote devices which connect to local device when syncing distributed database. + * + * @note When query database, this function should not be called. + * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ inAllDevices(): RdbPredicatesV9; - /** - * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is equal + /** + * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is equal * to a specified value. - * - * @note This method is similar to = of the SQL statement. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with the RdbPredicatesV9. - * @return Returns the RdbPredicatesV9 that match the specified field. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + * + * @note This method is similar to = of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ equalTo(field: string, value: ValueType): RdbPredicatesV9; - /** - * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is unequal to + /** + * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is unequal to * a specified value. - * - * @note This method is similar to != of the SQL statement. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with the RdbPredicatesV9. - * @return Returns the RdbPredicatesV9 that match the specified field. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + * + * @note This method is similar to != of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ notEqualTo(field: string, value: ValueType): RdbPredicatesV9; - /** - * Adds a left parenthesis to the RdbPredicatesV9. - * - * @note This method is similar to ( of the SQL statement and needs to be used together with endWrap(). - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @return Returns the RdbPredicatesV9 with the left parenthesis. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + /** + * Adds a left parenthesis to the RdbPredicatesV9. + * + * @note This method is similar to ( of the SQL statement and needs to be used together with endWrap(). + * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} with the left parenthesis. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ beginWrap(): RdbPredicatesV9; - /** - * Adds a right parenthesis to the RdbPredicatesV9. - * - * @note This method is similar to ) of the SQL statement and needs to be used together + /** + * Adds a right parenthesis to the RdbPredicatesV9. + * + * @note This method is similar to ) of the SQL statement and needs to be used together * with beginWrap(). - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @return Returns the RdbPredicatesV9 with the right parenthesis. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} with the right parenthesis. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ endWrap(): RdbPredicatesV9; /** * Adds an or condition to the RdbPredicatesV9. * * @note This method is similar to or of the SQL statement. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @return Returns the RdbPredicatesV9 with the or condition. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. + * @return Returns the {@link RdbPredicatesV9} with the or condition. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 */ or(): RdbPredicatesV9; - /** + /** * Adds an and condition to the RdbPredicatesV9. * - * @note This method is similar to and of the SQL statement. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @return Returns the RdbPredicatesV9 with the and condition. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. + * @note This method is similar to or of the SQL statement. + * @return Returns the {@link RdbPredicatesV9} with the or condition. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 */ and(): RdbPredicatesV9; - /** - * Configures the RdbPredicatesV9 to match the field whose data type is string and value + /** + * Configures the RdbPredicatesV9 to match the field whose data type is string and value * contains a specified value. - * - * @note This method is similar to contains of the SQL statement. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with the RdbPredicatesV9. - * @return Returns the RdbPredicatesV9 that match the specified field. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + * + * @note This method is similar to contains of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ contains(field: string, value: string): RdbPredicatesV9; - /** - * Configures the RdbPredicatesV9 to match the field whose data type is string and value starts + /** + * Configures the RdbPredicatesV9 to match the field whose data type is string and value starts * with a specified string. - * - * @note This method is similar to value% of the SQL statement. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with the RdbPredicatesV9. - * @return Returns the RdbPredicatesV9 that match the specified field. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + * + * @note This method is similar to value% of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ beginsWith(field: string, value: string): RdbPredicatesV9; - /** - * Configures the RdbPredicatesV9 to match the field whose data type is string and value + /** + * Configures the RdbPredicatesV9 to match the field whose data type is string and value * ends with a specified string. - * - * @note This method is similar to %value of the SQL statement. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with the RdbPredicatesV9. - * @return Returns the RdbPredicatesV9 that match the specified field. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + * + * @note This method is similar to %value of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ endsWith(field: string, value: string): RdbPredicatesV9; - - /** - * Configures the RdbPredicatesV9 to match the fields whose value is null. - * - * @note This method is similar to is null of the SQL statement. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name in the database table. - * @return Returns the RdbPredicatesV9 that match the specified field. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + + /** + * Configures the RdbPredicatesV9 to match the fields whose value is null. + * + * @note This method is similar to is null of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ isNull(field: string): RdbPredicatesV9; - /** - * Configures the RdbPredicatesV9 to match the specified fields whose value is not null. - * - * @note This method is similar to is not null of the SQL statement. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name in the database table. - * @return Returns the RdbPredicatesV9 that match the specified field. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + /** + * Configures the RdbPredicatesV9 to match the specified fields whose value is not null. + * + * @note This method is similar to is not null of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ isNotNull(field: string): RdbPredicatesV9; - /** - * Configures the RdbPredicatesV9 to match the fields whose data type is string and value is + /** + * Configures the RdbPredicatesV9 to match the fields whose data type is string and value is * similar to a specified string. - * - * @note This method is similar to like of the SQL statement. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with the RdbPredicatesV9. The percent sign (%) in the value - * is a wildcard (like * in a regular expression). - * @return Returns the RdbPredicatesV9 that match the specified field. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + * + * @note This method is similar to like of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} that match the specified field. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ like(field: string, value: string): RdbPredicatesV9; - /** - * Configures RdbPredicatesV9 to match the specified field whose data type is string and the value contains + /** + * Configures RdbPredicatesV9 to match the specified field whose data type is string and the value contains * a wildcard. - * - * @note Different from like, the input parameters of this method are case-sensitive. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name in the database table. - * @param value Indicates the value to match with RdbPredicatesV9. - * @return Returns the SQL statement with the specified RdbPredicatesV9. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + * + * @note Different from like, the input parameters of this method are case-sensitive. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ glob(field: string, value: string): RdbPredicatesV9; - /** - * Restricts the value of the field to the range between low value and high value. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name. - * @param low Indicates the minimum value. - * @param high Indicates the maximum value. - * @return Returns the SQL query statement with the specified RdbPredicatesV9. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + /** + * Configures RdbPredicatesV9 to match the specified field whose data type is string and the value contains + * a wildcard. + * + * @param {string} field - Indicates the column name. + * @param {ValueType} low - Indicates the minimum value. + * @param {ValueType} high - Indicates the maximum value. + * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ between(field: string, low: ValueType, high: ValueType): RdbPredicatesV9; - /** - * Configures RdbPredicatesV9 to match the specified field whose data type is int and value is + /** + * Configures RdbPredicatesV9 to match the specified field whose data type is int and value is * out of a given range. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name in the database table. - * @param low Indicates the minimum value to match with DataAbilityPredicates. - * @param high Indicates the maximum value to match with DataAbilityPredicates. - * @return Returns the SQL query statement with the specified RdbPredicatesV9. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + * + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} low - Indicates the minimum value. + * @param {ValueType} high - Indicates the maximum value to. + * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ notBetween(field: string, low: ValueType, high: ValueType): RdbPredicatesV9; - /** - * Restricts the value of the field to be greater than the specified value. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name. - * @param value Indicates the String field. - * @return Returns the SQL query statement with the specified RdbPredicatesV9. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + /** + * Restricts the value of the field to be greater than the specified value. + * + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ greaterThan(field: string, value: ValueType): RdbPredicatesV9; - /** - * Restricts the value of the field to be smaller than the specified value. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name. - * @param value Indicates the String field. - * @return Returns the SQL query statement with the specified RdbPredicatesV9. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + + /** + * Restricts the value of the field to be smaller than the specified value. + * + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ lessThan(field: string, value: ValueType): RdbPredicatesV9; - /** - * Restricts the value of the field to be greater than or equal to the specified value. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name. - * @param value Indicates the String field. - * @return Returns the SQL query statement with the specified RdbPredicatesV9. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + /** + * Restricts the value of the field to be greater than or equal to the specified value. + * + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ greaterThanOrEqualTo(field: string, value: ValueType): RdbPredicatesV9; - /** - * Restricts the value of the field to be smaller than or equal to the specified value. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name. - * @param value Indicates the String field. - * @return Returns the SQL query statement with the specified RdbPredicatesV9. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + /** + * Restricts the value of the field to be smaller than or equal to the specified value. + * + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ lessThanOrEqualTo(field: string, value: ValueType): RdbPredicatesV9; - /** - * Restricts the ascending order of the return list. When there are several orders, + /** + * Restricts the ascending order of the return list. When there are several orders, * the one close to the head has the highest priority. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name for sorting the return list. - * @return Returns the SQL query statement with the specified RdbPredicatesV9. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + * + * @param {string} field - Indicates the column name for sorting the return list. + * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ orderByAsc(field: string): RdbPredicatesV9; - /** - * Restricts the descending order of the return list. When there are several orders, + /** + * Restricts the descending order of the return list. When there are several orders, * the one close to the head has the highest priority. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name for sorting the return list. - * @return Returns the SQL query statement with the specified RdbPredicatesV9. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + * + * @param {string} field - Indicates the column name for sorting the return list. + * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ orderByDesc(field: string): RdbPredicatesV9; - /** - * Restricts each row of the query result to be unique. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @return Returns the SQL query statement with the specified RdbPredicatesV9. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + /** + * Restricts each row of the query result to be unique. + * + * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ distinct(): RdbPredicatesV9; - /** - * Restricts the max number of return records. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param value Indicates the max length of the return list. - * @return Returns the SQL query statement with the specified RdbPredicatesV9. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + /** + * Restricts the max number of return records. + * + * @param {number} value - Indicates the max length of the return list. + * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ limitAs(value: number): RdbPredicatesV9; - /** - * Configures RdbPredicatesV9 to specify the start position of the returned result. + /** + * Configures RdbPredicatesV9 to specify the start position of the returned result. * * @note Use this method together with limit(int). - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param rowOffset Indicates the start position of the returned result. The value is a positive integer. - * @return Returns the SQL query statement with the specified AbsPredicates. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + * @param {number} rowOffset - Indicates the start position of the returned result. The value is a positive integer. + * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ offsetAs(rowOffset: number): RdbPredicatesV9; - /** - * Configures RdbPredicatesV9 to group query results by specified columns. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param fields Indicates the specified columns by which query results are grouped. - * @return Returns the RdbPredicatesV9 with the specified columns by which query results are grouped. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + /** + * Configures RdbPredicatesV9 to group query results by specified columns. + * + * @param {Array} fields - Indicates the specified columns by which query results are grouped. + * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ groupBy(fields: Array): RdbPredicatesV9; - /** - * Configures RdbPredicatesV9 to specify the index column. + /** + * Configures RdbPredicatesV9 to specify the index column. * * @note Before using this method, you need to create an index column. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param indexName Indicates the name of the index column. - * @return Returns RdbPredicatesV9 with the specified index column. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + * @param {string} field - Indicates the name of the index column. + * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ indexedBy(field: string): RdbPredicatesV9; - /** - * Configures RdbPredicatesV9 to match the specified field whose data type is ValueType array and values + /** + * Configures RdbPredicatesV9 to match the specified field whose data type is ValueType array and values * are within a given range. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name in the database table. - * @param values Indicates the values to match with RdbPredicatesV9. - * @return Returns RdbPredicatesV9 that matches the specified field. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + * @param {string} field - Indicates the column name in the database table. + * @param {Array} value - Indicates the values to match with {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ in(field: string, value: Array): RdbPredicatesV9; - /** - * Configures RdbPredicatesV9 to match the specified field whose data type is ValueType array and values + /** + * Configures RdbPredicatesV9 to match the specified field whose data type is ValueType array and values * are out of a given range. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param field Indicates the column name in the database table. - * @param values Indicates the values to match with RdbPredicatesV9. - * @return Returns RdbPredicatesV9 that matches the specified field. - * @throws {BusinessError} if process failed - * @errorcode 401 Parameter error. - */ + * @param {string} field - Indicates the column name in the database table. + * @param {Array} value - Indicates the values to match with {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ notIn(field: string, value: Array): RdbPredicatesV9; } -- Gitee From 878cfb1cea40d099273db141d2db0a608b9322ee Mon Sep 17 00:00:00 2001 From: ltdong Date: Thu, 13 Oct 2022 12:22:48 +0000 Subject: [PATCH 092/438] update api/data/rdb/resultSet.d.ts. Signed-off-by: ltdong --- api/data/rdb/resultSet.d.ts | 284 +++++++++++++++++------------------- 1 file changed, 134 insertions(+), 150 deletions(-) diff --git a/api/data/rdb/resultSet.d.ts b/api/data/rdb/resultSet.d.ts index 9bdb3f9511..07199de374 100755 --- a/api/data/rdb/resultSet.d.ts +++ b/api/data/rdb/resultSet.d.ts @@ -13,24 +13,23 @@ * limitations under the License. */ -import { AsyncCallback } from '../../basic' - /** * Provides methods for accessing a database result set generated by querying the database. * + * @import import data_rdb from '@ohos.data.rdb'; + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @import import data_rdb from '@ohos.data.rdb'; */ -export default interface ResultSet { + interface ResultSet { + /** * Obtains the names of all columns in a result set. * * @note The column names are returned as a string array, in which the strings are in the same order * as the columns in the result set. - * @since 7 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 */ columnNames: Array; @@ -39,8 +38,8 @@ export default interface ResultSet { * * @note The returned number is equal to the length of the string array returned by the * columnCount method. - * @since 7 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 */ columnCount: number; @@ -48,8 +47,8 @@ export default interface ResultSet { * Obtains the number of rows in the result set. * * @note N/A - * @since 7 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 */ rowCount: number; @@ -57,8 +56,8 @@ export default interface ResultSet { * Obtains the current index of the result set. * * @note The result set index starts from 0. - * @since 7 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 */ rowIndex: number; @@ -66,8 +65,8 @@ export default interface ResultSet { * Checks whether the result set is positioned at the first row. * * @note N/A - * @since 7 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 */ isAtFirstRow: boolean; @@ -75,8 +74,8 @@ export default interface ResultSet { * Checks whether the result set is positioned at the last row. * * @note N/A - * @since 7 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 */ isAtLastRow: boolean; @@ -84,18 +83,18 @@ export default interface ResultSet { * Checks whether the result set is positioned after the last row. * * @note N/A - * @since 7 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 */ isEnded: boolean; /** - * Returns whether the cursor is pointing to the position before the first + * returns whether the cursor is pointing to the position before the first * row. * * @note N/A - * @since 7 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 */ isStarted: boolean; @@ -105,8 +104,8 @@ export default interface ResultSet { * If the result set is closed by calling the close method, true will be returned. * * @note N/A - * @since 7 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 */ isClosed: boolean; @@ -114,10 +113,10 @@ export default interface ResultSet { * Obtains the column index based on the specified column name. * * @note The column name is passed as an input parameter. - * @since 7 + * @param {string} columnName - Indicates the name of the specified column in the result set. + * @returns {number} return the index of the specified column. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param columnName Indicates the name of the specified column in the result set. - * @return Returns the index of the specified column. + * @since 7 */ getColumnIndex(columnName: string): number; @@ -125,23 +124,23 @@ export default interface ResultSet { * Obtains the column name based on the specified column index. * * @note The column index is passed as an input parameter. - * @since 7 + * @param {number} columnIndex - Indicates the index of the specified column in the result set. + * @returns {string} returns the name of the specified column. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param columnIndex Indicates the index of the specified column in the result set. - * @return Returns the name of the specified column. + * @since 7 */ getColumnName(columnIndex: number): string; - /** + /** * Go to the specified row of the result set forwards or backwards by an offset relative to its current position. * A positive offset indicates moving backwards, and a negative offset indicates moving forwards. * * @note N/A - * @since 7 + * @param {number} offset - Indicates the offset relative to the current position. + * @returns {string} returns true if the result set is moved successfully and does not go beyond the range; + * returns false otherwise. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param offset Indicates the offset relative to the current position. - * @return Returns true if the result set is moved successfully and does not go beyond the range; - * returns false otherwise. + * @since 7 */ goTo(offset: number): boolean; @@ -149,10 +148,10 @@ export default interface ResultSet { * Go to the specified row of the result set. * * @note N/A - * @since 7 + * @param {number} rowIndex - Indicates the index of the specified row, which starts from 0. + * @returns {boolean} returns true if the result set is moved successfully; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param rowIndex Indicates the index of the specified row, which starts from 0. - * @return Returns true if the result set is moved successfully; returns false otherwise. + * @since 7 */ goToRow(position: number): boolean; @@ -160,10 +159,10 @@ export default interface ResultSet { * Go to the first row of the result set. * * @note N/A - * @since 7 + * @returns {boolean} returns true if the result set is moved successfully; + * returns false otherwise, for example, if the result set is empty. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @return Returns true if the result set is moved successfully; - * returns false otherwise, for example, if the result set is empty. + * @since 7 */ goToFirstRow(): boolean; @@ -171,10 +170,10 @@ export default interface ResultSet { * Go to the last row of the result set. * * @note N/A - * @since 7 + * @returns {boolean} returns true if the result set is moved successfully; + * returns false otherwise, for example, if the result set is empty. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @return Returns true if the result set is moved successfully; - * returns false otherwise, for example, if the result set is empty. + * @since 7 */ goToLastRow(): boolean; @@ -182,10 +181,10 @@ export default interface ResultSet { * Go to the next row of the result set. * * @note N/A - * @since 7 + * @returns {boolean} returns true if the result set is moved successfully; + * returns false otherwise, for example, if the result set is already in the last row. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @return Returns true if the result set is moved successfully; - * returns false otherwise, for example, if the result set is already in the last row. + * @since 7 */ goToNextRow(): boolean; @@ -193,10 +192,10 @@ export default interface ResultSet { * Go to the previous row of the result set. * * @note N/A - * @since 7 + * @returns {boolean} returns true if the result set is moved successfully; + * returns false otherwise, for example, if the result set is already in the first row. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @return Returns true if the result set is moved successfully; - * returns false otherwise, for example, if the result set is already in the first row. + * @since 7 */ goToPreviousRow(): boolean; @@ -205,10 +204,10 @@ export default interface ResultSet { * * @note The implementation class determines whether to throw an exception if the value of the specified column * in the current row is null or the specified column is not of the Blob type. - * @since 7 + * @param {number} columnIndex - Indicates the specified column index, which starts from 0. + * @returns {Uint8Array} returns the value of the specified column as a byte array. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param columnIndex Indicates the specified column index, which starts from 0. - * @return Returns the value of the specified column as a byte array. + * @since 7 */ getBlob(columnIndex: number): Uint8Array; @@ -217,10 +216,10 @@ export default interface ResultSet { * * @note The implementation class determines whether to throw an exception if the value of the specified column * in the current row is null or the specified column is not of the string type. - * @since 7 + * @param {number} columnIndex - Indicates the specified column index, which starts from 0. + * @returns {string} returns the value of the specified column as a string. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param columnIndex Indicates the specified column index, which starts from 0. - * @return Returns the value of the specified column as a string. + * @since 7 */ getString(columnIndex: number): string; @@ -229,10 +228,10 @@ export default interface ResultSet { * * @note The implementation class determines whether to throw an exception if the value of the specified column * in the current row is null, the specified column is not of the integer type. - * @since 7 + * @param {number} columnIndex - Indicates the specified column index, which starts from 0. + * @returns {number} returns the value of the specified column as a long. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param columnIndex Indicates the specified column index, which starts from 0. - * @return Returns the value of the specified column as a long. + * @since 7 */ getLong(columnIndex: number): number; @@ -241,10 +240,10 @@ export default interface ResultSet { * * @note The implementation class determines whether to throw an exception if the value of the specified column * in the current row is null, the specified column is not of the double type. - * @since 7 + * @param {number} columnIndex - Indicates the specified column index, which starts from 0. + * @returns {number} returns the value of the specified column as a double. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param columnIndex Indicates the specified column index, which starts from 0. - * @return Returns the value of the specified column as a double. + * @since 7 */ getDouble(columnIndex: number): number; @@ -252,11 +251,11 @@ export default interface ResultSet { * Checks whether the value of the specified column in the current row is null. * * @note N/A - * @since 7 + * @param {number} columnIndex - Indicates the specified column index, which starts from 0. + * @returns {boolean} returns true if the value of the specified column in the current row is null; + * returns false otherwise. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param columnIndex Indicates the specified column index, which starts from 0. - * @return Returns true if the value of the specified column in the current row is null; - * returns false otherwise. + * @since 7 */ isColumnNull(columnIndex: number): boolean; @@ -264,9 +263,8 @@ export default interface ResultSet { * Closes the result set. * * @note Calling this method on the result set will release all of its resources and makes it ineffective. - * @since 7 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @return Returns true if the result set is closed; returns false otherwise. + * @since 7 */ close(): void; } @@ -274,18 +272,19 @@ export default interface ResultSet { /** * Provides methods for accessing a database result set generated by querying the database. * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @import import data_rdb from '@ohos.data.rdb'; + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 */ -export default interface ResultSetV9 { + interface ResultSetV9 { + /** * Obtains the names of all columns in a result set. * * @note The column names are returned as a string array, in which the strings are in the same order * as the columns in the result set. - * @since 9 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 */ columnNames: Array; @@ -303,8 +302,8 @@ export default interface ResultSetV9 { * Obtains the number of rows in the result set. * * @note N/A - * @since 9 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 */ rowCount: number; @@ -312,8 +311,8 @@ export default interface ResultSetV9 { * Obtains the current index of the result set. * * @note The result set index starts from 0. - * @since 9 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 */ rowIndex: number; @@ -330,8 +329,8 @@ export default interface ResultSetV9 { * Checks whether the result set is positioned at the last row. * * @note N/A - * @since 9 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 */ isAtLastRow: boolean; @@ -339,18 +338,18 @@ export default interface ResultSetV9 { * Checks whether the result set is positioned after the last row. * * @note N/A - * @since 9 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 */ isEnded: boolean; /** - * Returns whether the cursor is pointing to the position before the first + * returns whether the cursor is pointing to the position before the first * row. * * @note N/A - * @since 9 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 */ isStarted: boolean; @@ -360,8 +359,8 @@ export default interface ResultSetV9 { * If the result set is closed by calling the close method, true will be returned. * * @note N/A - * @since 9 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 */ isClosed: boolean; @@ -369,13 +368,12 @@ export default interface ResultSetV9 { * Obtains the column index based on the specified column name. * * @note The column name is passed as an input parameter. - * @since 9 + * @param {string} columnName - Indicates the name of the specified column in the result set. + * @returns {number} return the index of the specified column. + * @throws {BusinessError} 14800013 - The column value is null or the column type is incompatible. + * @throws {BusinessError} 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param columnName Indicates the name of the specified column in the result set. - * @return Returns the index of the specified column. - * @throws {BusinessError} if process failed - * @errorcode 14800013 The column value is null or the column type is incompatible. - * @errorcode 401 Parameter error. + * @since 9 */ getColumnIndex(columnName: string): number; @@ -383,13 +381,12 @@ export default interface ResultSetV9 { * Obtains the column name based on the specified column index. * * @note The column index is passed as an input parameter. - * @since 9 + * @param {number} columnIndex - Indicates the index of the specified column in the result set. + * @returns {string} returns the name of the specified column. + * @throws {BusinessError} 14800013 - The column value is null or the column type is incompatible. + * @throws {BusinessError} 401 - Parameter error. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param columnIndex Indicates the index of the specified column in the result set. - * @return Returns the name of the specified column. - * @throws {BusinessError} if process failed - * @errorcode 14800013 The column value is null or the column type is incompatible. - * @errorcode 401 Parameter error. + * @since 9 */ getColumnName(columnIndex: number): string; @@ -398,14 +395,13 @@ export default interface ResultSetV9 { * A positive offset indicates moving backwards, and a negative offset indicates moving forwards. * * @note N/A - * @since 9 + * @param {number} offset - Indicates the offset relative to the current position. + * @returns {string} returns true if the result set is moved successfully and does not go beyond the range; + * returns false otherwise. + * @throws {BusinessError} 14800012 - The result set is empty or the specified location is invalid. + * @throws {BusinessError} 401 - Parameter error. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param offset Indicates the offset relative to the current position. - * @return Returns true if the result set is moved successfully and does not go beyond the range; - * returns false otherwise. - * @throws {BusinessError} if process failed - * @errorcode 14800012 The result set is empty or the specified location is invalid. - * @errorcode 401 Parameter error. + * @since 9 */ goTo(offset: number): boolean; @@ -413,13 +409,12 @@ export default interface ResultSetV9 { * Go to the specified row of the result set. * * @note N/A - * @since 9 + * @param {number} rowIndex - Indicates the index of the specified row, which starts from 0. + * @returns {boolean} returns true if the result set is moved successfully; returns false otherwise. + * @throws {BusinessError} 14800012 - The result set is empty or the specified location is invalid. + * @throws {BusinessError} 401 - Parameter error. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param rowIndex Indicates the index of the specified row, which starts from 0. - * @return Returns true if the result set is moved successfully; returns false otherwise. - * @throws {BusinessError} if process failed - * @errorcode 14800012 The result set is empty or the specified location is invalid. - * @errorcode 401 Parameter error. + * @since 9 */ goToRow(position: number): boolean; @@ -427,12 +422,11 @@ export default interface ResultSetV9 { * Go to the first row of the result set. * * @note N/A - * @since 9 + * @returns {boolean} returns true if the result set is moved successfully; + * returns false otherwise, for example, if the result set is empty. + * @throws {BusinessError} 14800012 - The result set is empty or the specified location is invalid. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @return Returns true if the result set is moved successfully; - * returns false otherwise, for example, if the result set is empty. - * @throws {BusinessError} if process failed - * @errorcode 14800012 The result set is empty or the specified location is invalid. + * @since 9 */ goToFirstRow(): boolean; @@ -440,12 +434,11 @@ export default interface ResultSetV9 { * Go to the last row of the result set. * * @note N/A - * @since 9 + * @returns {boolean} returns true if the result set is moved successfully; + * returns false otherwise, for example, if the result set is empty. + * @throws {BusinessError} 14800012 - The result set is empty or the specified location is invalid. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @return Returns true if the result set is moved successfully; - * returns false otherwise, for example, if the result set is empty. - * @throws {BusinessError} if process failed - * @errorcode 14800012 The result set is empty or the specified location is invalid. + * @since 9 */ goToLastRow(): boolean; @@ -453,12 +446,11 @@ export default interface ResultSetV9 { * Go to the next row of the result set. * * @note N/A - * @since 9 + * @returns {boolean} returns true if the result set is moved successfully; + * returns false otherwise, for example, if the result set is already in the last row. + * @throws {BusinessError} 14800012 - The result set is empty or the specified location is invalid. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @return Returns true if the result set is moved successfully; - * returns false otherwise, for example, if the result set is already in the last row. - * @throws {BusinessError} if process failed - * @errorcode 14800012 The result set is empty or the specified location is invalid. + * @since 9 */ goToNextRow(): boolean; @@ -466,12 +458,11 @@ export default interface ResultSetV9 { * Go to the previous row of the result set. * * @note N/A - * @since 9 + * @returns {boolean} returns true if the result set is moved successfully; + * returns false otherwise, for example, if the result set is already in the first row. + * @throws {BusinessError} 14800012 - The result set is empty or the specified location is invalid. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @return Returns true if the result set is moved successfully; - * returns false otherwise, for example, if the result set is already in the first row. - * @throws {BusinessError} if process failed - * @errorcode 14800012 The result set is empty or the specified location is invalid. + * @since 9 */ goToPreviousRow(): boolean; @@ -480,13 +471,12 @@ export default interface ResultSetV9 { * * @note The implementation class determines whether to throw an exception if the value of the specified column * in the current row is null or the specified column is not of the Blob type. - * @since 9 + * @param {number} columnIndex - Indicates the specified column index, which starts from 0. + * @returns {Uint8Array} returns the value of the specified column as a byte array. + * @throws {BusinessError} 14800013 - The column value is null or the column type is incompatible. + * @throws {BusinessError} 401- Parameter error. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param columnIndex Indicates the specified column index, which starts from 0. - * @return Returns the value of the specified column as a byte array. - * @throws {BusinessError} if process failed - * @errorcode 14800013 The column value is null or the column type is incompatible. - * @errorcode 401 Parameter error. + * @since 9 */ getBlob(columnIndex: number): Uint8Array; @@ -495,13 +485,12 @@ export default interface ResultSetV9 { * * @note The implementation class determines whether to throw an exception if the value of the specified column * in the current row is null or the specified column is not of the string type. - * @since 9 + * @param {number} columnIndex - Indicates the specified column index, which starts from 0. + * @returns {string} returns the value of the specified column as a string. + * @throws {BusinessError} 14800013 - The column value is null or the column type is incompatible. + * @throws {BusinessError} 401 - Parameter error. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param columnIndex Indicates the specified column index, which starts from 0. - * @return Returns the value of the specified column as a string. - * @throws {BusinessError} if process failed - * @errorcode 14800013 The column value is null or the column type is incompatible. - * @errorcode 401 Parameter error. + * @since 9 */ getString(columnIndex: number): string; @@ -510,13 +499,12 @@ export default interface ResultSetV9 { * * @note The implementation class determines whether to throw an exception if the value of the specified column * in the current row is null, the specified column is not of the integer type. - * @since 9 + * @param {number} columnIndex - Indicates the specified column index, which starts from 0. + * @returns {number} returns the value of the specified column as a long. + * @throws {BusinessError} 14800013 - The column value is null or the column type is incompatible. + * @throws {BusinessError} 401 - Parameter error. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param columnIndex Indicates the specified column index, which starts from 0. - * @return Returns the value of the specified column as a long. - * @throws {BusinessError} if process failed - * @errorcode 14800013 The column value is null or the column type is incompatible. - * @errorcode 401 Parameter error. + * @since 9 */ getLong(columnIndex: number): number; @@ -525,13 +513,12 @@ export default interface ResultSetV9 { * * @note The implementation class determines whether to throw an exception if the value of the specified column * in the current row is null, the specified column is not of the double type. - * @since 9 + * @param {number} columnIndex - Indicates the specified column index, which starts from 0. + * @returns {number} returns the value of the specified column as a double. + * @throws {BusinessError} 14800013 - The column value is null or the column type is incompatible. + * @throws {BusinessError} 401 - Parameter error. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param columnIndex Indicates the specified column index, which starts from 0. - * @return Returns the value of the specified column as a double. - * @throws {BusinessError} if process failed - * @errorcode 14800013 The column value is null or the column type is incompatible. - * @errorcode 401 Parameter error. + * @since 9 */ getDouble(columnIndex: number): number; @@ -539,14 +526,13 @@ export default interface ResultSetV9 { * Checks whether the value of the specified column in the current row is null. * * @note N/A - * @since 9 + * @param {number} columnIndex - Indicates the specified column index, which starts from 0. + * @returns {boolean} returns true if the value of the specified column in the current row is null; + * returns false otherwise. + * @throws {BusinessError} 14800013 - The column value is null or the column type is incompatible. + * @throws {BusinessError} 401 - Parameter error. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @param columnIndex Indicates the specified column index, which starts from 0. - * @return Returns true if the value of the specified column in the current row is null; - * returns false otherwise. - * @throws {BusinessError} if process failed - * @errorcode 14800013 The column value is null or the column type is incompatible. - * @errorcode 401 Parameter error. + * @since 9 */ isColumnNull(columnIndex: number): boolean; @@ -554,11 +540,9 @@ export default interface ResultSetV9 { * Closes the result set. * * @note Calling this method on the result set will release all of its resources and makes it ineffective. - * @since 9 + * @throws {BusinessError} 14800012 - The result set is empty or the specified location is invalid. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @return Returns true if the result set is closed; returns false otherwise. - * @throws {BusinessError} if process failed - * @errorcode 14800012 The result set is empty or the specified location is invalid. + * @since 9 */ close(): void; } \ No newline at end of file -- Gitee From 96156d01fefbacd1cd2442119e771e5bf215049e Mon Sep 17 00:00:00 2001 From: Yippo Date: Thu, 13 Oct 2022 18:35:39 +0800 Subject: [PATCH 093/438] Description:ipc/rpc modify onRemoteRequestEx method name Feature or Bugfix:ipc/rpc modify onRemoteRequestEx method name Binary Source: No Signed-off-by: Yippo --- api/@ohos.rpc.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api/@ohos.rpc.d.ts b/api/@ohos.rpc.d.ts index c966c3c43d..6387bdb435 100644 --- a/api/@ohos.rpc.d.ts +++ b/api/@ohos.rpc.d.ts @@ -2082,10 +2082,9 @@ declare namespace rpc { * @return * Returns a simple boolean which is {@code true} if the operation succeeds; {{@code false} otherwise} when the function call is synchronous. * Returns a promise object with a boolean when the function call is asynchronous. - * @throws RemoteException Throws this exception if a remote service error occurs. * @since 9 */ - onRemoteRequestEx(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): boolean | Promise; + onRemoteMessageRequest(code: number, data: MessageSequence, reply: MessageSequence, options: MessageOption): boolean | Promise; /** * Sets an entry for receiving requests. -- Gitee From 7c07ecef87d4b47c18c91809a175763cc49f11be Mon Sep 17 00:00:00 2001 From: dingxiaochen Date: Thu, 13 Oct 2022 21:33:00 +0800 Subject: [PATCH 094/438] add interface permission. Signed-off-by: dingxiaochen --- api/@ohos.telephony.call.d.ts | 24 +++++++++++++++++++++++- api/@ohos.telephony.radio.d.ts | 2 ++ api/@ohos.telephony.sim.d.ts | 1 + 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/api/@ohos.telephony.call.d.ts b/api/@ohos.telephony.call.d.ts index a0a6b2abaf..60ef25c819 100644 --- a/api/@ohos.telephony.call.d.ts +++ b/api/@ohos.telephony.call.d.ts @@ -154,6 +154,7 @@ declare namespace call { * Hangups the foreground call. * * @param callId Indicates the identifier of the call to hangup. + * @permission ohos.permission.ANSWER_CALL * @systemapi Hide this for inner system use. * @since 7 */ @@ -173,6 +174,7 @@ declare namespace call { * * @param callId Indicates the identifier of the call to reject. * @param options Indicates the text message to reject. + * @permission ohos.permission.ANSWER_CALL * @systemapi Hide this for inner system use. * @since 7 */ @@ -184,6 +186,7 @@ declare namespace call { * Rejects the incoming call without callId. * * @param options Indicates the text message to reject. + * @permission ohos.permission.ANSWER_CALL * @systemapi Hide this for inner system use. * @since 9 */ @@ -191,6 +194,7 @@ declare namespace call { function reject(options: RejectMessageOptions, callback: AsyncCallback): void; /** + * @permission ohos.permission.ANSWER_CALL * @systemapi Hide this for inner system use. * @since 7 */ @@ -198,6 +202,7 @@ declare namespace call { function holdCall(callId: number): Promise; /** + * @permission ohos.permission.ANSWER_CALL * @systemapi Hide this for inner system use. * @since 7 */ @@ -205,6 +210,7 @@ declare namespace call { function unHoldCall(callId: number): Promise; /** + * @permission ohos.permission.ANSWER_CALL * @systemapi Hide this for inner system use. * @since 7 */ @@ -240,6 +246,7 @@ declare namespace call { function getCallIdListForConference(callId: number): Promise>; /** + * @permission ohos.permission.GET_TELEPHONY_STATE * @systemapi Hide this for inner system use. * @since 7 */ @@ -247,6 +254,7 @@ declare namespace call { function getCallWaitingStatus(slotId: number): Promise; /** + * @permission ohos.permission.SET_TELEPHONY_STATE * @systemapi Hide this for inner system use. * @since 7 */ @@ -276,36 +284,42 @@ declare namespace call { function isInEmergencyCall(): Promise; /** + * @permission ohos.permission.SET_TELEPHONY_STATE * @systemapi Hide this for inner system use. * @since 7 */ function on(type: 'callDetailsChange', callback: Callback): void; /** + * @permission ohos.permission.SET_TELEPHONY_STATE * @systemapi Hide this for inner system use. * @since 7 */ function off(type: 'callDetailsChange', callback?: Callback): void; /** + * @permission ohos.permission.SET_TELEPHONY_STATE * @systemapi Hide this for inner system use. * @since 8 */ function on(type: 'callEventChange', callback: Callback): void; /** + * @permission ohos.permission.SET_TELEPHONY_STATE * @systemapi Hide this for inner system use. * @since 8 */ function off(type: 'callEventChange', callback?: Callback): void; /** + * @permission ohos.permission.SET_TELEPHONY_STATE * @systemapi Hide this for inner system use. * @since 8 */ function on(type: 'callDisconnectedCause', callback: Callback): void; /** + * @permission ohos.permission.SET_TELEPHONY_STATE * @systemapi Hide this for inner system use. * @since 8 */ @@ -316,6 +330,7 @@ declare namespace call { * * @param type Indicates the observer type. * @param callback Return the result of MMI code. + * @permission ohos.permission.SET_TELEPHONY_STATE * @systemapi Hide this for inner system use. * @since 9 */ @@ -326,6 +341,7 @@ declare namespace call { * * @param type Indicates the observer type. * @param callback Return the result of MMI code. + * @permission ohos.permission.SET_TELEPHONY_STATE * @systemapi Hide this for inner system use. * @since 9 */ @@ -346,6 +362,7 @@ declare namespace call { function separateConference(callId: number): Promise; /** + * @permission ohos.permission.GET_TELEPHONY_STATE * @systemapi Hide this for inner system use. * @since 8 */ @@ -353,6 +370,7 @@ declare namespace call { function getCallRestrictionStatus(slotId: number, type: CallRestrictionType): Promise; /** + * @permission ohos.permission.SET_TELEPHONY_STATE * @systemapi Hide this for inner system use. * @since 8 */ @@ -360,6 +378,7 @@ declare namespace call { function setCallRestriction(slotId: number, info: CallRestrictionInfo): Promise; /** + * @permission ohos.permission.GET_TELEPHONY_STATE * @systemapi Hide this for inner system use. * @since 8 */ @@ -367,6 +386,7 @@ declare namespace call { function getCallTransferInfo(slotId: number, type: CallTransferType): Promise; /** + * @permission ohos.permission.SET_TELEPHONY_STATE * @systemapi Hide this for inner system use. * @since 8 */ @@ -432,6 +452,7 @@ declare namespace call { function updateImsCallMode(callId: number, mode: ImsCallMode): Promise; /** + * @permission ohos.permission.SET_TELEPHONY_STATE * @systemapi Hide this for inner system use. * @since 8 */ @@ -439,6 +460,7 @@ declare namespace call { function enableImsSwitch(slotId: number): Promise; /** + * @permission ohos.permission.SET_TELEPHONY_STATE * @systemapi Hide this for inner system use. * @since 8 */ @@ -809,4 +831,4 @@ declare namespace call { } } -export default call; \ No newline at end of file +export default call; diff --git a/api/@ohos.telephony.radio.d.ts b/api/@ohos.telephony.radio.d.ts index 4886f4aa2c..9f6d97f33a 100644 --- a/api/@ohos.telephony.radio.d.ts +++ b/api/@ohos.telephony.radio.d.ts @@ -67,6 +67,7 @@ declare namespace radio { /** * Proactively requests to update location information. * + * @permission ohos.permission.LOCATION * @param { number } [ slotId ] - indicates the card slot index number. * @param { AsyncCallback } callback - the callback of sendUpdateCellLocationRequest. * @systemapi @@ -78,6 +79,7 @@ declare namespace radio { /** * Proactively requests to update location information. * + * @permission ohos.permission.LOCATION * @param { number } [ slotId ] - indicates the card slot index number. * @returns { Promise } the promise returned by the function. * @systemapi diff --git a/api/@ohos.telephony.sim.d.ts b/api/@ohos.telephony.sim.d.ts index 7e3d87ff68..8112beffed 100644 --- a/api/@ohos.telephony.sim.d.ts +++ b/api/@ohos.telephony.sim.d.ts @@ -399,6 +399,7 @@ declare namespace sim { function updateIccDiallingNumbers(slotId: number, type: ContactType, diallingNumbers: DiallingNumbersInfo): Promise; /** + * @permission ohos.permission.GET_TELEPHONY_STATE * @systemapi Hide this for inner system use. * @since 8 */ -- Gitee From 669e4361d29e62b7bd7d59aa9151cf7c74280af0 Mon Sep 17 00:00:00 2001 From: shilei Date: Thu, 13 Oct 2022 21:44:45 +0800 Subject: [PATCH 095/438] add Signed-off-by: shilei Change-Id: I3e4de2cd908b75c60b75a009f1c2b6cbf940ada5 --- api/@ohos.bundle.bundleManager.d.ts | 122 +++++++++++++++++++ api/@ohos.bundle.d.ts | 2 + api/@ohos.bundle.installer.d.ts | 181 ++++++++++++++++++++++++++++ api/bundle/bundleInstaller.d.ts | 19 +++ 4 files changed, 324 insertions(+) create mode 100644 api/@ohos.bundle.bundleManager.d.ts create mode 100644 api/@ohos.bundle.installer.d.ts diff --git a/api/@ohos.bundle.bundleManager.d.ts b/api/@ohos.bundle.bundleManager.d.ts new file mode 100644 index 0000000000..754bb104fa --- /dev/null +++ b/api/@ohos.bundle.bundleManager.d.ts @@ -0,0 +1,122 @@ +/* + * 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 { AsyncCallback } from './basic'; + +/** + * Obtains the Want for starting the main ability of an application based on the + * given bundle name. The main ability of an application is the ability that has the + * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's config.json or module.json file. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { number } userId - Indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback - The callback for starting the application's main ability. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. + * @throws { BusinessError } 401 - Input parameters check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not existed. + * @throws { BusinessError } 17700004 - The specified userId is not existed. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +function getLaunchWantForBundle(bundleName: string, userId: number, callback: AsyncCallback): void; + +/** + * Obtains the Want for starting the main ability of an application based on the + * given bundle name. The main ability of an application is the ability that has the + * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's config.json or module.json file. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { AsyncCallback } callback - The callback for starting the application's main ability. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. + * @throws { BusinessError } 401 - Input parameters check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not existed. + * @throws { BusinessError } 17700004 - The specified userId is not existed. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +function getLaunchWantForBundle(bundleName: string, callback: AsyncCallback): void; + +/** + * Obtains the Want for starting the main ability of an application based on the + * given bundle name. The main ability of an application is the ability that has the + * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's config.json or module.json file. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { number } userId - Indicates the user ID or do not pass user ID. + * @returns { Promise } the Want for starting the application's main ability. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. + * @throws { BusinessError } 401 - Input parameters check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not existed. + * @throws { BusinessError } 17700004 - The specified userId is not existed. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +function getLaunchWantForBundle(bundleName: string, userId?: number): Promise; + +/** + * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. + * @param { string } moduleName - Indicates the moduleName of the application. + * @param { string } abilityName - Indicates the abilityName of the application. + * @param { string } metadataName - Indicates the name of metadata in ability. + * @param { AsyncCallback } callback - The callback of returning string in json-format of the corresponding config file. + * @throws { BusinessError } 401 - Input parameters check failed. + * @throws { BusinessError } 17700003 - The specified anilityName or moduleName is not existed. + * @throws { BusinessError } 17700024 - The specified metadataName is not existed or the profile is not json-format. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +function getProfileByAbility(moduleName: string, abilityName: string, metadataName: string, callback: AsyncCallback>): void; + +/** + * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. + * @param { string } moduleName - Indicates the moduleName of the application. + * @param { string } abilityName - Indicates the abilityName of the application. + * @param { string } metadataName - Indicates the name of metadata in ability. + * @returns { Promise> } Returns string in json-format of the corresponding config file. + * @throws { BusinessError } 401 - Input parameters check failed. + * @throws { BusinessError } 17700003 - The specified anilityName or moduleName is not existed. + * @throws { BusinessError } 17700024 - The specified metadataName is not existed or the profile is not json-format. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +function getProfileByAbility(moduleName: string, abilityName: string, metadataName?: string): Promise>; + +/** + * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. + * @param { string } moduleName - Indicates the moduleName of the application. + * @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application. + * @param { string } metadataName - Indicates the name of metadata in ability. + * @param { AsyncCallback } callback - The callback of returning string in json-format of the corresponding config file. + * @throws { BusinessError } 401 - Input parameters check failed. + * @throws { BusinessError } 17700003 - The specified extensionAbilityName or moduleName is not existed. + * @throws { BusinessError } 17700024 - The specified metadataName is not existed or the profile is not json-format. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +function getProfileByExtensionAbility(moduleName: string, extensionAbilityName: string, metadataName: string, callback: AsyncCallback>): void; + +/** + * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. + * @param { string } moduleName - Indicates the moduleName of the application. + * @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application. + * @param { string } metadataName - Indicates the name of metadata in ability. + * @returns { Promise> } Returns string in json-format of the corresponding config file. + * @throws { BusinessError } 401 - Input parameters check failed. + * @throws { BusinessError } 17700003 - The specified extensionAbilityName or moduleName is not existed. + * @throws { BusinessError } 17700024 - The specified metadataName is not existed or the profile is not json-format. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +function getProfileByExtensionAbility(moduleName: string, extensionAbilityName: string, metadataName?: string): Promise>; \ No newline at end of file diff --git a/api/@ohos.bundle.d.ts b/api/@ohos.bundle.d.ts index 468be9fb97..8444c2188e 100644 --- a/api/@ohos.bundle.d.ts +++ b/api/@ohos.bundle.d.ts @@ -662,6 +662,8 @@ declare namespace bundle { * @return Returns the Want for starting the application's main ability if any; returns null if * the given bundle does not exist or does not contain any main ability. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getLaunchWantForBundle */ function getLaunchWantForBundle(bundleName: string, callback: AsyncCallback): void; function getLaunchWantForBundle(bundleName: string): Promise; diff --git a/api/@ohos.bundle.installer.d.ts b/api/@ohos.bundle.installer.d.ts new file mode 100644 index 0000000000..680468fa47 --- /dev/null +++ b/api/@ohos.bundle.installer.d.ts @@ -0,0 +1,181 @@ +/* + * 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 { AsyncCallback } from './basic'; + +/** + * Support install, upgrade, remove and recover bundles on the devices. + * @namespace installer + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ +declare namespace installer { + /** + * Obtains the interface used to install bundle. + * @param { AsyncCallback } callback - The callback of BundleInstaller object. + * @throws { BusinessError } 401 - Input parameters check failed. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function getBundleInstaller(callback: AsyncCallback): void + + /** + * Obtains the interface used to install bundle. + * @param { AsyncCallback } callback - The callback of getting a list of BundleInstaller objects. + * @returns { Promise } BundleInstaller object. + * @throws { BusinessError } 401 - Input parameters check failed. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function getBundleInstaller(): Promise; + + /** + * Bundle installer interface, include install uninstall recover. + * @interface BundleInstaller + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + interface BundleInstaller { + /** + * Install haps for an application. + * @permission ohos.permission.INSTALL_BUNDLE + * @param { Array } hapFilePaths - Indicates the path where the hap of the application is stored. + * @param { InstallParam } installParam - Indicates other parameters required for the installation. + * @param { AsyncCallback } callback - The callback of installing haps result. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. + * @throws { BusinessError } 401 - Input parameters check failed. + * @throws { BusinessError } 17700004 - The specified userId is not existed. + * @throws { BusinessError } 17700010 - To parse file of config.json or module.json failed. + * @throws { BusinessError } 17700011 - To verify signature failed. + * @throws { BusinessError } 17700012 - Invalid hapFilePaths since being lack of file or path. + * @throws { BusinessError } 17700013 - Too large size of hap file which exceeds the size limitation. + * @throws { BusinessError } 17700014 - The suffix of the hap name is not .hap. + * @throws { BusinessError } 17700015 - Multiple haps have inconsistent configured information. + * @throws { BusinessError } 17700016 - No disk space left for installation. + * @throws { BusinessError } 17700017 - Downgrade installation is prohibited. + * @throws { BusinessError } 17700101 - The system service is excepted. + * @throws { BusinessError } 17700103 - I/O operation is failed. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + install(hapFilePaths: Array, installParam: InstallParam, callback: AsyncCallback) : void; + + /** + * Uninstall an application. + * @permission ohos.permission.INSTALL_BUNDLE + * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled. + * @param { InstallParam } installParam - Indicates other parameters required for the uninstallation. + * @param { AsyncCallback } callback - The callback of uninstalling application result. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. + * @throws { BusinessError } 401 - Input parameters check failed. + * @throws { BusinessError } 17700004 - The specified userId is not existed. + * @throws { BusinessError } 17700020 - The specified bundle is pre-installed bundle which cannot be uninstalled. + * @throws { BusinessError } 17700101 - The system service is excepted. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + uninstall(bundleName: string, installParam: InstallParam, callback : AsyncCallback) : void; + + /** + * recover an application. + * @permission ohos.permission.INSTALL_BUNDLE + * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled. + * @param { InstallParam } installParam - Indicates other parameters required for the uninstallation. + * @param { AsyncCallback } callback - The callback of recoverring application result. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. + * @throws { BusinessError } 401 - Input parameters check failed. + * @throws { BusinessError } 17700004 - The specified userId is not existed. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + recover(bundleName: string, installParam: InstallParam, callback: AsyncCallback): void; + } + + /** + * Provides parameters required for hashParam. + * @typedef HashParam + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + export interface HashParam { + /** + * Indicates the moduleName + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + moduleName: string; + + /** + * Indicates the hash value + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + hashValue: string; + } + + /** + * Provides parameters required for installing or uninstalling an application. + * @typedef InstallParam + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + export interface InstallParam { + /** + * Indicates the user id + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + userId: number; + + /** + * Indicates the install flag + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + installFlag: number; + + /** + * Indicates whether the param has data + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + isKeepData: boolean; + + /** + * Indicates the hash params + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + hashParams?: Array; + + /** + * Indicates the deadline of the crowdtesting bundle + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + crowdtestDeadline?: number; + } +} + +export default installer; \ No newline at end of file diff --git a/api/bundle/bundleInstaller.d.ts b/api/bundle/bundleInstaller.d.ts index a2e31165f8..3aee486769 100644 --- a/api/bundle/bundleInstaller.d.ts +++ b/api/bundle/bundleInstaller.d.ts @@ -45,12 +45,16 @@ import bundle from './../@ohos.bundle'; * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.installer#InstallParam */ export interface InstallParam { /** * @default Indicates the user id * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework + * @deprecated since 9 + * @useinstead ohos.bundle.installer.InstallParam#userId */ userId: number; @@ -58,6 +62,8 @@ export interface InstallParam { * @default Indicates the install flag * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework + * @deprecated since 9 + * @useinstead ohos.bundle.installer.InstallParam#installFlag */ installFlag: number; @@ -65,6 +71,8 @@ export interface InstallParam { * @default Indicates whether the param has data * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework + * @deprecated since 9 + * @useinstead ohos.bundle.installer.InstallParam#isKeepData */ isKeepData: boolean; @@ -89,6 +97,7 @@ export interface InstallParam { * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA * @systemapi Hide this for inner system use + * @deprecated since 9 */ export interface InstallStatus { @@ -96,6 +105,7 @@ export interface InstallStatus { * @default Indicates the install or uninstall error code * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework + * @deprecated since 9 */ status: bundle.InstallErrorCode; @@ -103,6 +113,7 @@ export interface InstallStatus { * @default Indicates the install or uninstall result string message * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework + * @deprecated since 9 */ statusMessage: string; } @@ -113,6 +124,8 @@ export interface InstallStatus { * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.installer#BundleInstaller */ export interface BundleInstaller { /** @@ -126,6 +139,8 @@ export interface BundleInstaller { * @param installParam Indicates other parameters required for the installation. * @return InstallStatus * @permission ohos.permission.INSTALL_BUNDLE + * @deprecated since 9 + * @useinstead ohos.bundle.installer.BundleInstaller#install */ install(bundleFilePaths: Array, param: InstallParam, callback: AsyncCallback): void; @@ -139,6 +154,8 @@ export interface BundleInstaller { * @param installParam Indicates other parameters required for the uninstallation. * @return InstallStatus * @permission ohos.permission.INSTALL_BUNDLE + * @deprecated since 9 + * @useinstead ohos.bundle.installer.BundleInstaller#uninstall */ uninstall(bundleName: string, param: InstallParam, callback: AsyncCallback): void; @@ -153,6 +170,8 @@ export interface BundleInstaller { * @return InstallStatus * @permission ohos.permission.INSTALL_BUNDLE * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.installer.BundleInstaller#recover */ recover(bundleName: string, param: InstallParam, callback: AsyncCallback): void; } \ No newline at end of file -- Gitee From 466a8caad725e106df720d3cc7985608da4ac7f2 Mon Sep 17 00:00:00 2001 From: dboy190 Date: Thu, 13 Oct 2022 21:56:33 +0800 Subject: [PATCH 096/438] add new package kvstore Signed-off-by: dboy190 --- api/@ohos.data.distributedData.d.ts | 2314 +++++++-------------------- api/@ohos.data.kvStore.d.ts | 1976 +++++++++++++++++++++++ 2 files changed, 2590 insertions(+), 1700 deletions(-) create mode 100644 api/@ohos.data.kvStore.d.ts diff --git a/api/@ohos.data.distributedData.d.ts b/api/@ohos.data.distributedData.d.ts index df8c5411d5..e020a04031 100644 --- a/api/@ohos.data.distributedData.d.ts +++ b/api/@ohos.data.distributedData.d.ts @@ -20,42 +20,43 @@ import DataShareResultSet from './@ohos.data.DataShareResultSet'; import Context from './application/Context'; /** - * Providers interfaces to creat a {@link KVManager} or {@link KVManagerV9} istances. + * Providers interfaces to creat a {@link KVManager} istances. + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A - * @since 7 */ + declare namespace distributedData { /** - * Provides configuration information for {@link KVManager} or {@link KVManagerV9} instances, + * Provides configuration information for {@link KVManager} instances, * including the caller's package name and distributed network type. + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ interface KVManagerConfig { /** * Indicates the user information + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ userInfo: UserInfo; /** * Indicates the bundleName + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ bundleName: string; /** * Indicates the ability or hap context + * @since 9 * @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 - * @since 9 */ context: Context; } @@ -66,24 +67,24 @@ declare namespace distributedData { *

This class provides methods for obtaining the user ID and type, setting the user ID and type, * and checking whether two users are the same. * + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ interface UserInfo { /** * Indicates the user ID to set + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ userId?: string; /** * Indicates the user type to set + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ userType?: UserType; } @@ -91,73 +92,72 @@ declare namespace distributedData { /** * Enumerates user types. * + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ enum UserType { /** * Indicates a user that logs in to different devices using the same account. + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ SAME_USER_ID = 0 } /** * KVStore constants - * + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ namespace Constants { /** * max key length. + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ const MAX_KEY_LENGTH = 1024; /** * max value length. + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ const MAX_VALUE_LENGTH = 4194303; /** * max device coordinate key length. + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ const MAX_KEY_LENGTH_DEVICE = 896; /** * max store id length. + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ const MAX_STORE_ID_LENGTH = 128; /** * max query length. + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ const MAX_QUERY_LENGTH = 512000; /** * max batch operation size. + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ const MAX_BATCH_SIZE = 128; } @@ -167,83 +167,83 @@ declare namespace distributedData { * *

{@code ValueType} is obtained based on the value. * + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ enum ValueType { /** * Indicates that the value type is string. + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ STRING = 0, /** * Indicates that the value type is int. + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ INTEGER = 1, /** * Indicates that the value type is float. + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ FLOAT = 2, /** * Indicates that the value type is byte array. + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 * */ BYTE_ARRAY = 3, /** * Indicates that the value type is boolean. + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 * */ BOOLEAN = 4, /** * Indicates that the value type is double. + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ DOUBLE = 5 } /** - * Obtains {@code Value} objects stored in a {@link KVStore} or {@link KVStoreV9} database. + * Obtains {@code Value} objects stored in a {@link KVStore} database. * + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ interface Value { /** * Indicates value type + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @see ValueType * @type {number} * @memberof Value - * @since 7 */ type: ValueType; /** * Indicates value + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ value: Uint8Array | string | number | boolean; } @@ -251,23 +251,23 @@ declare namespace distributedData { /** * Provides key-value pairs stored in the distributed database. * + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ interface Entry { /** * Indicates key + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ key: string; /** * Indicates value + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ value: Value; } @@ -275,40 +275,40 @@ declare namespace distributedData { /** * Receives notifications of all data changes, including data insertion, update, and deletion. * - *

If you have subscribed to {@code KVStore} or {@code KVStoreV9}, you will receive data change notifications and - * obtain the changed data from the parameters in callback methods upon data insertion, update, or deletion. + *

If you have subscribed to {@code KVStore}, you will receive data change notifications and obtain the changed data + * from the parameters in callback methods upon data insertion, update, or deletion. * + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ interface ChangeNotification { /** * Indicates data addition records. + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ insertEntries: Entry[]; /** * Indicates data update records. + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ updateEntries: Entry[]; /** * Indicates data deletion records. + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ deleteEntries: Entry[]; /** * Indicates from device id. + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ deviceId: string; } @@ -316,30 +316,30 @@ declare namespace distributedData { /** * Indicates the database synchronization mode. * + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ enum SyncMode { /** * Indicates that data is only pulled from the remote end. + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ PULL_ONLY = 0, /** * Indicates that data is only pushed from the local end. + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ PUSH_ONLY = 1, /** * Indicates that data is pushed from the local end, and then pulled from the remote end. + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ PUSH_PULL = 2 } @@ -347,83 +347,83 @@ declare namespace distributedData { /** * Describes the subscription type. * + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ enum SubscribeType { /** * Subscription to local data changes + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ SUBSCRIBE_TYPE_LOCAL = 0, /** * Subscription to remote data changes + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ SUBSCRIBE_TYPE_REMOTE = 1, /** * Subscription to both local and remote data changes + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ SUBSCRIBE_TYPE_ALL = 2, } /** - * Describes the {@code KVStore} or {@code KVStoreV9}type. + * Describes the {@code KVStore} type. * + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ enum KVStoreType { /** - * Device-collaborated database, as specified by {@code DeviceKVStore} or {@code DeviceKVStoreV9} + * Device-collaborated database, as specified by {@code DeviceKVStore} + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A - * @since 7 */ DEVICE_COLLABORATION = 0, /** * Single-version database, as specified by {@code SingleKVStore} + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ SINGLE_VERSION = 1, /** * Multi-version database, as specified by {@code MultiKVStore} + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A - * @since 7 */ MULTI_VERSION = 2, } /** - * Describes the {@code KVStore} or {@code KVStoreV9} type. + * Describes the {@code KVStore} type. * + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ enum SecurityLevel { /** * NO_LEVEL: mains not set the security level. * + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A - * @since 7 */ NO_LEVEL = 0, @@ -431,9 +431,9 @@ declare namespace distributedData { * S0: mains the db is public. * There is no impact even if the data is leaked. * + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ S0 = 1, @@ -441,9 +441,9 @@ declare namespace distributedData { * S1: mains the db is low level security * There are some low impact, when the data is leaked. * + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ S1 = 2, @@ -451,9 +451,9 @@ declare namespace distributedData { * S2: mains the db is middle level security * There are some major impact, when the data is leaked. * + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ S2 = 3, @@ -461,9 +461,9 @@ declare namespace distributedData { * S3: mains the db is high level security * There are some severity impact, when the data is leaked. * + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ S3 = 5, @@ -471,72 +471,72 @@ declare namespace distributedData { * S4: mains the db is critical level security * There are some critical impact, when the data is leaked. * + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ S4 = 6, } /** - * Provides configuration options for creating a {@code KVStore} or {@code KVStoreV9}. + * Provides configuration options for creating a {@code KVStore}. * - *

You can determine whether to create another database if a {@code KVStore} or {@code KVStoreV9} database is - * missing, whether to encrypt the database, and the database type. + *

You can determine whether to create another database if a {@code KVStore} database is missing, + * whether to encrypt the database, and the database type. * + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ interface Options { /** * Indicates whether to createa database when the database file does not exist + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ createIfMissing?: boolean; /** * Indicates setting whether database files are encrypted + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ encrypt?: boolean; /** * Indicates setting whether to back up database files + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ backup?: boolean; /** * Indicates setting whether database files are automatically synchronized - * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @permission ohos.permission.DISTRIBUTED_DATASYNC * @import N/A - * @since 7 */ autoSync?: boolean; /** * Indicates setting the databse type + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ kvStoreType?: KVStoreType; /** * Indicates setting the database security level + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ securityLevel?: SecurityLevel; /** * Indicates schema object + * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A - * @since 8 */ schema?: Schema; } @@ -546,44 +546,44 @@ declare namespace distributedData { * * You can create Schema objects and put them in Options when creating or opening the database. * + * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A - * @since 8 */ class Schema { /** * A constructor used to create a Schema instance. * - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore */ constructor() /** * Indicates the root json object. * - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore */ root: FieldNode; /** * Indicates the string array of json. * - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore */ indexes: Array; /** * Indicates the mode of schema. * - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore */ mode: number; /** * Indicates the skipsize of schema. * - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore */ skip: number; } @@ -597,17 +597,17 @@ declare namespace distributedData { * *

The leaf node must have a value; the non-leaf node must have a child {@code FieldNode}. * + * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A - * @since 8 */ class FieldNode { /** * A constructor used to create a FieldNode instance with the specified field. * name Indicates the field node name. * - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore */ constructor(name: string) /** @@ -615,516 +615,469 @@ declare namespace distributedData { * *

Adding a child node makes this node a non-leaf node. Field value will be ignored if it has child node. * - * @param child The field node to append. - * @returns Returns true if the child node is successfully added to this {@code FieldNode}; returns false otherwise. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @param child The field node to append. + * @returns Returns true if the child node is successfully added to this {@code FieldNode}; returns false otherwise. */ appendChild(child: FieldNode): boolean; /** * Indicates the default value of fieldnode. - * - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore */ default: string; /** * Indicates the nullable of database field. - * - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore */ nullable: boolean; /** * Indicates the type of value. - * - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore */ type: number; } /** - * Provide methods to obtain the result set of the {@code KvStore} or {@code KvStoreV9} database. + * Provide methods to obtain the result set of the {@code KvStore} database. * - *

The result set is created by using the {@code getResultSet} method in the {@code DeviceKVStore} or - * {@code DeviceKVStoreV9} class. This interface also provides methods for moving the data read position in the result set. + *

The result set is created by using the {@code getResultSet} method in the {@code DeviceKVStore} class. This interface also provides + * methods for moving the data read position in the result set. * + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A - * @since 7 */ interface KvStoreResultSet { /** * Obtains the number of lines in a result set. * - * @returns Returns the number of lines. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @returns Returns the number of lines. */ getCount(): number; /** * Obtains the current read position in a result set. * - * @returns Returns the current read position. The read position starts with 0. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @returns Returns the current read position. The read position starts with 0. */ getPosition(): number; /** * Moves the read position to the first line. * *

If the result set is empty, false is returned. - * - * @returns Returns true if the operation succeeds; return false otherwise. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @returns Returns true if the operation succeeds; return false otherwise. */ moveToFirst(): boolean; /** * Moves the read position to the last line. * *

If the result set is empty, false is returned. - * - * @returns Returns true if the operation succeeds; return false otherwise. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @returns Returns true if the operation succeeds; return false otherwise. */ moveToLast(): boolean; /** * Moves the read position to the next line. * *

If the result set is empty or the data in the last line is being read, false is returned. - * - * @returns Returns true if the operation succeeds; return false otherwise. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @returns Returns true if the operation succeeds; return false otherwise. */ moveToNext(): boolean; /** * Moves the read position to the previous line. * *

If the result set is empty or the data in the first line is being read, false is returned. - * - * @returns Returns true if the operation succeeds; return false otherwise. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @returns Returns true if the operation succeeds; return false otherwise. */ moveToPrevious(): boolean; /** * Moves the read position by a relative offset to the current position. * - * @param offset Indicates the relative offset to the current position. Anegative offset indicates moving backwards, and a - * positive offset indicates moving forewards. Forexample, if the current position is entry 1 and thisoffset is 2, - * the destination position will be entry 3; ifthe current position is entry 3 and this offset is -2, - * the destination position will be entry 1. The valid final position after moving forwards starts with 0. If the - * final position is invalid, false will be returned. - * @returns Returns true if the operation succeeds; return false otherwise. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 - * @deprecated since 9 - * @useinstead moveV9 - */ - move(offset: number): boolean; - /** - * Moves the read position by a relative offset to the current position. - * + * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param offset Indicates the relative offset to the current position. Anegative offset indicates moving backwards, and a * positive offset indicates moving forewards. Forexample, if the current position is entry 1 and thisoffset is 2, * the destination position will be entry 3; ifthe current position is entry 3 and this offset is -2, * the destination position will be entry 1. The valid final position after moving forwards starts with 0. If the * final position is invalid, false will be returned. * @returns Returns true if the operation succeeds; return false otherwise. - * @throws {BusinessError} 401 - if parameter check failed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 */ - moveV9(offset: number): boolean; + move(offset: number): boolean; /** * Moves the read position from 0 to an absolute position. * - * @param position Indicates the absolute position. - * @returns Returns true if the operation succeeds; return false otherwise. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 - * @deprecated since 9 - * @useinstead moveToPositionV9 - */ - moveToPosition(position: number): boolean; - /** - * Moves the read position from 0 to an absolute position. - * + * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param position Indicates the absolute position. * @returns Returns true if the operation succeeds; return false otherwise. - * @throws {BusinessError} 401 - if parameter check failed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 */ - moveToPositionV9(position: number): boolean; + moveToPosition(position: number): boolean; /** * Checks whether the read position is the first line. * - * @returns Returns true if the read position is the first line; returns false otherwise. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + + * @returns Returns true if the read position is the first line; returns false otherwise. */ isFirst(): boolean; /** * Checks whether the read position is the last line. * - * @returns Returns true if the read position is the last line; returns false otherwise. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @returns Returns true if the read position is the last line; returns false otherwise. */ isLast(): boolean; /** * Checks whether the read position is before the last line. * - * @returns Returns true if the read position is before the first line; returns false otherwise. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @returns Returns true if the read position is before the first line; returns false otherwise. */ isBeforeFirst(): boolean; /** * Checks whether the read position is after the last line. * - * @returns Returns true if the read position is after the last line; returns false otherwise. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @returns Returns true if the read position is after the last line; returns false otherwise. */ isAfterLast(): boolean; /** * Obtains a key-value pair. * - * @returns Returns a key-value pair. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 - * @deprecated since 9 - * @useinstead getEntryV9 - */ - getEntry(): Entry; - /** - * Obtains a key-value pair. - * - * @returns Returns a key-value pair. - * @throws {BusinessError} 15100004 - if the data not exist when get entry. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @returns Returns a key-value pair. */ - getEntryV9(): Entry; + getEntry(): Entry; } /** * Represents a database query using a predicate. - * + * *

This class provides a constructor used to create a {@code Query} instance, which is used to query data matching specified * conditions in the database. - * + * *

This class also provides methods for adding predicates to the {@code Query} instance. - * - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @since 8 - * @deprecated since 9 - * @useinstead QueryV9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A */ class Query { /** * A constructor used to create a Query instance. - * - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core */ - constructor() + constructor() /** * Resets this {@code Query} object. - * - * @returns Returns the reset {@code Query} object. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @returns Returns the reset {@code Query} object. */ reset(): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is equal to the specified long value. - * + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value IIndicates the long value. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 */ equalTo(field: string, value: number|string|boolean): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is not equal to the specified int value. - * + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the int value. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 */ notEqualTo(field: string, value: number|string|boolean): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is greater than or equal to the * specified int value. - * + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the int value. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 */ greaterThan(field: string, value: number|string|boolean): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is less than the specified int value. - * + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the int value. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 */ lessThan(field: string, value: number|string): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is greater than or equal to the * specified int value. - * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the int value. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 */ greaterThanOrEqualTo(field: string, value: number|string): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is less than or equal to the * specified int value. - * + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the int value. - * @returns Returns the {@coed Query} object. + * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 */ lessThanOrEqualTo(field: string, value: number|string): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is null. - * + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A * @param field Indicates the field, which must start with $. and cannot contain ^. - * @returns Returns the {@coed Query} object. + * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 */ isNull(field: string): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is within the specified int value list. - * + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A * @param field Indicates the field, which must start with $. and cannot contain ^. * @param valueList Indicates the int value list. - * @returns Returns the {@coed Query} object. + * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 */ inNumber(field: string, valueList: number[]): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is within the specified string value list. - * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + + * @import N/A * @param field Indicates the field, which must start with $. and cannot contain ^. * @param valueList Indicates the string value list. - * @returns Returns the {@coed Query} object. + * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 */ inString(field: string, valueList: string[]): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is not within the specified int value list. - * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A * @param field Indicates the field, which must start with $. and cannot contain ^. * @param valueList Indicates the int value list. * @returns Returns the {@coed Query} object. - * @throws Throws this exception if input is invalid. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 + * @throws Throws this exception if input is invalid. */ notInNumber(field: string, valueList: number[]): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is not within the specified string value list. - * + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A * @param field Indicates the field, which must start with $. and cannot contain ^. * @param valueList Indicates the string value list. - * @returns Returns the {@coed Query} object. - * @throws Throws this exception if input is invalid. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 + * @returns Returns the {@coed Query} object. + * @throws Throws this exception if input is invalid. */ notInString(field: string, valueList: string[]): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is similar to the specified string value. - * + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the string value. - * @returns Returns the {@coed Query} object. - * @throws Throws this exception if input is invalid. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 + * @returns Returns the {@coed Query} object. + * @throws Throws this exception if input is invalid. */ like(field: string, value: string): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is not similar to the specified string value. - * + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the string value. - * @returns Returns the {@coed Query} object. - * @throws Throws this exception if input is invalid. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 + * @returns Returns the {@coed Query} object. + * @throws Throws this exception if input is invalid. */ unlike(field: string, value: string): Query; /** * Constructs a {@code Query} object with the and condition. - * + * *

Multiple predicates should be connected using the and or or condition. - * - * @returns Returns the {@coed Query} object. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @returns Returns the {@coed Query} object. */ and(): Query; /** * Constructs a {@code Query} object with the or condition. - * + * *

Multiple predicates should be connected using the and or or condition. - * - * @returns Returns the {@coed Query} object. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @returns Returns the {@coed Query} object. */ or(): Query; /** * Constructs a {@code Query} object to sort the query results in ascending order. - * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @returns Returns the {@coed Query} object. - * @throws Throws this exception if input is invalid. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @returns Returns the {@coed Query} object. + * @throws Throws this exception if input is invalid. */ orderByAsc(field: string): Query; /** * Constructs a {@code Query} object to sort the query results in descending order. - * + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A * @param field Indicates the field, which must start with $. and cannot contain ^. * @returns Returns the {@coed Query} object. - * @throws Throws this exception if input is invalid. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 + * @throws Throws this exception if input is invalid. */ orderByDesc(field: string): Query; /** * Constructs a {@code Query} object to specify the number of results and the start position. - * + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A * @param total Indicates the number of results. * @param offset Indicates the start position. * @returns Returns the {@coed Query} object. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 */ limit(total: number, offset: number): Query; /** * Creates a {@code query} condition with a specified field that is not null. - * + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A * @param field Indicates the specified field. * @returns Returns the {@coed Query} object. - * @throws Throws this exception if input is invalid. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 + * @throws Throws this exception if input is invalid. */ isNotNull(field: string): Query; /** * Creates a query condition group with a left bracket. - * + * *

Multiple query conditions in an {@code Query} object can be grouped. The query conditions in a group can be used as a * whole to combine with other query conditions. - * - * @returns Returns the {@coed Query} object. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @returns Returns the {@coed Query} object. */ beginGroup(): Query; /** * Creates a query condition group with a right bracket. - * + * *

Multiple query conditions in an {@code Query} object can be grouped. The query conditions in a group can be used as a * whole to combine with other query conditions. - * - * @returns Returns the {@coed Query} object. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @returns Returns the {@coed Query} object. */ endGroup(): Query; /** * Creates a query condition with a specified key prefix. - * + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A * @param prefix Indicates the specified key prefix. * @returns Returns the {@coed Query} object. - * @throws Throws this exception if input is invalid. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 + * @throws Throws this exception if input is invalid. */ prefixKey(prefix: string): Query; /** * Sets a specified index that will be preferentially used for query. * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A * @param index Indicates the index to set. * @returns Returns the {@coed Query} object. - * @throws Throws this exception if input is invalid. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 + * @throws Throws this exception if input is invalid. */ setSuggestIndex(index: string): Query; /** * Add device ID key prefix.Used by {@code DeviceKVStore}. * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A * @param deviceId Specify device id to query from. * @return Returns the {@code Query} object with device ID prefix added. * @throw Throws this exception if input is invalid. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 */ deviceId(deviceId:string):Query; /** @@ -1132,593 +1085,95 @@ declare namespace distributedData { * *

The String would be parsed to DB query format. * The String length should be no longer than 500kb. - * - * @return String representing this {@code Query}. - * @import N/A + * + * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 + * @import N/A + * @return String representing this {@code Query}. */ getSqlLike():string; } /** - * Represents a database query using a predicate. - * - *

This class provides a constructor used to create a {@code QueryV9} instance, which is used to query data - * matching specified conditions in the database. + * Represents a key-value distributed database and provides methods for adding, deleting, modifying, querying, + * and subscribing to distributed data. * - *

This class also provides methods for adding predicates to the {@code QueryV9} instance. + *

You can create distributed databases of different types by {@link KVManager#getKVStore (Options, String)} + * with input parameter {@code Options}. Distributed database types are defined in {@code KVStoreType}, + * including {@code SingleKVStore}. * - * @import N/A + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @import N/A + * @version 1 */ - class QueryV9 { + interface KVStore { /** - * A constructor used to create a Query instance. + * Writes a key-value pair of the string type into the {@code KvStore} database. * + *

If you do not want to synchronize this key-value pair to other devices, set the write option in the local database. + * + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @param key Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. + * Spaces before and after the key will be cleared. + * @param value Indicates the string value, which must be less than 4 MB as a UTF-8 byte array. + * @throws Throws this exception if any of the following errors + * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and + * {@code DB_ERROR}. */ - constructor() - /** - * Resets this {@code QueryV9} object. - * - * @returns Returns the reset {@code QueryV9} object. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + put(key: string, value: Uint8Array | string | number | boolean, callback: AsyncCallback): void; + put(key: string, value: Uint8Array | string | number | boolean): Promise; + + /** + * Writes a value of the valuesbucket type into the {@code KvStore} database. + * * @since 9 - */ - reset(): QueryV9; - /** - * Constructs a {@code QueryV9} object to query entries with the specified field whose value is equal to the specified long value. - * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @param value IIndicates the long value. - * @returns Returns the {@coed QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @systemapi + * @param value Indicates the data record to put. + * Spaces before and after the key will be cleared. + * @throws Throws this exception if any of the following errors + * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and + * {@code DB_ERROR}. */ - equalTo(field: string, value: number|string|boolean): QueryV9; + putBatch(value: Array, callback: AsyncCallback): void; + putBatch(value: Array): Promise; + /** - * Constructs a {@code QueryV9} object to query entries with the specified field whose value is not equal to the specified int value. + * Deletes the key-value pair based on a specified key. * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @param value Indicates the int value. - * @returns Returns the {@coed QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - notEqualTo(field: string, value: number|string|boolean): QueryV9; - /** - * Constructs a {@code QueryV9} object to query entries with the specified field whose value is greater than or equal to the - * specified int value. - * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @param value Indicates the int value. - * @returns Returns the {@coed QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - greaterThan(field: string, value: number|string|boolean): QueryV9; - /** - * Constructs a {@code QueryV9} object to query entries with the specified field whose value is less than the specified int value. - * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @param value Indicates the int value. - * @returns Returns the {@coed QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - lessThan(field: string, value: number|string): QueryV9; - /** - * Constructs a {@code QueryV9} object to query entries with the specified field whose value is greater than or - * equal to the specified int value. - * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @param value Indicates the int value. - * @returns Returns the {@coed QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - greaterThanOrEqualTo(field: string, value: number|string): QueryV9; - /** - * Constructs a {@code QueryV9} object to query entries with the specified field whose value is less than or equal to the - * specified int value. - * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @param value Indicates the int value. - * @returns Returns the {@coed QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - lessThanOrEqualTo(field: string, value: number|string): QueryV9; - /** - * Constructs a {@code QueryV9} object to query entries with the specified field whose value is null. - * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @returns Returns the {@coed QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - isNull(field: string): QueryV9; - /** - * Constructs a {@code QueryV9} object to query entries with the specified field whose value is within the specified int value list. - * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @param valueList Indicates the int value list. - * @returns Returns the {@coed QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - inNumber(field: string, valueList: number[]): QueryV9; - /** - * Constructs a {@code QueryV9} object to query entries with the specified field whose value is within the specified string value list. - * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @param valueList Indicates the string value list. - * @returns Returns the {@coed QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - inString(field: string, valueList: string[]): QueryV9; - /** - * Constructs a {@code QueryV9} object to query entries with the specified field whose value is not within the specified int value list. - * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @param valueList Indicates the int value list. - * @returns Returns the {@coed QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - notInNumber(field: string, valueList: number[]): QueryV9; - /** - * Constructs a {@code QueryV9} object to query entries with the specified field whose value is not within the specified string value list. - * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @param valueList Indicates the string value list. - * @returns Returns the {@coed QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - notInString(field: string, valueList: string[]): QueryV9; - /** - * Constructs a {@code QueryV9} object to query entries with the specified field whose value is similar to the specified string value. - * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @param value Indicates the string value. - * @returns Returns the {@coed QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - like(field: string, value: string): QueryV9; - /** - * Constructs a {@code QueryV9} object to query entries with the specified field whose value is not similar to the specified string value. - * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @param value Indicates the string value. - * @returns Returns the {@coed QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - unlike(field: string, value: string): QueryV9; - /** - * Constructs a {@code QueryV9} object with the and condition. - * - *

Multiple predicates should be connected using the and or or condition. - * - * @returns Returns the {@coed QueryV9} object. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - and(): QueryV9; - /** - * Constructs a {@code QueryV9} object with the or condition. - * - *

Multiple predicates should be connected using the and or or condition. - * - * @returns Returns the {@coed QueryV9} object. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - or(): QueryV9; - /** - * Constructs a {@code QueryV9} object to sort the query results in ascending order. - * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @returns Returns the {@coed QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - orderByAsc(field: string): QueryV9; - /** - * Constructs a {@code QueryV9} object to sort the query results in descending order. - * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @returns Returns the {@coed QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - orderByDesc(field: string): QueryV9; - /** - * Constructs a {@code QueryV9} object to specify the number of results and the start position. - * - * @param total Indicates the number of results. - * @param offset Indicates the start position. - * @returns Returns the {@coed QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - limit(total: number, offset: number): QueryV9; - /** - * Creates a {@code QueryV9} condition with a specified field that is not null. - * - * @param field Indicates the specified field. - * @returns Returns the {@coed QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - isNotNull(field: string): QueryV9; - /** - * Creates a query condition group with a left bracket. - * - *

Multiple query conditions in an {@code QueryV9} object can be grouped. The query conditions in a group can be used as a - * whole to combine with other query conditions. - * - * @returns Returns the {@coed QueryV9} object. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - beginGroup(): QueryV9; - /** - * Creates a query condition group with a right bracket. - * - *

Multiple query conditions in an {@code QueryV9} object can be grouped. The query conditions in a group can be used as a - * whole to combine with other query conditions. - * - * @returns Returns the {@coed QueryV9} object. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - endGroup(): QueryV9; - /** - * Creates a query condition with a specified key prefix. - * - * @param prefix Indicates the specified key prefix. - * @returns Returns the {@coed QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - prefixKey(prefix: string): QueryV9; - /** - * Sets a specified index that will be preferentially used for query. - * - * @param index Indicates the index to set. - * @returns Returns the {@coed QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - setSuggestIndex(index: string): QueryV9; - /** - * Add device ID key prefix.Used by {@code DeviceKVStore}. - * - * @param deviceId Specify device id to query from. - * @return Returns the {@code QueryV9} object with device ID prefix added. - * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - deviceId(deviceId:string):QueryV9; - /** - * Get a String that repreaents this {@code QueryV9}. - * - *

The String would be parsed to DB query format. - * The String length should be no longer than 500kb. - * - * @return String representing this {@code QueryV9}. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - getSqlLike():string; - } - - /** - * Represents a key-value distributed database and provides methods for adding, deleting, modifying, querying, - * and subscribing to distributed data. - * - *

You can create distributed databases of different types by {@link KVManager#getKVStore (Options, String)} - * with input parameter {@code Options}. Distributed database types are defined in {@code KVStoreType}, - * including {@code SingleKVStore}. - * - * - * @import N/A - * @version 1 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 7 - * @deprecated since 9 - * @useinstead KVStoreV9 - */ - interface KVStore { - /** - * Writes a key-value pair of the string type into the {@code KvStore} database. - * - *

If you do not want to synchronize this key-value pair to other devices, set the write option in the local database. - * * @param key Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. * Spaces before and after the key will be cleared. - * @param value Indicates the string value, which must be less than 4 MB as a UTF-8 byte array. - * @throws Throws this exception if any of the following errors - * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 7 - */ - put(key: string, value: Uint8Array | string | number | boolean, callback: AsyncCallback): void; - put(key: string, value: Uint8Array | string | number | boolean): Promise; - - /** - * Deletes the key-value pair based on a specified key. - * - * @param key Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. - * Spaces before and after the key will be cleared. - * @throws Throws this exception if any of the following errors + * @throws Throws this exception if any of the following errors * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and * {@code DB_ERROR}, and {@code KEY_NOT_FOUND}. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 7 */ delete(key: string, callback: AsyncCallback): void; delete(key: string): Promise; - /** - * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in - * {@code KvStoreObserver} will be invoked. - * - * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. - * @param listener Indicates the observer of data change events in the distributed database. - * @throws Throws this exception if any of the following errors - * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, - * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 7 - */ - on(event: 'dataChange', type: SubscribeType, listener: Callback): void; - - /** - * Subscribes from the {@code KvStore} database based on the specified subscribeType and {@code KvStoreObserver}. - * - * @throws Throws this exception if any of the following errors - * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, - * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 7 - */ - on(event: 'syncComplete', syncCallback: Callback>): void; - - /** - * Unsubscribes from the {@code KvStore} database based on the specified subscribeType and {@code KvStoreObserver}. - * - * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. - * @throws Throws this exception if any of the following errors - * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, - * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 - */ - off(event: 'dataChange', listener?: Callback): void; - - /** - * Inserts key-value pairs into the {@code KvStore} database in batches. - * - * @param entries Indicates the key-value pairs to be inserted in batches. - * @throws Throws this exception if a database error occurs. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 - */ - putBatch(entries: Entry[], callback: AsyncCallback): void; - putBatch(entries: Entry[]): Promise; - - /** - * Deletes key-value pairs in batches from the {@code KvStore} database. - * - * @param keys Indicates the key-value pairs to be deleted in batches. - * @throws Throws this exception if a database error occurs. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 - */ - deleteBatch(keys: string[], callback: AsyncCallback): void; - deleteBatch(keys: string[]): Promise; - - /** - * Starts a transaction operation in the {@code KvStore} database. - * - *

After the database transaction is started, you can submit or roll back the operation. - * - * @throws Throws this exception if a database error occurs. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 - */ - startTransaction(callback: AsyncCallback): void; - startTransaction(): Promise; - - /** - * Submits a transaction operation in the {@code KvStore} database. - * - * @param callback - * @throws Throws this exception if a database error occurs. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 - */ - commit(callback: AsyncCallback): void; - commit(): Promise; - - /** - * Rolls back a transaction operation in the {@code KvStore} database. - * - * @throws Throws this exception if a database error occurs. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 - */ - rollback(callback: AsyncCallback): void; - rollback(): Promise; - - /** - * Sets whether to enable synchronization. - * - * @param enabled Specifies whether to enable synchronization. The value true means to enable - * synchronization, and false means the opposite. - * @throws Throws this exception if an internal service error occurs. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 - */ - enableSync(enabled: boolean, callback: AsyncCallback): void; - enableSync(enabled: boolean): Promise; - - /** - * Sets synchronization range labels. - * - *

The labels determine the devices with which data will be synchronized. - * - * @param localLabels Indicates the synchronization labels of the local device. - * @param remoteSupportLabels Indicates the labels of the devices with which data will be synchronized. - * @throws Throws this exception if an internal service error occurs. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 - */ - setSyncRange(localLabels: string[], remoteSupportLabels: string[], callback: AsyncCallback): void; - setSyncRange(localLabels: string[], remoteSupportLabels: string[]): Promise; - } - - /** - * Represents a key-value distributed database and provides methods for adding, deleting, modifying, querying, - * and subscribing to distributed data. - * - *

You can create distributed databases of different types by {@link KVManagerV9#getKVStore (Options, String)} - * with input parameter {@code Options}. Distributed database types are defined in {@code KVStoreType}, - * including {@code SingleKVStoreV9}. - * - * @import N/A - * @version 1 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - interface KVStoreV9 { - /** - * Writes a key-value pair of the string type into the {@code KvStoreV9} database. - * - *

If you do not want to synchronize this key-value pair to other devices, set the write option in the local database. - * - * @param key Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. - * Spaces before and after the key will be cleared. - * @param value Indicates the string value, which must be less than 4 MB as a UTF-8 byte array. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + /** + * Deletes the key-value pair based on a specified key. * @since 9 - */ - put(key: string, value: Uint8Array | string | number | boolean, callback: AsyncCallback): void; - put(key: string, value: Uint8Array | string | number | boolean): Promise; - - /** - * Writes a value of the valuesbucket type into the {@code KvStoreV9} database. - * - * @param value Indicates the data record to put. - * Spaces before and after the key will be cleared. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @systemapi - * @since 9 - */ - putBatch(value: Array, callback: AsyncCallback): void; - putBatch(value: Array): Promise; - - /** - * Deletes the key-value pair based on a specified key. - * - * @param key Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. - * Spaces before and after the key will be cleared. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100004 - if the data not exist when delete data. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - delete(key: string, callback: AsyncCallback): void; - delete(key: string): Promise; - - /** - * Deletes the key-value pair based on a specified key. - * * @param predicates Indicates the datasharePredicates. * Spaces before and after the key will be cleared. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100004 - if the data not exist when delete data. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @systemapi - * @since 9 - + * @throws Throws this exception if any of the following errors + * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and + * {@code DB_ERROR}. */ delete(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback); delete(predicates: dataSharePredicates.DataSharePredicates): Promise; - + /** * Backs up a database in a specified name. * - * @param file Indicates the name that saves the database backup. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100005 - if not support the operation. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param file Indicates the name that saves the database backup. */ backup(file:string, callback: AsyncCallback):void; backup(file:string): Promise; @@ -1726,12 +1181,9 @@ declare namespace distributedData { /** * Restores a database from a specified database file. * - * @param file Indicates the name that saves the database file. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100005 - if not support the operation. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param file Indicates the name that saves the database file. */ restore(file:string, callback: AsyncCallback):void; restore(file:string): Promise; @@ -1739,140 +1191,138 @@ declare namespace distributedData { /** * Delete a backup files based on a specified name. * - * @param files list Indicates the name that backup file to delete. - * @throws {BusinessError} 401 - if parameter check failed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param files list Indicates the name that backup file to delete. */ deleteBackup(files:Array, callback: AsyncCallback>):void; deleteBackup(files:Array): Promise>; /** - * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in + * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in * {@code KvStoreObserver} will be invoked. * + * @since 7 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. * @param listener Indicates the observer of data change events in the distributed database. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100001 - if the database has been subscribed over the max subscription time limit. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @throws Throws this exception if any of the following errors + * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, + * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. */ on(event: 'dataChange', type: SubscribeType, listener: Callback): void; /** - * Subscribes from the {@code KvStoreV9} database based on the specified subscribeType and {@code KvStoreObserver}. - * - * @throws {BusinessError} 401 - if parameter check failed. + * Subscribes from the {@code KvStore} database based on the specified subscribeType and {@code KvStoreObserver}. + * + * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @throws Throws this exception if any of the following errors + * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, + * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. */ on(event: 'syncComplete', syncCallback: Callback>): void; - + /** - * Unsubscribes from the {@code KvStoreV9} database based on the specified subscribeType and {@code KvStoreObserver}. + * Unsubscribes from the {@code KvStore} database based on the specified subscribeType and {@code KvStoreObserver}. * - * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. + * @throws Throws this exception if any of the following errors + * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, + * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. */ off(event:'dataChange', listener?: Callback): void; /** - * UnRegister Synchronizes {@code KvStoreV9} database callback. - * - * @param syncCallback Indicates the callback used to send the synchronization result to caller. - * @throws {BusinessError} 401 - if parameter check failed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * UnRegister Synchronizes {@code KvStore} database callback. * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param syncCallback Indicates the callback used to send the synchronization result to caller. + * @throws Throws this exception if any of the following errors + * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, + * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. */ off(event: 'syncComplete', syncCallback?: Callback>): void; /** - * Inserts key-value pairs into the {@code KvStoreV9} database in batches. - * - * @param entries Indicates the key-value pairs to be inserted in batches. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * Inserts key-value pairs into the {@code KvStore} database in batches. + * + * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @param entries Indicates the key-value pairs to be inserted in batches. + * @throws Throws this exception if a database error occurs. */ putBatch(entries: Entry[], callback: AsyncCallback): void; putBatch(entries: Entry[]): Promise; /** - * Deletes key-value pairs in batches from the {@code KvStoreV9} database. - * - * @param keys Indicates the key-value pairs to be deleted in batches. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100004 - if the data not exist when delete data. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * Deletes key-value pairs in batches from the {@code KvStore} database. + * + * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @param keys Indicates the key-value pairs to be deleted in batches. + * @throws Throws this exception if a database error occurs. */ deleteBatch(keys: string[], callback: AsyncCallback): void; deleteBatch(keys: string[]): Promise; /** - * Starts a transaction operation in the {@code KvStoreV9} database. - * + * Starts a transaction operation in the {@code KvStore} database. + * *

After the database transaction is started, you can submit or roll back the operation. - * - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * + * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @throws Throws this exception if a database error occurs. */ startTransaction(callback: AsyncCallback): void; startTransaction(): Promise; /** - * Submits a transaction operation in the {@code KvStoreV9} database. - * - * @param callback - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * Submits a transaction operation in the {@code KvStore} database. + * + * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @param callback + * @throws Throws this exception if a database error occurs. */ commit(callback: AsyncCallback): void; commit(): Promise; /** - * Rolls back a transaction operation in the {@code KvStoreV9} database. - * - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * Rolls back a transaction operation in the {@code KvStore} database. + * + * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @throws Throws this exception if a database error occurs. */ rollback(callback: AsyncCallback): void; rollback(): Promise; /** * Sets whether to enable synchronization. - * + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param enabled Specifies whether to enable synchronization. The value true means to enable * synchronization, and false means the opposite. - * @throws {BusinessError} 401 - if parameter check failed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @throws Throws this exception if an internal service error occurs. */ enableSync(enabled: boolean, callback: AsyncCallback): void; enableSync(enabled: boolean): Promise; /** * Sets synchronization range labels. - * + * *

The labels determine the devices with which data will be synchronized. - * + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param localLabels Indicates the synchronization labels of the local device. * @param remoteSupportLabels Indicates the labels of the devices with which data will be synchronized. - * @throws {BusinessError} 401 - if parameter check failed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @throws Throws this exception if an internal service error occurs. */ setSyncRange(localLabels: string[], remoteSupportLabels: string[], callback: AsyncCallback): void; setSyncRange(localLabels: string[], remoteSupportLabels: string[]): Promise; @@ -1888,51 +1338,49 @@ declare namespace distributedData { * The {@code SingleKVStore} database does not support * synchronous transactions, or data search using snapshots. * + * @since 7 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @version 1 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 7 - * @deprecated since 9 - * @useinstead SingleKVStoreV9 */ interface SingleKVStore extends KVStore { /** * Obtains the {@code String} value of a specified key. - * + * + * @since 7 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A * @param key Indicates the key of the boolean value to be queried. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}, and {@code KEY_NOT_FOUND}. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 7 */ get(key: string, callback: AsyncCallback): void; get(key: string): Promise; /** * Obtains all key-value pairs that match a specified key prefix. - * + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A * @param keyPrefix Indicates the key prefix to match. * @returns Returns the list of all key-value pairs that match the specified key prefix. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 */ getEntries(keyPrefix: string, callback: AsyncCallback): void; getEntries(keyPrefix: string): Promise; /** * Obtains the list of key-value pairs matching the specified {@code Query} object. - * + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A * @param query Indicates the {@code Query} object. * @returns Returns the list of key-value pairs matching the specified {@code Query} object. * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 */ getEntries(query: Query, callback: AsyncCallback): void; getEntries(query: Query): Promise; @@ -1943,63 +1391,78 @@ declare namespace distributedData { * {@code KvStoreResultSet} objects at the same time. If you have created four objects, calling this method will return a * failure. Therefore, you are advised to call the closeResultSet method to close unnecessary {@code KvStoreResultSet} objects * in a timely manner. - * + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A * @param keyPrefix Indicates the key prefix to match. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 */ getResultSet(keyPrefix: string, callback: AsyncCallback): void; getResultSet(keyPrefix: string): Promise; /** * Obtains the {@code KvStoreResultSet} object matching the specified {@code Query} object. - * + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A * @param query Indicates the {@code Query} object. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 */ getResultSet(query: Query, callback: AsyncCallback): void; getResultSet(query: Query): Promise; /** - * Closes a {@code KvStoreResultSet} object returned by getResultSet. + * Obtains the KvStoreResultSet object matching the specified Predicate object. * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @systemapi + * @param predicates Indicates the datasharePredicates. + * Spaces before and after the key will be cleared. + * @throws Throws this exception if any of the following errors + * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and + * {@code DB_ERROR}. + */ + getResultSet(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; + getResultSet(predicates: dataSharePredicates.DataSharePredicates): Promise; + + /** + * Closes a {@code KvStoreResultSet} object returned by getResultSet. + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A * @param resultSet Indicates the {@code KvStoreResultSet} object to close. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 */ closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; closeResultSet(resultSet: KvStoreResultSet): Promise; /** * Obtains the number of results matching the specified {@code Query} object. - * + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A * @param query Indicates the {@code Query} object. * @returns Returns the number of results matching the specified {@code Query} object. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 */ getResultSize(query: Query, callback: AsyncCallback): void; getResultSize(query: Query): Promise; /** * void removeDeviceData​({@link String} deviceId) throws {@link KvStoreException} - * - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A */ removeDeviceData(deviceId: string, callback: AsyncCallback): void; removeDeviceData(deviceId: string): Promise; @@ -2007,735 +1470,306 @@ declare namespace distributedData { /** * Synchronizes the database to the specified devices with the specified delay allowed. * + * @since 7 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param deviceIds Indicates the list of devices to which to synchronize the database. * @param mode Indicates the synchronization mode. The value can be {@code PUSH}, {@code PULL}, or {@code PUSH_PULL}. * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. * @throws Throws this exception if any of the following errors * @permission ohos.permission.DISTRIBUTED_DATASYNC - * occurs: {@code INVALID_ARGUMENT}, + * occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 7 - */ - sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; - - /** - * Register Synchronizes SingleKvStore databases callback. - *

Sync result is returned through asynchronous callback. - * - * @param syncCallback Indicates the callback used to send the synchronization result to the caller. - * @throws Throws this exception if no {@code SingleKvStore} database is available. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 - */ - on(event: 'syncComplete', syncCallback: Callback>): void; - - /** - * UnRegister Synchronizes SingleKvStore databases callback. - * - * @throws Throws this exception if no {@code SingleKvStore} database is available. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 - */ - off(event: 'syncComplete', syncCallback?: Callback>): void; - - /** - * Sets the default delay allowed for database synchronization - * - * @param defaultAllowedDelayMs Indicates the default delay allowed for the database synchronization, in milliseconds. - * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, - * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 - */ - setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback): void; - setSyncParam(defaultAllowedDelayMs: number): Promise; - - /** - * Get the security level of the database. - * - * @returns SecurityLevel {@code SecurityLevel} the security level of the database. - * @throws Throws this exception if any of the following errors occurs:{@code SERVER_UNAVAILABLE}, - * {@code IPC_ERROR}, and {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 - */ - getSecurityLevel(callback: AsyncCallback): void; - getSecurityLevel(): Promise; - } - - /** - * Provides methods related to single-version distributed databases. - * - *

To create a {@code SingleKVStoreV9} database, - * you can use the {@link data.distributed.common.KVManagerV9#getKVStore​(Options, String)} method - * with {@code KVStoreType} set to {@code SINGLE_VERSION} for the input parameter {@code Options}. - * This database synchronizes data to other databases in time sequence. - * The {@code SingleKVStoreV9} database does not support - * synchronous transactions, or data search using snapshots. - * - * @import N/A - * @version 1 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - interface SingleKVStoreV9 extends KVStoreV9 { - /** - * Obtains the {@code String} value of a specified key. - * - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100004 - if the data not exist when query data. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - get(key: string, callback: AsyncCallback): void; - get(key: string): Promise; - - /** - * Obtains all key-value pairs that match a specified key prefix. - * - * @param keyPrefix Indicates the key prefix to match. - * @returns Returns the list of all key-value pairs that match the specified key prefix. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - getEntries(keyPrefix: string, callback: AsyncCallback): void; - getEntries(keyPrefix: string): Promise; - - /** - * Obtains the list of key-value pairs matching the specified {@code QueryV9} object. - * - * @param query Indicates the {@code QueryV9} object. - * @returns Returns the list of key-value pairs matching the specified {@code QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100005 - if not support the operation. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - getEntries(query: QueryV9, callback: AsyncCallback): void; - getEntries(query: QueryV9): Promise; - - /** - * Obtains the result sets with a specified prefix from a {@code KvStoreV9} database. The {@code KvStoreResultSet} - * object can be used to query all key-value pairs that meet the search criteria. Each {@code KvStoreV9} - * instance can have a maximum of four {@code KvStoreResultSet} objects at the same time. If you have created - * four objects, calling this method will return a failure. Therefore, you are advised to call the closeResultSet - * method to close unnecessary {@code KvStoreResultSet} objects in a timely manner. - * - * @param keyPrefix Indicates the key prefix to match. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - getResultSet(keyPrefix: string, callback: AsyncCallback): void; - getResultSet(keyPrefix: string): Promise; - - /** - * Obtains the {@code KvStoreResultSet} object matching the specified {@code QueryV9} object. - * - * @param query Indicates the {@code QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - getResultSet(query: QueryV9, callback: AsyncCallback): void; - getResultSet(query: QueryV9): Promise; - - /** - * Obtains the KvStoreResultSet object matching the specified Predicate object. - * - * @param predicates Indicates the datasharePredicates. - * Spaces before and after the key will be cleared. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @systemapi - * @since 9 - */ - getResultSet(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; - getResultSet(predicates: dataSharePredicates.DataSharePredicates): Promise; - - /** - * Closes a {@code KvStoreResultSet} object returned by getResultSet. - * - * @param resultSet Indicates the {@code KvStoreResultSet} object to close. - * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; - closeResultSet(resultSet: KvStoreResultSet): Promise; - - /** - * Obtains the number of results matching the specified {@code QueryV9} object. - * - * @param query Indicates the {@code QueryV9} object. - * @returns Returns the number of results matching the specified {@code QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - getResultSize(query: QueryV9, callback: AsyncCallback): void; - getResultSize(query: QueryV9): Promise; - - /** - * void removeDeviceData​({@link String} deviceId) throws {@link KvStoreException} - * - * @param deviceId Indicates the device to be removed data. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - removeDeviceData(deviceId: string, callback: AsyncCallback): void; - removeDeviceData(deviceId: string): Promise; - - /** - * Synchronizes the database to the specified devices with the specified delay allowed. - * - * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @param deviceIds Indicates the list of devices to which to synchronize the database. - * @param mode Indicates the synchronization mode. The value can be {@code PUSH}, {@code PULL}, or {@code PUSH_PULL}. - * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100004 - if the database not exist when sync data. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 */ - sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void + sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void /** * Synchronizes the database to the specified devices with the specified delay allowed. * - * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param deviceIds Indicates the list of devices to which to synchronize the database. * @param mode Indicates the synchronization mode. The value can be {@code PUSH}, {@code PULL}, or {@code PUSH_PULL}. * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. - * @param query Indicates the {@code QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100004 - if the database not exist when sync data. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @param query Indicates the {@code Query} object. + * @throws Throws this exception if any of the following errors + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * occurs: {@code INVALID_ARGUMENT}, + * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. */ - sync(deviceIds: string[], query: QueryV9, mode: SyncMode, delayMs?: number): void; - + sync(deviceIds: string[], query: Query, mode: SyncMode, delayMs?: number): void; + /** - * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in + * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in * {@code KvStoreObserver} will be invoked. * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. * @param listener Indicates the observer of data change events in the distributed database. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100001 - if the database has been subscribed over the max subscription time limit. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @throws Throws this exception if no {@code SingleKvStore} database is available. + * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. */ - on(event: 'dataChange', type: SubscribeType, listener: Callback): void; + on(event: 'dataChange', type: SubscribeType, listener: Callback): void; /** - * Register Synchronizes SingleKvStore databases callback. + * Register Synchronizes SingleKvStore databases callback. *

Sync result is returned through asynchronous callback. - * - * @param syncCallback Indicates the callback used to send the synchronization result to the caller. - * @throws {BusinessError} 401 - if parameter check failed. + * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @param syncCallback Indicates the callback used to send the synchronization result to the caller. + * @throws Throws this exception if no {@code SingleKvStore} database is available. */ - on(event: 'syncComplete', syncCallback: Callback>): void; + on(event: 'syncComplete', syncCallback: Callback>): void; /** * Unsubscribes from the SingleKvStore database based on the specified subscribeType and {@code KvStoreObserver}. - * - * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 - */ - off(event:'dataChange', listener?: Callback): void; - - /** - * UnRegister Synchronizes SingleKvStore databases callback. - * - * @throws {BusinessError} 401 - if parameter check failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. + * @throws Throws this exception if any of the following errors + * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, + * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. */ - off(event: 'syncComplete', syncCallback?: Callback>): void; - + off(event:'dataChange', listener?: Callback): void; /** - * Sets the default delay allowed for database synchronization - * - * @param defaultAllowedDelayMs Indicates the default delay allowed for the database synchronization, in milliseconds. - * @throws {BusinessError} 401 - if parameter check failed. + * UnRegister Synchronizes SingleKvStore databases callback. + * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @throws Throws this exception if no {@code SingleKvStore} database is available. */ - setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback): void; - setSyncParam(defaultAllowedDelayMs: number): Promise; + off(event: 'syncComplete', syncCallback?: Callback>): void; + + + /** + * Sets the default delay allowed for database synchronization + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param defaultAllowedDelayMs Indicates the default delay allowed for the database synchronization, in milliseconds. + * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, + * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. + */ + setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback): void; + setSyncParam(defaultAllowedDelayMs: number): Promise; - /** - * Get the security level of the database. - * - * @returns SecurityLevel {@code SecurityLevel} the security level of the database. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - getSecurityLevel(callback: AsyncCallback): void; - getSecurityLevel(): Promise; + /** + * Get the security level of the database. + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @returns SecurityLevel {@code SecurityLevel} the security level of the database. + * @throws Throws this exception if any of the following errors occurs:{@code SERVER_UNAVAILABLE}, + * {@code IPC_ERROR}, and {@code DB_ERROR}. + */ + getSecurityLevel(callback: AsyncCallback): void; + getSecurityLevel(): Promise; } /** * Manages distributed data by device in a distributed system. - * + * *

To create a {@code DeviceKVStore} database, you can use the {@link data.distributed.common.KVManager.getKvStore(Options, String)} * method with {@code KvStoreType} set to {@code DEVICE_COLLABORATION} for the input parameter Options. This database manages distributed * data by device, and cannot modify data synchronized from remote devices. When an application writes a key-value pair entry * into the database, the system automatically adds the ID of the device running the application to the key. - * - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * * @since 8 - * @deprecated since 9 - * @useinstead DeviceKVStoreV9 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @import N/A */ interface DeviceKVStore extends KVStore { /** * Obtains the {@code String} value matching a specified device ID and key. * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deviceId Indicates the device to be queried. * @param key Indicates the key of the value to be queried. * @return Returns the value matching the given criteria. * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}, and {@code KEY_NOT_FOUND}. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 */ get(deviceId: string, key: string, callback: AsyncCallback): void; get(deviceId: string, key: string): Promise; /** * Obtains all key-value pairs matching a specified device ID and key prefix. - * + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deviceId Identifies the device whose data is to be queried. * @param keyPrefix Indicates the key prefix to match. * @returns Returns the list of all key-value pairs meeting the given criteria. * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 */ getEntries(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; getEntries(deviceId: string, keyPrefix: string): Promise; /** * Obtains the list of key-value pairs matching the specified {@code Query} object. - * + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param query Indicates the {@code Query} object. * @returns Returns the list of key-value pairs matching the specified {@code Query} object. * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 */ getEntries(query: Query, callback: AsyncCallback): void; getEntries(query: Query): Promise; /** * Obtains the list of key-value pairs matching a specified device ID and {@code Query} object. - * + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deviceId Indicates the ID of the device to which the key-value pairs belong. * @param query Indicates the {@code Query} object. * @returns Returns the list of key-value pairs matching the specified {@code Query} object. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 */ getEntries(deviceId: string, query: Query, callback: AsyncCallback): void; getEntries(deviceId: string, query: Query): Promise; /** * Obtains the {@code KvStoreResultSet} object matching the specified device ID and key prefix. - * + * *

The {@code KvStoreResultSet} object can be used to query all key-value pairs that meet the search criteria. Each {@code KvStore} * instance can have a maximum of four {@code KvStoreResultSet} objects at the same time. If you have created four objects, * calling this method will return a failure. Therefore, you are advised to call the closeResultSet method to close unnecessary * {@code KvStoreResultSet} objects in a timely manner. - * + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deviceId Identifies the device whose data is to be queried. * @param keyPrefix Indicates the key prefix to match. * @returns Returns the {@code KvStoreResultSet} objects. * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 */ getResultSet(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; getResultSet(deviceId: string, keyPrefix: string): Promise; /** * Obtains the {@code KvStoreResultSet} object matching the specified {@code Query} object. - * + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param query Indicates the {@code Query} object. * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code Query} object. * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 */ getResultSet(query: Query, callback: AsyncCallback): void; getResultSet(query: Query): Promise; - /** - * Obtains the {@code KvStoreResultSet} object matching a specified device ID and {@code Query} object. - * - * @param deviceId Indicates the ID of the device to which the {@code KvStoreResultSet} object belongs. - * @param query Indicates the {@code Query} object. - * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code Query} object. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - */ - getResultSet(deviceId: string, query: Query, callback: AsyncCallback): void; - getResultSet(deviceId: string, query: Query): Promise; - - /** - * Closes a {@code KvStoreResultSet} object returned by getResultSet. - * - * @param resultSet Indicates the {@code KvStoreResultSet} object to close. - * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, - * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - */ - closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; - closeResultSet(resultSet: KvStoreResultSet): Promise; - - /** - * Obtains the number of results matching the specified {@code Query} object. - * - * @param query Indicates the {@code Query} object. - * @returns Returns the number of results matching the specified {@code Query} object. - * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, - * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - */ - getResultSize(query: Query, callback: AsyncCallback): void; - getResultSize(query: Query): Promise; - - /** - * Obtains the number of results matching a specified device ID and {@code Query} object. - * - * @param deviceId Indicates the ID of the device to which the results belong. - * @param query Indicates the {@code Query} object. - * @returns Returns the number of results matching the specified {@code Query} object. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - */ - getResultSize(deviceId: string, query: Query, callback: AsyncCallback): void; - getResultSize(deviceId: string, query: Query): Promise; - - /** - * Removes data of a specified device from the current database. This method is used to remove only the data - * synchronized from remote devices. This operation does not synchronize data to other databases or affect - * subsequent data synchronization. - * - * @param deviceId Identifies the device whose data is to be removed. The value cannot be the current device ID. - * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, - * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - */ - removeDeviceData(deviceId: string, callback: AsyncCallback): void; - removeDeviceData(deviceId: string): Promise; - - /** - * Synchronizes {@code DeviceKVStore} databases. - * - *

This method returns immediately and sync result will be returned through asynchronous callback. - * - * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @param deviceIds Indicates the list of IDs of devices whose - * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. - * {@code DeviceKVStore} databases are to be synchronized. - * @param mode Indicates the synchronization mode, {@code PUSH}, {@code PULL}, or - * {@code PUSH_PULL}. - * @throws Throws this exception if no DeviceKVStore database is available. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 - */ - sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; - - /** - * Register Synchronizes DeviceKVStore databases callback. - * - *

Sync result is returned through asynchronous callback. - * - * @param syncCallback Indicates the callback used to send the synchronization result to the caller. - * @throws Throws this exception if no DeviceKVStore database is available. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 - */ - on(event: 'syncComplete', syncCallback: Callback>): void; - - /** - * UnRegister Synchronizes DeviceKVStore databases callback. - * - * @throws Throws this exception if no DeviceKVStore database is available. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 - */ - off(event: 'syncComplete', syncCallback?: Callback>): void; - } - - /** - * Manages distributed data by device in a distributed system. - * - *

To create a {@code DeviceKVStoreV9} database, you can use the {@link data.distributed.common.KVManagerV9.getKvStore(Options, String)} - * method with {@code KvStoreType} set to {@code DEVICE_COLLABORATION} for the input parameter Options. This database manages distributed - * data by device, and cannot modify data synchronized from remote devices. When an application writes a key-value pair entry - * into the database, the system automatically adds the ID of the device running the application to the key. - * - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 - */ - interface DeviceKVStoreV9 extends KVStoreV9 { - /** - * Obtains the {@code String} value matching a specified device ID and key. - * - * @param deviceId Indicates the device to be queried. - * @param key Indicates the key of the value to be queried. - * @return Returns the value matching the given criteria. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100004 - if the data not exist when query data. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 - */ - get(deviceId: string, key: string, callback: AsyncCallback): void; - get(deviceId: string, key: string): Promise; - - /** - * Obtains all key-value pairs matching a specified device ID and key prefix. - * - * @param deviceId Identifies the device whose data is to be queried. - * @param keyPrefix Indicates the key prefix to match. - * @returns Returns the list of all key-value pairs meeting the given criteria. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 - */ - getEntries(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; - getEntries(deviceId: string, keyPrefix: string): Promise; - - /** - * Obtains the list of key-value pairs matching the specified {@code QueryV9} object. - * - * @param query Indicates the {@code QueryV9} object. - * @returns Returns the list of key-value pairs matching the specified {@code QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100005 - if not support the operation. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 - */ - getEntries(query: QueryV9, callback: AsyncCallback): void; - getEntries(query: QueryV9): Promise; - - /** - * Obtains the list of key-value pairs matching a specified device ID and {@code QueryV9} object. - * - * @param deviceId Indicates the ID of the device to which the key-value pairs belong. - * @param query Indicates the {@code QueryV9} object. - * @returns Returns the list of key-value pairs matching the specified {@code QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100005 - if not support the operation. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 - */ - getEntries(deviceId: string, query: QueryV9, callback: AsyncCallback): void; - getEntries(deviceId: string, query: QueryV9): Promise; - - /** - * Obtains the {@code KvStoreResultSet} object matching the specified device ID and key prefix. - * - *

The {@code KvStoreResultSet} object can be used to query all key-value pairs that meet the search criteria. Each {@code KvStoreV9} - * instance can have a maximum of four {@code KvStoreResultSet} objects at the same time. If you have created four objects, - * calling this method will return a failure. Therefore, you are advised to call the closeResultSet method to close unnecessary - * {@code KvStoreResultSet} objects in a timely manner. - * - * @param deviceId Identifies the device whose data is to be queried. - * @param keyPrefix Indicates the key prefix to match. - * @returns Returns the {@code KvStoreResultSet} objects. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 - */ - getResultSet(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; - getResultSet(deviceId: string, keyPrefix: string): Promise; - - /** - * Obtains the {@code KvStoreResultSet} object matching the specified {@code QueryV9} object. - * - * @param query Indicates the {@code QueryV9} object. - * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 - */ - getResultSet(query: QueryV9, callback: AsyncCallback): void; - getResultSet(query: QueryV9): Promise; - - /** - * Obtains the {@code KvStoreResultSet} object matching a specified device ID and {@code QueryV9} object. - * - * @param deviceId Indicates the ID of the device to which the {@code KvStoreResultSet} object belongs. - * @param query Indicates the {@code QueryV9} object. - * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 - */ - getResultSet(deviceId: string, query: QueryV9, callback: AsyncCallback): void; - getResultSet(deviceId: string, query: QueryV9): Promise; + /** + * Obtains the {@code KvStoreResultSet} object matching a specified device ID and {@code Query} object. + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @param deviceId Indicates the ID of the device to which the {@code KvStoreResultSet} object belongs. + * @param query Indicates the {@code Query} object. + * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code Query} object. + */ + getResultSet(deviceId: string, query: Query, callback: AsyncCallback): void; + getResultSet(deviceId: string, query: Query): Promise; /** * Obtains the KvStoreResultSet object matching the specified Predicate object. * - * @param predicates Indicates the datasharePredicates. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @since 9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param predicates Indicates the datasharePredicates. * @systemapi - * @since 9 + * Spaces before and after the key will be cleared. + * @throws Throws this exception if any of the following errors + * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and + * {@code DB_ERROR}. */ - getResultSet(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; - getResultSet(predicates: dataSharePredicates.DataSharePredicates): Promise; + getResultSet(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; + getResultSet(predicates: dataSharePredicates.DataSharePredicates): Promise; /** * Obtains the KvStoreResultSet object matching a specified Device ID and Predicate object. - * - * @param predicates Indicates the key. - * @param deviceId Indicates the ID of the device to which the results belong. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @since 9 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @systemapi - * @since 9 - */ - getResultSet(deviceId: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; - getResultSet(deviceId: string, predicates: dataSharePredicates.DataSharePredicates): Promise; - - /** - * Closes a {@code KvStoreResultSet} object returned by getResultSet. - * - * @param resultSet Indicates the {@code KvStoreResultSet} object to close. - * @throws {BusinessError} 401 - if parameter check failed. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 - */ - closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; - closeResultSet(resultSet: KvStoreResultSet): Promise; - - /** - * Obtains the number of results matching the specified {@code QueryV9} object. - * - * @param query Indicates the {@code QueryV9} object. - * @returns Returns the number of results matching the specified {@code QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 - */ - getResultSize(query: QueryV9, callback: AsyncCallback): void; - getResultSize(query: QueryV9): Promise; - - /** - * Obtains the number of results matching a specified device ID and {@code Query} object. - * + * @param predicates Indicates the key. * @param deviceId Indicates the ID of the device to which the results belong. - * @param query Indicates the {@code QueryV9} object. - * @returns Returns the number of results matching the specified {@code QueryV9} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 + * Spaces before and after the key will be cleared. + * @throws Throws this exception if any of the following errors + * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and + * {@code DB_ERROR}. */ - getResultSize(deviceId: string, query: QueryV9, callback: AsyncCallback): void; - getResultSize(deviceId: string, query: QueryV9): Promise; + getResultSet(deviceId: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; + getResultSet(deviceId: string, predicates: dataSharePredicates.DataSharePredicates): Promise; + + /** + * Closes a {@code KvStoreResultSet} object returned by getResultSet. + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @param resultSet Indicates the {@code KvStoreResultSet} object to close. + * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, + * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + */ + closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; + closeResultSet(resultSet: KvStoreResultSet): Promise; - /** - * Removes data of a specified device from the current database. This method is used to remove only the data - * synchronized from remote devices. This operation does not synchronize data to other databases or affect - * subsequent data synchronization. - * - * @param deviceId Identifies the device whose data is to be removed. The value cannot be the current device ID. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 - */ - removeDeviceData(deviceId: string, callback: AsyncCallback): void; - removeDeviceData(deviceId: string): Promise; + /** + * Obtains the number of results matching the specified {@code Query} object. + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @param query Indicates the {@code Query} object. + * @returns Returns the number of results matching the specified {@code Query} object. + * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, + * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + */ + getResultSize(query: Query, callback: AsyncCallback): void; + getResultSize(query: Query): Promise; + + /** + * Obtains the number of results matching a specified device ID and {@code Query} object. + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @param deviceId Indicates the ID of the device to which the results belong. + * @param query Indicates the {@code Query} object. + * @returns Returns the number of results matching the specified {@code Query} object. + */ + getResultSize(deviceId: string, query: Query, callback: AsyncCallback): void; + getResultSize(deviceId: string, query: Query): Promise; + /** + * Removes data of a specified device from the current database. This method is used to remove only the data + * synchronized from remote devices. This operation does not synchronize data to other databases or affect + * subsequent data synchronization. + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @param deviceId Identifies the device whose data is to be removed. The value cannot be the current device ID. + * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, + * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + */ + removeDeviceData(deviceId: string, callback: AsyncCallback): void; + removeDeviceData(deviceId: string): Promise; + /** * Synchronizes {@code DeviceKVStore} databases. * *

This method returns immediately and sync result will be returned through asynchronous callback. - * - * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param deviceIds Indicates the list of IDs of devices whose * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. * {@code DeviceKVStore} databases are to be synchronized. - * @param mode Indicates the synchronization mode, {@code PUSH}, {@code PULL}, or {@code PUSH_PULL}. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100004 - if the database not exist when sync data. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @param mode Indicates the synchronization mode, {@code PUSH}, {@code PULL}, or + * {@code PUSH_PULL}. + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @throws Throws this exception if no DeviceKVStore database is available. */ sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; @@ -2743,64 +1777,61 @@ declare namespace distributedData { * Synchronizes {@code DeviceKVStore} databases. * *

This method returns immediately and sync result will be returned through asynchronous callback. - * - * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param deviceIds Indicates the list of IDs of devices whose * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. * {@code DeviceKVStore} databases are to be synchronized. - * @param query Indicates the {@code QueryV9} object. - * @param mode Indicates the synchronization mode, {@code PUSH}, {@code PULL}, or {@code PUSH_PULL}. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100004 - if the database not exist when sync data. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @param query Indicates the {@code Query} object. + * @param mode Indicates the synchronization mode, {@code PUSH}, {@code PULL}, or + * {@code PUSH_PULL}. + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @throws Throws this exception if no DeviceKVStore database is available. */ - sync(deviceIds: string[], query: QueryV9, mode: SyncMode, delayMs?: number): void; + sync(deviceIds: string[], query: Query, mode: SyncMode, delayMs?: number): void; /** * Register Synchronizes DeviceKVStore databases callback. - * + * *

Sync result is returned through asynchronous callback. - * - * @param syncCallback Indicates the callback used to send the synchronization result to the caller. - * @throws {BusinessError} 401 - if parameter check failed. + * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @param syncCallback Indicates the callback used to send the synchronization result to the caller. + * @throws Throws this exception if no DeviceKVStore database is available. */ on(event: 'syncComplete', syncCallback: Callback>): void; - + /** - * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in + * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in * {@code KvStoreObserver} will be invoked. * + * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. * @param listener Indicates the observer of data change events in the distributed database. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100001 - if the database has been subscribed over the max subscription time limit. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @throws Throws this exception if any of the following errors + * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, + * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. */ - on(event: 'dataChange', type: SubscribeType, listener: Callback): void; + on(event: 'dataChange', type: SubscribeType, listener: Callback): void; /** * Unsubscribes from the DeviceKVStore database based on the specified subscribeType and {@code KvStoreObserver}. * - * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. + * @throws Throws this exception if any of the following errors + * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, + * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. */ - off(event:'dataChange', listener?: Callback): void; + off(event:'dataChange', listener?: Callback): void; /** * UnRegister Synchronizes DeviceKVStore databases callback. - * - * @throws {BusinessError} 401 - if parameter check failed. + * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @throws Throws this exception if no DeviceKVStore database is available. */ off(event: 'syncComplete', syncCallback?: Callback>): void; } @@ -2811,56 +1842,36 @@ declare namespace distributedData { *

You must pass {@link KVManagerConfig} to provide configuration information * for creating the {@link KVManager} instance. * + * @since 7 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param config Indicates the {@link KVStore} configuration information, * including the user information and package name. * @return Returns the {@code KVManager} instance. * @throws Throws exception if input is invalid. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 7 - * @deprecated since 9 - * @useinstead createKVManagerV9 */ function createKVManager(config: KVManagerConfig, callback: AsyncCallback): void; function createKVManager(config: KVManagerConfig): Promise; - /** - * Creates a {@link KVManagerV9} instance based on the configuration information. - * - *

You must pass {@link KVManagerConfig} to provide configuration information - * for creating the {@link KVManagerV9} instance. - * - * @param config Indicates the {@link KVStoreV9} configuration information, - * including the user information and package name. - * @return Returns the {@code KVManagerV9} instance. - * @throws {BusinessError} 401 - if parameter check failed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - function createKVManagerV9(config: KVManagerConfig, callback: AsyncCallback): void; - function createKVManagerV9(config: KVManagerConfig): Promise; - /** * Provides interfaces to manage a {@code KVStore} database, including obtaining, closing, and deleting the {@code KVStore}. * + * @since 7 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @version 1 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 7 - * @deprecated since 9 - * @useinstead KVManagerV9 */ interface KVManager { /** * Creates and obtains a {@code KVStore} database by specifying {@code Options} and {@code storeId}. * + * @since 7 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param options Indicates the options used for creating and obtaining the {@code KVStore} database, * including {@code isCreateIfMissing}, {@code isEncrypt}, and {@code KVStoreType}. * @param storeId Identifies the {@code KVStore} database. * The value of this parameter must be unique for the same application, * and different applications can share the same value. * @return Returns a {@code KVStore}, or {@code SingleKVStore}. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 7 */ getKVStore(storeId: string, options: Options): Promise; getKVStore(storeId: string, options: Options, callback: AsyncCallback): void; @@ -2875,14 +1886,14 @@ declare namespace distributedData { * method, release the resources created for the database, for example, {@code KvStoreResultSet} for {@code SingleKvStore}, * otherwise closing the database will fail. If you are attempting to close a database that is already closed, an error * will be returned. - * + * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param kvStore Indicates the {@code KvStore} database to close. * @throws Throws this exception if any of the following errors * occurs:{@code INVALID_ARGUMENT}, {@code ERVER_UNAVAILABLE}, * {@code STORE_NOT_OPEN}, {@code STORE_NOT_FOUND}, {@code DB_ERROR}, * {@code PERMISSION_DENIED}, and {@code IPC_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 */ closeKVStore(appId: string, storeId: string, kvStore: KVStore, callback: AsyncCallback): void; closeKVStore(appId: string, storeId: string, kvStore: KVStore): Promise; @@ -2894,14 +1905,13 @@ declare namespace distributedData { * *

You can use this method to delete a {@code KvStore} database not in use. After the database is deleted, all its data will be * lost. - * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param storeId Identifies the {@code KvStore} database to delete. * @throws Throws this exception if any of the following errors * occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code STORE_NOT_FOUND}, * {@code DB_ERROR}, {@code PERMISSION_DENIED}, and {@code IPC_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 */ deleteKVStore(appId: string, storeId: string, callback: AsyncCallback): void; deleteKVStore(appId: string, storeId: string): Promise; @@ -2910,12 +1920,12 @@ declare namespace distributedData { * Obtains the storeId of all {@code KvStore} databases that are created by using the {@code getKvStore} method and not deleted by * calling the {@code deleteKvStore} method. * - * @returns Returns the storeId of all created {@code KvStore} databases. + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @returns Returns the storeId of all created {@code KvStore} databases. * @throws Throws this exception if any of the following errors * occurs: {@code SERVER_UNAVAILABLE}, {@code DB_ERROR}, * {@code PERMISSION_DENIED}, and {@code IPC_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 */ getAllKVStoreId(appId: string, callback: AsyncCallback): void; getAllKVStoreId(appId: string): Promise; @@ -2923,116 +1933,20 @@ declare namespace distributedData { /** * register DeviceChangeCallback to get notification when device's status changed * + * @since 8 + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deathCallback device change callback {@code DeviceChangeCallback} * @throws exception maybe occurs. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 */ on(event: 'distributedDataServiceDie', deathCallback: Callback): void; /** * unRegister DeviceChangeCallback and can not receive notification * - * @param deathCallback device change callback {@code DeviceChangeCallback} which has been registered. - * @throws exception maybe occurs. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 - */ - off(event: 'distributedDataServiceDie', deathCallback?: Callback): void; - } - - /** - * Provides interfaces to manage a {@code KVStoreV9} database, including obtaining, closing, and deleting the {@code KVStoreV9}. - * - * @import N/A - * @version 1 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - interface KVManagerV9 { - /** - * Creates and obtains a {@code KVStoreV9} database by specifying {@code Options} and {@code storeId}. - * - * @param options Indicates the options used for creating and obtaining the {@code KVStoreV9} database, - * including {@code isCreateIfMissing}, {@code isEncrypt}, and {@code KVStoreType}. - * @param storeId Identifies the {@code KVStoreV9} database. - * The value of this parameter must be unique for the same application, - * and different applications can share the same value. - * @return Returns a {@code KVStoreV9}, or {@code SingleKVStoreV9}. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100002 - if open existed database with changed options. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - getKVStore(storeId: string, options: Options): Promise; - getKVStore(storeId: string, options: Options, callback: AsyncCallback): void; - - /** - * Closes the {@code KvStoreV9} database. - * - *

Warning: This method is not thread-safe. If you call this method to stop a KvStore database that is running, your - * thread may crash. - * - *

The {@code KvStoreV9} database to close must be an object created by using the {@code getKvStore} method. Before using this - * method, release the resources created for the database, for example, {@code KvStoreResultSet} for {@code SingleKvStoreV9}, - * otherwise closing the database will fail. If you are attempting to close a database that is already closed, an error - * will be returned. - * - * @param kvStore Indicates the {@code KvStoreV9} database to close. - * @throws {BusinessError} 401 - if parameter check failed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - closeKVStore(appId: string, storeId: string, kvStore: KVStoreV9, callback: AsyncCallback): void; - closeKVStore(appId: string, storeId: string, kvStore: KVStoreV9): Promise; - - /** - * Deletes the {@code KvStoreV9} database identified by storeId. - * - *

Before using this method, close all {@code KvStoreV9} instances in use that are identified by the same storeId. - * - *

You can use this method to delete a {@code KvStoreV9} database not in use. After the database is deleted, all its data will be - * lost. - * - * @param storeId Identifies the {@code KvStoreV9} database to delete. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100004 - if the database not exist when delete database. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - deleteKVStore(appId: string, storeId: string, callback: AsyncCallback): void; - deleteKVStore(appId: string, storeId: string): Promise; - - /** - * Obtains the storeId of all {@code KvStoreV9} databases that are created by using the {@code getKvStore} method and not deleted by - * calling the {@code deleteKvStore} method. - * - * @returns Returns the storeId of all created {@code KvStoreV9} databases. - * @throws {BusinessError} 401 - if parameter check failed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - getAllKVStoreId(appId: string, callback: AsyncCallback): void; - getAllKVStoreId(appId: string): Promise; - - /** - * register DeviceChangeCallback to get notification when device's status changed - * - * @param deathCallback device change callback {@code DeviceChangeCallback} - * @throws {BusinessError} 401 - if parameter check failed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 - */ - on(event: 'distributedDataServiceDie', deathCallback: Callback): void; - - /** - * unRegister DeviceChangeCallback and can not receive notification - * * @param deathCallback device change callback {@code DeviceChangeCallback} which has been registered. - * @throws {BusinessError} 401 - if parameter check failed. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 + * @throws exception maybe occurs. */ off(event: 'distributedDataServiceDie', deathCallback?: Callback): void; } diff --git a/api/@ohos.data.kvStore.d.ts b/api/@ohos.data.kvStore.d.ts new file mode 100644 index 0000000000..a72691b335 --- /dev/null +++ b/api/@ohos.data.kvStore.d.ts @@ -0,0 +1,1976 @@ +/* + * Copyright (c) 2021 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 { AsyncCallback, Callback } from './basic'; +import { ValuesBucket } from './@ohos.data.ValuesBucket'; +import dataSharePredicates from './@ohos.data.dataSharePredicates'; +import DataShareResultSet from './@ohos.data.DataShareResultSet'; +import Context from './application/Context'; + +/** + * Providers interfaces to creat a {@link KVManager} istances. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @import N/A + * @since 9 + */ +declare namespace kvStore { + /** + * Provides configuration information for {@link KVManager} instances, + * including the caller's package name and distributed network type. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + interface KVManagerConfig { + /** + * Indicates the user information + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + userInfo: UserInfo; + + /** + * Indicates the bundleName + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + bundleName: string; + + /** + * Indicates the ability or hap context + * @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 + * @since 9 + */ + context: Context; + } + + /** + * Manages user information. + * + *

This class provides methods for obtaining the user ID and type, setting the user ID and type, + * and checking whether two users are the same. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + interface UserInfo { + /** + * Indicates the user ID to set + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + userId?: string; + + /** + * Indicates the user type to set + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + userType?: UserType; + } + + /** + * Enumerates user types. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + enum UserType { + /** + * Indicates a user that logs in to different devices using the same account. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + SAME_USER_ID = 0 + } + + /** + * KVStore constants + * + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + namespace Constants { + /** + * max key length. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + const MAX_KEY_LENGTH = 1024; + + /** + * max value length. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + const MAX_VALUE_LENGTH = 4194303; + + /** + * max device coordinate key length. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + const MAX_KEY_LENGTH_DEVICE = 896; + + /** + * max store id length. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + const MAX_STORE_ID_LENGTH = 128; + + /** + * max query length. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + const MAX_QUERY_LENGTH = 512000; + + /** + * max batch operation size. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + const MAX_BATCH_SIZE = 128; + } + + /** + * Indicates the {@code ValueType}. + * + *

{@code ValueType} is obtained based on the value. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + enum ValueType { + /** + * Indicates that the value type is string. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + STRING = 0, + + /** + * Indicates that the value type is int. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + INTEGER = 1, + + /** + * Indicates that the value type is float. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + FLOAT = 2, + + /** + * Indicates that the value type is byte array. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + * */ + BYTE_ARRAY = 3, + + /** + * Indicates that the value type is boolean. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + * */ + BOOLEAN = 4, + + /** + * Indicates that the value type is double. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + DOUBLE = 5 + } + + /** + * Obtains {@code Value} objects stored in a {@link KVStore} or {@link KVStore} database. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + interface Value { + /** + * Indicates value type + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @see ValueType + * @type {number} + * @memberof Value + * @since 9 + */ + type: ValueType; + /** + * Indicates value + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + value: Uint8Array | string | number | boolean; + } + + /** + * Provides key-value pairs stored in the distributed database. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + interface Entry { + /** + * Indicates key + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + key: string; + /** + * Indicates value + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + value: Value; + } + + /** + * Receives notifications of all data changes, including data insertion, update, and deletion. + * + *

If you have subscribed to {@code KVStore} or {@code KVStore}, you will receive data change notifications and + * obtain the changed data from the parameters in callback methods upon data insertion, update, or deletion. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + interface ChangeNotification { + /** + * Indicates data addition records. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + insertEntries: Entry[]; + /** + * Indicates data update records. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + updateEntries: Entry[]; + /** + * Indicates data deletion records. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + deleteEntries: Entry[]; + /** + * Indicates from device id. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + deviceId: string; + } + + /** + * Indicates the database synchronization mode. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + enum SyncMode { + /** + * Indicates that data is only pulled from the remote end. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + PULL_ONLY = 0, + /** + * Indicates that data is only pushed from the local end. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + PUSH_ONLY = 1, + /** + * Indicates that data is pushed from the local end, and then pulled from the remote end. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + PUSH_PULL = 2 + } + + /** + * Describes the subscription type. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + enum SubscribeType { + /** + * Subscription to local data changes + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + SUBSCRIBE_TYPE_LOCAL = 0, + + /** + * Subscription to remote data changes + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + SUBSCRIBE_TYPE_REMOTE = 1, + + /** + * Subscription to both local and remote data changes + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + SUBSCRIBE_TYPE_ALL = 2, + } + + /** + * Describes the {@code KVStore} or {@code KVStore}type. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + enum KVStoreType { + /** + * Device-collaborated database, as specified by {@code DeviceKVStore} or {@code DeviceKVStore} + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @import N/A + * @since 9 + */ + DEVICE_COLLABORATION = 0, + + /** + * Single-version database, as specified by {@code SingleKVStore} + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + SINGLE_VERSION = 1, + } + + /** + * Describes the {@code KVStore} or {@code KVStore} type. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + enum SecurityLevel { + /** + * S1: mains the db is low level security + * There are some low impact, when the data is leaked. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + S1 = 2, + + /** + * S2: mains the db is middle level security + * There are some major impact, when the data is leaked. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + S2 = 3, + + /** + * S3: mains the db is high level security + * There are some severity impact, when the data is leaked. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + S3 = 5, + + /** + * S4: mains the db is critical level security + * There are some critical impact, when the data is leaked. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + S4 = 6, + } + + /** + * Provides configuration options for creating a {@code KVStore} or {@code KVStore}. + * + *

You can determine whether to create another database if a {@code KVStore} or {@code KVStore} database is + * missing, whether to encrypt the database, and the database type. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + interface Options { + /** + * Indicates whether to createa database when the database file does not exist + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + createIfMissing?: boolean; + /** + * Indicates setting whether database files are encrypted + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + encrypt?: boolean; + /** + * Indicates setting whether to back up database files + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + backup?: boolean; + /** + * Indicates setting whether database files are automatically synchronized + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + autoSync?: boolean; + /** + * Indicates setting the databse type + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + kvStoreType?: KVStoreType; + /** + * Indicates setting the database security level + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + securityLevel: SecurityLevel; + /** + * Indicates schema object + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @import N/A + * @since 9 + */ + schema?: Schema; + } + + /** + * Represents the database schema. + * + * You can create Schema objects and put them in Options when creating or opening the database. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @import N/A + * @since 9 + */ + class Schema { + /** + * A constructor used to create a Schema instance. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + constructor() + /** + * Indicates the root json object. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + root: FieldNode; + /** + * Indicates the string array of json. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + indexes: Array; + /** + * Indicates the mode of schema. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + mode: number; + /** + * Indicates the skipsize of schema. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + skip: number; + } + + /** + * Represents a node of a {@link Schema} instance. + * + *

Through the {@link Schema} instance, you can define the fields contained in the values stored in a database. + * + *

A FieldNode of the {@link Schema} instance is either a leaf or a non-leaf node. + * + *

The leaf node must have a value; the non-leaf node must have a child {@code FieldNode}. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @import N/A + * @since 9 + */ + class FieldNode { + /** + * A constructor used to create a FieldNode instance with the specified field. + * name Indicates the field node name. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + constructor(name: string) + /** + * Adds a child node to this {@code FieldNode}. + * + *

Adding a child node makes this node a non-leaf node. Field value will be ignored if it has child node. + * + * @param child The field node to append. + * @returns Returns true if the child node is successfully added to this {@code FieldNode}; returns false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + appendChild(child: FieldNode): boolean; + /** + * Indicates the default value of fieldnode. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + default: string; + /** + * Indicates the nullable of database field. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + nullable: boolean; + /** + * Indicates the type of value. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + type: number; + } + + /** + * Provide methods to obtain the result set of the {@code KvStore} or {@code KVStore} database. + * + *

The result set is created by using the {@code getResultSet} method in the {@code DeviceKVStore} or + * {@code DeviceKVStore} class. This interface also provides methods for moving the data read position in the result set. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @import N/A + * @since 9 + */ + interface KVStoreResultSet { + /** + * Obtains the number of lines in a result set. + * + * @returns Returns the number of lines. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + getCount(): number; + /** + * Obtains the current read position in a result set. + * + * @returns Returns the current read position. The read position starts with 0. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + getPosition(): number; + /** + * Moves the read position to the first line. + * + *

If the result set is empty, false is returned. + * + * @returns Returns true if the operation succeeds; return false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + moveToFirst(): boolean; + /** + * Moves the read position to the last line. + * + *

If the result set is empty, false is returned. + * + * @returns Returns true if the operation succeeds; return false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + moveToLast(): boolean; + /** + * Moves the read position to the next line. + * + *

If the result set is empty or the data in the last line is being read, false is returned. + * + * @returns Returns true if the operation succeeds; return false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + moveToNext(): boolean; + /** + * Moves the read position to the previous line. + * + *

If the result set is empty or the data in the first line is being read, false is returned. + * + * @returns Returns true if the operation succeeds; return false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + moveToPrevious(): boolean; + /** + * Moves the read position by a relative offset to the current position. + * + * @param offset Indicates the relative offset to the current position. Anegative offset indicates moving backwards, and a + * positive offset indicates moving forewards. Forexample, if the current position is entry 1 and thisoffset is 2, + * the destination position will be entry 3; ifthe current position is entry 3 and this offset is -2, + * the destination position will be entry 1. The valid final position after moving forwards starts with 0. If the + * final position is invalid, false will be returned. + * @returns Returns true if the operation succeeds; return false otherwise. + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + move(offset: number): boolean; + /** + * Moves the read position from 0 to an absolute position. + * + * @param position Indicates the absolute position. + * @returns Returns true if the operation succeeds; return false otherwise. + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + moveToPosition(position: number): boolean; + /** + * Checks whether the read position is the first line. + * + * @returns Returns true if the read position is the first line; returns false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + isFirst(): boolean; + /** + * Checks whether the read position is the last line. + * + * @returns Returns true if the read position is the last line; returns false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + isLast(): boolean; + /** + * Checks whether the read position is before the last line. + * + * @returns Returns true if the read position is before the first line; returns false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + isBeforeFirst(): boolean; + /** + * Checks whether the read position is after the last line. + * + * @returns Returns true if the read position is after the last line; returns false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + isAfterLast(): boolean; + /** + * Obtains a key-value pair. + * + * @returns Returns a key-value pair. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + getEntry(): Entry; + } + + /** + * Represents a database query using a predicate. + * + *

This class provides a constructor used to create a {@code Query} instance, which is used to query data + * matching specified conditions in the database. + * + *

This class also provides methods for adding predicates to the {@code Query} instance. + * + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + class Query { + /** + * A constructor used to create a Query instance. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + constructor() + /** + * Resets this {@code Query} object. + * + * @returns Returns the reset {@code Query} object. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + reset(): Query; + /** + * Constructs a {@code Query} object to query entries with the specified field whose value is equal to the specified long value. + * + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @param value IIndicates the long value. + * @returns Returns the {@coed Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + equalTo(field: string, value: number|string|boolean): Query; + /** + * Constructs a {@code Query} object to query entries with the specified field whose value is not equal to the specified int value. + * + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @param value Indicates the int value. + * @returns Returns the {@coed Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + notEqualTo(field: string, value: number|string|boolean): Query; + /** + * Constructs a {@code Query} object to query entries with the specified field whose value is greater than or equal to the + * specified int value. + * + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @param value Indicates the int value. + * @returns Returns the {@coed Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + greaterThan(field: string, value: number|string|boolean): Query; + /** + * Constructs a {@code Query} object to query entries with the specified field whose value is less than the specified int value. + * + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @param value Indicates the int value. + * @returns Returns the {@coed Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + lessThan(field: string, value: number|string): Query; + /** + * Constructs a {@code Query} object to query entries with the specified field whose value is greater than or + * equal to the specified int value. + * + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @param value Indicates the int value. + * @returns Returns the {@coed Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + greaterThanOrEqualTo(field: string, value: number|string): Query; + /** + * Constructs a {@code Query} object to query entries with the specified field whose value is less than or equal to the + * specified int value. + * + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @param value Indicates the int value. + * @returns Returns the {@coed Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + lessThanOrEqualTo(field: string, value: number|string): Query; + /** + * Constructs a {@code Query} object to query entries with the specified field whose value is null. + * + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @returns Returns the {@coed Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + isNull(field: string): Query; + /** + * Constructs a {@code Query} object to query entries with the specified field whose value is within the specified int value list. + * + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @param valueList Indicates the int value list. + * @returns Returns the {@coed Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + inNumber(field: string, valueList: number[]): Query; + /** + * Constructs a {@code Query} object to query entries with the specified field whose value is within the specified string value list. + * + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @param valueList Indicates the string value list. + * @returns Returns the {@coed Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + inString(field: string, valueList: string[]): Query; + /** + * Constructs a {@code Query} object to query entries with the specified field whose value is not within the specified int value list. + * + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @param valueList Indicates the int value list. + * @returns Returns the {@coed Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + notInNumber(field: string, valueList: number[]): Query; + /** + * Constructs a {@code Query} object to query entries with the specified field whose value is not within the specified string value list. + * + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @param valueList Indicates the string value list. + * @returns Returns the {@coed Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + notInString(field: string, valueList: string[]): Query; + /** + * Constructs a {@code Query} object to query entries with the specified field whose value is similar to the specified string value. + * + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @param value Indicates the string value. + * @returns Returns the {@coed Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + like(field: string, value: string): Query; + /** + * Constructs a {@code Query} object to query entries with the specified field whose value is not similar to the specified string value. + * + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @param value Indicates the string value. + * @returns Returns the {@coed Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + unlike(field: string, value: string): Query; + /** + * Constructs a {@code Query} object with the and condition. + * + *

Multiple predicates should be connected using the and or or condition. + * + * @returns Returns the {@coed Query} object. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + and(): Query; + /** + * Constructs a {@code Query} object with the or condition. + * + *

Multiple predicates should be connected using the and or or condition. + * + * @returns Returns the {@coed Query} object. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + or(): Query; + /** + * Constructs a {@code Query} object to sort the query results in ascending order. + * + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @returns Returns the {@coed Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + orderByAsc(field: string): Query; + /** + * Constructs a {@code Query} object to sort the query results in descending order. + * + * @param field Indicates the field, which must start with $. and cannot contain ^. + * @returns Returns the {@coed Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + orderByDesc(field: string): Query; + /** + * Constructs a {@code Query} object to specify the number of results and the start position. + * + * @param total Indicates the number of results. + * @param offset Indicates the start position. + * @returns Returns the {@coed Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + limit(total: number, offset: number): Query; + /** + * Creates a {@code Query} condition with a specified field that is not null. + * + * @param field Indicates the specified field. + * @returns Returns the {@coed Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + isNotNull(field: string): Query; + /** + * Creates a query condition group with a left bracket. + * + *

Multiple query conditions in an {@code Query} object can be grouped. The query conditions in a group can be used as a + * whole to combine with other query conditions. + * + * @returns Returns the {@coed Query} object. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + beginGroup(): Query; + /** + * Creates a query condition group with a right bracket. + * + *

Multiple query conditions in an {@code Query} object can be grouped. The query conditions in a group can be used as a + * whole to combine with other query conditions. + * + * @returns Returns the {@coed Query} object. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + endGroup(): Query; + /** + * Creates a query condition with a specified key prefix. + * + * @param prefix Indicates the specified key prefix. + * @returns Returns the {@coed Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + prefixKey(prefix: string): Query; + /** + * Sets a specified index that will be preferentially used for query. + * + * @param index Indicates the index to set. + * @returns Returns the {@coed Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + setSuggestIndex(index: string): Query; + /** + * Add device ID key prefix.Used by {@code DeviceKVStore}. + * + * @param deviceId Specify device id to query from. + * @return Returns the {@code Query} object with device ID prefix added. + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + deviceId(deviceId:string):Query; + /** + * Get a String that repreaents this {@code Query}. + * + *

The String would be parsed to DB query format. + * The String length should be no longer than 500kb. + * + * @return String representing this {@code Query}. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + getSqlLike():string; + } + + /** + * Represents a key-value distributed database and provides methods for adding, deleting, modifying, querying, + * and subscribing to distributed data. + * + *

You can create distributed databases of different types by {@link KVManager#getKVStore (Options, String)} + * with input parameter {@code Options}. Distributed database types are defined in {@code KVStoreType}, + * including {@code SingleKVStore}. + * + * @import N/A + * @version 1 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + interface KVStore { + /** + * Writes a key-value pair of the string type into the {@code KVStore} database. + * + *

If you do not want to synchronize this key-value pair to other devices, set the write option in the local database. + * + * @param key Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. + * Spaces before and after the key will be cleared. + * @param value Indicates the string value, which must be less than 4 MB as a UTF-8 byte array. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + put(key: string, value: Uint8Array | string | number | boolean, callback: AsyncCallback): void; + put(key: string, value: Uint8Array | string | number | boolean): Promise; + + /** + * Writes a value of the valuesbucket type into the {@code KVStore} database. + * + * @param value Indicates the data record to put. + * Spaces before and after the key will be cleared. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @systemapi + * @since 9 + */ + putBatch(value: Array, callback: AsyncCallback): void; + putBatch(value: Array): Promise; + + /** + * Deletes the key-value pair based on a specified key. + * + * @param key Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. + * Spaces before and after the key will be cleared. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the data not exist when delete data. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + delete(key: string, callback: AsyncCallback): void; + delete(key: string): Promise; + + /** + * Deletes the key-value pair based on a specified key. + * + * @param predicates Indicates the datasharePredicates. + * Spaces before and after the key will be cleared. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the data not exist when delete data. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @systemapi + * @since 9 + + */ + delete(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback); + delete(predicates: dataSharePredicates.DataSharePredicates): Promise; + + /** + * Backs up a database in a specified name. + * + * @param file Indicates the name that saves the database backup. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100005 - if not support the operation. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + backup(file:string, callback: AsyncCallback):void; + backup(file:string): Promise; + + /** + * Restores a database from a specified database file. + * + * @param file Indicates the name that saves the database file. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100005 - if not support the operation. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + restore(file:string, callback: AsyncCallback):void; + restore(file:string): Promise; + + /** + * Delete a backup files based on a specified name. + * + * @param files list Indicates the name that backup file to delete. + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + deleteBackup(files:Array, callback: AsyncCallback>):void; + deleteBackup(files:Array): Promise>; + + /** + * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in + * {@code KvStoreObserver} will be invoked. + * + * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. + * @param listener Indicates the observer of data change events in the distributed database. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100001 - if the database has been subscribed over the max subscription time limit. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + on(event: 'dataChange', type: SubscribeType, listener: Callback): void; + + /** + * Subscribes from the {@code KVStore} database based on the specified subscribeType and {@code KvStoreObserver}. + * + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + on(event: 'syncComplete', syncCallback: Callback>): void; + + /** + * Unsubscribes from the {@code KVStore} database based on the specified subscribeType and {@code KvStoreObserver}. + * + * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + off(event:'dataChange', listener?: Callback): void; + + /** + * UnRegister Synchronizes {@code KVStore} database callback. + * + * @param syncCallback Indicates the callback used to send the synchronization result to caller. + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + off(event: 'syncComplete', syncCallback?: Callback>): void; + + /** + * Inserts key-value pairs into the {@code KVStore} database in batches. + * + * @param entries Indicates the key-value pairs to be inserted in batches. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + putBatch(entries: Entry[], callback: AsyncCallback): void; + putBatch(entries: Entry[]): Promise; + + /** + * Deletes key-value pairs in batches from the {@code KVStore} database. + * + * @param keys Indicates the key-value pairs to be deleted in batches. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the data not exist when delete data. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + deleteBatch(keys: string[], callback: AsyncCallback): void; + deleteBatch(keys: string[]): Promise; + + /** + * Starts a transaction operation in the {@code KVStore} database. + * + *

After the database transaction is started, you can submit or roll back the operation. + * + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + startTransaction(callback: AsyncCallback): void; + startTransaction(): Promise; + + /** + * Submits a transaction operation in the {@code KVStore} database. + * + * @param callback + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + commit(callback: AsyncCallback): void; + commit(): Promise; + + /** + * Rolls back a transaction operation in the {@code KVStore} database. + * + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + rollback(callback: AsyncCallback): void; + rollback(): Promise; + + /** + * Sets whether to enable synchronization. + * + * @param enabled Specifies whether to enable synchronization. The value true means to enable + * synchronization, and false means the opposite. + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + enableSync(enabled: boolean, callback: AsyncCallback): void; + enableSync(enabled: boolean): Promise; + + /** + * Sets synchronization range labels. + * + *

The labels determine the devices with which data will be synchronized. + * + * @param localLabels Indicates the synchronization labels of the local device. + * @param remoteSupportLabels Indicates the labels of the devices with which data will be synchronized. + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + setSyncRange(localLabels: string[], remoteSupportLabels: string[], callback: AsyncCallback): void; + setSyncRange(localLabels: string[], remoteSupportLabels: string[]): Promise; + } + + /** + * Provides methods related to single-version distributed databases. + * + *

To create a {@code SingleKVStore} database, + * you can use the {@link data.distributed.common.KVManager#getKVStore​(Options, String)} method + * with {@code KVStoreType} set to {@code SINGLE_VERSION} for the input parameter {@code Options}. + * This database synchronizes data to other databases in time sequence. + * The {@code SingleKVStore} database does not support + * synchronous transactions, or data search using snapshots. + * + * @import N/A + * @version 1 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + interface SingleKVStore extends KVStore { + /** + * Obtains the {@code String} value of a specified key. + * + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the data not exist when query data. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + get(key: string, callback: AsyncCallback): void; + get(key: string): Promise; + + /** + * Obtains all key-value pairs that match a specified key prefix. + * + * @param keyPrefix Indicates the key prefix to match. + * @returns Returns the list of all key-value pairs that match the specified key prefix. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + getEntries(keyPrefix: string, callback: AsyncCallback): void; + getEntries(keyPrefix: string): Promise; + + /** + * Obtains the list of key-value pairs matching the specified {@code Query} object. + * + * @param query Indicates the {@code Query} object. + * @returns Returns the list of key-value pairs matching the specified {@code Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100005 - if not support the operation. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + getEntries(query: Query, callback: AsyncCallback): void; + getEntries(query: Query): Promise; + + /** + * Obtains the result sets with a specified prefix from a {@code KVStore} database. The {@code KVStoreResultSet} + * object can be used to query all key-value pairs that meet the search criteria. Each {@code KVStore} + * instance can have a maximum of four {@code KVStoreResultSet} objects at the same time. If you have created + * four objects, calling this method will return a failure. Therefore, you are advised to call the closeResultSet + * method to close unnecessary {@code KVStoreResultSet} objects in a timely manner. + * + * @param keyPrefix Indicates the key prefix to match. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + getResultSet(keyPrefix: string, callback: AsyncCallback): void; + getResultSet(keyPrefix: string): Promise; + + /** + * Obtains the {@code KVStoreResultSet} object matching the specified {@code Query} object. + * + * @param query Indicates the {@code Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + getResultSet(query: Query, callback: AsyncCallback): void; + getResultSet(query: Query): Promise; + + /** + * Obtains the KVStoreResultSet object matching the specified Predicate object. + * + * @param predicates Indicates the datasharePredicates. + * Spaces before and after the key will be cleared. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @systemapi + * @since 9 + */ + getResultSet(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; + getResultSet(predicates: dataSharePredicates.DataSharePredicates): Promise; + + /** + * Closes a {@code KVStoreResultSet} object returned by getResultSet. + * + * @param resultSet Indicates the {@code KVStoreResultSet} object to close. + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + closeResultSet(resultSet: KVStoreResultSet, callback: AsyncCallback): void; + closeResultSet(resultSet: KVStoreResultSet): Promise; + + /** + * Obtains the number of results matching the specified {@code Query} object. + * + * @param query Indicates the {@code Query} object. + * @returns Returns the number of results matching the specified {@code Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + getResultSize(query: Query, callback: AsyncCallback): void; + getResultSize(query: Query): Promise; + + /** + * void removeDeviceData​({@link String} deviceId) throws {@link KvStoreException} + * + * @param deviceId Indicates the device to be removed data. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + removeDeviceData(deviceId: string, callback: AsyncCallback): void; + removeDeviceData(deviceId: string): Promise; + + /** + * Synchronizes the database to the specified devices with the specified delay allowed. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param deviceIds Indicates the list of devices to which to synchronize the database. + * @param mode Indicates the synchronization mode. The value can be {@code PUSH}, {@code PULL}, or {@code PUSH_PULL}. + * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the database not exist when sync data. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void + + /** + * Synchronizes the database to the specified devices with the specified delay allowed. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param deviceIds Indicates the list of devices to which to synchronize the database. + * @param mode Indicates the synchronization mode. The value can be {@code PUSH}, {@code PULL}, or {@code PUSH_PULL}. + * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. + * @param query Indicates the {@code Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the database not exist when sync data. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + sync(deviceIds: string[], query: Query, mode: SyncMode, delayMs?: number): void; + + /** + * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in + * {@code KvStoreObserver} will be invoked. + * + * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. + * @param listener Indicates the observer of data change events in the distributed database. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100001 - if the database has been subscribed over the max subscription time limit. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + on(event: 'dataChange', type: SubscribeType, listener: Callback): void; + + /** + * Register Synchronizes SingleKvStore databases callback. + *

Sync result is returned through asynchronous callback. + * + * @param syncCallback Indicates the callback used to send the synchronization result to the caller. + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + on(event: 'syncComplete', syncCallback: Callback>): void; + + /** + * Unsubscribes from the SingleKvStore database based on the specified subscribeType and {@code KvStoreObserver}. + * + * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + off(event:'dataChange', listener?: Callback): void; + + /** + * UnRegister Synchronizes SingleKvStore databases callback. + * + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + off(event: 'syncComplete', syncCallback?: Callback>): void; + + + /** + * Sets the default delay allowed for database synchronization + * + * @param defaultAllowedDelayMs Indicates the default delay allowed for the database synchronization, in milliseconds. + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback): void; + setSyncParam(defaultAllowedDelayMs: number): Promise; + + /** + * Get the security level of the database. + * + * @returns SecurityLevel {@code SecurityLevel} the security level of the database. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + getSecurityLevel(callback: AsyncCallback): void; + getSecurityLevel(): Promise; + } + + /** + * Manages distributed data by device in a distributed system. + * + *

To create a {@code DeviceKVStore} database, you can use the {@link data.distributed.common.KVManager.getKvStore(Options, String)} + * method with {@code KvStoreType} set to {@code DEVICE_COLLABORATION} for the input parameter Options. This database manages distributed + * data by device, and cannot modify data synchronized from remote devices. When an application writes a key-value pair entry + * into the database, the system automatically adds the ID of the device running the application to the key. + * + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + interface DeviceKVStore extends KVStore { + /** + * Obtains the {@code String} value matching a specified device ID and key. + * + * @param deviceId Indicates the device to be queried. + * @param key Indicates the key of the value to be queried. + * @return Returns the value matching the given criteria. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the data not exist when query data. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + get(deviceId: string, key: string, callback: AsyncCallback): void; + get(deviceId: string, key: string): Promise; + + /** + * Obtains all key-value pairs matching a specified device ID and key prefix. + * + * @param deviceId Identifies the device whose data is to be queried. + * @param keyPrefix Indicates the key prefix to match. + * @returns Returns the list of all key-value pairs meeting the given criteria. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + getEntries(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; + getEntries(deviceId: string, keyPrefix: string): Promise; + + /** + * Obtains the list of key-value pairs matching the specified {@code Query} object. + * + * @param query Indicates the {@code Query} object. + * @returns Returns the list of key-value pairs matching the specified {@code Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100005 - if not support the operation. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + getEntries(query: Query, callback: AsyncCallback): void; + getEntries(query: Query): Promise; + + /** + * Obtains the list of key-value pairs matching a specified device ID and {@code Query} object. + * + * @param deviceId Indicates the ID of the device to which the key-value pairs belong. + * @param query Indicates the {@code Query} object. + * @returns Returns the list of key-value pairs matching the specified {@code Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100005 - if not support the operation. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + getEntries(deviceId: string, query: Query, callback: AsyncCallback): void; + getEntries(deviceId: string, query: Query): Promise; + + /** + * Obtains the {@code KVStoreResultSet} object matching the specified device ID and key prefix. + * + *

The {@code KVStoreResultSet} object can be used to query all key-value pairs that meet the search criteria. Each {@code KVStore} + * instance can have a maximum of four {@code KVStoreResultSet} objects at the same time. If you have created four objects, + * calling this method will return a failure. Therefore, you are advised to call the closeResultSet method to close unnecessary + * {@code KVStoreResultSet} objects in a timely manner. + * + * @param deviceId Identifies the device whose data is to be queried. + * @param keyPrefix Indicates the key prefix to match. + * @returns Returns the {@code KVStoreResultSet} objects. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + getResultSet(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; + getResultSet(deviceId: string, keyPrefix: string): Promise; + + /** + * Obtains the {@code KVStoreResultSet} object matching the specified {@code Query} object. + * + * @param query Indicates the {@code Query} object. + * @returns Returns the {@code KVStoreResultSet} object matching the specified {@code Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + getResultSet(query: Query, callback: AsyncCallback): void; + getResultSet(query: Query): Promise; + + /** + * Obtains the {@code KVStoreResultSet} object matching a specified device ID and {@code Query} object. + * + * @param deviceId Indicates the ID of the device to which the {@code KVStoreResultSet} object belongs. + * @param query Indicates the {@code Query} object. + * @returns Returns the {@code KVStoreResultSet} object matching the specified {@code Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + getResultSet(deviceId: string, query: Query, callback: AsyncCallback): void; + getResultSet(deviceId: string, query: Query): Promise; + + /** + * Obtains the KVStoreResultSet object matching the specified Predicate object. + * + * @param predicates Indicates the datasharePredicates. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @systemapi + * @since 9 + */ + getResultSet(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; + getResultSet(predicates: dataSharePredicates.DataSharePredicates): Promise; + + /** + * Obtains the KVStoreResultSet object matching a specified Device ID and Predicate object. + * + * @param predicates Indicates the key. + * @param deviceId Indicates the ID of the device to which the results belong. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @systemapi + * @since 9 + */ + getResultSet(deviceId: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; + getResultSet(deviceId: string, predicates: dataSharePredicates.DataSharePredicates): Promise; + + /** + * Closes a {@code KVStoreResultSet} object returned by getResultSet. + * + * @param resultSet Indicates the {@code KVStoreResultSet} object to close. + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + closeResultSet(resultSet: KVStoreResultSet, callback: AsyncCallback): void; + closeResultSet(resultSet: KVStoreResultSet): Promise; + + /** + * Obtains the number of results matching the specified {@code Query} object. + * + * @param query Indicates the {@code Query} object. + * @returns Returns the number of results matching the specified {@code Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + getResultSize(query: Query, callback: AsyncCallback): void; + getResultSize(query: Query): Promise; + + /** + * Obtains the number of results matching a specified device ID and {@code Query} object. + * + * @param deviceId Indicates the ID of the device to which the results belong. + * @param query Indicates the {@code Query} object. + * @returns Returns the number of results matching the specified {@code Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + getResultSize(deviceId: string, query: Query, callback: AsyncCallback): void; + getResultSize(deviceId: string, query: Query): Promise; + + /** + * Removes data of a specified device from the current database. This method is used to remove only the data + * synchronized from remote devices. This operation does not synchronize data to other databases or affect + * subsequent data synchronization. + * + * @param deviceId Identifies the device whose data is to be removed. The value cannot be the current device ID. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + removeDeviceData(deviceId: string, callback: AsyncCallback): void; + removeDeviceData(deviceId: string): Promise; + + /** + * Synchronizes {@code DeviceKVStore} databases. + * + *

This method returns immediately and sync result will be returned through asynchronous callback. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param deviceIds Indicates the list of IDs of devices whose + * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. + * {@code DeviceKVStore} databases are to be synchronized. + * @param mode Indicates the synchronization mode, {@code PUSH}, {@code PULL}, or {@code PUSH_PULL}. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the database not exist when sync data. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; + + /** + * Synchronizes {@code DeviceKVStore} databases. + * + *

This method returns immediately and sync result will be returned through asynchronous callback. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param deviceIds Indicates the list of IDs of devices whose + * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. + * {@code DeviceKVStore} databases are to be synchronized. + * @param query Indicates the {@code Query} object. + * @param mode Indicates the synchronization mode, {@code PUSH}, {@code PULL}, or {@code PUSH_PULL}. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the database not exist when sync data. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + sync(deviceIds: string[], query: Query, mode: SyncMode, delayMs?: number): void; + + /** + * Register Synchronizes DeviceKVStore databases callback. + * + *

Sync result is returned through asynchronous callback. + * + * @param syncCallback Indicates the callback used to send the synchronization result to the caller. + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + on(event: 'syncComplete', syncCallback: Callback>): void; + + /** + * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in + * {@code KvStoreObserver} will be invoked. + * + * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. + * @param listener Indicates the observer of data change events in the distributed database. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100001 - if the database has been subscribed over the max subscription time limit. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + on(event: 'dataChange', type: SubscribeType, listener: Callback): void; + + /** + * Unsubscribes from the DeviceKVStore database based on the specified subscribeType and {@code KvStoreObserver}. + * + * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + off(event:'dataChange', listener?: Callback): void; + + /** + * UnRegister Synchronizes DeviceKVStore databases callback. + * + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + off(event: 'syncComplete', syncCallback?: Callback>): void; + } + + /** + * Creates a {@link KVManager} instance based on the configuration information. + * + *

You must pass {@link KVManagerConfig} to provide configuration information + * for creating the {@link KVManager} instance. + * + * @param config Indicates the {@link KVStore} configuration information, + * including the user information and package name. + * @return Returns the {@code KVManager} instance. + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + function createKVManager(config: KVManagerConfig, callback: AsyncCallback): void; + function createKVManager(config: KVManagerConfig): Promise; + + /** + * Provides interfaces to manage a {@code KVStore} database, including obtaining, closing, and deleting the {@code KVStore}. + * + * @import N/A + * @version 1 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + interface KVManager { + /** + * Creates and obtains a {@code KVStore} database by specifying {@code Options} and {@code storeId}. + * + * @param options Indicates the options used for creating and obtaining the {@code KVStore} database, + * including {@code isCreateIfMissing}, {@code isEncrypt}, and {@code KVStoreType}. + * @param storeId Identifies the {@code KVStore} database. + * The value of this parameter must be unique for the same application, + * and different applications can share the same value. + * @return Returns a {@code KVStore}, or {@code SingleKVStore}. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100002 - if open existed database with changed options. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + getKVStore(storeId: string, options: Options): Promise; + getKVStore(storeId: string, options: Options, callback: AsyncCallback): void; + + /** + * Closes the {@code KVStore} database. + * + *

Warning: This method is not thread-safe. If you call this method to stop a KvStore database that is running, your + * thread may crash. + * + *

The {@code KVStore} database to close must be an object created by using the {@code getKvStore} method. Before using this + * method, release the resources created for the database, for example, {@code KVStoreResultSet} for {@code SingleKVStore}, + * otherwise closing the database will fail. If you are attempting to close a database that is already closed, an error + * will be returned. + * + * @param kvStore Indicates the {@code KVStore} database to close. + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + closeKVStore(appId: string, storeId: string, kvStore: KVStore, callback: AsyncCallback): void; + closeKVStore(appId: string, storeId: string, kvStore: KVStore): Promise; + + /** + * Deletes the {@code KVStore} database identified by storeId. + * + *

Before using this method, close all {@code KVStore} instances in use that are identified by the same storeId. + * + *

You can use this method to delete a {@code KVStore} database not in use. After the database is deleted, all its data will be + * lost. + * + * @param storeId Identifies the {@code KVStore} database to delete. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100004 - if the database not exist when delete database. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + deleteKVStore(appId: string, storeId: string, callback: AsyncCallback): void; + deleteKVStore(appId: string, storeId: string): Promise; + + /** + * Obtains the storeId of all {@code KVStore} databases that are created by using the {@code getKvStore} method and not deleted by + * calling the {@code deleteKvStore} method. + * + * @returns Returns the storeId of all created {@code KVStore} databases. + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + getAllKVStoreId(appId: string, callback: AsyncCallback): void; + getAllKVStoreId(appId: string): Promise; + + /** + * register DeviceChangeCallback to get notification when device's status changed + * + * @param deathCallback device change callback {@code DeviceChangeCallback} + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + on(event: 'distributedDataServiceDie', deathCallback: Callback): void; + + /** + * unRegister DeviceChangeCallback and can not receive notification + * + * @param deathCallback device change callback {@code DeviceChangeCallback} which has been registered. + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + off(event: 'distributedDataServiceDie', deathCallback?: Callback): void; + } +} + +export default kvStore; \ No newline at end of file -- Gitee From 08723a01b7cccb3bd8450413a0e0648740965392 Mon Sep 17 00:00:00 2001 From: ltdong Date: Fri, 14 Oct 2022 00:06:07 +0000 Subject: [PATCH 097/438] update api/@ohos.data.rdb.d.ts. Signed-off-by: ltdong --- api/@ohos.data.rdb.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index 2a44b7290a..aac8d61487 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -204,7 +204,7 @@ declare namespace rdb { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ - S0 = 0, + S0 = 1, /** * S1: mains the db is low level security @@ -213,7 +213,7 @@ declare namespace rdb { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ - S1 = 1, + S1 = 2, /** * S2: mains the db is middle level security @@ -222,7 +222,7 @@ declare namespace rdb { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ - S2 = 2, + S2 = 3, /** * S3: mains the db is high level security @@ -231,7 +231,7 @@ declare namespace rdb { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ - S3 = 3, + S3 = 5, /** * S4: mains the db is critical level security @@ -240,7 +240,7 @@ declare namespace rdb { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ - S4 = 4, + S4 = 6, } /** -- Gitee From 2001ca68fce082d8e2e3f8c4574543c1fcb2d583 Mon Sep 17 00:00:00 2001 From: ltdong Date: Fri, 14 Oct 2022 00:08:48 +0000 Subject: [PATCH 098/438] update api/data/rdb/resultSet.d.ts. Signed-off-by: ltdong --- api/data/rdb/resultSet.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/data/rdb/resultSet.d.ts b/api/data/rdb/resultSet.d.ts index 07199de374..19e8fac574 100755 --- a/api/data/rdb/resultSet.d.ts +++ b/api/data/rdb/resultSet.d.ts @@ -13,6 +13,8 @@ * limitations under the License. */ +import { AsyncCallback } from '../../basic' + /** * Provides methods for accessing a database result set generated by querying the database. * -- Gitee From 5f35a8bcdb8ed3d283560080fc141eddf65f754e Mon Sep 17 00:00:00 2001 From: dboy190 Date: Fri, 14 Oct 2022 08:30:31 +0800 Subject: [PATCH 099/438] distributedData delete api9 interface Signed-off-by: dboy190 --- api/@ohos.data.distributedData.d.ts | 211 ---------------------------- 1 file changed, 211 deletions(-) diff --git a/api/@ohos.data.distributedData.d.ts b/api/@ohos.data.distributedData.d.ts index e020a04031..77ee7f6942 100644 --- a/api/@ohos.data.distributedData.d.ts +++ b/api/@ohos.data.distributedData.d.ts @@ -14,10 +14,6 @@ */ import { AsyncCallback, Callback } from './basic'; -import { ValuesBucket } from './@ohos.data.ValuesBucket'; -import dataSharePredicates from './@ohos.data.dataSharePredicates'; -import DataShareResultSet from './@ohos.data.DataShareResultSet'; -import Context from './application/Context'; /** * Providers interfaces to creat a {@link KVManager} istances. @@ -50,15 +46,6 @@ declare namespace distributedData { * @import N/A */ bundleName: string; - - /** - * Indicates the ability or hap context - * @since 9 - * @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 - */ - context: Context; } /** @@ -1125,21 +1112,6 @@ declare namespace distributedData { put(key: string, value: Uint8Array | string | number | boolean, callback: AsyncCallback): void; put(key: string, value: Uint8Array | string | number | boolean): Promise; - /** - * Writes a value of the valuesbucket type into the {@code KvStore} database. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @systemapi - * @param value Indicates the data record to put. - * Spaces before and after the key will be cleared. - * @throws Throws this exception if any of the following errors - * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and - * {@code DB_ERROR}. - */ - putBatch(value: Array, callback: AsyncCallback): void; - putBatch(value: Array): Promise; - /** * Deletes the key-value pair based on a specified key. * @@ -1154,50 +1126,6 @@ declare namespace distributedData { delete(key: string, callback: AsyncCallback): void; delete(key: string): Promise; - /** - * Deletes the key-value pair based on a specified key. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @systemapi - * @param predicates Indicates the datasharePredicates. - * Spaces before and after the key will be cleared. - * @throws Throws this exception if any of the following errors - * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and - * {@code DB_ERROR}. - */ - delete(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback); - delete(predicates: dataSharePredicates.DataSharePredicates): Promise; - - /** - * Backs up a database in a specified name. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @param file Indicates the name that saves the database backup. - */ - backup(file:string, callback: AsyncCallback):void; - backup(file:string): Promise; - - /** - * Restores a database from a specified database file. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @param file Indicates the name that saves the database file. - */ - restore(file:string, callback: AsyncCallback):void; - restore(file:string): Promise; - - /** - * Delete a backup files based on a specified name. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @param files list Indicates the name that backup file to delete. - */ - deleteBackup(files:Array, callback: AsyncCallback>):void; - deleteBackup(files:Array): Promise>; - /** * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in * {@code KvStoreObserver} will be invoked. @@ -1235,17 +1163,6 @@ declare namespace distributedData { */ off(event:'dataChange', listener?: Callback): void; - /** - * UnRegister Synchronizes {@code KvStore} database callback. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @param syncCallback Indicates the callback used to send the synchronization result to caller. - * @throws Throws this exception if any of the following errors - * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, - * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. - */ - off(event: 'syncComplete', syncCallback?: Callback>): void; - /** * Inserts key-value pairs into the {@code KvStore} database in batches. * @@ -1415,21 +1332,6 @@ declare namespace distributedData { getResultSet(query: Query, callback: AsyncCallback): void; getResultSet(query: Query): Promise; - /** - * Obtains the KvStoreResultSet object matching the specified Predicate object. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @systemapi - * @param predicates Indicates the datasharePredicates. - * Spaces before and after the key will be cleared. - * @throws Throws this exception if any of the following errors - * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and - * {@code DB_ERROR}. - */ - getResultSet(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; - getResultSet(predicates: dataSharePredicates.DataSharePredicates): Promise; - /** * Closes a {@code KvStoreResultSet} object returned by getResultSet. * @@ -1482,35 +1384,6 @@ declare namespace distributedData { */ sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void - /** - * Synchronizes the database to the specified devices with the specified delay allowed. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @param deviceIds Indicates the list of devices to which to synchronize the database. - * @param mode Indicates the synchronization mode. The value can be {@code PUSH}, {@code PULL}, or {@code PUSH_PULL}. - * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. - * @param query Indicates the {@code Query} object. - * @throws Throws this exception if any of the following errors - * @permission ohos.permission.DISTRIBUTED_DATASYNC - * occurs: {@code INVALID_ARGUMENT}, - * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. - */ - sync(deviceIds: string[], query: Query, mode: SyncMode, delayMs?: number): void; - - /** - * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in - * {@code KvStoreObserver} will be invoked. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. - * @param listener Indicates the observer of data change events in the distributed database. - * @throws Throws this exception if no {@code SingleKvStore} database is available. - * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. - */ - on(event: 'dataChange', type: SubscribeType, listener: Callback): void; - /** * Register Synchronizes SingleKvStore databases callback. *

Sync result is returned through asynchronous callback. @@ -1521,17 +1394,6 @@ declare namespace distributedData { */ on(event: 'syncComplete', syncCallback: Callback>): void; - /** - * Unsubscribes from the SingleKvStore database based on the specified subscribeType and {@code KvStoreObserver}. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. - * @throws Throws this exception if any of the following errors - * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, - * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. - */ - off(event:'dataChange', listener?: Callback): void; - /** * UnRegister Synchronizes SingleKvStore databases callback. * @since 8 @@ -1676,36 +1538,6 @@ declare namespace distributedData { getResultSet(deviceId: string, query: Query, callback: AsyncCallback): void; getResultSet(deviceId: string, query: Query): Promise; - /** - * Obtains the KvStoreResultSet object matching the specified Predicate object. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @param predicates Indicates the datasharePredicates. - * @systemapi - * Spaces before and after the key will be cleared. - * @throws Throws this exception if any of the following errors - * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and - * {@code DB_ERROR}. - */ - getResultSet(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; - getResultSet(predicates: dataSharePredicates.DataSharePredicates): Promise; - - /** - * Obtains the KvStoreResultSet object matching a specified Device ID and Predicate object. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @systemapi - * @param predicates Indicates the key. - * @param deviceId Indicates the ID of the device to which the results belong. - * Spaces before and after the key will be cleared. - * @throws Throws this exception if any of the following errors - * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and - * {@code DB_ERROR}. - */ - getResultSet(deviceId: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; - getResultSet(deviceId: string, predicates: dataSharePredicates.DataSharePredicates): Promise; - /** * Closes a {@code KvStoreResultSet} object returned by getResultSet. * @@ -1773,23 +1605,6 @@ declare namespace distributedData { */ sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; - /** - * Synchronizes {@code DeviceKVStore} databases. - * - *

This method returns immediately and sync result will be returned through asynchronous callback. - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @param deviceIds Indicates the list of IDs of devices whose - * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. - * {@code DeviceKVStore} databases are to be synchronized. - * @param query Indicates the {@code Query} object. - * @param mode Indicates the synchronization mode, {@code PUSH}, {@code PULL}, or - * {@code PUSH_PULL}. - * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @throws Throws this exception if no DeviceKVStore database is available. - */ - sync(deviceIds: string[], query: Query, mode: SyncMode, delayMs?: number): void; - /** * Register Synchronizes DeviceKVStore databases callback. * @@ -1801,32 +1616,6 @@ declare namespace distributedData { */ on(event: 'syncComplete', syncCallback: Callback>): void; - /** - * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in - * {@code KvStoreObserver} will be invoked. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. - * @param listener Indicates the observer of data change events in the distributed database. - * @throws Throws this exception if any of the following errors - * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, - * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. - */ - on(event: 'dataChange', type: SubscribeType, listener: Callback): void; - - /** - * Unsubscribes from the DeviceKVStore database based on the specified subscribeType and {@code KvStoreObserver}. - * - * @since 9 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. - * @throws Throws this exception if any of the following errors - * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, - * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. - */ - off(event:'dataChange', listener?: Callback): void; - /** * UnRegister Synchronizes DeviceKVStore databases callback. * @since 8 -- Gitee From 8121c76e1980377e4006e0d4deacd411292004d8 Mon Sep 17 00:00:00 2001 From: "@shi-xiaoxiao-iris" Date: Fri, 14 Oct 2022 09:09:14 +0800 Subject: [PATCH 100/438] =?UTF-8?q?[=E5=88=86=E5=B8=83=E5=BC=8F=E7=A1=AC?= =?UTF-8?q?=E4=BB=B6]=E9=94=99=E8=AF=AF=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: @shi-xiaoxiao-iris --- api/@ohos.distributedHardware.deviceManager.d.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/api/@ohos.distributedHardware.deviceManager.d.ts b/api/@ohos.distributedHardware.deviceManager.d.ts index f9073f101a..f388aecaef 100644 --- a/api/@ohos.distributedHardware.deviceManager.d.ts +++ b/api/@ohos.distributedHardware.deviceManager.d.ts @@ -356,7 +356,6 @@ declare namespace deviceManager { /** * Obtains a list of trusted devices. * - * @throws {BusinessError} 401 - Input parameter error. * @throws {BusinessError} 11600101 - Failed to execute the function. * @return Returns a list of trusted devices. * @systemapi this method can be used only by system applications. @@ -378,7 +377,6 @@ declare namespace deviceManager { * Obtains a list of trusted devices. * * @since 8 - * @throws {BusinessError} 401 - Input parameter error. * @return Returns a list of trusted devices. * @systemapi this method can be used only by system applications. */ @@ -388,7 +386,6 @@ declare namespace deviceManager { * Obtains local device info * * @since 8 - * @throws {BusinessError} 401 - Input parameter error. * @throws {BusinessError} 11600101 - Failed to execute the function. * @return Returns local device info. * @systemapi this method can be used only by system applications. @@ -410,7 +407,6 @@ declare namespace deviceManager { * Obtains local device info * * @since 8 - * @throws {BusinessError} 401 - Input parameter error. * @return Returns local device info. * @systemapi this method can be used only by system applications. */ -- Gitee From 810049183038dd977a986a5b91e53ca2b9be11f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwangxiyue=E2=80=9D?= Date: Fri, 14 Oct 2022 09:32:26 +0800 Subject: [PATCH 101/438] modified: api/@ohos.data.distributedDataObject.d.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: “wangxiyue” --- api/@ohos.data.distributedDataObject.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/api/@ohos.data.distributedDataObject.d.ts b/api/@ohos.data.distributedDataObject.d.ts index 26cf1c3811..b1c4c834c3 100644 --- a/api/@ohos.data.distributedDataObject.d.ts +++ b/api/@ohos.data.distributedDataObject.d.ts @@ -350,6 +350,7 @@ declare namespace distributedDataObject { * Revoke save object, delete saved object immediately, if object is saved in local device, * it will delete saved data on all trusted device. * if object is saved in other device, it will delete data in local device. + * * @returns {Promise} {RevokeSaveSuccessResponse}: the response of revokeSave. * @throws {BusinessError} 401 - the parameter check failed. * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. -- Gitee From 36fb390691590b58e87093e1e34feeade7a70055 Mon Sep 17 00:00:00 2001 From: dboy190 Date: Fri, 14 Oct 2022 09:40:00 +0800 Subject: [PATCH 102/438] fix since problem Signed-off-by: dboy190 --- api/@ohos.data.distributedData.d.ts | 834 ++++++++++++++-------------- 1 file changed, 431 insertions(+), 403 deletions(-) diff --git a/api/@ohos.data.distributedData.d.ts b/api/@ohos.data.distributedData.d.ts index 77ee7f6942..9ba4e2fdfa 100644 --- a/api/@ohos.data.distributedData.d.ts +++ b/api/@ohos.data.distributedData.d.ts @@ -17,33 +17,32 @@ import { AsyncCallback, Callback } from './basic'; /** * Providers interfaces to creat a {@link KVManager} istances. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A + * @since 7 */ - declare namespace distributedData { /** * Provides configuration information for {@link KVManager} instances, * including the caller's package name and distributed network type. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ interface KVManagerConfig { /** * Indicates the user information - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ userInfo: UserInfo; /** * Indicates the bundleName - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ bundleName: string; } @@ -54,24 +53,24 @@ declare namespace distributedData { *

This class provides methods for obtaining the user ID and type, setting the user ID and type, * and checking whether two users are the same. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ interface UserInfo { /** * Indicates the user ID to set - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ userId?: string; /** * Indicates the user type to set - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ userType?: UserType; } @@ -79,72 +78,73 @@ declare namespace distributedData { /** * Enumerates user types. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ enum UserType { /** * Indicates a user that logs in to different devices using the same account. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ SAME_USER_ID = 0 } /** * KVStore constants - * @since 7 + * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ namespace Constants { /** * max key length. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ const MAX_KEY_LENGTH = 1024; /** * max value length. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ const MAX_VALUE_LENGTH = 4194303; /** * max device coordinate key length. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ const MAX_KEY_LENGTH_DEVICE = 896; /** * max store id length. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ const MAX_STORE_ID_LENGTH = 128; /** * max query length. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ const MAX_QUERY_LENGTH = 512000; /** * max batch operation size. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ const MAX_BATCH_SIZE = 128; } @@ -154,56 +154,56 @@ declare namespace distributedData { * *

{@code ValueType} is obtained based on the value. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ enum ValueType { /** * Indicates that the value type is string. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ STRING = 0, /** * Indicates that the value type is int. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ INTEGER = 1, /** * Indicates that the value type is float. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ FLOAT = 2, /** * Indicates that the value type is byte array. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 * */ BYTE_ARRAY = 3, /** * Indicates that the value type is boolean. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 * */ BOOLEAN = 4, /** * Indicates that the value type is double. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ DOUBLE = 5 } @@ -211,26 +211,26 @@ declare namespace distributedData { /** * Obtains {@code Value} objects stored in a {@link KVStore} database. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ interface Value { /** * Indicates value type - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @see ValueType * @type {number} * @memberof Value + * @since 7 */ type: ValueType; /** * Indicates value - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ value: Uint8Array | string | number | boolean; } @@ -238,23 +238,23 @@ declare namespace distributedData { /** * Provides key-value pairs stored in the distributed database. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ interface Entry { /** * Indicates key - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ key: string; /** * Indicates value - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ value: Value; } @@ -265,37 +265,37 @@ declare namespace distributedData { *

If you have subscribed to {@code KVStore}, you will receive data change notifications and obtain the changed data * from the parameters in callback methods upon data insertion, update, or deletion. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ interface ChangeNotification { /** * Indicates data addition records. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ insertEntries: Entry[]; /** * Indicates data update records. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ updateEntries: Entry[]; /** * Indicates data deletion records. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ deleteEntries: Entry[]; /** * Indicates from device id. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ deviceId: string; } @@ -303,30 +303,30 @@ declare namespace distributedData { /** * Indicates the database synchronization mode. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ enum SyncMode { /** * Indicates that data is only pulled from the remote end. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ PULL_ONLY = 0, /** * Indicates that data is only pushed from the local end. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ PUSH_ONLY = 1, /** * Indicates that data is pushed from the local end, and then pulled from the remote end. - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ PUSH_PULL = 2 } @@ -334,32 +334,32 @@ declare namespace distributedData { /** * Describes the subscription type. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ enum SubscribeType { /** * Subscription to local data changes - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ SUBSCRIBE_TYPE_LOCAL = 0, /** * Subscription to remote data changes - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ SUBSCRIBE_TYPE_REMOTE = 1, /** * Subscription to both local and remote data changes - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ SUBSCRIBE_TYPE_ALL = 2, } @@ -367,32 +367,32 @@ declare namespace distributedData { /** * Describes the {@code KVStore} type. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ enum KVStoreType { /** * Device-collaborated database, as specified by {@code DeviceKVStore} - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A + * @since 7 */ DEVICE_COLLABORATION = 0, /** * Single-version database, as specified by {@code SingleKVStore} - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ SINGLE_VERSION = 1, /** * Multi-version database, as specified by {@code MultiKVStore} - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A + * @since 7 */ MULTI_VERSION = 2, } @@ -400,17 +400,17 @@ declare namespace distributedData { /** * Describes the {@code KVStore} type. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ enum SecurityLevel { /** * NO_LEVEL: mains not set the security level. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A + * @since 7 */ NO_LEVEL = 0, @@ -418,9 +418,9 @@ declare namespace distributedData { * S0: mains the db is public. * There is no impact even if the data is leaked. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ S0 = 1, @@ -428,9 +428,9 @@ declare namespace distributedData { * S1: mains the db is low level security * There are some low impact, when the data is leaked. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ S1 = 2, @@ -438,9 +438,9 @@ declare namespace distributedData { * S2: mains the db is middle level security * There are some major impact, when the data is leaked. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ S2 = 3, @@ -448,9 +448,9 @@ declare namespace distributedData { * S3: mains the db is high level security * There are some severity impact, when the data is leaked. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ S3 = 5, @@ -458,9 +458,9 @@ declare namespace distributedData { * S4: mains the db is critical level security * There are some critical impact, when the data is leaked. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ S4 = 6, } @@ -471,59 +471,59 @@ declare namespace distributedData { *

You can determine whether to create another database if a {@code KVStore} database is missing, * whether to encrypt the database, and the database type. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ interface Options { /** * Indicates whether to createa database when the database file does not exist - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ createIfMissing?: boolean; /** * Indicates setting whether database files are encrypted - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ encrypt?: boolean; /** * Indicates setting whether to back up database files - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ backup?: boolean; /** * Indicates setting whether database files are automatically synchronized - * @since 7 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ autoSync?: boolean; /** * Indicates setting the databse type - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ kvStoreType?: KVStoreType; /** * Indicates setting the database security level - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ securityLevel?: SecurityLevel; /** * Indicates schema object - * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A + * @since 8 */ schema?: Schema; } @@ -533,44 +533,44 @@ declare namespace distributedData { * * You can create Schema objects and put them in Options when creating or opening the database. * - * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A + * @since 8 */ class Schema { /** * A constructor used to create a Schema instance. * - * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ constructor() /** * Indicates the root json object. * - * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ root: FieldNode; /** * Indicates the string array of json. * - * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ indexes: Array; /** * Indicates the mode of schema. * - * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ mode: number; /** * Indicates the skipsize of schema. * - * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ skip: number; } @@ -584,17 +584,17 @@ declare namespace distributedData { * *

The leaf node must have a value; the non-leaf node must have a child {@code FieldNode}. * - * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A + * @since 8 */ class FieldNode { /** * A constructor used to create a FieldNode instance with the specified field. * name Indicates the field node name. * - * @since 8 * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ constructor(name: string) /** @@ -602,31 +602,31 @@ declare namespace distributedData { * *

Adding a child node makes this node a non-leaf node. Field value will be ignored if it has child node. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @param child The field node to append. + * @param child The field node to append. * @returns Returns true if the child node is successfully added to this {@code FieldNode}; returns false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ appendChild(child: FieldNode): boolean; /** * Indicates the default value of fieldnode. - * - * @since 8 + * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ default: string; /** * Indicates the nullable of database field. - * - * @since 8 + * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ nullable: boolean; /** * Indicates the type of value. - * - * @since 8 + * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ type: number; } @@ -637,434 +637,447 @@ declare namespace distributedData { *

The result set is created by using the {@code getResultSet} method in the {@code DeviceKVStore} class. This interface also provides * methods for moving the data read position in the result set. * - * @since 7 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A + * @since 7 */ interface KvStoreResultSet { /** * Obtains the number of lines in a result set. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @returns Returns the number of lines. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ getCount(): number; /** * Obtains the current read position in a result set. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @returns Returns the current read position. The read position starts with 0. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ getPosition(): number; /** * Moves the read position to the first line. * *

If the result set is empty, false is returned. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @returns Returns true if the operation succeeds; return false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ moveToFirst(): boolean; /** * Moves the read position to the last line. * *

If the result set is empty, false is returned. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @returns Returns true if the operation succeeds; return false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ moveToLast(): boolean; /** * Moves the read position to the next line. * *

If the result set is empty or the data in the last line is being read, false is returned. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @returns Returns true if the operation succeeds; return false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ moveToNext(): boolean; /** * Moves the read position to the previous line. * *

If the result set is empty or the data in the first line is being read, false is returned. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @returns Returns true if the operation succeeds; return false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ moveToPrevious(): boolean; /** * Moves the read position by a relative offset to the current position. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param offset Indicates the relative offset to the current position. Anegative offset indicates moving backwards, and a * positive offset indicates moving forewards. Forexample, if the current position is entry 1 and thisoffset is 2, * the destination position will be entry 3; ifthe current position is entry 3 and this offset is -2, * the destination position will be entry 1. The valid final position after moving forwards starts with 0. If the * final position is invalid, false will be returned. * @returns Returns true if the operation succeeds; return false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 + * @deprecated since 9 + * @useinstead moveV9 */ move(offset: number): boolean; /** * Moves the read position from 0 to an absolute position. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param position Indicates the absolute position. * @returns Returns true if the operation succeeds; return false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 + * @deprecated since 9 + * @useinstead moveToPositionV9 */ moveToPosition(position: number): boolean; /** * Checks whether the read position is the first line. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @returns Returns true if the read position is the first line; returns false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ isFirst(): boolean; /** * Checks whether the read position is the last line. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @returns Returns true if the read position is the last line; returns false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ isLast(): boolean; /** * Checks whether the read position is before the last line. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @returns Returns true if the read position is before the first line; returns false otherwise. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ isBeforeFirst(): boolean; /** * Checks whether the read position is after the last line. * - * @since 8 + * @returns Returns true if the read position is after the last line; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @returns Returns true if the read position is after the last line; returns false otherwise. + * @since 8 */ isAfterLast(): boolean; /** * Obtains a key-value pair. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @returns Returns a key-value pair. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 + * @deprecated since 9 + * @useinstead getEntryV9 */ getEntry(): Entry; } /** * Represents a database query using a predicate. - * + * *

This class provides a constructor used to create a {@code Query} instance, which is used to query data matching specified * conditions in the database. - * + * *

This class also provides methods for adding predicates to the {@code Query} instance. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 + * @deprecated since 9 + * @useinstead QueryV9 */ class Query { /** * A constructor used to create a Query instance. - * - * @since 8 + * * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ - constructor() + constructor() /** * Resets this {@code Query} object. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @returns Returns the reset {@code Query} object. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ reset(): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is equal to the specified long value. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value IIndicates the long value. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ equalTo(field: string, value: number|string|boolean): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is not equal to the specified int value. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the int value. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ notEqualTo(field: string, value: number|string|boolean): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is greater than or equal to the * specified int value. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the int value. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - */ - greaterThan(field: string, value: number|string|boolean): Query; + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 + */ + greaterThan(field: string, value: number|string|boolean): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is less than the specified int value. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the int value. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ lessThan(field: string, value: number|string): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is greater than or equal to the * specified int value. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the int value. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ greaterThanOrEqualTo(field: string, value: number|string): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is less than or equal to the * specified int value. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the int value. - * @returns Returns the {@coed Query} object. + * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ lessThanOrEqualTo(field: string, value: number|string): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is null. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. - * @returns Returns the {@coed Query} object. + * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ isNull(field: string): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is within the specified int value list. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @param valueList Indicates the int value list. - * @returns Returns the {@coed Query} object. + * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ inNumber(field: string, valueList: number[]): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is within the specified string value list. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @param valueList Indicates the string value list. - * @returns Returns the {@coed Query} object. + * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ inString(field: string, valueList: string[]): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is not within the specified int value list. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @param valueList Indicates the int value list. * @returns Returns the {@coed Query} object. - * @throws Throws this exception if input is invalid. + * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ notInNumber(field: string, valueList: number[]): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is not within the specified string value list. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @param valueList Indicates the string value list. - * @returns Returns the {@coed Query} object. - * @throws Throws this exception if input is invalid. + * @returns Returns the {@coed Query} object. + * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ notInString(field: string, valueList: string[]): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is similar to the specified string value. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the string value. - * @returns Returns the {@coed Query} object. - * @throws Throws this exception if input is invalid. + * @returns Returns the {@coed Query} object. + * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ like(field: string, value: string): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is not similar to the specified string value. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @param value Indicates the string value. - * @returns Returns the {@coed Query} object. - * @throws Throws this exception if input is invalid. + * @returns Returns the {@coed Query} object. + * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ unlike(field: string, value: string): Query; /** * Constructs a {@code Query} object with the and condition. - * + * *

Multiple predicates should be connected using the and or or condition. - * - * @since 8 + * + * @returns Returns the {@coed Query} object. + * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A - * @returns Returns the {@coed Query} object. + * @since 8 */ and(): Query; /** * Constructs a {@code Query} object with the or condition. - * + * *

Multiple predicates should be connected using the and or or condition. - * - * @since 8 + * + * @returns Returns the {@coed Query} object. + * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A - * @returns Returns the {@coed Query} object. + * @since 8 */ or(): Query; /** * Constructs a {@code Query} object to sort the query results in ascending order. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. - * @returns Returns the {@coed Query} object. - * @throws Throws this exception if input is invalid. + * @returns Returns the {@coed Query} object. + * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ orderByAsc(field: string): Query; /** * Constructs a {@code Query} object to sort the query results in descending order. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the field, which must start with $. and cannot contain ^. * @returns Returns the {@coed Query} object. - * @throws Throws this exception if input is invalid. + * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ orderByDesc(field: string): Query; /** * Constructs a {@code Query} object to specify the number of results and the start position. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param total Indicates the number of results. * @param offset Indicates the start position. * @returns Returns the {@coed Query} object. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ limit(total: number, offset: number): Query; /** * Creates a {@code query} condition with a specified field that is not null. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param field Indicates the specified field. * @returns Returns the {@coed Query} object. - * @throws Throws this exception if input is invalid. + * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ isNotNull(field: string): Query; /** * Creates a query condition group with a left bracket. - * + * *

Multiple query conditions in an {@code Query} object can be grouped. The query conditions in a group can be used as a * whole to combine with other query conditions. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @returns Returns the {@coed Query} object. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ beginGroup(): Query; /** * Creates a query condition group with a right bracket. - * + * *

Multiple query conditions in an {@code Query} object can be grouped. The query conditions in a group can be used as a * whole to combine with other query conditions. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @returns Returns the {@coed Query} object. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ endGroup(): Query; /** * Creates a query condition with a specified key prefix. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param prefix Indicates the specified key prefix. * @returns Returns the {@coed Query} object. - * @throws Throws this exception if input is invalid. + * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ prefixKey(prefix: string): Query; /** * Sets a specified index that will be preferentially used for query. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param index Indicates the index to set. * @returns Returns the {@coed Query} object. - * @throws Throws this exception if input is invalid. + * @throws Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ setSuggestIndex(index: string): Query; /** * Add device ID key prefix.Used by {@code DeviceKVStore}. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @param deviceId Specify device id to query from. * @return Returns the {@code Query} object with device ID prefix added. * @throw Throws this exception if input is invalid. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ deviceId(deviceId:string):Query; /** @@ -1072,11 +1085,11 @@ declare namespace distributedData { * *

The String would be parsed to DB query format. * The String length should be no longer than 500kb. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * + * @return String representing this {@code Query}. * @import N/A - * @return String representing this {@code Query}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ getSqlLike():string; } @@ -1089,25 +1102,27 @@ declare namespace distributedData { * with input parameter {@code Options}. Distributed database types are defined in {@code KVStoreType}, * including {@code SingleKVStore}. * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @import N/A * @version 1 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 7 + * @deprecated since 9 + * @useinstead KVStoreV9 */ interface KVStore { /** * Writes a key-value pair of the string type into the {@code KvStore} database. * *

If you do not want to synchronize this key-value pair to other devices, set the write option in the local database. - * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @param key Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. * Spaces before and after the key will be cleared. * @param value Indicates the string value, which must be less than 4 MB as a UTF-8 byte array. - * @throws Throws this exception if any of the following errors - * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and - * {@code DB_ERROR}. + * @throws Throws this exception if any of the following errors + * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 7 */ put(key: string, value: Uint8Array | string | number | boolean, callback: AsyncCallback): void; put(key: string, value: Uint8Array | string | number | boolean): Promise; @@ -1115,131 +1130,131 @@ declare namespace distributedData { /** * Deletes the key-value pair based on a specified key. * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param key Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. * Spaces before and after the key will be cleared. - * @throws Throws this exception if any of the following errors + * @throws Throws this exception if any of the following errors * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and * {@code DB_ERROR}, and {@code KEY_NOT_FOUND}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 7 */ delete(key: string, callback: AsyncCallback): void; delete(key: string): Promise; /** - * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in + * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in * {@code KvStoreObserver} will be invoked. * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. * @param listener Indicates the observer of data change events in the distributed database. - * @throws Throws this exception if any of the following errors + * @throws Throws this exception if any of the following errors * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 7 */ on(event: 'dataChange', type: SubscribeType, listener: Callback): void; /** * Subscribes from the {@code KvStore} database based on the specified subscribeType and {@code KvStoreObserver}. - * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @throws Throws this exception if any of the following errors + * + * @throws Throws this exception if any of the following errors * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 7 */ on(event: 'syncComplete', syncCallback: Callback>): void; - + /** * Unsubscribes from the {@code KvStore} database based on the specified subscribeType and {@code KvStoreObserver}. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. - * @throws Throws this exception if any of the following errors + * @throws Throws this exception if any of the following errors * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ - off(event:'dataChange', listener?: Callback): void; + off(event: 'dataChange', listener?: Callback): void; /** * Inserts key-value pairs into the {@code KvStore} database in batches. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @param entries Indicates the key-value pairs to be inserted in batches. * @throws Throws this exception if a database error occurs. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ putBatch(entries: Entry[], callback: AsyncCallback): void; putBatch(entries: Entry[]): Promise; /** * Deletes key-value pairs in batches from the {@code KvStore} database. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @param keys Indicates the key-value pairs to be deleted in batches. * @throws Throws this exception if a database error occurs. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ deleteBatch(keys: string[], callback: AsyncCallback): void; deleteBatch(keys: string[]): Promise; /** * Starts a transaction operation in the {@code KvStore} database. - * + * *

After the database transaction is started, you can submit or roll back the operation. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @throws Throws this exception if a database error occurs. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ startTransaction(callback: AsyncCallback): void; startTransaction(): Promise; /** * Submits a transaction operation in the {@code KvStore} database. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @param callback + * + * @param callback * @throws Throws this exception if a database error occurs. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ commit(callback: AsyncCallback): void; commit(): Promise; /** * Rolls back a transaction operation in the {@code KvStore} database. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @throws Throws this exception if a database error occurs. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ rollback(callback: AsyncCallback): void; rollback(): Promise; /** * Sets whether to enable synchronization. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @param enabled Specifies whether to enable synchronization. The value true means to enable * synchronization, and false means the opposite. * @throws Throws this exception if an internal service error occurs. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ enableSync(enabled: boolean, callback: AsyncCallback): void; enableSync(enabled: boolean): Promise; /** * Sets synchronization range labels. - * + * *

The labels determine the devices with which data will be synchronized. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @param localLabels Indicates the synchronization labels of the local device. * @param remoteSupportLabels Indicates the labels of the devices with which data will be synchronized. * @throws Throws this exception if an internal service error occurs. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ setSyncRange(localLabels: string[], remoteSupportLabels: string[], callback: AsyncCallback): void; setSyncRange(localLabels: string[], remoteSupportLabels: string[]): Promise; @@ -1255,49 +1270,51 @@ declare namespace distributedData { * The {@code SingleKVStore} database does not support * synchronous transactions, or data search using snapshots. * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @version 1 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 7 + * @deprecated since 9 + * @useinstead SingleKVStoreV9 */ interface SingleKVStore extends KVStore { /** * Obtains the {@code String} value of a specified key. - * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param key Indicates the key of the boolean value to be queried. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}, and {@code KEY_NOT_FOUND}. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 7 */ get(key: string, callback: AsyncCallback): void; get(key: string): Promise; /** * Obtains all key-value pairs that match a specified key prefix. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param keyPrefix Indicates the key prefix to match. * @returns Returns the list of all key-value pairs that match the specified key prefix. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ getEntries(keyPrefix: string, callback: AsyncCallback): void; getEntries(keyPrefix: string): Promise; /** * Obtains the list of key-value pairs matching the specified {@code Query} object. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param query Indicates the {@code Query} object. * @returns Returns the list of key-value pairs matching the specified {@code Query} object. * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ getEntries(query: Query, callback: AsyncCallback): void; getEntries(query: Query): Promise; @@ -1308,63 +1325,63 @@ declare namespace distributedData { * {@code KvStoreResultSet} objects at the same time. If you have created four objects, calling this method will return a * failure. Therefore, you are advised to call the closeResultSet method to close unnecessary {@code KvStoreResultSet} objects * in a timely manner. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param keyPrefix Indicates the key prefix to match. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ getResultSet(keyPrefix: string, callback: AsyncCallback): void; getResultSet(keyPrefix: string): Promise; /** * Obtains the {@code KvStoreResultSet} object matching the specified {@code Query} object. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param query Indicates the {@code Query} object. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ getResultSet(query: Query, callback: AsyncCallback): void; getResultSet(query: Query): Promise; /** * Closes a {@code KvStoreResultSet} object returned by getResultSet. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param resultSet Indicates the {@code KvStoreResultSet} object to close. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; closeResultSet(resultSet: KvStoreResultSet): Promise; /** * Obtains the number of results matching the specified {@code Query} object. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A + * * @param query Indicates the {@code Query} object. * @returns Returns the number of results matching the specified {@code Query} object. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ getResultSize(query: Query, callback: AsyncCallback): void; getResultSize(query: Query): Promise; /** * void removeDeviceData​({@link String} deviceId) throws {@link KvStoreException} - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ removeDeviceData(deviceId: string, callback: AsyncCallback): void; removeDeviceData(deviceId: string): Promise; @@ -1372,57 +1389,58 @@ declare namespace distributedData { /** * Synchronizes the database to the specified devices with the specified delay allowed. * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param deviceIds Indicates the list of devices to which to synchronize the database. * @param mode Indicates the synchronization mode. The value can be {@code PUSH}, {@code PULL}, or {@code PUSH_PULL}. * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. * @throws Throws this exception if any of the following errors * @permission ohos.permission.DISTRIBUTED_DATASYNC - * occurs: {@code INVALID_ARGUMENT}, + * occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 7 */ - sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void + sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; /** - * Register Synchronizes SingleKvStore databases callback. + * Register Synchronizes SingleKvStore databases callback. *

Sync result is returned through asynchronous callback. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @param syncCallback Indicates the callback used to send the synchronization result to the caller. * @throws Throws this exception if no {@code SingleKvStore} database is available. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ on(event: 'syncComplete', syncCallback: Callback>): void; /** * UnRegister Synchronizes SingleKvStore databases callback. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @throws Throws this exception if no {@code SingleKvStore} database is available. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ off(event: 'syncComplete', syncCallback?: Callback>): void; - - + /** * Sets the default delay allowed for database synchronization - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @param defaultAllowedDelayMs Indicates the default delay allowed for the database synchronization, in milliseconds. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback): void; setSyncParam(defaultAllowedDelayMs: number): Promise; /** * Get the security level of the database. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @returns SecurityLevel {@code SecurityLevel} the security level of the database. * @throws Throws this exception if any of the following errors occurs:{@code SERVER_UNAVAILABLE}, * {@code IPC_ERROR}, and {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ getSecurityLevel(callback: AsyncCallback): void; getSecurityLevel(): Promise; @@ -1430,147 +1448,149 @@ declare namespace distributedData { /** * Manages distributed data by device in a distributed system. - * + * *

To create a {@code DeviceKVStore} database, you can use the {@link data.distributed.common.KVManager.getKvStore(Options, String)} * method with {@code KvStoreType} set to {@code DEVICE_COLLABORATION} for the input parameter Options. This database manages distributed * data by device, and cannot modify data synchronized from remote devices. When an application writes a key-value pair entry * into the database, the system automatically adds the ID of the device running the application to the key. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 + * @deprecated since 9 + * @useinstead DeviceKVStoreV9 */ interface DeviceKVStore extends KVStore { /** * Obtains the {@code String} value matching a specified device ID and key. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deviceId Indicates the device to be queried. * @param key Indicates the key of the value to be queried. * @return Returns the value matching the given criteria. * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}, and {@code KEY_NOT_FOUND}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ get(deviceId: string, key: string, callback: AsyncCallback): void; get(deviceId: string, key: string): Promise; /** * Obtains all key-value pairs matching a specified device ID and key prefix. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * * @param deviceId Identifies the device whose data is to be queried. * @param keyPrefix Indicates the key prefix to match. * @returns Returns the list of all key-value pairs meeting the given criteria. * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ getEntries(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; getEntries(deviceId: string, keyPrefix: string): Promise; /** * Obtains the list of key-value pairs matching the specified {@code Query} object. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * * @param query Indicates the {@code Query} object. * @returns Returns the list of key-value pairs matching the specified {@code Query} object. * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ getEntries(query: Query, callback: AsyncCallback): void; getEntries(query: Query): Promise; /** * Obtains the list of key-value pairs matching a specified device ID and {@code Query} object. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * * @param deviceId Indicates the ID of the device to which the key-value pairs belong. * @param query Indicates the {@code Query} object. * @returns Returns the list of key-value pairs matching the specified {@code Query} object. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ getEntries(deviceId: string, query: Query, callback: AsyncCallback): void; getEntries(deviceId: string, query: Query): Promise; /** * Obtains the {@code KvStoreResultSet} object matching the specified device ID and key prefix. - * + * *

The {@code KvStoreResultSet} object can be used to query all key-value pairs that meet the search criteria. Each {@code KvStore} * instance can have a maximum of four {@code KvStoreResultSet} objects at the same time. If you have created four objects, * calling this method will return a failure. Therefore, you are advised to call the closeResultSet method to close unnecessary * {@code KvStoreResultSet} objects in a timely manner. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * * @param deviceId Identifies the device whose data is to be queried. * @param keyPrefix Indicates the key prefix to match. * @returns Returns the {@code KvStoreResultSet} objects. * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ getResultSet(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; getResultSet(deviceId: string, keyPrefix: string): Promise; /** * Obtains the {@code KvStoreResultSet} object matching the specified {@code Query} object. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * * @param query Indicates the {@code Query} object. * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code Query} object. * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ getResultSet(query: Query, callback: AsyncCallback): void; getResultSet(query: Query): Promise; /** * Obtains the {@code KvStoreResultSet} object matching a specified device ID and {@code Query} object. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * * @param deviceId Indicates the ID of the device to which the {@code KvStoreResultSet} object belongs. * @param query Indicates the {@code Query} object. * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code Query} object. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ getResultSet(deviceId: string, query: Query, callback: AsyncCallback): void; getResultSet(deviceId: string, query: Query): Promise; /** * Closes a {@code KvStoreResultSet} object returned by getResultSet. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * * @param resultSet Indicates the {@code KvStoreResultSet} object to close. * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; closeResultSet(resultSet: KvStoreResultSet): Promise; /** * Obtains the number of results matching the specified {@code Query} object. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * * @param query Indicates the {@code Query} object. * @returns Returns the number of results matching the specified {@code Query} object. * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ getResultSize(query: Query, callback: AsyncCallback): void; getResultSize(query: Query): Promise; /** * Obtains the number of results matching a specified device ID and {@code Query} object. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * * @param deviceId Indicates the ID of the device to which the results belong. * @param query Indicates the {@code Query} object. * @returns Returns the number of results matching the specified {@code Query} object. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ getResultSize(deviceId: string, query: Query, callback: AsyncCallback): void; getResultSize(deviceId: string, query: Query): Promise; @@ -1579,64 +1599,69 @@ declare namespace distributedData { * Removes data of a specified device from the current database. This method is used to remove only the data * synchronized from remote devices. This operation does not synchronize data to other databases or affect * subsequent data synchronization. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * * @param deviceId Identifies the device whose data is to be removed. The value cannot be the current device ID. * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ removeDeviceData(deviceId: string, callback: AsyncCallback): void; removeDeviceData(deviceId: string): Promise; - + /** * Synchronizes {@code DeviceKVStore} databases. * *

This method returns immediately and sync result will be returned through asynchronous callback. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC * @param deviceIds Indicates the list of IDs of devices whose * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. * {@code DeviceKVStore} databases are to be synchronized. * @param mode Indicates the synchronization mode, {@code PUSH}, {@code PULL}, or * {@code PUSH_PULL}. - * @permission ohos.permission.DISTRIBUTED_DATASYNC * @throws Throws this exception if no DeviceKVStore database is available. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; /** * Register Synchronizes DeviceKVStore databases callback. - * + * *

Sync result is returned through asynchronous callback. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @param syncCallback Indicates the callback used to send the synchronization result to the caller. * @throws Throws this exception if no DeviceKVStore database is available. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ on(event: 'syncComplete', syncCallback: Callback>): void; - + /** * UnRegister Synchronizes DeviceKVStore databases callback. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @throws Throws this exception if no DeviceKVStore database is available. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ off(event: 'syncComplete', syncCallback?: Callback>): void; } - + /** * Creates a {@link KVManager} instance based on the configuration information. * *

You must pass {@link KVManagerConfig} to provide configuration information * for creating the {@link KVManager} instance. * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param config Indicates the {@link KVStore} configuration information, * including the user information and package name. * @return Returns the {@code KVManager} instance. * @throws Throws exception if input is invalid. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 7 + * @deprecated since 9 + * @useinstead createKVManagerV9 */ function createKVManager(config: KVManagerConfig, callback: AsyncCallback): void; function createKVManager(config: KVManagerConfig): Promise; @@ -1644,23 +1669,25 @@ declare namespace distributedData { /** * Provides interfaces to manage a {@code KVStore} database, including obtaining, closing, and deleting the {@code KVStore}. * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @version 1 + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 7 + * @deprecated since 9 + * @useinstead KVManagerV9 */ interface KVManager { /** * Creates and obtains a {@code KVStore} database by specifying {@code Options} and {@code storeId}. * - * @since 7 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @param options Indicates the options used for creating and obtaining the {@code KVStore} database, * including {@code isCreateIfMissing}, {@code isEncrypt}, and {@code KVStoreType}. * @param storeId Identifies the {@code KVStore} database. * The value of this parameter must be unique for the same application, * and different applications can share the same value. * @return Returns a {@code KVStore}, or {@code SingleKVStore}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 7 */ getKVStore(storeId: string, options: Options): Promise; getKVStore(storeId: string, options: Options, callback: AsyncCallback): void; @@ -1675,14 +1702,14 @@ declare namespace distributedData { * method, release the resources created for the database, for example, {@code KvStoreResultSet} for {@code SingleKvStore}, * otherwise closing the database will fail. If you are attempting to close a database that is already closed, an error * will be returned. - * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @param kvStore Indicates the {@code KvStore} database to close. * @throws Throws this exception if any of the following errors * occurs:{@code INVALID_ARGUMENT}, {@code ERVER_UNAVAILABLE}, * {@code STORE_NOT_OPEN}, {@code STORE_NOT_FOUND}, {@code DB_ERROR}, * {@code PERMISSION_DENIED}, and {@code IPC_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ closeKVStore(appId: string, storeId: string, kvStore: KVStore, callback: AsyncCallback): void; closeKVStore(appId: string, storeId: string, kvStore: KVStore): Promise; @@ -1694,13 +1721,14 @@ declare namespace distributedData { * *

You can use this method to delete a {@code KvStore} database not in use. After the database is deleted, all its data will be * lost. - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * * @param storeId Identifies the {@code KvStore} database to delete. * @throws Throws this exception if any of the following errors * occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code STORE_NOT_FOUND}, * {@code DB_ERROR}, {@code PERMISSION_DENIED}, and {@code IPC_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ deleteKVStore(appId: string, storeId: string, callback: AsyncCallback): void; deleteKVStore(appId: string, storeId: string): Promise; @@ -1709,12 +1737,12 @@ declare namespace distributedData { * Obtains the storeId of all {@code KvStore} databases that are created by using the {@code getKvStore} method and not deleted by * calling the {@code deleteKvStore} method. * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @returns Returns the storeId of all created {@code KvStore} databases. + * @returns Returns the storeId of all created {@code KvStore} databases. * @throws Throws this exception if any of the following errors * occurs: {@code SERVER_UNAVAILABLE}, {@code DB_ERROR}, * {@code PERMISSION_DENIED}, and {@code IPC_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 */ getAllKVStoreId(appId: string, callback: AsyncCallback): void; getAllKVStoreId(appId: string): Promise; @@ -1722,20 +1750,20 @@ declare namespace distributedData { /** * register DeviceChangeCallback to get notification when device's status changed * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deathCallback device change callback {@code DeviceChangeCallback} * @throws exception maybe occurs. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ on(event: 'distributedDataServiceDie', deathCallback: Callback): void; /** * unRegister DeviceChangeCallback and can not receive notification * - * @since 8 - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @param deathCallback device change callback {@code DeviceChangeCallback} which has been registered. * @throws exception maybe occurs. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 */ off(event: 'distributedDataServiceDie', deathCallback?: Callback): void; } -- Gitee From 5c1c0ddc1e2c971fe1520fe36d65effc44d9d828 Mon Sep 17 00:00:00 2001 From: dboy190 Date: Fri, 14 Oct 2022 13:47:38 +0800 Subject: [PATCH 103/438] fix codes Signed-off-by: dboy190 --- api/@ohos.data.distributedData.d.ts | 4 + ....ts => @ohos.data.distributedKVStore.d.ts} | 514 ++++++------------ 2 files changed, 170 insertions(+), 348 deletions(-) rename api/{@ohos.data.kvStore.d.ts => @ohos.data.distributedKVStore.d.ts} (88%) diff --git a/api/@ohos.data.distributedData.d.ts b/api/@ohos.data.distributedData.d.ts index 9ba4e2fdfa..db85d859d1 100644 --- a/api/@ohos.data.distributedData.d.ts +++ b/api/@ohos.data.distributedData.d.ts @@ -20,6 +20,8 @@ import { AsyncCallback, Callback } from './basic'; * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.kvStore */ declare namespace distributedData { /** @@ -28,6 +30,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.kvStore.KVManagerConfig */ interface KVManagerConfig { /** diff --git a/api/@ohos.data.kvStore.d.ts b/api/@ohos.data.distributedKVStore.d.ts similarity index 88% rename from api/@ohos.data.kvStore.d.ts rename to api/@ohos.data.distributedKVStore.d.ts index a72691b335..de74faaa95 100644 --- a/api/@ohos.data.kvStore.d.ts +++ b/api/@ohos.data.distributedKVStore.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -16,16 +16,15 @@ import { AsyncCallback, Callback } from './basic'; import { ValuesBucket } from './@ohos.data.ValuesBucket'; import dataSharePredicates from './@ohos.data.dataSharePredicates'; -import DataShareResultSet from './@ohos.data.DataShareResultSet'; import Context from './application/Context'; /** - * Providers interfaces to creat a {@link KVManager} istances. + * Providers interfaces to create a {@link KVManager} istances. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A * @since 9 */ -declare namespace kvStore { +declare namespace distributedKVStore { /** * Provides configuration information for {@link KVManager} instances, * including the caller's package name and distributed network type. @@ -34,14 +33,6 @@ declare namespace kvStore { * @since 9 */ interface KVManagerConfig { - /** - * Indicates the user information - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A - * @since 9 - */ - userInfo: UserInfo; - /** * Indicates the bundleName * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -60,51 +51,6 @@ declare namespace kvStore { context: Context; } - /** - * Manages user information. - * - *

This class provides methods for obtaining the user ID and type, setting the user ID and type, - * and checking whether two users are the same. - * - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A - * @since 9 - */ - interface UserInfo { - /** - * Indicates the user ID to set - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A - * @since 9 - */ - userId?: string; - - /** - * Indicates the user type to set - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A - * @since 9 - */ - userType?: UserType; - } - - /** - * Enumerates user types. - * - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A - * @since 9 - */ - enum UserType { - /** - * Indicates a user that logs in to different devices using the same account. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A - * @since 9 - */ - SAME_USER_ID = 0 - } - /** * KVStore constants * @@ -178,7 +124,7 @@ declare namespace kvStore { * @import N/A * @since 9 */ - STRING = 0, + STRING, /** * Indicates that the value type is int. @@ -186,7 +132,7 @@ declare namespace kvStore { * @import N/A * @since 9 */ - INTEGER = 1, + INTEGER, /** * Indicates that the value type is float. @@ -194,7 +140,7 @@ declare namespace kvStore { * @import N/A * @since 9 */ - FLOAT = 2, + FLOAT, /** * Indicates that the value type is byte array. @@ -202,7 +148,7 @@ declare namespace kvStore { * @import N/A * @since 9 * */ - BYTE_ARRAY = 3, + BYTE_ARRAY, /** * Indicates that the value type is boolean. @@ -210,7 +156,7 @@ declare namespace kvStore { * @import N/A * @since 9 * */ - BOOLEAN = 4, + BOOLEAN, /** * Indicates that the value type is double. @@ -218,7 +164,7 @@ declare namespace kvStore { * @import N/A * @since 9 */ - DOUBLE = 5 + DOUBLE, } /** @@ -327,21 +273,21 @@ declare namespace kvStore { * @import N/A * @since 9 */ - PULL_ONLY = 0, + PULL_ONLY, /** * Indicates that data is only pushed from the local end. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 9 */ - PUSH_ONLY = 1, + PUSH_ONLY, /** * Indicates that data is pushed from the local end, and then pulled from the remote end. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 9 */ - PUSH_PULL = 2 + PUSH_PULL, } /** @@ -358,7 +304,7 @@ declare namespace kvStore { * @import N/A * @since 9 */ - SUBSCRIBE_TYPE_LOCAL = 0, + SUBSCRIBE_TYPE_LOCAL, /** * Subscription to remote data changes @@ -366,7 +312,7 @@ declare namespace kvStore { * @import N/A * @since 9 */ - SUBSCRIBE_TYPE_REMOTE = 1, + SUBSCRIBE_TYPE_REMOTE, /** * Subscription to both local and remote data changes @@ -374,7 +320,7 @@ declare namespace kvStore { * @import N/A * @since 9 */ - SUBSCRIBE_TYPE_ALL = 2, + SUBSCRIBE_TYPE_ALL, } /** @@ -391,7 +337,7 @@ declare namespace kvStore { * @import N/A * @since 9 */ - DEVICE_COLLABORATION = 0, + DEVICE_COLLABORATION, /** * Single-version database, as specified by {@code SingleKVStore} @@ -399,7 +345,7 @@ declare namespace kvStore { * @import N/A * @since 9 */ - SINGLE_VERSION = 1, + SINGLE_VERSION, } /** @@ -418,7 +364,7 @@ declare namespace kvStore { * @import N/A * @since 9 */ - S1 = 2, + S1, /** * S2: mains the db is middle level security @@ -428,7 +374,7 @@ declare namespace kvStore { * @import N/A * @since 9 */ - S2 = 3, + S2, /** * S3: mains the db is high level security @@ -438,7 +384,7 @@ declare namespace kvStore { * @import N/A * @since 9 */ - S3 = 5, + S3, /** * S4: mains the db is critical level security @@ -448,7 +394,7 @@ declare namespace kvStore { * @import N/A * @since 9 */ - S4 = 6, + S4, } /** @@ -618,7 +564,7 @@ declare namespace kvStore { } /** - * Provide methods to obtain the result set of the {@code KvStore} or {@code KVStore} database. + * Provide methods to obtain the result set of the {@code KVStore} or {@code KVStore} database. * *

The result set is created by using the {@code getResultSet} method in the {@code DeviceKVStore} or * {@code DeviceKVStore} class. This interface also provides methods for moving the data read position in the result set. @@ -1076,19 +1022,21 @@ declare namespace kvStore { } /** - * Represents a key-value distributed database and provides methods for adding, deleting, modifying, querying, - * and subscribing to distributed data. + * Provides methods related to single-version distributed databases. * - *

You can create distributed databases of different types by {@link KVManager#getKVStore (Options, String)} - * with input parameter {@code Options}. Distributed database types are defined in {@code KVStoreType}, - * including {@code SingleKVStore}. + *

To create a {@code SingleKVStore} database, + * you can use the {@link data.distributed.common.KVManager#getKVStore​(Options, String)} method + * with {@code KVStoreType} set to {@code SINGLE_VERSION} for the input parameter {@code Options}. + * This database synchronizes data to other databases in time sequence. + * The {@code SingleKVStore} database does not support + * synchronous transactions, or data search using snapshots. * * @import N/A * @version 1 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - interface KVStore { + interface SingleKVStore { /** * Writes a key-value pair of the string type into the {@code KVStore} database. * @@ -1106,6 +1054,19 @@ declare namespace kvStore { put(key: string, value: Uint8Array | string | number | boolean, callback: AsyncCallback): void; put(key: string, value: Uint8Array | string | number | boolean): Promise; + /** + * Inserts key-value pairs into the {@code KVStore} database in batches. + * + * @param entries Indicates the key-value pairs to be inserted in batches. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + putBatch(entries: Entry[], callback: AsyncCallback): void; + putBatch(entries: Entry[]): Promise; + /** * Writes a value of the valuesbucket type into the {@code KVStore} database. * @@ -1153,100 +1114,6 @@ declare namespace kvStore { delete(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback); delete(predicates: dataSharePredicates.DataSharePredicates): Promise; - /** - * Backs up a database in a specified name. - * - * @param file Indicates the name that saves the database backup. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100005 - if not support the operation. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - backup(file:string, callback: AsyncCallback):void; - backup(file:string): Promise; - - /** - * Restores a database from a specified database file. - * - * @param file Indicates the name that saves the database file. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100005 - if not support the operation. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - restore(file:string, callback: AsyncCallback):void; - restore(file:string): Promise; - - /** - * Delete a backup files based on a specified name. - * - * @param files list Indicates the name that backup file to delete. - * @throws {BusinessError} 401 - if parameter check failed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - deleteBackup(files:Array, callback: AsyncCallback>):void; - deleteBackup(files:Array): Promise>; - - /** - * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in - * {@code KvStoreObserver} will be invoked. - * - * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. - * @param listener Indicates the observer of data change events in the distributed database. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100001 - if the database has been subscribed over the max subscription time limit. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - on(event: 'dataChange', type: SubscribeType, listener: Callback): void; - - /** - * Subscribes from the {@code KVStore} database based on the specified subscribeType and {@code KvStoreObserver}. - * - * @throws {BusinessError} 401 - if parameter check failed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - on(event: 'syncComplete', syncCallback: Callback>): void; - - /** - * Unsubscribes from the {@code KVStore} database based on the specified subscribeType and {@code KvStoreObserver}. - * - * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - off(event:'dataChange', listener?: Callback): void; - - /** - * UnRegister Synchronizes {@code KVStore} database callback. - * - * @param syncCallback Indicates the callback used to send the synchronization result to caller. - * @throws {BusinessError} 401 - if parameter check failed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - off(event: 'syncComplete', syncCallback?: Callback>): void; - - /** - * Inserts key-value pairs into the {@code KVStore} database in batches. - * - * @param entries Indicates the key-value pairs to be inserted in batches. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - putBatch(entries: Entry[], callback: AsyncCallback): void; - putBatch(entries: Entry[]): Promise; - /** * Deletes key-value pairs in batches from the {@code KVStore} database. * @@ -1262,81 +1129,18 @@ declare namespace kvStore { deleteBatch(keys: string[]): Promise; /** - * Starts a transaction operation in the {@code KVStore} database. - * - *

After the database transaction is started, you can submit or roll back the operation. - * - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - startTransaction(callback: AsyncCallback): void; - startTransaction(): Promise; - - /** - * Submits a transaction operation in the {@code KVStore} database. - * - * @param callback - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - commit(callback: AsyncCallback): void; - commit(): Promise; - - /** - * Rolls back a transaction operation in the {@code KVStore} database. - * - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - rollback(callback: AsyncCallback): void; - rollback(): Promise; - - /** - * Sets whether to enable synchronization. + * void removeDeviceData​({@link String} deviceId) throws {@link BusinessError} * - * @param enabled Specifies whether to enable synchronization. The value true means to enable - * synchronization, and false means the opposite. - * @throws {BusinessError} 401 - if parameter check failed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - enableSync(enabled: boolean, callback: AsyncCallback): void; - enableSync(enabled: boolean): Promise; - - /** - * Sets synchronization range labels. - * - *

The labels determine the devices with which data will be synchronized. - * - * @param localLabels Indicates the synchronization labels of the local device. - * @param remoteSupportLabels Indicates the labels of the devices with which data will be synchronized. + * @param deviceId Indicates the device to be removed data. * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - setSyncRange(localLabels: string[], remoteSupportLabels: string[], callback: AsyncCallback): void; - setSyncRange(localLabels: string[], remoteSupportLabels: string[]): Promise; - } + removeDeviceData(deviceId: string, callback: AsyncCallback): void; + removeDeviceData(deviceId: string): Promise; - /** - * Provides methods related to single-version distributed databases. - * - *

To create a {@code SingleKVStore} database, - * you can use the {@link data.distributed.common.KVManager#getKVStore​(Options, String)} method - * with {@code KVStoreType} set to {@code SINGLE_VERSION} for the input parameter {@code Options}. - * This database synchronizes data to other databases in time sequence. - * The {@code SingleKVStore} database does not support - * synchronous transactions, or data search using snapshots. - * - * @import N/A - * @version 1 - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - interface SingleKVStore extends KVStore { /** * Obtains the {@code String} value of a specified key. * @@ -1457,17 +1261,111 @@ declare namespace kvStore { getResultSize(query: Query): Promise; /** - * void removeDeviceData​({@link String} deviceId) throws {@link KvStoreException} + * Backs up a database in a specified name. * - * @param deviceId Indicates the device to be removed data. + * @param file Indicates the name that saves the database backup. * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100005 - if not support the operation. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - removeDeviceData(deviceId: string, callback: AsyncCallback): void; - removeDeviceData(deviceId: string): Promise; + backup(file:string, callback: AsyncCallback):void; + backup(file:string): Promise; + + /** + * Restores a database from a specified database file. + * + * @param file Indicates the name that saves the database file. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100005 - if not support the operation. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + restore(file:string, callback: AsyncCallback):void; + restore(file:string): Promise; + + /** + * Delete a backup files based on a specified name. + * + * @param files list Indicates the name that backup file to delete. + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + deleteBackup(files:Array, callback: AsyncCallback>):void; + deleteBackup(files:Array): Promise>; + + /** + * Starts a transaction operation in the {@code KVStore} database. + * + *

After the database transaction is started, you can submit or roll back the operation. + * + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + startTransaction(callback: AsyncCallback): void; + startTransaction(): Promise; + + /** + * Submits a transaction operation in the {@code KVStore} database. + * + * @param callback + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + commit(callback: AsyncCallback): void; + commit(): Promise; + + /** + * Rolls back a transaction operation in the {@code KVStore} database. + * + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + rollback(callback: AsyncCallback): void; + rollback(): Promise; + + /** + * Sets whether to enable synchronization. + * + * @param enabled Specifies whether to enable synchronization. The value true means to enable + * synchronization, and false means the opposite. + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + enableSync(enabled: boolean, callback: AsyncCallback): void; + enableSync(enabled: boolean): Promise; + + /** + * Sets synchronization range labels. + * + *

The labels determine the devices with which data will be synchronized. + * + * @param localLabels Indicates the synchronization labels of the local device. + * @param remoteSupportLabels Indicates the labels of the devices with which data will be synchronized. + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + setSyncRange(localLabels: string[], remoteSupportLabels: string[], callback: AsyncCallback): void; + setSyncRange(localLabels: string[], remoteSupportLabels: string[]): Promise; + + /** + * Sets the default delay allowed for database synchronization + * + * @param defaultAllowedDelayMs Indicates the default delay allowed for the database synchronization, in milliseconds. + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback): void; + setSyncParam(defaultAllowedDelayMs: number): Promise; /** * Synchronizes the database to the specified devices with the specified delay allowed. @@ -1501,8 +1399,8 @@ declare namespace kvStore { sync(deviceIds: string[], query: Query, mode: SyncMode, delayMs?: number): void; /** - * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in - * {@code KvStoreObserver} will be invoked. + * Registers a {@code KVStoreObserver} for the database. When data in the distributed database changes, the callback in + * {@code KVStoreObserver} will be invoked. * * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. * @param listener Indicates the observer of data change events in the distributed database. @@ -1515,7 +1413,7 @@ declare namespace kvStore { on(event: 'dataChange', type: SubscribeType, listener: Callback): void; /** - * Register Synchronizes SingleKvStore databases callback. + * Register Synchronizes SingleKVStore databases callback. *

Sync result is returned through asynchronous callback. * * @param syncCallback Indicates the callback used to send the synchronization result to the caller. @@ -1526,9 +1424,9 @@ declare namespace kvStore { on(event: 'syncComplete', syncCallback: Callback>): void; /** - * Unsubscribes from the SingleKvStore database based on the specified subscribeType and {@code KvStoreObserver}. + * Unsubscribes from the SingleKVStore database based on the specified subscribeType and {@code KVStoreObserver}. * - * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. + * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KVStoreObserver)}. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100006 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -1537,7 +1435,7 @@ declare namespace kvStore { off(event:'dataChange', listener?: Callback): void; /** - * UnRegister Synchronizes SingleKvStore databases callback. + * UnRegister Synchronizes SingleKVStore databases callback. * * @throws {BusinessError} 401 - if parameter check failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -1545,18 +1443,6 @@ declare namespace kvStore { */ off(event: 'syncComplete', syncCallback?: Callback>): void; - - /** - * Sets the default delay allowed for database synchronization - * - * @param defaultAllowedDelayMs Indicates the default delay allowed for the database synchronization, in milliseconds. - * @throws {BusinessError} 401 - if parameter check failed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback): void; - setSyncParam(defaultAllowedDelayMs: number): Promise; - /** * Get the security level of the database. * @@ -1572,8 +1458,8 @@ declare namespace kvStore { /** * Manages distributed data by device in a distributed system. * - *

To create a {@code DeviceKVStore} database, you can use the {@link data.distributed.common.KVManager.getKvStore(Options, String)} - * method with {@code KvStoreType} set to {@code DEVICE_COLLABORATION} for the input parameter Options. This database manages distributed + *

To create a {@code DeviceKVStore} database, you can use the {@link data.distributed.common.KVManager.getKVStore(Options, String)} + * method with {@code KVStoreType} set to {@code DEVICE_COLLABORATION} for the input parameter Options. This database manages distributed * data by device, and cannot modify data synchronized from remote devices. When an application writes a key-value pair entry * into the database, the system automatically adds the ID of the device running the application to the key. * @@ -1581,7 +1467,7 @@ declare namespace kvStore { * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ - interface DeviceKVStore extends KVStore { + interface DeviceKVStore extends SingleKVStore { /** * Obtains the {@code String} value matching a specified device ID and key. * @@ -1613,21 +1499,6 @@ declare namespace kvStore { getEntries(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; getEntries(deviceId: string, keyPrefix: string): Promise; - /** - * Obtains the list of key-value pairs matching the specified {@code Query} object. - * - * @param query Indicates the {@code Query} object. - * @returns Returns the list of key-value pairs matching the specified {@code Query} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100005 - if not support the operation. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 - */ - getEntries(query: Query, callback: AsyncCallback): void; - getEntries(query: Query): Promise; - /** * Obtains the list of key-value pairs matching a specified device ID and {@code Query} object. * @@ -1664,20 +1535,6 @@ declare namespace kvStore { getResultSet(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; getResultSet(deviceId: string, keyPrefix: string): Promise; - /** - * Obtains the {@code KVStoreResultSet} object matching the specified {@code Query} object. - * - * @param query Indicates the {@code Query} object. - * @returns Returns the {@code KVStoreResultSet} object matching the specified {@code Query} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 - */ - getResultSet(query: Query, callback: AsyncCallback): void; - getResultSet(query: Query): Promise; - /** * Obtains the {@code KVStoreResultSet} object matching a specified device ID and {@code Query} object. * @@ -1693,20 +1550,6 @@ declare namespace kvStore { getResultSet(deviceId: string, query: Query, callback: AsyncCallback): void; getResultSet(deviceId: string, query: Query): Promise; - /** - * Obtains the KVStoreResultSet object matching the specified Predicate object. - * - * @param predicates Indicates the datasharePredicates. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @systemapi - * @since 9 - */ - getResultSet(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; - getResultSet(predicates: dataSharePredicates.DataSharePredicates): Promise; - /** * Obtains the KVStoreResultSet object matching a specified Device ID and Predicate object. * @@ -1722,31 +1565,6 @@ declare namespace kvStore { getResultSet(deviceId: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; getResultSet(deviceId: string, predicates: dataSharePredicates.DataSharePredicates): Promise; - /** - * Closes a {@code KVStoreResultSet} object returned by getResultSet. - * - * @param resultSet Indicates the {@code KVStoreResultSet} object to close. - * @throws {BusinessError} 401 - if parameter check failed. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 - */ - closeResultSet(resultSet: KVStoreResultSet, callback: AsyncCallback): void; - closeResultSet(resultSet: KVStoreResultSet): Promise; - - /** - * Obtains the number of results matching the specified {@code Query} object. - * - * @param query Indicates the {@code Query} object. - * @returns Returns the number of results matching the specified {@code Query} object. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 - */ - getResultSize(query: Query, callback: AsyncCallback): void; - getResultSize(query: Query): Promise; - /** * Obtains the number of results matching a specified device ID and {@code Query} object. * @@ -1826,8 +1644,8 @@ declare namespace kvStore { on(event: 'syncComplete', syncCallback: Callback>): void; /** - * Registers a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback in - * {@code KvStoreObserver} will be invoked. + * Registers a {@code KVStoreObserver} for the database. When data in the distributed database changes, the callback in + * {@code KVStoreObserver} will be invoked. * * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. * @param listener Indicates the observer of data change events in the distributed database. @@ -1840,9 +1658,9 @@ declare namespace kvStore { on(event: 'dataChange', type: SubscribeType, listener: Callback): void; /** - * Unsubscribes from the DeviceKVStore database based on the specified subscribeType and {@code KvStoreObserver}. + * Unsubscribes from the DeviceKVStore database based on the specified subscribeType and {@code KVStoreObserver}. * - * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. + * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KVStoreObserver)}. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100006 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -1906,10 +1724,10 @@ declare namespace kvStore { /** * Closes the {@code KVStore} database. * - *

Warning: This method is not thread-safe. If you call this method to stop a KvStore database that is running, your + *

Warning: This method is not thread-safe. If you call this method to stop a KVStore database that is running, your * thread may crash. * - *

The {@code KVStore} database to close must be an object created by using the {@code getKvStore} method. Before using this + *

The {@code KVStore} database to close must be an object created by using the {@code getKVStore} method. Before using this * method, release the resources created for the database, for example, {@code KVStoreResultSet} for {@code SingleKVStore}, * otherwise closing the database will fail. If you are attempting to close a database that is already closed, an error * will be returned. @@ -1940,8 +1758,8 @@ declare namespace kvStore { deleteKVStore(appId: string, storeId: string): Promise; /** - * Obtains the storeId of all {@code KVStore} databases that are created by using the {@code getKvStore} method and not deleted by - * calling the {@code deleteKvStore} method. + * Obtains the storeId of all {@code KVStore} databases that are created by using the {@code getKVStore} method and not deleted by + * calling the {@code deleteKVStore} method. * * @returns Returns the storeId of all created {@code KVStore} databases. * @throws {BusinessError} 401 - if parameter check failed. @@ -1973,4 +1791,4 @@ declare namespace kvStore { } } -export default kvStore; \ No newline at end of file +export default distributedKVStore; \ No newline at end of file -- Gitee From b694b2839e1e3af45c658857a42f2e0e9ba41b28 Mon Sep 17 00:00:00 2001 From: onexiaomin Date: Fri, 14 Oct 2022 14:42:52 +0800 Subject: [PATCH 104/438] remove @ohos.fileManager.d.ts Signed-off-by: onexiaomin --- api/@ohos.fileManager.d.ts | 149 ------------------------------------- 1 file changed, 149 deletions(-) delete mode 100644 api/@ohos.fileManager.d.ts diff --git a/api/@ohos.fileManager.d.ts b/api/@ohos.fileManager.d.ts deleted file mode 100644 index 0c273772f6..0000000000 --- a/api/@ohos.fileManager.d.ts +++ /dev/null @@ -1,149 +0,0 @@ - /* - * Copyright (c) 2021 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 { AsyncCallback } from './basic' - -export default filemanager; - -/** - * @syscap SystemCapability.FileManagement.UserFileService - * @systemapi - */ -declare namespace filemanager { - export { listFile }; - export { getRoot }; - export { createFile }; - export { FileInfo }; - export { DevInfo }; -} - -/** - * listFile. - * - * @note N/A - * @syscap SystemCapability.FileManagement.UserFileService - * @since 9 - * @permission N/A - * @function listFile - * @param {string} path - path. - * @param {string} type - type. - * @param {Object} options - options - * @param {DevInfo} [options.dev = {name: "local"}] - dev name. - * @param {number} [options.offset = 0] - offset. - * @param {number} [options.count = 0] - count. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws {TypedError} Parameter check failed - * @systemapi - */ -declare function listFile(path: string, type: string, options?: {dev?: DevInfo, offset?: number, count?: number}): Promise; -declare function listFile(path: string, type: string, callback: AsyncCallback): void; -declare function listFile(path: string, type: string, options: {dev?: DevInfo, offset?: number, count?: number}, callback: AsyncCallback): void; - -/** - * getRoot. - * - * @note N/A - * @syscap SystemCapability.FileManagement.UserFileService - * @since 9 - * @permission N/A - * @function getRoot - * @param {Object} options - options - * @param {DevInfo} [options.dev = {name: "local"}] - dev name. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws {TypedError} Parameter check failed - * @systemapi - */ -declare function getRoot(options?: {dev?: DevInfo}): Promise; -declare function getRoot(callback: AsyncCallback): void; -declare function getRoot(options: {dev?: DevInfo}, callback: AsyncCallback): void; - -/** - * createFile. - * - * @note N/A - * @syscap SystemCapability.FileManagement.UserFileService - * @since 9 - * @permission N/A - * @function createFile - * @param {string} path - album uri. - * @param {string} filename- file name. - * @param {Object} options - options - * @param {DevInfo} [options.dev = {name: "local"}] - dev name. - * @param {AsyncCallback} [callback] - callback. - * @returns {void | Promise} no callback return Promise otherwise return void - * @throws {TypedError} Parameter check failed - * @systemapi - */ -declare function createFile(path: string, filename: string, options?: {dev?: DevInfo}): Promise; -declare function createFile(path: string, filename: string, callback: AsyncCallback): void; -declare function createFile(path: string, filename: string, options: {dev?: DevInfo}, callback: AsyncCallback): void; - -/** - * FileInfo - * @note N/A - * @syscap SystemCapability.FileManagement.UserFileService - * @since 9 - * @permission N/A - * @systemapi - */ -declare interface FileInfo { - /** - * @type {string} - * @readonly - */ - name: string; - /** - * @type {string} - * @readonly - */ - path: string; - /** - * @type {string} - * @readonly - */ - type: string; - /** - * @type {string} - * @readonly - */ - size: number; - /** - * @type {string} - * @readonly - */ - addedTime: number; - /** - * @type {string} - * @readonly - */ - modifiedTime: number; -} - -/** - * DevInfo - * @note N/A - * @syscap SystemCapability.FileManagement.UserFileService - * @since 9 - * @permission N/A - * @systemapi - */ - declare interface DevInfo { - /** - * @type {string} - */ - name: string; - } -- Gitee From 07e2023869953a6b51945f8d064914dabd27b4a3 Mon Sep 17 00:00:00 2001 From: LeiiYB Date: Fri, 14 Oct 2022 07:49:28 +0000 Subject: [PATCH 105/438] =?UTF-8?q?=E6=B7=BB=E5=8A=A0@ohos.multimedia.avse?= =?UTF-8?q?ssion.d.ts=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: LeiiYB --- api/@ohos.multimedia.avsession.d.ts | 1009 +++++++++++++++++++++++++++ 1 file changed, 1009 insertions(+) create mode 100644 api/@ohos.multimedia.avsession.d.ts diff --git a/api/@ohos.multimedia.avsession.d.ts b/api/@ohos.multimedia.avsession.d.ts new file mode 100644 index 0000000000..4ff22ea600 --- /dev/null +++ b/api/@ohos.multimedia.avsession.d.ts @@ -0,0 +1,1009 @@ +/* +* 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 { AsyncCallback } from './basic'; +import { WantAgent } from '@ohos.wantAgent'; +import KeyEvent from './@ohos.multimodalInput.keyEvent'; +import { ElementName } from './bundle/elementName'; +import image from './@ohos.multimedia.image'; +import audio from './@ohos.multimedia.audio'; + +/** + * @name avSession + * @syscap SystemCapability.Multimedia.AVSession.Core + * @import import avsession from '@ohos.multimedia.avsession'; + * @since 9 + */ +declare namespace avSession { + /** + * Create an AVSession instance. An ability can only create one AVSession + * @param context The context of application + * @param tag A user-defined name for this session + * @param type The type of session {@link AVSessionType} + * @param {AsyncCallback} [callback] - callback. + * @returns {void | Promise} no callback returns Promise otherwise returns void + * @throws {BusinessError} 401 - parameter check failed + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + function createAVSession(context: Context, tag: string, type: AVSessionType, callback: AsyncCallback): void; + function createAVSession(context: Context, tag: string, type: AVSessionType): Promise; + + /** + * Get all avsession descriptors of the system + * @permission ohos.permission.MANAGE_MEDIA_RESOURCES + * @returns The array of {@link AVSessionDescriptor} + * @throws {BusinessError} 201 - permission denied + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @syscap SystemCapability.Multimedia.AVSession.Manager + * @systemapi + * @since 9 + */ + function getAllSessionDescriptors(callback: AsyncCallback>>): void; + function getAllSessionDescriptors(): Promise>>; + + /** + * Create an avsession controller + * @permission ohos.permission.MANAGE_MEDIA_RESOURCES + * @param sessionId Specifies the sessionId to create the controller. + * If provided 'default', the system will create a default controller, Used to control the system default session + * @returns An instance of {@link AVSessionController} + * @throws {BusinessError} 201 - permission denied + * @throws {BusinessError} 401 - parameter check failed + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_SESSION_NOT_EXIST} - session does not exist + * @syscap SystemCapability.Multimedia.AVSession.Manager + * @systemapi + * @since 9 + */ + function createController(sessionId: string, callback: AsyncCallback): void; + function createController(sessionId: string): Promise; + + /** + * Cast Audio to the remote devices or cast back local device + * @permission ohos.permission.MANAGE_MEDIA_RESOURCES + * @param audioDevices Specifies the audio devices to cast. + * @param sessionId Specifies the sessionId which to send to remote. + * 'all' means cast all the media audio of this device to remote. + * @throws {BusinessError} 201 - permission denied + * @throws {BusinessError} 401 - parameter check failed + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_SESSION_NOT_EXIST} - session does not exist + * @throws {BusinessError} {@link #ERR_CODE_REMOTE_CONNECTION_ERR} - remote connection error + * @syscap SystemCapability.Multimedia.AVSession.Manager + * @systemapi + * @since 9 + */ + function castAudio(session: SessionToken | 'all', audioDevices: Array, callback: AsyncCallback): void; + function castAudio(session: SessionToken | 'all', audioDevices: Array): Promise; + + /** + * Session token. Used to judge the legitimacy of the session. + * @permission ohos.permission.MANAGE_MEDIA_RESOURCES + * @syscap SystemCapability.Multimedia.AVSession.Manager + * @systemapi + * @since 9 + */ + interface SessionToken { + /** + * session id + * @since 9 + */ + sessionId: string; + /** + * process id + * @since 9 + */ + pid: number; + /** + * user id + * @since 9 + */ + uid: number; + } + /** + * Register or unregister system session changed callback + * @permission ohos.permission.MANAGE_MEDIA_RESOURCES + * @param type Registration Type, session creation, deletion or top priority session changed + * @param callback Used to returns the descriptor of created or delete session + * @throws {BusinessError} 201 - permission denied + * @throws {BusinessError} 401 - parameter check failed + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @syscap SystemCapability.Multimedia.AVSession.Manager + * @systemapi + * @since 9 + */ + function on(type: 'sessionCreate' | 'sessionDestroy' | 'topSessionChange', callback: (session: AVSessionDescriptor) => void): void; + function off(type: 'sessionCreate' | 'sessionDestroy' | 'topSessionChange', callback?: (session: AVSessionDescriptor) => void): void; + + /** + * Register or unregister Session service death callback, notifying the application to clean up resources. + * @param type Registration Type + * @param callback Used to handle the session service death event. + * @throws {BusinessError} 201 - permission denied + * @throws {BusinessError} 401 - packagearameter check failed + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + function on(type: 'sessionServiceDie', callback: () => void): void; + function off(type: 'sessionServiceDie', callback?: () => void): void; + + /** + * Send system media key event.The system automatically selects the recipient. + * @permission ohos.permission.MANAGE_MEDIA_RESOURCES + * @param event The key event to be send + * @throws {BusinessError} 201 - permission denied + * @throws {BusinessError} 401 - parameter check failed + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_COMMAND_INVALID} - command not supported + * @syscap SystemCapability.Multimedia.AVSession.Manager + * @systemapi + * @since 9 + */ + function sendSystemAVKeyEvent(event: KeyEvent, callback: AsyncCallback): void; + function sendSystemAVKeyEvent(event: KeyEvent): Promise; + + /** + * Send system control command.The system automatically selects the recipient. + * @permission ohos.permission.MANAGE_MEDIA_RESOURCES + * @param command The command to be send. See {@link AVControlCommand} + * @throws {BusinessError} 201 - permission denied + * @throws {BusinessError} 401 - parameter check failed + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_COMMAND_INVALID} - command not supported + * @throws {BusinessError} {@link #ERR_CODE_MESSAGE_OVERLOAD} - command or event overload + * @syscap SystemCapability.Multimedia.AVSession.Manager + * @systemapi + * @since 9 + */ + function sendSystemControlCommand(command: AVControlCommand, callback: AsyncCallback): void; + function sendSystemControlCommand(command: AVControlCommand): Promise; + + /** + * session type. + */ + type AVSessionType = 'audio' | 'video'; + /** + * AVSession object. + * @interface AVSession + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + interface AVSession { + /** + * unique session Id + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + readonly sessionId: string; + + /** + * Set the metadata of this session. + * In addition to the required properties, users can fill in partially supported properties + * @param data {@link AVMetadata} + * @throws {BusinessError} 401 - parameter check failed + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_SESSION_NOT_EXIST} - session does not exist + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + setAVMetadata(data: AVMetadata, callback: AsyncCallback): void; + setAVMetadata(data: AVMetadata): Promise; + + /** + * Set the playback state of this session. + * @param state {@link AVPlaybackState} + * @throws {BusinessError} 401 - parameter check failed + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_SESSION_NOT_EXIST} - session does not exist + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + setAVPlaybackState(state: AVPlaybackState, callback: AsyncCallback): void; + setAVPlaybackState(state: AVPlaybackState): Promise; + + /** + * Set the ability to start the session corresponding to + * @param ability The WantAgent for launch the ability + * @since 9 + * @syscap SystemCapability.Multimedia.AVSession.Core + * @throws {BusinessError} 401 - parameter check failed + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_SESSION_NOT_EXIST} - session does not exist + */ + setLaunchAbility(ability: WantAgent, callback: AsyncCallback): void; + setLaunchAbility(ability: WantAgent): Promise; + + /** + * Set audio stream id. Identifies the audio streams controlled by this session. + * If multiple streams are set, these streams will be simultaneously cast to the remote during the casting operation. + * @param streamId The audio streams + * @throws {BusinessError} 401 - parameter check failed + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_SESSION_NOT_EXIST} - session does not exist + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 10 + */ + setAudioStreamId(streamIds: Array, callback: AsyncCallback): void; + setAudioStreamId(streamIds: Array): Promise; + + /** + * Get the current session's own controller + * @returns The instance of {@link AVSessionController} + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_SESSION_NOT_EXIST} - session does not exist + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + getController(callback: AsyncCallback): void; + getController(): Promise; + + /** + * Get output device information + * @returns The instance of {@link OutputDeviceInfo} + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_SESSION_NOT_EXIST} - session does not exist + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + getOutputDevice(callback: AsyncCallback): void; + getOutputDevice(): Promise; + + /** + * Register or unregister playback command callback. + * As long as it is registered, it means that the ability supports this command. + * If you cancel the callback, you need to call off {@link off} + * When canceling the callback, need to update the supported commands list. + * Each playback command only supports registering one callback, + * and the new callback will replace the previous one. + * @param type Command to register. + * @param callback Used to handle callback commands + * @throws {BusinessError} 401 - parameter check failed + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_SESSION_NOT_EXIST} - session does not exist + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + on(type: 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward' | 'rewind', callback: () => void): void; + off(type: 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward' | 'rewind', callback?: () => void): void; + + /** + * Register or unregister seek command callback + * @param type Registration Type 'seek' + * @param callback Used to handle seek command.The callback provide the seek time(ms) + * @throws {BusinessError} 401 - parameter check failed + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_SESSION_NOT_EXIST} - session does not exist + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + on(type: 'seek', callback: (time: number) => void): void; + off(type: 'seek', callback?: (time: number) => void): void; + + /** + * Register or unregister setSpeed command callback + * @param type Registration Type 'setSpeed' + * @param callback Used to handle setSpeed command.The callback provide the speed value + * @throws {BusinessError} 401 - parameter check failed + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_SESSION_NOT_EXIST} - session does not exist + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + on(type: 'setSpeed', callback: (speed: number) => void): void; + off(type: 'setSpeed', callback?: (speed: number) => void): void; + + /** + * Register or unregister setLoopMode command callback + * @param type Registration Type 'setLoopMode' + * @param callback Used to handle setLoopMode command.The callback provide the {@link LoopMode} + * @throws {BusinessError} 401 - parameter check failed + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_SESSION_NOT_EXIST} - session does not exist + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + on(type: 'setLoopMode', callback: (mode: LoopMode) => void): void; + off(type: 'setLoopMode', callback?: (mode: LoopMode) => void): void; + + /** + * Register or unregister toggle favorite command callback + * @param type Registration Type 'toggleFavorite' + * @param callback Used to handle toggleFavorite command.The callback provide + * the assetId for which the favorite status needs to be switched. + * @throws {BusinessError} 401 - parameter check failed + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_SESSION_NOT_EXIST} - session does not exist + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + on(type: 'toggleFavorite', callback: (assetId: string) => void): void; + off(type: 'toggleFavorite', callback?: (assetId: string) => void): void; + + /** + * Register or unregister media key handling callback + * @param type Registration Type + * @param callback Used to handle key events.The callback provide the KeyEvent + * @throws {BusinessError} 401 - parameter check failed + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_SESSION_NOT_EXIST} - session does not exist + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + on(type: 'handleKeyEvent', callback: (event: KeyEvent) => void): void; + off(type: 'handleKeyEvent', callback?: (event: KeyEvent) => void): void; + + /** + * Register or unregister session output device change callback + * @param type Registration Type + * @param callback Used to handle output device changed. + * The callback provide the new device info {@link OutputDeviceInfo} + * @throws {BusinessError} 401 - parameter check failed + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_SESSION_NOT_EXIST} - session does not exist + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + on(type: 'outputDeviceChange', callback: (device: OutputDeviceInfo) => void): void; + off(type: 'outputDeviceChange', callback?: (device: OutputDeviceInfo) => void): void; + + /** + * Activate the session, indicating that the session can accept control commands + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_SESSION_NOT_EXIST} - session does not exist + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + activate(callback: AsyncCallback): void; + activate(): Promise; + + /** + * Deactivate the session, indicating that the session not ready to accept control commands + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_SESSION_NOT_EXIST} - session does not exist + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + deactivate(callback: AsyncCallback): void; + deactivate(): Promise; + + /** + * Destroy this session, the server will clean up the session resources + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_SESSION_NOT_EXIST} - session does not exist + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + destroy(callback: AsyncCallback): void; + destroy(): Promise; + } + + /** + * The metadata of the current media.Used to set the properties of the current media file + * @interface AVMetadata + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + interface AVMetadata { + /** + * Unique ID used to represent this media. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + assetId: string; + /** + * The title of this media, for display in media center. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + title?: string; + /** + * The artist of this media + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + artist?: string; + /** + * The author of this media + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + author?: string; + /** + * The album of this media + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + album?: string; + /** + * The writer of this media + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + writer?: string; + /** + * The composer of this media + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + composer?: string; + /** + * The duration of this media, used to automatically calculate playback position + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + duration?: number; + /** + * The image of the media as a {@link PixelMap} or an uri formatted String, + * used to display in media center. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + mediaImage?: image.PixelMap | string; + /** + * The publishDate of the media + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + publishDate?: Date; + /** + * The subtitle of the media, used for display + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + subtitle?: string; + /** + * The discription of the media, used for display + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + description?: string; + /** + * The lyric of the media, it should be in standard lyric format + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + lyric?: string; + /** + * The previous playable media id. + * Used to tell the controller if there is a previous playable media + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + previousAssetId?: string; + /** + * The next playable media id. + * Used to tell the controller if there is a next playable media + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + nextAssetId?: string; + } + + /** + * Used to indicate the playback state of the current media. + * If the playback state of the media changes, it needs to be updated synchronously + * @interface AVPlaybackState + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + interface AVPlaybackState { + /** + * Current playback state. See {@link PlaybackState} + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + state?: PlaybackState; + /** + * Current playback speed + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + speed?: number; + /** + * Current playback position of this media. See {@link PlaybackPosition} + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + position?: PlaybackPosition; + /** + * The current buffered time, the maximum playable position + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + bufferedTime?: number; + /** + * Current playback loop mode. See {@link LoopMode} + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + loopMode?: LoopMode; + /** + * Current Favorite Status + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + isFavorite?: boolean; + } + + /** + * Playback position defination + * @interface PlaybackPosition + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + interface PlaybackPosition { + /** + * Elapsed time(position) of this media set by the app. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + elapsedTime: number; + /** + * Record the system time when elapsedTime is set. + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + updateTime: number; + } + /** + * Target Device Information Definition + * @interface OutputDeviceInfo + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + interface OutputDeviceInfo { + /** + * Whether the remote device + * @since 9 + */ + isRemote: boolean; + /** + * Audio device id.The length of the audioDeviceId array is greater than 1 + * if output to multiple devices at the same time. + * @since 9 + */ + audioDeviceId: Array; + /** + * Device name. The length of the deviceName array is greater than 1 + * if output to multiple devices at the same time. + * @since 9 + */ + deviceName: Array; + } + /** + * Loop Play Mode Definition + * @enum {number} + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + enum LoopMode { + /** + * The default mode is sequential playback + * @since 9 + */ + LOOP_MODE_SEQUENCE = 0, + + /** + * Single loop mode + * @since 9 + */ + LOOP_MODE_SINGLE = 1, + + /** + * List loop mode + * @since 9 + */ + LOOP_MODE_LIST = 2, + + /** + * Shuffle playback mode + * @since 9 + */ + LOOP_MODE_SHUFFLE = 3, + } + + /** + * Definition of current playback state + * @enum {number} + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + enum PlaybackState { + /** + * Initial state. The initial state of media file + * @since 9 + */ + PLAYBACK_STATE_INITIAL = 0, + + /** + * Preparing state. Indicates that the media file is not ready to play, + * the media is loading or buffering + * @since 9 + */ + PLAYBACK_STATE_PREPARE = 1, + + /** + * Playing state. + * @since 9 + */ + PLAYBACK_STATE_PLAY = 2, + + /** + * Paused state. + * @since 9 + */ + PLAYBACK_STATE_PAUSE = 3, + + /** + * Fast forwarding state. + * @since 9 + */ + PLAYBACK_STATE_FAST_FORWARD = 4, + + /** + * Rewinding state. + * @since 9 + */ + PLAYBACK_STATE_REWIND = 5, + + /** + * Stopped state.The server will clear the media playback position and other information. + * @since 9 + */ + PLAYBACK_STATE_STOP = 6, + } + + /** + * The description of the session + * @interface AVSessionDescriptor + * @syscap SystemCapability.Multimedia.AVSession.Manager + * @systemapi + * @since 9 + */ + interface AVSessionDescriptor { + /** + * Unique ID of the session + * @since 9 + */ + sessionId: string; + /** + * Session type, currently supports audio or video + * @since 9 + */ + type: AVSessionType; + /** + * The session tag set by the application + * @since 9 + */ + sessionTag: string; + /** + * The elementName of the ability that created this session. See {@link ElementName} in bundle/elementName.d.ts + * @since 9 + */ + elementName: ElementName; + /** + * Session active state + * @since 9 + */ + isActive: boolean; + /** + * Is it the top priority session + * @since 9 + */ + isTopSession: boolean; + /** + * The current output device information. + * It will be undefined if this is a local session. + * @since 9 + */ + outputDevice: OutputDeviceInfo; + } + + /** + * Session controller,used to control media playback and get media information + * @interface AVSessionController + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + interface AVSessionController { + /** + * Unique session Id + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + readonly sessionId: string; + /** + * Get the playback status of the current session + * @returns AVPlaybackState {@link AVPlaybackState} + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_SESSION_NOT_EXIST} - session does not exist + * @throws {BusinessError} {@link #ERR_CODE_CONTROLLER_NOT_EXIST} - controller does not exist + * @since 9 + */ + getAVPlaybackState(callback: AsyncCallback): void; + getAVPlaybackState(): Promise; + + /** + * Get the metadata of the current session + * @returns AVMetadata {@link AVMetadata} + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_SESSION_NOT_EXIST} - session does not exist + * @throws {BusinessError} {@link #ERR_CODE_CONTROLLER_NOT_EXIST} - controller does not exist + * @since 9 + */ + getAVMetadata(callback: AsyncCallback): void; + getAVMetadata(): Promise; + + /** + * Get output device information + * @returns The instance of {@link OutputDeviceInfo} + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_CONTROLLER_NOT_EXIST} - controller does not exist + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + getOutputDevice(callback: AsyncCallback): void; + getOutputDevice(): Promise; + + /** + * Send media key event to this session + * @param event The KeyEvent + * @throws {BusinessError} 401 - parameter check failed + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_SESSION_NOT_EXIST} - session does not exist + * @throws {BusinessError} {@link #ERR_CODE_CONTROLLER_NOT_EXIST} - controller does not exist + * @throws {BusinessError} {@link #ERR_CODE_COMMAND_INVALID} - command not supported + * @throws {BusinessError} {@link #ERR_CODE_SESSION_INACTIVE} - session inactive + * @since 9 + */ + sendAVKeyEvent(event: KeyEvent, callback: AsyncCallback): void; + sendAVKeyEvent(event: KeyEvent): Promise; + + /** + * Get the {@link WantAgent} of this session that can launch the session ability + * @returns WantAgent {@link WantAgent} + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_SESSION_NOT_EXIST} - session does not exist + * @throws {BusinessError} {@link #ERR_CODE_CONTROLLER_NOT_EXIST} - controller does not exist + * @since 9 + */ + getLaunchAbility(callback: AsyncCallback): void; + getLaunchAbility(): Promise; + + /** + * Get the adjusted playback position. The time automatically calculated by the system + * taking into account factors such as playback status, playback speed, and application update time. + * @returns current playback position in ms.Note that the returns value of each call will be different. + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_CONTROLLER_NOT_EXIST} - controller does not exist + * @since 9 + */ + getRealPlaybackPositionSync(): number; + + /** + * Check if the current session is active + * @returns the active state + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_SESSION_NOT_EXIST} - session does not exist + * @throws {BusinessError} {@link #ERR_CODE_CONTROLLER_NOT_EXIST} - controller does not exist + * @since 9 + */ + isActive(callback: AsyncCallback): void; + isActive(): Promise; + + /** + * Destroy the server controller + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_CONTROLLER_NOT_EXIST} - controller does not exist + * @since 9 + */ + destroy(callback: AsyncCallback): void; + destroy(): Promise; + + /** + * Get commands supported by the current session + * @returns An array of AVControlCommandType {@link AVControlCommandType} + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_SESSION_NOT_EXIST} - session does not exist + * @throws {BusinessError} {@link #ERR_CODE_CONTROLLER_NOT_EXIST} - controller does not exist + * @since 9 + */ + getValidCommands(callback: AsyncCallback>): void; + getValidCommands(): Promise>; + + /** + * Send control commands to this session + * @param command The command to be send. See {@link AVControlCommand} + * @throws {BusinessError} 401 - parameter check failed + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_SESSION_NOT_EXIST} - session does not exist + * @throws {BusinessError} {@link #ERR_CODE_CONTROLLER_NOT_EXIST} - controller does not exist + * @throws {BusinessError} {@link #ERR_CODE_COMMAND_INVALID} - command not supported + * @throws {BusinessError} {@link #ERR_CODE_SESSION_INACTIVE} - session inactive + * @throws {BusinessError} {@link #ERR_CODE_MESSAGE_OVERLOAD} - command or event overload + * @since 9 + */ + sendControlCommand(command: AVControlCommand, callback: AsyncCallback): void; + sendControlCommand(command: AVControlCommand): Promise; + + /** + * Register or unregister metadata changed callback + * @param type 'metadataChange' + * @param filter The properties of {@link AVMetadata} that you cared about + * @param callback The callback used to handle metadata changed event. + * The callback function provides the {@link AVMetadata} parameter. + * It only contains the properties set in the filter. + * @throws {BusinessError} 401 - parameter check failed + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_CONTROLLER_NOT_EXIST} - controller does not exist + * @since 9 + */ + on(type: 'metadataChange', filter: Array | 'all', callback: (data: AVMetadata) => void); + off(type: 'metadataChange', callback?: (data: AVMetadata) => void); + + /** + * Register or unregister playback state changed callback + * @param type 'playbackStateChange' + * @param filter The properties of {@link AVPlaybackState} that you cared about + * @param callback The callback used to handle playback state changed event. + * The callback function provides the {@link AVPlaybackState} parameter. + * @throws {BusinessError} 401 - parameter check failed + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_CONTROLLER_NOT_EXIST} - controller does not exist + * @since 9 + */ + on(type: 'playbackStateChange', filter: Array | 'all', callback: (state: AVPlaybackState) => void); + off(type: 'playbackStateChange', callback?: (state: AVPlaybackState) => void); + + /** + * Register or unregister current session destroyed callback + * @param type 'sessionDestroy' + * @param callback The callback used to handle current session destroyed event. + * @throws {BusinessError} 401 - parameter check failed + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_CONTROLLER_NOT_EXIST} - controller does not exist + * @since 9 + */ + on(type: 'sessionDestroy', callback: () => void); + off(type: 'sessionDestroy', callback?: () => void); + + /** + * Register or unregister the active state of this session changed callback + * @param type 'activeStateChange' + * @param callback The callback used to handle the active state of this session changed event. + * The callback function provides the changed session state. + * @throws {BusinessError} 401 - parameter check failed + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_CONTROLLER_NOT_EXIST} - controller does not exist + * @since 9 + */ + on(type: 'activeStateChange', callback: (isActive: boolean) => void); + off(type: 'activeStateChange', callback?: (isActive: boolean) => void); + + /** + * Register or unregister the valid commands of the session changed callback + * @param type 'validCommandChange' + * @param callback The callback used to handle the changes. + * The callback function provides an array of AVControlCommandType. + * @throws {BusinessError} 401 - parameter check failed + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_CONTROLLER_NOT_EXIST} - controller does not exist + * @since 9 + */ + on(type: 'validCommandChange', callback: (commands: Array) => void); + off(type: 'validCommandChange', callback?: (commands: Array) => void); + + /** + * Register or unregister session output device change callback + * @param type Registration Type + * @param callback Used to handle output device changed. + * The callback provide the new device info {@link OutputDeviceInfo} + * @throws {BusinessError} 401 - parameter check failed + * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception + * @throws {BusinessError} {@link #ERR_CODE_CONTROLLER_NOT_EXIST} - controller does not exist + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + on(type: 'outputDeviceChange', callback: (device: OutputDeviceInfo) => void): void; + off(type: 'outputDeviceChange', callback?: (device: OutputDeviceInfo) => void): void; + } + + /** + * The type of control command + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + type AVControlCommandType = 'play' | 'pause' | 'stop' | 'playNext' | 'playPrevious' | 'fastForward' | 'rewind' | + 'seek' | 'setSpeed' | 'setLoopMode' | 'toggleFavorite'; + + /** + * The defination of command to be send to the session + * @interface AVControlCommand + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + interface AVControlCommand { + /** + * The command value {@link AVControlCommandType} + * @since 9 + */ + command: AVControlCommandType; + /** + * parameter of the command. Whether this command requires parameters, see {@link AVSessionCommand} + * seek command requires a number parameter + * setSpeed command requires a number parameter + * setLoopMode command requires a {@link LoopMode} parameter. + * toggleFavorite command requires assetId {@link AVMetadata.assetId} parameter + * other commands need no parameter + * @since 9 + */ + parameter?: LoopMode | string | number; + } + + /** + * Enumerates ErrorCode types, returns in BusinessError.code. + * @enum {number} + * @syscap SystemCapability.Multimedia.AVSession.Core + * @since 9 + */ + enum AVSessionErrorCode { + /** + * Server exception + * @since 9 + */ + ERR_CODE_SERVICE_EXCEPTION = 6600101, + + /** + * The session does not exist + * @since 9 + */ + ERR_CODE_SESSION_NOT_EXIST = 6600102, + + /** + * The controller does not exist + * @since 9 + */ + ERR_CODE_CONTROLLER_NOT_EXIST = 6600103, + + /** + * Remote connection error + * @since 9 + */ + ERR_CODE_REMOTE_CONNECTION_ERR = 6600104, + + /** + * Command not supported + * @since 9 + */ + ERR_CODE_COMMAND_INVALID = 6600105, + + /** + * Session inactive + * @since 9 + */ + ERR_CODE_SESSION_INACTIVE = 6600106, + + /** + * Command or event overload + * @since 9 + */ + ERR_CODE_MESSAGE_OVERLOAD = 6600107, + } +} + +export default avSession; -- Gitee From 48092b6e0af75e148e3282277e2a4820d9a0e2f1 Mon Sep 17 00:00:00 2001 From: guozejun Date: Fri, 14 Oct 2022 16:15:14 +0800 Subject: [PATCH 106/438] Update measure layout api type Signed-off-by: guozejun Change-Id: I2589aa666497c7784b3077d5be89d7e214431ee2 --- api/@internal/component/ets/common.d.ts | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index d8623f93e0..c37289934e 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -2020,26 +2020,17 @@ declare class CommonShapeMethod extends CommonMethod { * @since 9 */ declare interface LayoutBorderInfo { - borderWidth: number, + borderWidth: EdgeWidths, margin: Margin, padding: Padding, } -/** - * Sub component position info. - * @since 9 - */ -declare interface LayoutPosition { - x: number, - y: number, -} - /** * Sub component layout info. * @since 9 */ declare interface LayoutInfo { - position: LayoutPosition, + position: Position, constraint: ConstraintSizeOptions, } @@ -2076,7 +2067,7 @@ declare interface LayoutChild { * Sub component position. * @since 9 */ - position: LayoutPosition, + position: Position, /** * Call this measure method in onMeasure callback to supply sub component size. -- Gitee From e7c27a3fc5420cb2a858d08c73f7eeb7c3daf243 Mon Sep 17 00:00:00 2001 From: lutao Date: Fri, 14 Oct 2022 16:20:53 +0800 Subject: [PATCH 107/438] change interface name Signed-off-by: lutao --- api/@ohos.hichecker.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/@ohos.hichecker.d.ts b/api/@ohos.hichecker.d.ts index de5335a73f..a0951402b2 100644 --- a/api/@ohos.hichecker.d.ts +++ b/api/@ohos.hichecker.d.ts @@ -94,7 +94,7 @@ declare namespace hichecker { * @syscap SystemCapability.HiviewDFX.HiChecker * @throws {error} if the param is invalid */ - function addRuleV9(rule: bigint) : void; + function addCheckRule(rule: bigint) : void; /** * remove one or more rule. @@ -103,7 +103,7 @@ declare namespace hichecker { * @syscap SystemCapability.HiviewDFX.HiChecker * @throws {error} if the param is invalid */ - function removeRuleV9(rule: bigint) : void; + function removeCheckRule(rule: bigint) : void; /** * whether the query rule is added @@ -113,6 +113,6 @@ declare namespace hichecker { * @syscap SystemCapability.HiviewDFX.HiChecker * @throws {error} if the param is invalid */ - function containsV9(rule: bigint) : boolean; + function containsCheckRule(rule: bigint) : boolean; } export default hichecker; \ No newline at end of file -- Gitee From cbff9a796e0f6251ce9a156f112bea002678fa11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BB=96=E5=BA=B7=E5=BA=B7?= Date: Fri, 14 Oct 2022 16:42:21 +0800 Subject: [PATCH 108/438] =?UTF-8?q?api=E9=94=99=E8=AF=AF=E7=A0=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 廖康康 --- api/@ohos.reminderAgentManager.d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/api/@ohos.reminderAgentManager.d.ts b/api/@ohos.reminderAgentManager.d.ts index a004497c6e..b96875149f 100644 --- a/api/@ohos.reminderAgentManager.d.ts +++ b/api/@ohos.reminderAgentManager.d.ts @@ -361,7 +361,7 @@ declare namespace reminderAgentManager { snoozeContent?: string; /** - * notification id. If there are reminders with the same ID, the later one will overwrite the earlier one. + * Notification id. If there are reminders with the same ID, the later one will overwrite the earlier one. * @since 9 * @syscap SystemCapability.Notification.ReminderAgent */ @@ -413,7 +413,7 @@ declare namespace reminderAgentManager { hour: number; /** - * minute portion of the reminder time. + * Minute portion of the reminder time. * @since 9 * @syscap SystemCapability.Notification.ReminderAgent */ @@ -439,42 +439,42 @@ declare namespace reminderAgentManager { interface LocalDateTime { /** - * value of year. + * Value of year. * @since 9 * @syscap SystemCapability.Notification.ReminderAgent */ year: number; /** - * value of month. + * Value of month. * @since 9 * @syscap SystemCapability.Notification.ReminderAgent */ month: number; /** - * value of day. + * Value of day. * @since 9 * @syscap SystemCapability.Notification.ReminderAgent */ day: number; /** - * value of hour. + * Value of hour. * @since 9 * @syscap SystemCapability.Notification.ReminderAgent */ hour: number; /** - * value of minute. + * Value of minute. * @since 9 * @syscap SystemCapability.Notification.ReminderAgent */ minute: number; /** - * value of second. + * Value of second. * @since 9 * @syscap SystemCapability.Notification.ReminderAgent */ -- Gitee From d17a32e1b04706e09e8eb0ef05adf46e61f9b10c Mon Sep 17 00:00:00 2001 From: shiyueeee Date: Fri, 14 Oct 2022 17:00:04 +0800 Subject: [PATCH 109/438] Update color manager napi definition with error throw Signed-off-by: shiyueeee Change-Id: I26c8926e0c61440df7810bcbc0d7d9bece2fb7c3 --- api/@ohos.graphics.colorSpaceManager.d.ts | 27 ++++++++++++++--------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/api/@ohos.graphics.colorSpaceManager.d.ts b/api/@ohos.graphics.colorSpaceManager.d.ts index db7b533a3f..e73dccbdfb 100644 --- a/api/@ohos.graphics.colorSpaceManager.d.ts +++ b/api/@ohos.graphics.colorSpaceManager.d.ts @@ -71,63 +71,63 @@ import { AsyncCallback } from './basic'; } /** - * Describes the primary colors red, green, blue and white point - * in each color space map(x, y), in terms of real world chromaticities. + * Describes the primary colors red, green, blue and white point coordinated as (x, y) + * in color space, in terms of real world chromaticities. * @since 9 * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core */ interface ColorSpacePrimaries { /** - * x value of red color + * Coordinate value x of red color * @since 9 * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core */ redX: number; /** - * y value of red color + * Coordinate value y of red color * @since 9 * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core */ redY: number; /** - * x value of green color + * Coordinate value x of green color * @since 9 * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core */ greenX: number; /** - * y value of green color + * Coordinate value y of green color * @since 9 * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core */ greenY: number; /** - * x value of blue color + * Coordinate value x of blue color * @since 9 * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core */ blueX: number; /** - * y value of blue color + * Coordinate value y of blue color * @since 9 * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core */ blueY: number; /** - * x value of white point + * Coordinate value x of white point * @since 9 * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core */ whitePointX: number; /** - * y value of white point + * Coordinate value y of white point * @since 9 * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core */ @@ -143,18 +143,21 @@ import { AsyncCallback } from './basic'; /** * Get color space type. * @since 9 + * @throws {BusinessError} 18600001 - If param value is abnormal */ getColorSpaceName(): ColorSpace; /** * Get white point(x, y) of color space. * @since 9 + * @throws {BusinessError} 18600001 - If param value is abnormal */ getWhitePoint(): Array; /** * Get gamma value of color space. * @since 9 + * @throws {BusinessError} 18600001 - If param value is abnormal */ getGamma(): number; } @@ -163,6 +166,8 @@ import { AsyncCallback } from './basic'; * Create a color space manager by proviced color space type. * @param colorSpaceName Indicates the type of color space * @since 9 + * @throws {BusinessError} 401 - If param is invalid + * @throws {BusinessError} 18600001 - If param value is abnormal */ function create(colorSpaceName: ColorSpace): ColorSpaceManager; @@ -171,6 +176,8 @@ import { AsyncCallback } from './basic'; * @param primaries Indicates the customized color primaries * @param gamma Indicates display gamma value * @since 9 + * @throws {BusinessError} 401 - If param is invalid + * @throws {BusinessError} 18600001 - If param value is abnormal */ function create(primaries: ColorSpacePrimaries, gamma: number): ColorSpaceManager; } -- Gitee From 7a0982c8c9766390ba524d10048f4f50d5fda41d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E6=99=BA=E6=B5=B7?= Date: Fri, 14 Oct 2022 09:41:06 +0000 Subject: [PATCH 110/438] update api/@ohos.continuation.continuationManager.d.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 杜智海 --- api/@ohos.continuation.continuationManager.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.continuation.continuationManager.d.ts b/api/@ohos.continuation.continuationManager.d.ts index fb081b509d..6758c4915c 100644 --- a/api/@ohos.continuation.continuationManager.d.ts +++ b/api/@ohos.continuation.continuationManager.d.ts @@ -59,7 +59,7 @@ declare namespace continuationManager { * @syscap SystemCapability.Ability.DistributedAbilityManager * @since 9 */ - function on(type: "deviceUnselected", token: number, callback: Callback>): void; + function on(type: "deviceUnselected", token: number, callback: Callback>): void; function off(type: "deviceUnselected", token: number): void; /** -- Gitee From 8ec923694919faf23ab6cd386e50c84792bd1210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E6=99=BA=E6=B5=B7?= Date: Fri, 14 Oct 2022 10:04:05 +0000 Subject: [PATCH 111/438] update api/@ohos.continuation.continuationManager.d.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 杜智海 --- api/@ohos.continuation.continuationManager.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.continuation.continuationManager.d.ts b/api/@ohos.continuation.continuationManager.d.ts index 6758c4915c..292945f77c 100644 --- a/api/@ohos.continuation.continuationManager.d.ts +++ b/api/@ohos.continuation.continuationManager.d.ts @@ -50,7 +50,7 @@ declare namespace continuationManager { * * @permission ohos.permission.DISTRIBUTED_DATASYNC * @param type deviceUnselected. - * @return callback Indicates the ID of the disconnected devices. + * @return callback Indicates the information about the unselected devices. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 16600001 - The system ability work abnormally. -- Gitee From e0a8cf75d39a0ec1546c0855fd990b104c544c5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E6=80=A1?= Date: Fri, 14 Oct 2022 10:07:04 +0000 Subject: [PATCH 112/438] bugfix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱天怡 --- ...ohos.resourceschedule.usageStatistics.d.ts | 36 ++++++++++++++++--- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/api/@ohos.resourceschedule.usageStatistics.d.ts b/api/@ohos.resourceschedule.usageStatistics.d.ts index e0f69a0702..44cd7ad6d7 100644 --- a/api/@ohos.resourceschedule.usageStatistics.d.ts +++ b/api/@ohos.resourceschedule.usageStatistics.d.ts @@ -31,6 +31,7 @@ declare namespace usageStatistics { /** * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. */ interface BundleStatsInfo { /** @@ -187,6 +188,28 @@ declare namespace usageStatistics { count: number; } + /** + * @since 9 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. + */ + interface NotificationEventStats { + /** + * the bundle name or notification event name. + */ + name: string; + + /** + * the event id. + */ + eventId: number; + + /** + * the the event occurrence number. + */ + count: number; + } + /** * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App @@ -213,7 +236,7 @@ declare namespace usageStatistics { */ eventOccurredTime?: number; /** - * the event type. + * the event id. */ eventId?: number; } @@ -292,6 +315,7 @@ declare namespace usageStatistics { /** * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. */ interface BundleStatsMap { [key: string]: BundleStatsInfo; @@ -327,6 +351,7 @@ declare namespace usageStatistics { * * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App + * @systemapi Hide this for inner system use. */ export enum IntervalType { /** @@ -487,6 +512,7 @@ declare namespace usageStatistics { * @throws { BusinessError } 10000003 - System service operation failed. * @throws { BusinessError } 10000004 - IPC Communication failed. * @throws { BusinessError } 10000005 - Application is not installed. + * @throws { BusinessError } 10000006 - Get application info failed. * @throws { BusinessError } 10100002 - Get Application group info failed. * @return Returns the usage priority group of the calling application. */ @@ -595,7 +621,7 @@ declare namespace usageStatistics { function unRegisterAppGroupCallBack(): Promise; /** - * Queries system event states data within a specified period identified by the start and end time. + * Queries device event states data within a specified period identified by the start and end time. * * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App @@ -635,10 +661,10 @@ declare namespace usageStatistics { * @throws { BusinessError } 10000004 - IPC Communication failed. * @throws { BusinessError } 10000006 - Get application info failed. * @throws { BusinessError } 10000007 - Get system or actual time failed. - * @return Returns the {@link DeviceEventStats} object Array containing the event states data. + * @return Returns the {@link NotificationEventStats} object Array containing the event states data. */ - function queryNotificationEventStats(begin: number, end: number, callback: AsyncCallback>): void; - function queryNotificationEventStats(begin: number, end: number): Promise>; + function queryNotificationEventStats(begin: number, end: number, callback: AsyncCallback>): void; + function queryNotificationEventStats(begin: number, end: number): Promise>; } export default usageStatistics; \ No newline at end of file -- Gitee From 27d59b2a2ea404e2b464468c55d8ed088a32dc31 Mon Sep 17 00:00:00 2001 From: dboy190 Date: Sat, 15 Oct 2022 10:19:51 +0800 Subject: [PATCH 113/438] fix interface Signed-off-by: dboy190 --- api/@ohos.data.distributedKVStore.d.ts | 91 ++------------------------ 1 file changed, 4 insertions(+), 87 deletions(-) diff --git a/api/@ohos.data.distributedKVStore.d.ts b/api/@ohos.data.distributedKVStore.d.ts index de74faaa95..7e84a4644c 100644 --- a/api/@ohos.data.distributedKVStore.d.ts +++ b/api/@ohos.data.distributedKVStore.d.ts @@ -1593,89 +1593,6 @@ declare namespace distributedKVStore { */ removeDeviceData(deviceId: string, callback: AsyncCallback): void; removeDeviceData(deviceId: string): Promise; - - /** - * Synchronizes {@code DeviceKVStore} databases. - * - *

This method returns immediately and sync result will be returned through asynchronous callback. - * - * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @param deviceIds Indicates the list of IDs of devices whose - * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. - * {@code DeviceKVStore} databases are to be synchronized. - * @param mode Indicates the synchronization mode, {@code PUSH}, {@code PULL}, or {@code PUSH_PULL}. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100004 - if the database not exist when sync data. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; - - /** - * Synchronizes {@code DeviceKVStore} databases. - * - *

This method returns immediately and sync result will be returned through asynchronous callback. - * - * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @param deviceIds Indicates the list of IDs of devices whose - * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. - * {@code DeviceKVStore} databases are to be synchronized. - * @param query Indicates the {@code Query} object. - * @param mode Indicates the synchronization mode, {@code PUSH}, {@code PULL}, or {@code PUSH_PULL}. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100004 - if the database not exist when sync data. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - sync(deviceIds: string[], query: Query, mode: SyncMode, delayMs?: number): void; - - /** - * Register Synchronizes DeviceKVStore databases callback. - * - *

Sync result is returned through asynchronous callback. - * - * @param syncCallback Indicates the callback used to send the synchronization result to the caller. - * @throws {BusinessError} 401 - if parameter check failed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - on(event: 'syncComplete', syncCallback: Callback>): void; - - /** - * Registers a {@code KVStoreObserver} for the database. When data in the distributed database changes, the callback in - * {@code KVStoreObserver} will be invoked. - * - * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. - * @param listener Indicates the observer of data change events in the distributed database. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100001 - if the database has been subscribed over the max subscription time limit. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - on(event: 'dataChange', type: SubscribeType, listener: Callback): void; - - /** - * Unsubscribes from the DeviceKVStore database based on the specified subscribeType and {@code KVStoreObserver}. - * - * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KVStoreObserver)}. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - off(event:'dataChange', listener?: Callback): void; - - /** - * UnRegister Synchronizes DeviceKVStore databases callback. - * - * @throws {BusinessError} 401 - if parameter check failed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 - */ - off(event: 'syncComplete', syncCallback?: Callback>): void; } /** @@ -1718,8 +1635,8 @@ declare namespace distributedKVStore { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - getKVStore(storeId: string, options: Options): Promise; - getKVStore(storeId: string, options: Options, callback: AsyncCallback): void; + getKVStore(storeId: string, options: Options): Promise; + getKVStore(storeId: string, options: Options, callback: AsyncCallback): void; /** * Closes the {@code KVStore} database. @@ -1737,8 +1654,8 @@ declare namespace distributedKVStore { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - closeKVStore(appId: string, storeId: string, kvStore: KVStore, callback: AsyncCallback): void; - closeKVStore(appId: string, storeId: string, kvStore: KVStore): Promise; + closeKVStore(appId: string, storeId: string, callback: AsyncCallback): void; + closeKVStore(appId: string, storeId: string): Promise; /** * Deletes the {@code KVStore} database identified by storeId. -- Gitee From b6f7f4977c00aafcd0efc0b3500a3adeef328801 Mon Sep 17 00:00:00 2001 From: dboy190 Date: Sat, 15 Oct 2022 16:27:07 +0800 Subject: [PATCH 114/438] add deprecated Signed-off-by: dboy190 --- api/@ohos.data.distributedData.d.ts | 99 ++++++++++++++++++++++++++++- 1 file changed, 97 insertions(+), 2 deletions(-) diff --git a/api/@ohos.data.distributedData.d.ts b/api/@ohos.data.distributedData.d.ts index db85d859d1..7cfb7522a4 100644 --- a/api/@ohos.data.distributedData.d.ts +++ b/api/@ohos.data.distributedData.d.ts @@ -21,7 +21,7 @@ import { AsyncCallback, Callback } from './basic'; * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.kvStore + * @useinstead ohos.data.distributedKVStore */ declare namespace distributedData { /** @@ -31,7 +31,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.kvStore.KVManagerConfig + * @useinstead ohos.data.distributedKVStore.KVManagerConfig */ interface KVManagerConfig { /** @@ -39,6 +39,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 */ userInfo: UserInfo; @@ -47,6 +48,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.KVManagerConfig.bundleName */ bundleName: string; } @@ -60,6 +63,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 */ interface UserInfo { /** @@ -67,6 +71,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 */ userId?: string; @@ -75,6 +80,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 */ userType?: UserType; } @@ -85,6 +91,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 */ enum UserType { /** @@ -92,6 +99,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 */ SAME_USER_ID = 0 } @@ -102,6 +110,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Constants */ namespace Constants { /** @@ -109,6 +119,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Constants.MAX_KEY_LENGTH */ const MAX_KEY_LENGTH = 1024; @@ -117,6 +129,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Constants.MAX_VALUE_LENGTH */ const MAX_VALUE_LENGTH = 4194303; @@ -125,6 +139,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Constants.MAX_KEY_LENGTH_DEVICEs */ const MAX_KEY_LENGTH_DEVICE = 896; @@ -133,6 +149,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Constants.MAX_STORE_ID_LENGTH */ const MAX_STORE_ID_LENGTH = 128; @@ -141,6 +159,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Constants.MAX_QUERY_LENGTH */ const MAX_QUERY_LENGTH = 512000; @@ -149,6 +169,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Constants.MAX_BATCH_SIZE */ const MAX_BATCH_SIZE = 128; } @@ -161,6 +183,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.ValueType */ enum ValueType { /** @@ -168,6 +192,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.ValueType.STRING */ STRING = 0, @@ -176,6 +202,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.ValueType.INTEGER */ INTEGER = 1, @@ -184,6 +212,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.ValueType.FLOAT */ FLOAT = 2, @@ -192,6 +222,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.ValueType.BYTE_ARRAY * */ BYTE_ARRAY = 3, @@ -200,6 +232,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.ValueType.BOOLEAN * */ BOOLEAN = 4, @@ -208,6 +242,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.ValueType.DOUBLE */ DOUBLE = 5 } @@ -218,6 +254,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Value */ interface Value { /** @@ -228,6 +266,8 @@ declare namespace distributedData { * @type {number} * @memberof Value * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Value.type */ type: ValueType; /** @@ -235,6 +275,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Value.value */ value: Uint8Array | string | number | boolean; } @@ -245,6 +287,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Entry */ interface Entry { /** @@ -252,6 +296,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Entry.key */ key: string; /** @@ -259,6 +305,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Entry.value */ value: Value; } @@ -272,6 +320,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.ChangeNotification */ interface ChangeNotification { /** @@ -279,6 +329,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.ChangeNotification.insertEntries */ insertEntries: Entry[]; /** @@ -286,6 +338,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.ChangeNotification.updateEntries */ updateEntries: Entry[]; /** @@ -293,6 +347,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.ChangeNotification.deleteEntries */ deleteEntries: Entry[]; /** @@ -300,6 +356,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.ChangeNotification.deviceId */ deviceId: string; } @@ -310,6 +368,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SyncMode */ enum SyncMode { /** @@ -317,6 +377,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SyncMode.PULL_ONLY */ PULL_ONLY = 0, /** @@ -324,6 +386,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SyncMode.PUSH_ONLY */ PUSH_ONLY = 1, /** @@ -331,6 +395,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SyncMode.PUSH_PULL */ PUSH_PULL = 2 } @@ -341,6 +407,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SubscribeType */ enum SubscribeType { /** @@ -348,6 +416,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SubscribeType.SUBSCRIBE_TYPE_LOCAL */ SUBSCRIBE_TYPE_LOCAL = 0, @@ -356,6 +426,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SubscribeType.SUBSCRIBE_TYPE_REMOTE */ SUBSCRIBE_TYPE_REMOTE = 1, @@ -364,6 +436,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SubscribeType.SUBSCRIBE_TYPE_ALL */ SUBSCRIBE_TYPE_ALL = 2, } @@ -374,6 +448,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.KVStoreType */ enum KVStoreType { /** @@ -381,6 +457,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.KVStoreType.DEVICE_COLLABORATION */ DEVICE_COLLABORATION = 0, @@ -389,6 +467,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.KVStoreType.SINGLE_VERSION */ SINGLE_VERSION = 1, @@ -397,6 +477,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A * @since 7 + * @deprecated since 9 */ MULTI_VERSION = 2, } @@ -407,6 +488,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SecurityLevel */ enum SecurityLevel { /** @@ -415,6 +498,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A * @since 7 + * @deprecated since 9 */ NO_LEVEL = 0, @@ -425,6 +509,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 */ S0 = 1, @@ -435,6 +520,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SecurityLevel.S1 */ S1 = 2, @@ -445,6 +532,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SecurityLevel.S2 */ S2 = 3, @@ -455,6 +544,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SecurityLevel.S3 */ S3 = 5, @@ -465,6 +556,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SecurityLevel.S4 */ S4 = 6, } @@ -478,6 +571,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Options */ interface Options { /** -- Gitee From 92ffc4d9e9b6530093b94a19bca5e527ff447c1f Mon Sep 17 00:00:00 2001 From: dboy190 Date: Sat, 15 Oct 2022 19:15:16 +0800 Subject: [PATCH 115/438] add deprecated comments Signed-off-by: dboy190 --- api/@ohos.data.distributedData.d.ts | 294 +++++++++++++++++++++++----- 1 file changed, 249 insertions(+), 45 deletions(-) diff --git a/api/@ohos.data.distributedData.d.ts b/api/@ohos.data.distributedData.d.ts index 7cfb7522a4..33cca8bc0d 100644 --- a/api/@ohos.data.distributedData.d.ts +++ b/api/@ohos.data.distributedData.d.ts @@ -49,7 +49,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.KVManagerConfig.bundleName + * @useinstead ohos.data.distributedKVStore.KVManagerConfig#bundleName */ bundleName: string; } @@ -120,7 +120,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.Constants.MAX_KEY_LENGTH + * @useinstead ohos.data.distributedKVStore.Constants#MAX_KEY_LENGTH */ const MAX_KEY_LENGTH = 1024; @@ -130,7 +130,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.Constants.MAX_VALUE_LENGTH + * @useinstead ohos.data.distributedKVStore.Constants#MAX_VALUE_LENGTH */ const MAX_VALUE_LENGTH = 4194303; @@ -140,7 +140,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.Constants.MAX_KEY_LENGTH_DEVICEs + * @useinstead ohos.data.distributedKVStore.Constants#MAX_KEY_LENGTH_DEVICEs */ const MAX_KEY_LENGTH_DEVICE = 896; @@ -150,7 +150,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.Constants.MAX_STORE_ID_LENGTH + * @useinstead ohos.data.distributedKVStore.Constants#MAX_STORE_ID_LENGTH */ const MAX_STORE_ID_LENGTH = 128; @@ -160,7 +160,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.Constants.MAX_QUERY_LENGTH + * @useinstead ohos.data.distributedKVStore.Constants#MAX_QUERY_LENGTH */ const MAX_QUERY_LENGTH = 512000; @@ -170,7 +170,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.Constants.MAX_BATCH_SIZE + * @useinstead ohos.data.distributedKVStore.Constants#MAX_BATCH_SIZE */ const MAX_BATCH_SIZE = 128; } @@ -193,7 +193,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.ValueType.STRING + * @useinstead ohos.data.distributedKVStore.ValueType#STRING */ STRING = 0, @@ -203,7 +203,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.ValueType.INTEGER + * @useinstead ohos.data.distributedKVStore.ValueType#INTEGER */ INTEGER = 1, @@ -213,7 +213,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.ValueType.FLOAT + * @useinstead ohos.data.distributedKVStore.ValueType#FLOAT */ FLOAT = 2, @@ -223,7 +223,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.ValueType.BYTE_ARRAY + * @useinstead ohos.data.distributedKVStore.ValueTypeB#YTE_ARRAY * */ BYTE_ARRAY = 3, @@ -233,7 +233,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.ValueType.BOOLEAN + * @useinstead ohos.data.distributedKVStore.ValueType#BOOLEAN * */ BOOLEAN = 4, @@ -243,7 +243,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.ValueType.DOUBLE + * @useinstead ohos.data.distributedKVStore.ValueType#DOUBLE */ DOUBLE = 5 } @@ -267,7 +267,7 @@ declare namespace distributedData { * @memberof Value * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.Value.type + * @useinstead ohos.data.distributedKVStore.Value#type */ type: ValueType; /** @@ -276,7 +276,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.Value.value + * @useinstead ohos.data.distributedKVStore.Value#value */ value: Uint8Array | string | number | boolean; } @@ -297,7 +297,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.Entry.key + * @useinstead ohos.data.distributedKVStore.Entry#key */ key: string; /** @@ -306,7 +306,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.Entry.value + * @useinstead ohos.data.distributedKVStore.Entry#value */ value: Value; } @@ -330,7 +330,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.ChangeNotification.insertEntries + * @useinstead ohos.data.distributedKVStore.ChangeNotification#insertEntries */ insertEntries: Entry[]; /** @@ -339,7 +339,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.ChangeNotification.updateEntries + * @useinstead ohos.data.distributedKVStore.ChangeNotification#updateEntries */ updateEntries: Entry[]; /** @@ -348,7 +348,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.ChangeNotification.deleteEntries + * @useinstead ohos.data.distributedKVStore.ChangeNotification#deleteEntries */ deleteEntries: Entry[]; /** @@ -357,7 +357,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.ChangeNotification.deviceId + * @useinstead ohos.data.distributedKVStore.ChangeNotification#deviceId */ deviceId: string; } @@ -378,7 +378,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.SyncMode.PULL_ONLY + * @useinstead ohos.data.distributedKVStore.SyncMode#PULL_ONLY */ PULL_ONLY = 0, /** @@ -387,7 +387,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.SyncMode.PUSH_ONLY + * @useinstead ohos.data.distributedKVStore.SyncMode#PUSH_ONLY */ PUSH_ONLY = 1, /** @@ -396,7 +396,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.SyncMode.PUSH_PULL + * @useinstead ohos.data.distributedKVStore.SyncMode#PUSH_PULL */ PUSH_PULL = 2 } @@ -417,7 +417,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.SubscribeType.SUBSCRIBE_TYPE_LOCAL + * @useinstead ohos.data.distributedKVStore.SubscribeType#SUBSCRIBE_TYPE_LOCAL */ SUBSCRIBE_TYPE_LOCAL = 0, @@ -427,7 +427,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.SubscribeType.SUBSCRIBE_TYPE_REMOTE + * @useinstead ohos.data.distributedKVStore.SubscribeType#SUBSCRIBE_TYPE_REMOTE */ SUBSCRIBE_TYPE_REMOTE = 1, @@ -437,7 +437,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.SubscribeType.SUBSCRIBE_TYPE_ALL + * @useinstead ohos.data.distributedKVStore.SubscribeType#SUBSCRIBE_TYPE_ALL */ SUBSCRIBE_TYPE_ALL = 2, } @@ -458,7 +458,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.KVStoreType.DEVICE_COLLABORATION + * @useinstead ohos.data.distributedKVStore.KVStoreType#DEVICE_COLLABORATION */ DEVICE_COLLABORATION = 0, @@ -468,7 +468,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.KVStoreType.SINGLE_VERSION + * @useinstead ohos.data.distributedKVStore.KVStoreType#SINGLE_VERSION */ SINGLE_VERSION = 1, @@ -521,7 +521,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.SecurityLevel.S1 + * @useinstead ohos.data.distributedKVStore.SecurityLevel#S1 */ S1 = 2, @@ -533,7 +533,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.SecurityLevel.S2 + * @useinstead ohos.data.distributedKVStore.SecurityLevel#S2 */ S2 = 3, @@ -545,7 +545,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.SecurityLevel.S3 + * @useinstead ohos.data.distributedKVStore.SecurityLevel#S3 */ S3 = 5, @@ -557,7 +557,7 @@ declare namespace distributedData { * @import N/A * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.SecurityLevel.S4 + * @useinstead ohos.data.distributedKVStore.SecurityLevel#S4 */ S4 = 6, } @@ -580,6 +580,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Options#createIfMissing */ createIfMissing?: boolean; /** @@ -587,6 +589,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Options#encrypt */ encrypt?: boolean; /** @@ -594,6 +598,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Options#backup */ backup?: boolean; /** @@ -602,6 +608,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Options#autoSync */ autoSync?: boolean; /** @@ -609,6 +617,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Options#kvStoreType */ kvStoreType?: KVStoreType; /** @@ -616,6 +626,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Options#securityLevel */ securityLevel?: SecurityLevel; /** @@ -623,6 +635,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Options#schema */ schema?: Schema; } @@ -635,6 +649,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Schema */ class Schema { /** @@ -642,6 +658,8 @@ declare namespace distributedData { * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Schema#constructor */ constructor() /** @@ -649,6 +667,8 @@ declare namespace distributedData { * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Schema#root */ root: FieldNode; /** @@ -656,6 +676,8 @@ declare namespace distributedData { * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Schema#indexes */ indexes: Array; /** @@ -663,6 +685,8 @@ declare namespace distributedData { * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Schema#mode */ mode: number; /** @@ -670,6 +694,8 @@ declare namespace distributedData { * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Schema#skip */ skip: number; } @@ -686,6 +712,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.FieldNode */ class FieldNode { /** @@ -694,6 +722,8 @@ declare namespace distributedData { * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.FieldNode#constructor */ constructor(name: string) /** @@ -705,6 +735,8 @@ declare namespace distributedData { * @returns Returns true if the child node is successfully added to this {@code FieldNode}; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.FieldNode#appendChild */ appendChild(child: FieldNode): boolean; /** @@ -712,6 +744,8 @@ declare namespace distributedData { * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.FieldNode#default */ default: string; /** @@ -719,6 +753,8 @@ declare namespace distributedData { * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.FieldNode#nullable */ nullable: boolean; /** @@ -726,6 +762,8 @@ declare namespace distributedData { * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.FieldNode#type */ type: number; } @@ -739,6 +777,8 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.KVStoreResultSet */ interface KvStoreResultSet { /** @@ -747,6 +787,8 @@ declare namespace distributedData { * @returns Returns the number of lines. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#getCount */ getCount(): number; /** @@ -755,6 +797,8 @@ declare namespace distributedData { * @returns Returns the current read position. The read position starts with 0. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#getPosition */ getPosition(): number; /** @@ -765,6 +809,8 @@ declare namespace distributedData { * @returns Returns true if the operation succeeds; return false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#moveToFirst */ moveToFirst(): boolean; /** @@ -775,6 +821,8 @@ declare namespace distributedData { * @returns Returns true if the operation succeeds; return false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#moveToLast */ moveToLast(): boolean; /** @@ -785,6 +833,8 @@ declare namespace distributedData { * @returns Returns true if the operation succeeds; return false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#moveToNext */ moveToNext(): boolean; /** @@ -795,6 +845,8 @@ declare namespace distributedData { * @returns Returns true if the operation succeeds; return false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#moveToPrevious */ moveToPrevious(): boolean; /** @@ -809,7 +861,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 - * @useinstead moveV9 + * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#move */ move(offset: number): boolean; /** @@ -820,7 +872,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 - * @useinstead moveToPositionV9 + * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#moveToPosition */ moveToPosition(position: number): boolean; /** @@ -829,6 +881,8 @@ declare namespace distributedData { * @returns Returns true if the read position is the first line; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#isFirst */ isFirst(): boolean; /** @@ -837,6 +891,8 @@ declare namespace distributedData { * @returns Returns true if the read position is the last line; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#isLast */ isLast(): boolean; /** @@ -845,6 +901,8 @@ declare namespace distributedData { * @returns Returns true if the read position is before the first line; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#isBeforeFirst */ isBeforeFirst(): boolean; /** @@ -853,6 +911,8 @@ declare namespace distributedData { * @returns Returns true if the read position is after the last line; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#isAfterLast */ isAfterLast(): boolean; /** @@ -862,7 +922,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 - * @useinstead getEntryV9 + * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#getEntry */ getEntry(): Entry; } @@ -879,7 +939,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 - * @useinstead QueryV9 + * @useinstead ohos.data.distributedKVStore.Query */ class Query { /** @@ -887,6 +947,8 @@ declare namespace distributedData { * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Query#constructor */ constructor() /** @@ -896,6 +958,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Query#reset */ reset(): Query; /** @@ -908,6 +972,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Query#equalTo */ equalTo(field: string, value: number|string|boolean): Query; /** @@ -920,6 +986,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Query#notEqualTo */ notEqualTo(field: string, value: number|string|boolean): Query; /** @@ -933,6 +1001,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Query#greaterThan */ greaterThan(field: string, value: number|string|boolean): Query; /** @@ -945,6 +1015,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Query#lessThan */ lessThan(field: string, value: number|string): Query; /** @@ -958,6 +1030,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Query#greaterThanOrEqualTo */ greaterThanOrEqualTo(field: string, value: number|string): Query; /** @@ -971,6 +1045,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Query#lessThanOrEqualTo */ lessThanOrEqualTo(field: string, value: number|string): Query; /** @@ -982,6 +1058,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Query#isNull */ isNull(field: string): Query; /** @@ -994,6 +1072,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Query#inNumber */ inNumber(field: string, valueList: number[]): Query; /** @@ -1006,6 +1086,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Query#inString */ inString(field: string, valueList: string[]): Query; /** @@ -1018,6 +1100,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Query#notInNumber */ notInNumber(field: string, valueList: number[]): Query; /** @@ -1030,6 +1114,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Query#notInString */ notInString(field: string, valueList: string[]): Query; /** @@ -1042,6 +1128,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Query#like */ like(field: string, value: string): Query; /** @@ -1054,6 +1142,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Query#unlike */ unlike(field: string, value: string): Query; /** @@ -1065,6 +1155,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Query#and */ and(): Query; /** @@ -1076,6 +1168,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Query#or */ or(): Query; /** @@ -1087,6 +1181,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Query#orderByAsc */ orderByAsc(field: string): Query; /** @@ -1098,6 +1194,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Query#orderByDesc */ orderByDesc(field: string): Query; /** @@ -1109,6 +1207,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Query#limit */ limit(total: number, offset: number): Query; /** @@ -1120,6 +1220,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Query#isNotNull */ isNotNull(field: string): Query; /** @@ -1132,6 +1234,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Query#beginGroup */ beginGroup(): Query; /** @@ -1144,6 +1248,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Query#endGroup */ endGroup(): Query; /** @@ -1155,6 +1261,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Query#prefixKey */ prefixKey(prefix: string): Query; /** @@ -1166,6 +1274,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Query#setSuggestIndex */ setSuggestIndex(index: string): Query; /** @@ -1174,9 +1284,11 @@ declare namespace distributedData { * @param deviceId Specify device id to query from. * @return Returns the {@code Query} object with device ID prefix added. * @throw Throws this exception if input is invalid. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Query#deviceId */ deviceId(deviceId:string):Query; /** @@ -1189,6 +1301,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.Query#getSqlLike */ getSqlLike():string; } @@ -1207,7 +1321,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 - * @useinstead KVStoreV9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore */ interface KVStore { /** @@ -1222,6 +1336,8 @@ declare namespace distributedData { * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#put */ put(key: string, value: Uint8Array | string | number | boolean, callback: AsyncCallback): void; put(key: string, value: Uint8Array | string | number | boolean): Promise; @@ -1236,6 +1352,8 @@ declare namespace distributedData { * {@code DB_ERROR}, and {@code KEY_NOT_FOUND}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#delete */ delete(key: string, callback: AsyncCallback): void; delete(key: string): Promise; @@ -1251,6 +1369,8 @@ declare namespace distributedData { * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#on */ on(event: 'dataChange', type: SubscribeType, listener: Callback): void; @@ -1262,6 +1382,8 @@ declare namespace distributedData { * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#on */ on(event: 'syncComplete', syncCallback: Callback>): void; @@ -1274,6 +1396,8 @@ declare namespace distributedData { * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#off */ off(event: 'dataChange', listener?: Callback): void; @@ -1284,6 +1408,8 @@ declare namespace distributedData { * @throws Throws this exception if a database error occurs. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#putBatch */ putBatch(entries: Entry[], callback: AsyncCallback): void; putBatch(entries: Entry[]): Promise; @@ -1295,6 +1421,8 @@ declare namespace distributedData { * @throws Throws this exception if a database error occurs. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#deleteBatch */ deleteBatch(keys: string[], callback: AsyncCallback): void; deleteBatch(keys: string[]): Promise; @@ -1307,6 +1435,8 @@ declare namespace distributedData { * @throws Throws this exception if a database error occurs. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#startTransaction */ startTransaction(callback: AsyncCallback): void; startTransaction(): Promise; @@ -1318,6 +1448,8 @@ declare namespace distributedData { * @throws Throws this exception if a database error occurs. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#commit */ commit(callback: AsyncCallback): void; commit(): Promise; @@ -1328,6 +1460,8 @@ declare namespace distributedData { * @throws Throws this exception if a database error occurs. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#rollback */ rollback(callback: AsyncCallback): void; rollback(): Promise; @@ -1340,6 +1474,8 @@ declare namespace distributedData { * @throws Throws this exception if an internal service error occurs. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#enableSync */ enableSync(enabled: boolean, callback: AsyncCallback): void; enableSync(enabled: boolean): Promise; @@ -1354,6 +1490,8 @@ declare namespace distributedData { * @throws Throws this exception if an internal service error occurs. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#setSyncRange */ setSyncRange(localLabels: string[], remoteSupportLabels: string[], callback: AsyncCallback): void; setSyncRange(localLabels: string[], remoteSupportLabels: string[]): Promise; @@ -1374,7 +1512,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 - * @useinstead SingleKVStoreV9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore */ interface SingleKVStore extends KVStore { /** @@ -1386,6 +1524,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#get */ get(key: string, callback: AsyncCallback): void; get(key: string): Promise; @@ -1400,6 +1540,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#getEntries */ getEntries(keyPrefix: string, callback: AsyncCallback): void; getEntries(keyPrefix: string): Promise; @@ -1414,6 +1556,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#getEntries */ getEntries(query: Query, callback: AsyncCallback): void; getEntries(query: Query): Promise; @@ -1431,6 +1575,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#getResultSet */ getResultSet(keyPrefix: string, callback: AsyncCallback): void; getResultSet(keyPrefix: string): Promise; @@ -1444,6 +1590,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#getResultSet */ getResultSet(query: Query, callback: AsyncCallback): void; getResultSet(query: Query): Promise; @@ -1457,6 +1605,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#closeResultSet */ closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; closeResultSet(resultSet: KvStoreResultSet): Promise; @@ -1471,6 +1621,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#getResultSize */ getResultSize(query: Query, callback: AsyncCallback): void; getResultSize(query: Query): Promise; @@ -1481,6 +1633,8 @@ declare namespace distributedData { * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#removeDeviceData */ removeDeviceData(deviceId: string, callback: AsyncCallback): void; removeDeviceData(deviceId: string): Promise; @@ -1497,6 +1651,8 @@ declare namespace distributedData { * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#sync */ sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; @@ -1508,6 +1664,8 @@ declare namespace distributedData { * @throws Throws this exception if no {@code SingleKvStore} database is available. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#on */ on(event: 'syncComplete', syncCallback: Callback>): void; @@ -1517,6 +1675,8 @@ declare namespace distributedData { * @throws Throws this exception if no {@code SingleKvStore} database is available. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#off */ off(event: 'syncComplete', syncCallback?: Callback>): void; @@ -1528,6 +1688,8 @@ declare namespace distributedData { * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#setSyncParam */ setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback): void; setSyncParam(defaultAllowedDelayMs: number): Promise; @@ -1540,6 +1702,8 @@ declare namespace distributedData { * {@code IPC_ERROR}, and {@code DB_ERROR}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#getSecurityLevel */ getSecurityLevel(callback: AsyncCallback): void; getSecurityLevel(): Promise; @@ -1557,7 +1721,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 * @deprecated since 9 - * @useinstead DeviceKVStoreV9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore */ interface DeviceKVStore extends KVStore { /** @@ -1570,6 +1734,8 @@ declare namespace distributedData { * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}, and {@code KEY_NOT_FOUND}. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#get */ get(deviceId: string, key: string, callback: AsyncCallback): void; get(deviceId: string, key: string): Promise; @@ -1584,6 +1750,8 @@ declare namespace distributedData { * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getEntries */ getEntries(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; getEntries(deviceId: string, keyPrefix: string): Promise; @@ -1597,6 +1765,8 @@ declare namespace distributedData { * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getEntries */ getEntries(query: Query, callback: AsyncCallback): void; getEntries(query: Query): Promise; @@ -1609,6 +1779,8 @@ declare namespace distributedData { * @returns Returns the list of key-value pairs matching the specified {@code Query} object. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getEntries */ getEntries(deviceId: string, query: Query, callback: AsyncCallback): void; getEntries(deviceId: string, query: Query): Promise; @@ -1628,6 +1800,8 @@ declare namespace distributedData { * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSet */ getResultSet(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; getResultSet(deviceId: string, keyPrefix: string): Promise; @@ -1641,6 +1815,8 @@ declare namespace distributedData { * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSet */ getResultSet(query: Query, callback: AsyncCallback): void; getResultSet(query: Query): Promise; @@ -1653,6 +1829,8 @@ declare namespace distributedData { * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code Query} object. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSet */ getResultSet(deviceId: string, query: Query, callback: AsyncCallback): void; getResultSet(deviceId: string, query: Query): Promise; @@ -1665,6 +1843,8 @@ declare namespace distributedData { * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#closeResultSet */ closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; closeResultSet(resultSet: KvStoreResultSet): Promise; @@ -1678,6 +1858,8 @@ declare namespace distributedData { * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSize */ getResultSize(query: Query, callback: AsyncCallback): void; getResultSize(query: Query): Promise; @@ -1690,6 +1872,8 @@ declare namespace distributedData { * @returns Returns the number of results matching the specified {@code Query} object. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSize */ getResultSize(deviceId: string, query: Query, callback: AsyncCallback): void; getResultSize(deviceId: string, query: Query): Promise; @@ -1704,6 +1888,8 @@ declare namespace distributedData { * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#removeDeviceData */ removeDeviceData(deviceId: string, callback: AsyncCallback): void; removeDeviceData(deviceId: string): Promise; @@ -1722,6 +1908,8 @@ declare namespace distributedData { * @throws Throws this exception if no DeviceKVStore database is available. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#sync */ sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; @@ -1734,6 +1922,8 @@ declare namespace distributedData { * @throws Throws this exception if no DeviceKVStore database is available. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#on */ on(event: 'syncComplete', syncCallback: Callback>): void; @@ -1743,6 +1933,8 @@ declare namespace distributedData { * @throws Throws this exception if no DeviceKVStore database is available. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#off */ off(event: 'syncComplete', syncCallback?: Callback>): void; } @@ -1760,7 +1952,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 - * @useinstead createKVManagerV9 + * @useinstead ohos.data.distributedKVStore#createKVManager */ function createKVManager(config: KVManagerConfig, callback: AsyncCallback): void; function createKVManager(config: KVManagerConfig): Promise; @@ -1773,7 +1965,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 - * @useinstead KVManagerV9 + * @useinstead ohos.data.distributedKVStore.KVManager */ interface KVManager { /** @@ -1787,6 +1979,8 @@ declare namespace distributedData { * @return Returns a {@code KVStore}, or {@code SingleKVStore}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.KVManager#getKVStore */ getKVStore(storeId: string, options: Options): Promise; getKVStore(storeId: string, options: Options, callback: AsyncCallback): void; @@ -1809,6 +2003,8 @@ declare namespace distributedData { * {@code PERMISSION_DENIED}, and {@code IPC_ERROR}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.KVManager#closeKVStore */ closeKVStore(appId: string, storeId: string, kvStore: KVStore, callback: AsyncCallback): void; closeKVStore(appId: string, storeId: string, kvStore: KVStore): Promise; @@ -1828,6 +2024,8 @@ declare namespace distributedData { * {@code DB_ERROR}, {@code PERMISSION_DENIED}, and {@code IPC_ERROR}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.KVManager#deleteKVStore */ deleteKVStore(appId: string, storeId: string, callback: AsyncCallback): void; deleteKVStore(appId: string, storeId: string): Promise; @@ -1842,6 +2040,8 @@ declare namespace distributedData { * {@code PERMISSION_DENIED}, and {@code IPC_ERROR}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.KVManager#getAllKVStoreId */ getAllKVStoreId(appId: string, callback: AsyncCallback): void; getAllKVStoreId(appId: string): Promise; @@ -1853,6 +2053,8 @@ declare namespace distributedData { * @throws exception maybe occurs. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.KVManager#on */ on(event: 'distributedDataServiceDie', deathCallback: Callback): void; @@ -1863,6 +2065,8 @@ declare namespace distributedData { * @throws exception maybe occurs. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.KVManager#off */ off(event: 'distributedDataServiceDie', deathCallback?: Callback): void; } -- Gitee From cd030bed2ac2f0b8b915b026adb1206a0a418f24 Mon Sep 17 00:00:00 2001 From: zhutianyi Date: Sun, 16 Oct 2022 09:10:05 +0800 Subject: [PATCH 116/438] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhutianyi --- ...chedule.WorkSchedulerExtensionAbility.d.ts | 45 ------------------- api/@ohos.WorkSchedulerExtensionAbility.d.ts | 8 +--- 2 files changed, 1 insertion(+), 52 deletions(-) delete mode 100644 @ohos.resourceschedule.WorkSchedulerExtensionAbility.d.ts diff --git a/@ohos.resourceschedule.WorkSchedulerExtensionAbility.d.ts b/@ohos.resourceschedule.WorkSchedulerExtensionAbility.d.ts deleted file mode 100644 index 1aaa8c13f5..0000000000 --- a/@ohos.resourceschedule.WorkSchedulerExtensionAbility.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 workScheduler from "./@ohos.resourceschedule.workScheduler"; - -/** - * Class of the work scheduler extension ability. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - */ -export default class WorkSchedulerExtensionAbility { - /** - * Called back when a work is started. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - * @param work The info of work. - */ - onWorkStart(work: workScheduler.WorkInfo): void; - - /** - * Called back when a work is stopped. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - * @param work The info of work. - */ - onWorkStop(work: workScheduler.WorkInfo): void; -} \ No newline at end of file diff --git a/api/@ohos.WorkSchedulerExtensionAbility.d.ts b/api/@ohos.WorkSchedulerExtensionAbility.d.ts index 9a75d079e5..e84ee214c2 100644 --- a/api/@ohos.WorkSchedulerExtensionAbility.d.ts +++ b/api/@ohos.WorkSchedulerExtensionAbility.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import workScheduler from "./@ohos.workScheduler"; +import workScheduler from "./@ohos.resourceschedule.workScheduler"; /** * Class of the work scheduler extension ability. @@ -21,8 +21,6 @@ import workScheduler from "./@ohos.workScheduler"; * @since 9 * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly - * @deprecated since 9 - * @useinstead @ohos.resourceschedule.WorkSchedulerExtensionAbility */ export default class WorkSchedulerExtensionAbility { /** @@ -32,8 +30,6 @@ export default class WorkSchedulerExtensionAbility { * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly * @param work The info of work. - * @deprecated since 9 - * @useinstead @ohos.resourceschedule.WorkSchedulerExtensionAbility.onWorkStart */ onWorkStart(work: workScheduler.WorkInfo): void; @@ -44,8 +40,6 @@ export default class WorkSchedulerExtensionAbility { * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly * @param work The info of work. - * @deprecated since 9 - * @useinstead @ohos.resourceschedule.WorkSchedulerExtensionAbility.onWorkStop */ onWorkStop(work: workScheduler.WorkInfo): void; } \ No newline at end of file -- Gitee From 96a605431480f323066305aa375272c1816fba12 Mon Sep 17 00:00:00 2001 From: dboy190 Date: Sun, 16 Oct 2022 21:45:24 +0800 Subject: [PATCH 117/438] remove KVStore code reference Signed-off-by: dboy190 --- api/@ohos.data.distributedKVStore.d.ts | 104 +++++++++++-------------- 1 file changed, 45 insertions(+), 59 deletions(-) diff --git a/api/@ohos.data.distributedKVStore.d.ts b/api/@ohos.data.distributedKVStore.d.ts index 7e84a4644c..9695ac2c50 100644 --- a/api/@ohos.data.distributedKVStore.d.ts +++ b/api/@ohos.data.distributedKVStore.d.ts @@ -168,7 +168,7 @@ declare namespace distributedKVStore { } /** - * Obtains {@code Value} objects stored in a {@link KVStore} or {@link KVStore} database. + * Obtains {@code Value} objects stored in a {@link SingleKVStore} or {@link DeviceKVStore} database. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A @@ -221,8 +221,9 @@ declare namespace distributedKVStore { /** * Receives notifications of all data changes, including data insertion, update, and deletion. * - *

If you have subscribed to {@code KVStore} or {@code KVStore}, you will receive data change notifications and - * obtain the changed data from the parameters in callback methods upon data insertion, update, or deletion. + *

If you have subscribed to {@code SingleKVStore} or {@code DeviceKVStore}, you will receive + * data change notifications and obtain the changed data from the parameters in callback methods + * upon data insertion, update, or deletion. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A @@ -324,7 +325,7 @@ declare namespace distributedKVStore { } /** - * Describes the {@code KVStore} or {@code KVStore}type. + * Describes the KVStore type. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A @@ -332,7 +333,7 @@ declare namespace distributedKVStore { */ enum KVStoreType { /** - * Device-collaborated database, as specified by {@code DeviceKVStore} or {@code DeviceKVStore} + * Device-collaborated database, as specified by {@code DeviceKVStore} * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @import N/A * @since 9 @@ -349,7 +350,7 @@ declare namespace distributedKVStore { } /** - * Describes the {@code KVStore} or {@code KVStore} type. + * Describes the KVStore security level. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A @@ -398,10 +399,10 @@ declare namespace distributedKVStore { } /** - * Provides configuration options for creating a {@code KVStore} or {@code KVStore}. + * Provides configuration options for creating a {@code SingleKVStore} or {@code DeviceKVStore}. * - *

You can determine whether to create another database if a {@code KVStore} or {@code KVStore} database is - * missing, whether to encrypt the database, and the database type. + *

You can determine whether to create another database if a KVStore database is missing, + * whether to encrypt the database, and the database type. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A @@ -564,10 +565,11 @@ declare namespace distributedKVStore { } /** - * Provide methods to obtain the result set of the {@code KVStore} or {@code KVStore} database. + * Provide methods to obtain the result set of the {@code SingleKVStore} or {@code SingleKVStore} database. * - *

The result set is created by using the {@code getResultSet} method in the {@code DeviceKVStore} or - * {@code DeviceKVStore} class. This interface also provides methods for moving the data read position in the result set. + *

The result set is created by using the {@code getResultSet} method in the {@code SingleKVStore} or + * {@code DeviceKVStore} class. This interface also provides methods for moving the data read + * position in the result set. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @import N/A @@ -1038,7 +1040,7 @@ declare namespace distributedKVStore { */ interface SingleKVStore { /** - * Writes a key-value pair of the string type into the {@code KVStore} database. + * Writes a key-value pair of the string type into the {@code SingleKVStore} database. * *

If you do not want to synchronize this key-value pair to other devices, set the write option in the local database. * @@ -1055,7 +1057,7 @@ declare namespace distributedKVStore { put(key: string, value: Uint8Array | string | number | boolean): Promise; /** - * Inserts key-value pairs into the {@code KVStore} database in batches. + * Inserts key-value pairs into the {@code SingleKVStore} database in batches. * * @param entries Indicates the key-value pairs to be inserted in batches. * @throws {BusinessError} 401 - if parameter check failed. @@ -1068,7 +1070,7 @@ declare namespace distributedKVStore { putBatch(entries: Entry[]): Promise; /** - * Writes a value of the valuesbucket type into the {@code KVStore} database. + * Writes a value of the valuesbucket type into the {@code SingleKVStore} database. * * @param value Indicates the data record to put. * Spaces before and after the key will be cleared. @@ -1109,13 +1111,12 @@ declare namespace distributedKVStore { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @systemapi * @since 9 - */ delete(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback); delete(predicates: dataSharePredicates.DataSharePredicates): Promise; /** - * Deletes key-value pairs in batches from the {@code KVStore} database. + * Deletes key-value pairs in batches from the {@code SingleKVStore} database. * * @param keys Indicates the key-value pairs to be deleted in batches. * @throws {BusinessError} 401 - if parameter check failed. @@ -1129,13 +1130,14 @@ declare namespace distributedKVStore { deleteBatch(keys: string[]): Promise; /** - * void removeDeviceData​({@link String} deviceId) throws {@link BusinessError} + * Removes data of a specified device from the current database. This method is used to remove only the data + * synchronized from remote devices. This operation does not synchronize data to other databases or affect + * subsequent data synchronization. * - * @param deviceId Indicates the device to be removed data. + * @param deviceId Identifies the device whose data is to be removed. The value cannot be the current device ID. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @import N/A - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ removeDeviceData(deviceId: string, callback: AsyncCallback): void; @@ -1187,8 +1189,8 @@ declare namespace distributedKVStore { getEntries(query: Query): Promise; /** - * Obtains the result sets with a specified prefix from a {@code KVStore} database. The {@code KVStoreResultSet} - * object can be used to query all key-value pairs that meet the search criteria. Each {@code KVStore} + * Obtains the result sets with a specified prefix from a {@code SingleKVStore} database. The {@code KVStoreResultSet} + * object can be used to query all key-value pairs that meet the search criteria. Each {@code SingleKVStore} * instance can have a maximum of four {@code KVStoreResultSet} objects at the same time. If you have created * four objects, calling this method will return a failure. Therefore, you are advised to call the closeResultSet * method to close unnecessary {@code KVStoreResultSet} objects in a timely manner. @@ -1298,7 +1300,7 @@ declare namespace distributedKVStore { deleteBackup(files:Array): Promise>; /** - * Starts a transaction operation in the {@code KVStore} database. + * Starts a transaction operation in the {@code SingleKVStore} database. * *

After the database transaction is started, you can submit or roll back the operation. * @@ -1310,7 +1312,7 @@ declare namespace distributedKVStore { startTransaction(): Promise; /** - * Submits a transaction operation in the {@code KVStore} database. + * Submits a transaction operation in the {@code SingleKVStore} database. * * @param callback * @throws {BusinessError} 15100006 - if the database or result set has been closed. @@ -1321,7 +1323,7 @@ declare namespace distributedKVStore { commit(): Promise; /** - * Rolls back a transaction operation in the {@code KVStore} database. + * Rolls back a transaction operation in the {@code SingleKVStore} database. * * @throws {BusinessError} 15100006 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -1518,7 +1520,7 @@ declare namespace distributedKVStore { /** * Obtains the {@code KVStoreResultSet} object matching the specified device ID and key prefix. * - *

The {@code KVStoreResultSet} object can be used to query all key-value pairs that meet the search criteria. Each {@code KVStore} + *

The {@code KVStoreResultSet} object can be used to query all key-value pairs that meet the search criteria. Each {@code SingleKVStore} * instance can have a maximum of four {@code KVStoreResultSet} objects at the same time. If you have created four objects, * calling this method will return a failure. Therefore, you are advised to call the closeResultSet method to close unnecessary * {@code KVStoreResultSet} objects in a timely manner. @@ -1579,20 +1581,6 @@ declare namespace distributedKVStore { */ getResultSize(deviceId: string, query: Query, callback: AsyncCallback): void; getResultSize(deviceId: string, query: Query): Promise; - - /** - * Removes data of a specified device from the current database. This method is used to remove only the data - * synchronized from remote devices. This operation does not synchronize data to other databases or affect - * subsequent data synchronization. - * - * @param deviceId Identifies the device whose data is to be removed. The value cannot be the current device ID. - * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 - */ - removeDeviceData(deviceId: string, callback: AsyncCallback): void; - removeDeviceData(deviceId: string): Promise; } /** @@ -1601,7 +1589,7 @@ declare namespace distributedKVStore { *

You must pass {@link KVManagerConfig} to provide configuration information * for creating the {@link KVManager} instance. * - * @param config Indicates the {@link KVStore} configuration information, + * @param config Indicates the KVStore configuration information, * including the user information and package name. * @return Returns the {@code KVManager} instance. * @throws {BusinessError} 401 - if parameter check failed. @@ -1612,7 +1600,7 @@ declare namespace distributedKVStore { function createKVManager(config: KVManagerConfig): Promise; /** - * Provides interfaces to manage a {@code KVStore} database, including obtaining, closing, and deleting the {@code KVStore}. + * Provides interfaces to manage a {@code SingleKVStore} database, including obtaining, closing, and deleting the {@code SingleKVStore}. * * @import N/A * @version 1 @@ -1621,14 +1609,14 @@ declare namespace distributedKVStore { */ interface KVManager { /** - * Creates and obtains a {@code KVStore} database by specifying {@code Options} and {@code storeId}. + * Creates and obtains a {@code SingleKVStore} database by specifying {@code Options} and {@code storeId}. * - * @param options Indicates the options used for creating and obtaining the {@code KVStore} database, + * @param options Indicates the options used for creating and obtaining the KVStore database, * including {@code isCreateIfMissing}, {@code isEncrypt}, and {@code KVStoreType}. - * @param storeId Identifies the {@code KVStore} database. + * @param storeId Identifies the KVStore database. * The value of this parameter must be unique for the same application, * and different applications can share the same value. - * @return Returns a {@code KVStore}, or {@code SingleKVStore}. + * @return Returns a {@code SingleKVStore}, or {@code DeviceKVStore}. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100002 - if open existed database with changed options. * @throws {BusinessError} 15100003 - if the database is corrupted. @@ -1639,17 +1627,15 @@ declare namespace distributedKVStore { getKVStore(storeId: string, options: Options, callback: AsyncCallback): void; /** - * Closes the {@code KVStore} database. + * Closes the KVStore database. * *

Warning: This method is not thread-safe. If you call this method to stop a KVStore database that is running, your * thread may crash. * - *

The {@code KVStore} database to close must be an object created by using the {@code getKVStore} method. Before using this - * method, release the resources created for the database, for example, {@code KVStoreResultSet} for {@code SingleKVStore}, - * otherwise closing the database will fail. If you are attempting to close a database that is already closed, an error - * will be returned. + *

The KVStore database to close must be an object created by using the {@code getKVStore} method. Before using this + * method, release the resources created for the database, for example, {@code KVStoreResultSet} for KVStore, otherwise + * closing the database will fail. If you are attempting to close a database that is already closed, an error will be returned. * - * @param kvStore Indicates the {@code KVStore} database to close. * @throws {BusinessError} 401 - if parameter check failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 @@ -1658,14 +1644,14 @@ declare namespace distributedKVStore { closeKVStore(appId: string, storeId: string): Promise; /** - * Deletes the {@code KVStore} database identified by storeId. + * Deletes the KVStore database identified by storeId. * - *

Before using this method, close all {@code KVStore} instances in use that are identified by the same storeId. + *

Before using this method, close all KVStore instances in use that are identified by the same storeId. * - *

You can use this method to delete a {@code KVStore} database not in use. After the database is deleted, all its data will be + *

You can use this method to delete a KVStore database not in use. After the database is deleted, all its data will be * lost. * - * @param storeId Identifies the {@code KVStore} database to delete. + * @param storeId Identifies the KVStore database to delete. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100004 - if the database not exist when delete database. * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -1675,10 +1661,10 @@ declare namespace distributedKVStore { deleteKVStore(appId: string, storeId: string): Promise; /** - * Obtains the storeId of all {@code KVStore} databases that are created by using the {@code getKVStore} method and not deleted by + * Obtains the storeId of all KVStore databases that are created by using the {@code getKVStore} method and not deleted by * calling the {@code deleteKVStore} method. * - * @returns Returns the storeId of all created {@code KVStore} databases. + * @returns Returns the storeId of all created KVStore databases. * @throws {BusinessError} 401 - if parameter check failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 -- Gitee From d8cccb86c9ea24a3d719b2457eea7ecbca5e445d Mon Sep 17 00:00:00 2001 From: dboy190 Date: Mon, 17 Oct 2022 09:07:28 +0800 Subject: [PATCH 118/438] fix code comments Signed-off-by: dboy190 --- api/@ohos.data.distributedKVStore.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.data.distributedKVStore.d.ts b/api/@ohos.data.distributedKVStore.d.ts index 9695ac2c50..fe3e9d1eee 100644 --- a/api/@ohos.data.distributedKVStore.d.ts +++ b/api/@ohos.data.distributedKVStore.d.ts @@ -1609,7 +1609,7 @@ declare namespace distributedKVStore { */ interface KVManager { /** - * Creates and obtains a {@code SingleKVStore} database by specifying {@code Options} and {@code storeId}. + * Creates and obtains a KVStore database by specifying {@code Options} and {@code storeId}. * * @param options Indicates the options used for creating and obtaining the KVStore database, * including {@code isCreateIfMissing}, {@code isEncrypt}, and {@code KVStoreType}. -- Gitee From 81b083d1c160fb83a9492b200d0756371e13497c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E6=80=A1?= Date: Mon, 17 Oct 2022 01:34:13 +0000 Subject: [PATCH 119/438] bugfix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱天怡 --- ...ohos.resourceschedule.usageStatistics.d.ts | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/api/@ohos.resourceschedule.usageStatistics.d.ts b/api/@ohos.resourceschedule.usageStatistics.d.ts index 44cd7ad6d7..cd509c00dd 100644 --- a/api/@ohos.resourceschedule.usageStatistics.d.ts +++ b/api/@ohos.resourceschedule.usageStatistics.d.ts @@ -312,6 +312,32 @@ declare namespace usageStatistics { function queryAppGroup(callback: AsyncCallback): void; function queryAppGroup(): Promise; + /** + * Queries the usage priority group of the calling application. + * + *

The priority defined in a priority group restricts the resource usage of an application, + * for example, restricting the running of background tasks.

+ * + * @since 9 + * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + * @permission ohos.permission.BUNDLE_ACTIVE_INFO + * @systemapi Hide this for inner system use. + * @param bundleName, name of the application. + * @throws { BusinessError } 201 - Parameter error. + * @throws { BusinessError } 401 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 10000001 - Memory operation failed. + * @throws { BusinessError } 10000002 - Parcel operation failed. + * @throws { BusinessError } 10000003 - System service operation failed. + * @throws { BusinessError } 10000004 - IPC Communication failed. + * @throws { BusinessError } 10000005 - Application is not installed. + * @throws { BusinessError } 10000006 - Get application info failed. + * @throws { BusinessError } 10100002 - Get Application group info failed. + * @return Returns the usage priority group of the calling application. + */ + function queryAppGroup(bundleName : string, callback: AsyncCallback): void; + function queryAppGroup(bundleName : string): Promise; + /** * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App @@ -493,32 +519,6 @@ declare namespace usageStatistics { function queryModuleUsageRecords(callback: AsyncCallback>): void; function queryModuleUsageRecords(): Promise>; - /** - * Queries the usage priority group of the calling application. - * - *

The priority defined in a priority group restricts the resource usage of an application, - * for example, restricting the running of background tasks.

- * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup - * @permission ohos.permission.BUNDLE_ACTIVE_INFO - * @systemapi Hide this for inner system use. - * @param bundleName, name of the application. - * @throws { BusinessError } 201 - Parameter error. - * @throws { BusinessError } 401 - Permission denied. - * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 10000001 - Memory operation failed. - * @throws { BusinessError } 10000002 - Parcel operation failed. - * @throws { BusinessError } 10000003 - System service operation failed. - * @throws { BusinessError } 10000004 - IPC Communication failed. - * @throws { BusinessError } 10000005 - Application is not installed. - * @throws { BusinessError } 10000006 - Get application info failed. - * @throws { BusinessError } 10100002 - Get Application group info failed. - * @return Returns the usage priority group of the calling application. - */ - function queryAppGroup(bundleName : string, callback: AsyncCallback): void; - function queryAppGroup(bundleName : string): Promise; - /** * Declares group type. * -- Gitee From 126c97e015bf0e72f9ebccbf985764f20889e0f3 Mon Sep 17 00:00:00 2001 From: longwei Date: Wed, 12 Oct 2022 14:15:16 +0800 Subject: [PATCH 120/438] add bundleMonitor module Signed-off-by: longwei Change-Id: I7ca2f36020717f6f0935a9c8896a2ae1617cc790 --- api/@ohos.bundle.bundleMonitor.d.ts | 87 ++++ api/@ohos.bundle.innerBundleManager.d.ts | 10 + api/@ohos.bundle.launcherBundleManager.d.ts | 132 ++++++ api/bundle/abilityInfo.d.ts | 2 + api/bundle/applicationInfo.d.ts | 3 +- api/bundle/bundleStatusCallback.d.ts | 1 + api/bundle/extensionAbilityInfo.d.ts | 3 +- api/bundle/hapModuleInfo.d.ts | 3 +- api/bundle/launcherAbilityInfo.d.ts | 2 + api/bundle/metadata.d.ts | 3 +- api/bundle/moduleInfo.d.ts | 3 +- api/bundle/shortcutInfo.d.ts | 6 +- api/bundleManager/abilityInfo.d.ts | 469 ++++++++++++++++++++ api/bundleManager/applicationInfo.d.ts | 212 +++++++++ api/bundleManager/extensionAbilityInfo.d.ts | 252 +++++++++++ api/bundleManager/hapModuleInfo.d.ts | 147 ++++++ api/bundleManager/launcherAbilityInfo.d.ts | 74 +++ api/bundleManager/metadata.d.ts | 46 ++ api/bundleManager/shortcutInfo.d.ts | 128 ++++++ 19 files changed, 1577 insertions(+), 6 deletions(-) create mode 100644 api/@ohos.bundle.bundleMonitor.d.ts create mode 100644 api/@ohos.bundle.launcherBundleManager.d.ts create mode 100644 api/bundleManager/abilityInfo.d.ts create mode 100644 api/bundleManager/applicationInfo.d.ts create mode 100644 api/bundleManager/extensionAbilityInfo.d.ts create mode 100644 api/bundleManager/hapModuleInfo.d.ts create mode 100644 api/bundleManager/launcherAbilityInfo.d.ts create mode 100644 api/bundleManager/metadata.d.ts create mode 100644 api/bundleManager/shortcutInfo.d.ts diff --git a/api/@ohos.bundle.bundleMonitor.d.ts b/api/@ohos.bundle.bundleMonitor.d.ts new file mode 100644 index 0000000000..0f08c1d940 --- /dev/null +++ b/api/@ohos.bundle.bundleMonitor.d.ts @@ -0,0 +1,87 @@ +/* + * 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 { Callback } from './basic'; + +/** + * Bundle monitor + * @namespace bundleMonitor + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ +declare namespace bundleMonitor { + /** + * This module defines the result information of monitoring install, update and uninstall. + * @typedef BundleChangedInfo + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + interface BundleChangedInfo { + /** + * The bundle name + * @type {string} + * @systemapi + * @since 9 + */ + bundleName: string; + /** + * The user id + * @type {number} + * @systemapi + * @since 9 + */ + userId: number; + } + + /** + * Indicates the event type of bundle change + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + type BundleChangedEvent = 'add' | 'update' | 'remove'; + + /** + * Register to monitor the installation status + * @permission ohos.permission.LISTEN_BUNDLE_CHANGE + * @param { BundleChangedEvent } type - Indicates the command should be implement. + * @param { Callback } callback - Indicates the callback to be register. + * @throws {BusinessError} 201 - Verify permission denied. + * @throws {BusinessError} 401 - The parameter check failed. + * @throws {BusinessError} 801 - Capability not support. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function on(type: BundleChangedEvent, callback: Callback): void; + + /** + * Unregister to monitor the installation status + * @permission ohos.permission.LISTEN_BUNDLE_CHANGE + * @param { BundleChangedEvent } type -type Indicates the command should be implement. + * @param { Callback } callback - Indicates the callback to be unregister. + * @throws {BusinessError} 201 - Verify permission denied. + * @throws {BusinessError} 401 - The parameter check failed. + * @throws {BusinessError} 801 - Capability not support. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function off(type: BundleChangedEvent, callback?: Callback): void; +} + +export default bundleMonitor diff --git a/api/@ohos.bundle.innerBundleManager.d.ts b/api/@ohos.bundle.innerBundleManager.d.ts index 9eaaeee19f..eabbae5479 100644 --- a/api/@ohos.bundle.innerBundleManager.d.ts +++ b/api/@ohos.bundle.innerBundleManager.d.ts @@ -38,6 +38,8 @@ declare namespace innerBundleManager { * @return Returns the LauncherAbilityInfo object. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.launcherBundleManager#getLauncherAbilityInfo */ function getLauncherAbilityInfos(bundleName: string, userId: number, callback: AsyncCallback>) : void; function getLauncherAbilityInfos(bundleName: string, userId: number) : Promise>; @@ -52,6 +54,8 @@ declare namespace innerBundleManager { * @return Returns the result or error maeeage. * @permission ohos.permission.LISTEN_BUNDLE_CHANGE * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.bundleMonitor#on */ function on(type:"BundleStatusChange", bundleStatusCallback : BundleStatusCallback, callback: AsyncCallback) : void; function on(type:"BundleStatusChange", bundleStatusCallback : BundleStatusCallback): Promise; @@ -65,6 +69,8 @@ declare namespace innerBundleManager { * @return Returns the result or error maeeage. * @permission ohos.permission.LISTEN_BUNDLE_CHANGE * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.bundleMonitor#off */ function off(type:"BundleStatusChange", callback: AsyncCallback) : void; function off(type:"BundleStatusChange"): Promise; @@ -78,6 +84,8 @@ declare namespace innerBundleManager { * @return Returns the LauncherAbilityInfo object. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.launcherBundleManager#getAllLauncherAbilityInfos */ function getAllLauncherAbilityInfos(userId: number, callback: AsyncCallback>) : void; function getAllLauncherAbilityInfos(userId: number) : Promise>; @@ -91,6 +99,8 @@ declare namespace innerBundleManager { * @return Returns the LauncherShortcutInfo object. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.launcherBundleManager#getShortcutInfo */ function getShortcutInfos(bundleName :string, callback: AsyncCallback>) : void; function getShortcutInfos(bundleName : string) : Promise>; diff --git a/api/@ohos.bundle.launcherBundleManager.d.ts b/api/@ohos.bundle.launcherBundleManager.d.ts new file mode 100644 index 0000000000..6eb6137c7b --- /dev/null +++ b/api/@ohos.bundle.launcherBundleManager.d.ts @@ -0,0 +1,132 @@ +/* + * 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 { AsyncCallback } from './basic'; +import { LauncherAbilityInfo as _LauncherAbilityInfo } from './bundleManager/launcherAbilityInfo'; +import { ShortcutInfo as _ShortcutInfo, ShortcutWant as _ShortcutWant} from './bundleManager/shortcutInfo'; + + +/** + * Launcher bundle manager. + * @namespace launcherBundleManager + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 9 + */ +declare namespace launcherBundleManager { + /** + * Obtains launcher abilities info based on a given bundleName and userId. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { number } userId - Indicates the id for the user. + * @param { AsyncCallback> } callback -The callback of the LauncherAbilityInfo object result. + * @throws {BusinessError} 201 - Verify permission denied. + * @throws {BusinessError} 401 - The parameter check failed. + * @throws {BusinessError} 801 - Capability not support. + * @throws {BusinessError} 17700001 - The specified bundle name is not found. + * @throws {BusinessError} 17700004 - The specified user id is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 9 + */ + function getLauncherAbilityInfo(bundleName: string, userId: number, callback: AsyncCallback>) : void; + + /** + * Obtains launcher abilities info based on a given bundleName and userId. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { number } userId - Indicates the id for the user. + * @returns { Promise> } the LauncherAbilityInfo object. + * @throws {BusinessError} 201 - Verify permission denied. + * @throws {BusinessError} 401 - The parameter check failed. + * @throws {BusinessError} 801 - Capability not support. + * @throws {BusinessError} 17700001 - The specified bundle name is not found. + * @throws {BusinessError} 17700004 - The specified user id is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 9 + */ + function getLauncherAbilityInfo(bundleName: string, userId: number) : Promise>; + + /** + * Obtains launcher abilities info based on a given userId. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { number } userId - Indicates the id for the user. + * @param { AsyncCallback> } callback -The callback of the LauncherAbilityInfo object result. + * @throws {BusinessError} 201 - Verify permission denied. + * @throws {BusinessError} 401 - The parameter check failed. + * @throws {BusinessError} 801 - Capability not support. + * @throws {BusinessError} 17700004 - The specified user id is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 9 + */ + function getAllLauncherAbilityInfo(userId: number, callback: AsyncCallback>) : void; + + /** + * Obtains launcher abilities info based on a given userId. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { number } userId - Indicates the id for the user. + * @returns { Promise> } the LauncherAbilityInfo object. + * @throws {BusinessError} 201 - Verify permission denied. + * @throws {BusinessError} 401 - The parameter check failed. + * @throws {BusinessError} 801 - Capability not support. + * @throws {BusinessError} 17700004 - The specified user id is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 9 + */ + function getAllLauncherAbilityInfo(userId: number) : Promise>; + + /** + * Obtains shortcut info based on a given bundleName. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { AsyncCallback> } callback -The callback of the ShortcutInfo object result. + * @throws {BusinessError} 201 - Verify permission denied. + * @throws {BusinessError} 401 - The parameter check failed. + * @throws {BusinessError} 801 - Capability not support. + * @throws {BusinessError} 17700001 - The specified bundle name is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 9 + */ + function getShortcutInfo(bundleName :string, callback: AsyncCallback>) : void; + + /** + * Obtains shortcut info based on a given bundleName. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @returns { Promise> } the LauncherShortcutInfo object. + * @throws {BusinessError} 201 - Verify permission denied. + * @throws {BusinessError} 401 - The parameter check failed. + * @throws {BusinessError} 801 - Capability not support. + * @throws {BusinessError} 17700001 - The specified bundle name is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 9 + */ + function getShortcutInfo(bundleName : string) : Promise>; + + /** + * Contains basic launcher Ability information, which uniquely identifies an LauncherAbilityInfo. + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 9 + */ + export type LauncherAbilityInfo = _LauncherAbilityInfo; +} + +export default launcherBundleManager; diff --git a/api/bundle/abilityInfo.d.ts b/api/bundle/abilityInfo.d.ts index b1ae1d907f..fea1af4095 100644 --- a/api/bundle/abilityInfo.d.ts +++ b/api/bundle/abilityInfo.d.ts @@ -23,6 +23,8 @@ import bundle from './../@ohos.bundle'; * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager.AbilityInfo */ export interface AbilityInfo { /** diff --git a/api/bundle/applicationInfo.d.ts b/api/bundle/applicationInfo.d.ts index 73477bb49b..1d43226bc4 100644 --- a/api/bundle/applicationInfo.d.ts +++ b/api/bundle/applicationInfo.d.ts @@ -23,7 +23,8 @@ import { Resource } from './../global/resource'; * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA - * + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager.ApplicationInfo */ export interface ApplicationInfo { /** diff --git a/api/bundle/bundleStatusCallback.d.ts b/api/bundle/bundleStatusCallback.d.ts index b5c4d36858..7b1a2107dc 100644 --- a/api/bundle/bundleStatusCallback.d.ts +++ b/api/bundle/bundleStatusCallback.d.ts @@ -23,6 +23,7 @@ * * @permission ohos.permission.LISTEN_BUNDLE_CHANGE * @systemapi Hide this for inner system use + * @deprecated since 9 */ export interface BundleStatusCallback { /** diff --git a/api/bundle/extensionAbilityInfo.d.ts b/api/bundle/extensionAbilityInfo.d.ts index c533ad6dc5..d8bf7564c7 100644 --- a/api/bundle/extensionAbilityInfo.d.ts +++ b/api/bundle/extensionAbilityInfo.d.ts @@ -22,7 +22,8 @@ import bundle from './../@ohos.bundle'; * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA - * + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager.ExtensionAbilityInfo */ export interface ExtensionAbilityInfo { /** diff --git a/api/bundle/hapModuleInfo.d.ts b/api/bundle/hapModuleInfo.d.ts index 5ed5be922e..c9662744a4 100644 --- a/api/bundle/hapModuleInfo.d.ts +++ b/api/bundle/hapModuleInfo.d.ts @@ -22,7 +22,8 @@ import { Metadata } from './metadata' * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA - * + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager.HapModuleInfo */ export interface HapModuleInfo { /** diff --git a/api/bundle/launcherAbilityInfo.d.ts b/api/bundle/launcherAbilityInfo.d.ts index a73f3ce63f..31438d20dd 100644 --- a/api/bundle/launcherAbilityInfo.d.ts +++ b/api/bundle/launcherAbilityInfo.d.ts @@ -26,6 +26,8 @@ import { ElementName } from './elementName' * * @permission N/A * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager.LauncherAbilityInfo */ export interface LauncherAbilityInfo { /** diff --git a/api/bundle/metadata.d.ts b/api/bundle/metadata.d.ts index 4fba45c534..de2c7533d9 100644 --- a/api/bundle/metadata.d.ts +++ b/api/bundle/metadata.d.ts @@ -18,7 +18,8 @@ * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA - * + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager.Metadata */ export interface Metadata { /** diff --git a/api/bundle/moduleInfo.d.ts b/api/bundle/moduleInfo.d.ts index f961a10b9d..2f23150f40 100644 --- a/api/bundle/moduleInfo.d.ts +++ b/api/bundle/moduleInfo.d.ts @@ -18,7 +18,8 @@ * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA - * + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager.HapModuleInfo */ export interface ModuleInfo { /** diff --git a/api/bundle/shortcutInfo.d.ts b/api/bundle/shortcutInfo.d.ts index 98c0a85563..7b931ae799 100644 --- a/api/bundle/shortcutInfo.d.ts +++ b/api/bundle/shortcutInfo.d.ts @@ -20,6 +20,8 @@ * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.launcherBundleManager.ShortcutWant */ export interface ShortcutWant{ /** @@ -47,13 +49,15 @@ * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA - * + * @deprecated since 9 + * @useinstead ohos.bundle.launcherBundleManager.ShortcutInfo */ export interface ShortcutInfo { /** * @default Indicates the ID of the application to which this shortcut belongs * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework + * */ readonly id: string; /** diff --git a/api/bundleManager/abilityInfo.d.ts b/api/bundleManager/abilityInfo.d.ts new file mode 100644 index 0000000000..e3a0325bf9 --- /dev/null +++ b/api/bundleManager/abilityInfo.d.ts @@ -0,0 +1,469 @@ +/* + * 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 { ApplicationInfo } from './applicationInfo'; +import { Metadata } from './metadata' + +/** + * Obtains configuration information about an ability + * @typedef AbilityInfo + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +export interface AbilityInfo { + /** + * Indicates the name of the bundle containing the ability + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly bundleName: string; + + /** + * Indicates the name of the .hap package to which the capability belongs + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly moduleName: string; + + /** + * Ability simplified class name + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly name: string; + + /** + * Indicates the label of the ability + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly label: string; + + /** + * Indicates the label id of the ability + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly labelId: number; + + /** + * Indicates the ability + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly description: string; + + /** + * Indicates the description id of the ability + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly descriptionId: number; + + /** + * Indicates the icon of the ability + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly icon: string; + + /** + * Indicates the icon id of the ability + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly iconId: number; + + /** + * Process of ability, if user do not set it, the value equal application process + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly process: string; + + /** + * Indicates whether an ability can be called by other abilities + * @type {boolean} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly isVisible: boolean; + + /** + * Enumerates types of templates that can be used by an ability + * @type {AbilityType} + * @syscap SystemCapability.BundleManager.BundleFramework + * @FAModelOnly + * @since 9 + */ + readonly type: AbilityType; + + /** + * Enumerates ability display orientations + * @type {DisplayOrientation} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly orientation: DisplayOrientation; + + /** + * Enumerates ability launch type + * @type {LaunchType} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly launchType: LaunchType; + + /** + * The permissions that others need to launch this ability + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly permissions: Array; + + /** + * Indicates the permission required for reading ability data + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework + * @FAModelOnly + * @since 9 + */ + readonly readPermission: string; + + /** + * Indicates the permission required for writing data to the ability + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework + * @FAModelOnly + * @since 9 + */ + readonly writePermission: string; + + /** + * Uri of ability + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework + * @FAModelOnly + * @since 9 + */ + readonly uri: string; + + /** + * The device types that this ability can run on + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly deviceTypes: Array; + + /** + * Obtains configuration information about an application + * @type {ApplicationInfo} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly applicationInfo: ApplicationInfo; + + /** + * Indicates the metadata of ability + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly metadata: Array; + + /** + * Indicates whether the ability is enabled + * @type {boolean} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly enabled: boolean; + + /** + * Indicates which window mode is supported + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly supportWindowModes: Array; + + /** + * Indicates window size + * @type {WindowSize} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly windowSize: WindowSize; +} + +/** + * Indicates the window size. + * @typedef WindowSize + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +export interface WindowSize { + /** + * Indicates maximum ratio of width over height of window under free window status. + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly maxWindowRatio: number; + + /** + * Indicates minimum ratio of width over height of window under free window status. + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly minWindowRatio: number; + + /** + * Indicates maximum width of window under free window status. + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly maxWindowWidth: number; + + /** + * Indicates minimum width of window under free window status. + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly minWindowWidth: number; + + /** + * Indicates maximum height of window under free window status. + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly maxWindowHeight: number; + + /** + * Indicates minimum height of window under free window status. + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly minWindowHeight: number; +} + +/** + * Support window mode + * @enum {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +export enum SupportWindowMode { + /** + * Indicates supported window mode of full screen mode + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + FULL_SCREEN = 0, + /** + * Indicates supported window mode of split mode + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + SPLIT = 1, + /** + * Indicates supported window mode of floating mode + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + FLOATING = 2, +} + +/** + * Launch type + * @enum {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +export enum LaunchType { + /** + * Indicates that the ability has only one instance + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + SINGLETON = 0, + + /** + * Indicates that the ability can have multiple instances + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + STANDARD = 1, + + /** + * Indicates that the ability can have specified instances + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + SPECIFIED = 2, +} + +/** + * Indicates ability type + * @enum {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +export enum AbilityType { + /** + * Indicates an unknown ability type + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + UNKNOWN, + + /** + * Indicates that the ability has a UI + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + PAGE, + + /** + * Indicates that the ability does not have a UI + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + SERVICE, + + /** + * Indicates that the ability is used to provide data access services + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + DATA, +} + + +/** + * Display orientation + * @enum {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +export enum DisplayOrientation { + /** + * Indicates that the system automatically determines the display orientation + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + UNSPECIFIED, + + /** + * Indicates the landscape orientation + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + LANDSCAPE, + + /** + * Indicates the portrait orientation + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + PORTRAIT, + + /** + * Indicates the page ability orientation is the same as that of the nearest ability in the stack + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + FOLLOW_RECENT, + + /** + * Indicates the inverted landscape orientation + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + LANDSCAPE_INVERTED, + + /** + * Indicates the inverted portrait orientation + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + PORTRAIT_INVERTED, + + /** + * Indicates the orientation can be auto-rotated + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + AUTO_ROTATION, + + /** + * Indicates the landscape orientation rotated with sensor + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + AUTO_ROTATION_LANDSCAPE, + + /** + * Indicates the portrait orientation rotated with sensor + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + AUTO_ROTATION_PORTRAIT, + + /** + * Indicates the sensor restricted mode + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + AUTO_ROTATION_RESTRICTED, + + /** + * Indicates the sensor landscape restricted mode + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + AUTO_ROTATION_LANDSCAPE_RESTRICTED, + + /** + * Indicates the sensor portrait restricted mode + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + AUTO_ROTATION_PORTRAIT_RESTRICTED, + + /** + * Indicates the locked orientation mode + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + LOCKED, +} diff --git a/api/bundleManager/applicationInfo.d.ts b/api/bundleManager/applicationInfo.d.ts new file mode 100644 index 0000000000..2ea06512bd --- /dev/null +++ b/api/bundleManager/applicationInfo.d.ts @@ -0,0 +1,212 @@ +/* + * 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 { HapModuleInfo } from './hapModuleInfo'; +import { Metadata } from './metadata'; +import { Resource } from '../global/resource'; + +/** + * Obtains configuration information about an application + * @typedef ApplicationInfo + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +export interface ApplicationInfo { + /** + * Indicates the application name, which is the same as {@code bundleName} + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly name: string; + + /** + * Description of application + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly description: string; + + /** + * Indicates the description id of the application + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly descriptionId: number; + + /** + * Indicates whether or not this application may be instantiated + * @type {boolean} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly enabled: boolean; + + /** + * Indicates the label of the application + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly label: string; + + /** + * Indicates the label id of the application + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly labelId: number; + + /** + * Indicates the icon of the application + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly icon: string; + + /** + * Indicates the icon id of the application + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly iconId: number; + + /** + * Process of application, if user do not set it ,the value equal bundleName + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly process: string; + + /** + * Indicates the path storing the module resources of the application + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly moduleSourceDirs: Array; + + /** + * Indicates the permissions required for accessing the application. + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly permissions: Array; + + /** + * Indicates modules information about an application + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly modulesInfo: Array; + + /** + * Indicates the path where the {@code Entry.hap} file of the application is saved + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly entryDir: string; + + /** + * Indicates the application source code path + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly codePath: string; + + /** + * Indicates the metadata of module + * @type {Map>} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly metadata: Map>; + + /** + * Indicates whether or not this application may be removable + * @type {boolean} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly removable: boolean; + + /** + * Indicates the access token of the application + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly accessTokenId: number; + + /** + * Indicates the uid of the application + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly uid: number; + + /** + * Indicates icon resource of the application + * @type {Resource} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly iconResource: Resource; + + /** + * Indicates label resource of the application + * @type {Resource} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly labelResource: Resource; + + /** + * Indicates description resource of the application + * @type {Resource} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly descriptionResource: Resource; + + /** + * Indicates the appDistributionType of the application + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + readonly appDistributionType: string; + + /** + * Indicates the appProvisionType of the application + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + readonly appProvisionType: string; +} diff --git a/api/bundleManager/extensionAbilityInfo.d.ts b/api/bundleManager/extensionAbilityInfo.d.ts new file mode 100644 index 0000000000..538dec8952 --- /dev/null +++ b/api/bundleManager/extensionAbilityInfo.d.ts @@ -0,0 +1,252 @@ +/* + * 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 { ApplicationInfo } from './applicationInfo'; +import { Metadata } from './metadata' + +/** + * Extension information about a bundle + * @typedef ExtensionAbilityInfo + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +export interface ExtensionAbilityInfo { + /** + * Indicates the name of the bundle + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly bundleName: string; + + /** + * Indicates the name of the module + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly moduleName: string; + + /** + * Indicates the name of the extension ability info + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly name: string; + + /** + * Indicates the label id of the extension ability info + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly labelId: number; + + /** + * Indicates the description id of the extension ability info + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly descriptionId: number; + + /** + * Indicates the icon id of the extension ability info + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly iconId: number; + + /** + * Indicates whether the extension ability info can be visible or not + * @type {boolean} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly isVisible: boolean; + + /** + * Enumerates types of the extension ability info + * @type {ExtensionAbilityType} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly extensionAbilityType: ExtensionAbilityType; + + /** + * The permissions that others need to use this extension ability info + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly permissions: Array; + + /** + * Obtains configuration information about an application + * @type {ApplicationInfo} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly applicationInfo: ApplicationInfo; + + /** + * Indicates the metadata of bundle + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly metadata: Array; + + /** + * Indicates the src language to express extension ability info + * @type {boolean} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly enabled: boolean; + + /** + * Indicates the read permission extension ability info + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly readPermission: string; + + /** + * Indicates the write permission of extension ability info + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly writePermission: string; +} + +/** + * This enumeration value is used to identify various types of extension ability + * @enum {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + export enum ExtensionAbilityType { + /** + * Indicates extension info with type of form + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + FORM = 0, + + /** + * Indicates extension info with type of work schedule + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + WORK_SCHEDULER = 1, + + /** + * Indicates extension info with type of input method + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + INPUT_METHOD = 2, + + /** + * Indicates extension info with type of service + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + SERVICE = 3, + + /** + * Indicates extension info with type of accessibility + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + ACCESSIBILITY = 4, + + /** + * Indicates extension info with type of dataShare + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + DATA_SHARE = 5, + + /** + * Indicates extension info with type of filesShare + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + FILE_SHARE = 6, + + /** + * Indicates extension info with type of staticSubscriber + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + STATIC_SUBSCRIBER = 7, + + /** + * Indicates extension info with type of wallpaper + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + WALLPAPER = 8, + + /** + * Indicates extension info with type of backup + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + BACKUP = 9, + + /** + * Indicates extension info with type of window + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + WINDOW = 10, + + /** + * Indicates extension info with type of enterprise admin + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + ENTERPRISE_ADMIN = 11, + + /** + * Indicates extension info with type of thumbnail + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + THUMBNAIL = 13, + + /** + * Indicates extension info with type of preview + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + PREVIEW = 14, + + /** + * Indicates extension info with type of unspecified + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + UNSPECIFIED = 255, +} diff --git a/api/bundleManager/hapModuleInfo.d.ts b/api/bundleManager/hapModuleInfo.d.ts new file mode 100644 index 0000000000..4fc11edabe --- /dev/null +++ b/api/bundleManager/hapModuleInfo.d.ts @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2021 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 { AbilityInfo } from "./abilityInfo"; +import { ExtensionAbilityInfo } from "./extensionAbilityInfo"; +import { Metadata } from './metadata' + +/** + * Obtains configuration information about a hap module. + * @typedef HapModuleInfo + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +export interface HapModuleInfo { + /** + * Indicates the name of this hap module + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly name: string; + + /** + * Indicates the icon of this hap module + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly icon: string; + + /** + * Indicates the icon id of this hap module + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly iconId: number; + + /** + * Indicates the label of this hap module + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly label: string; + + /** + * Indicates the label id of this hap module + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly labelId: number; + + /** + * Describes the hap module + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly description: string; + + /** + * Indicates the description of this hap module + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly descriptionId: number; + + /** + * Indicates main elementName of the hap module + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly mainElementName: string; + + /** + * Obtains configuration information about abilities + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly abilitiesInfo: Array; + + /** + * Obtains configuration information about extension abilities + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly extensionAbilitiesInfo: Array; + + /** + * Indicates the metadata of ability + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly metadata: Array; + + /** + * The device types that this hap module can run on + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly deviceTypes: Array; + + /** + * Indicates whether free installation of the hap module is supported + * @type {boolean} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly installationFree: boolean; + + /** + * Indicates the hash value of the hap module + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + readonly hashValue: string; + + /** + * Indicates the module source dir of this hap module + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly moduleSourceDir: string; +} diff --git a/api/bundleManager/launcherAbilityInfo.d.ts b/api/bundleManager/launcherAbilityInfo.d.ts new file mode 100644 index 0000000000..0fb9f55e8b --- /dev/null +++ b/api/bundleManager/launcherAbilityInfo.d.ts @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ApplicationInfo } from './applicationInfo'; +import { ElementName } from './elementName' + +/** + * Contains basic launcher Ability information, which uniquely identifies an LauncherAbilityInfo + * @typedef LauncherAbilityInfo + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 9 + */ +export interface LauncherAbilityInfo { + /** + * Obtains application info information about an launcher ability. + * @type {ApplicationInfo} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly applicationInfo: ApplicationInfo; + + /** + * Obtains element name about an launcher ability. + * @type {ElementName} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly elementName : ElementName; + + /** + * Obtains labelId about an launcher ability. + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly labelId: number; + + /** + * Obtains iconId about an launcher ability. + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly iconId: number; + + /** + * Obtains userId about an launcher ability. + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly userId: number; + + /** + * Obtains installTime about an launcher ability. + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly installTime : number; +} diff --git a/api/bundleManager/metadata.d.ts b/api/bundleManager/metadata.d.ts new file mode 100644 index 0000000000..4a9e28b748 --- /dev/null +++ b/api/bundleManager/metadata.d.ts @@ -0,0 +1,46 @@ +/* + * 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. + */ + + /** + * Indicates the Metadata + * @typedef Metadata + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + export interface Metadata { + /** + * Indicates the metadata name + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + name: string; + + /** + * Indicates the metadata value + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + value: string; + + /** + * Indicates the metadata resource + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + resource: string; + } \ No newline at end of file diff --git a/api/bundleManager/shortcutInfo.d.ts b/api/bundleManager/shortcutInfo.d.ts new file mode 100644 index 0000000000..615f46d1fc --- /dev/null +++ b/api/bundleManager/shortcutInfo.d.ts @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2021 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. + */ + +/** + * Provides information about a shortcut, including the shortcut ID and label. + * @typedef ShortcutInfo + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 9 + */ + export interface ShortcutInfo { + /** + * Indicates the ID of the application to which this shortcut belongs + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly id: string; + + /** + * Indicates the name of the bundle containing the shortcut + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly bundleName: string; + + /** + * Indicates the moduleName of the shortcut + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly moduleName: string; + + /** + * Indicates the host ability of the shortcut + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly hostAbility: string; + + /** + * Indicates the icon of the shortcut + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly icon: string; + + /** + * Indicate s the icon id of the shortcut + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly iconId: number; + + /** + * Indicates the label of the shortcut + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly label: string; + + /** + * Indicates the label id of the shortcut + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly labelId: number; + + /** + * Indicates the wants of the shortcut + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly wants: Array; + } + + /** + * Obtains information about the ability that a shortcut will start. + * @typedef ShortcutWant + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 9 + */ + export interface ShortcutWant{ + /** + * Indicates the target bundle of the shortcut want + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly targetBundle: string; + + /** + * Indicates the target module of the shortcut want + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly targetModule: string; + + /** + * Indicates the target ability of the shortcut want + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @since 9 + */ + readonly targetAbility: string; + } \ No newline at end of file -- Gitee From 83c241c82536ca6a80587bf408a111f3b704c903 Mon Sep 17 00:00:00 2001 From: lyj_love_code Date: Mon, 17 Oct 2022 15:06:46 +0800 Subject: [PATCH 121/438] fix the error message of hiAppEvent Signed-off-by: lyj_love_code --- api/@ohos.hiviewdfx.hiAppEvent.d.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/api/@ohos.hiviewdfx.hiAppEvent.d.ts b/api/@ohos.hiviewdfx.hiAppEvent.d.ts index 2f76dd1747..9d9df9602c 100644 --- a/api/@ohos.hiviewdfx.hiAppEvent.d.ts +++ b/api/@ohos.hiviewdfx.hiAppEvent.d.ts @@ -201,13 +201,13 @@ declare namespace hiAppEvent { * @param {AppEventInfo} info Application event information to be written. * @param {AsyncCallback} [callback] Callback function. * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 11100001 - Function is disable. + * @throws {BusinessError} 11100001 - Function is disabled. * @throws {BusinessError} 11101001 - Invalid event domain. * @throws {BusinessError} 11101002 - Invalid event name. - * @throws {BusinessError} 11101003 - Invalid param num. - * @throws {BusinessError} 11101004 - Invalid string length. - * @throws {BusinessError} 11101005 - Invalid param name. - * @throws {BusinessError} 11101006 - Invalid array length. + * @throws {BusinessError} 11101003 - Invalid number of event parameters. + * @throws {BusinessError} 11101004 - Invalid string length of the event parameter. + * @throws {BusinessError} 11101005 - Invalid event parameter name. + * @throws {BusinessError} 11101006 - Invalid array length of the event parameter. */ function write(info: AppEventInfo): Promise; function write(info: AppEventInfo, callback: AsyncCallback): void; @@ -263,7 +263,7 @@ declare namespace hiAppEvent { * @syscap SystemCapability.HiviewDFX.HiAppEvent * @param {number} size Threshold size. * @throws {BusinessError} 401 - Parameter error. - * @throws {BusinessError} 11104001 - Size must be a positive integer. + * @throws {BusinessError} 11104001 - Invalid size value. */ setSize(size: number): void; @@ -356,10 +356,10 @@ declare namespace hiAppEvent { * @return {AppEventPackageHolder} Holder object, which is used to read the monitoring data of the watcher. * @throws {BusinessError} 401 - Parameter error. * @throws {BusinessError} 11102001 - Invalid watcher name. - * @throws {BusinessError} 11102002 - Invalid filter domain. - * @throws {BusinessError} 11102003 - Row must be a positive integer. - * @throws {BusinessError} 11102004 - Size must be a positive integer. - * @throws {BusinessError} 11102005 - Timeout must be a positive integer. + * @throws {BusinessError} 11102002 - Invalid filtering event domain. + * @throws {BusinessError} 11102003 - Invalid row value. + * @throws {BusinessError} 11102004 - Invalid size value. + * @throws {BusinessError} 11102005 - Invalid timeout value. */ function addWatcher(watcher: Watcher): AppEventPackageHolder; -- Gitee From c718f451985888b4751e8d9a735fb6290fc86e89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E6=80=A1?= Date: Mon, 17 Oct 2022 08:34:36 +0000 Subject: [PATCH 122/438] bugfix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱天怡 --- ...ohos.resourceschedule.usageStatistics.d.ts | 26 ++----------------- 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/api/@ohos.resourceschedule.usageStatistics.d.ts b/api/@ohos.resourceschedule.usageStatistics.d.ts index cd509c00dd..a4b728dd83 100644 --- a/api/@ohos.resourceschedule.usageStatistics.d.ts +++ b/api/@ohos.resourceschedule.usageStatistics.d.ts @@ -188,28 +188,6 @@ declare namespace usageStatistics { count: number; } - /** - * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App - * @systemapi Hide this for inner system use. - */ - interface NotificationEventStats { - /** - * the bundle name or notification event name. - */ - name: string; - - /** - * the event id. - */ - eventId: number; - - /** - * the the event occurrence number. - */ - count: number; - } - /** * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App @@ -663,8 +641,8 @@ declare namespace usageStatistics { * @throws { BusinessError } 10000007 - Get system or actual time failed. * @return Returns the {@link NotificationEventStats} object Array containing the event states data. */ - function queryNotificationEventStats(begin: number, end: number, callback: AsyncCallback>): void; - function queryNotificationEventStats(begin: number, end: number): Promise>; + function queryNotificationEventStats(begin: number, end: number, callback: AsyncCallback>): void; + function queryNotificationEventStats(begin: number, end: number): Promise>; } export default usageStatistics; \ No newline at end of file -- Gitee From 6fe6cd30c20d6918970276a70a9460ff980835f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E6=80=A1?= Date: Mon, 17 Oct 2022 08:58:00 +0000 Subject: [PATCH 123/438] bugfix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱天怡 --- api/@ohos.backgroundTaskManager.d.ts | 26 ++-- api/@ohos.bundleState.d.ts | 138 +++++++++--------- ...esourceschedule.backgroundTaskManager.d.ts | 2 +- ...ohos.resourceschedule.usageStatistics.d.ts | 90 ++++++------ api/@ohos.workScheduler.d.ts | 24 +-- 5 files changed, 140 insertions(+), 140 deletions(-) diff --git a/api/@ohos.backgroundTaskManager.d.ts b/api/@ohos.backgroundTaskManager.d.ts index a051ce8115..7011676c21 100644 --- a/api/@ohos.backgroundTaskManager.d.ts +++ b/api/@ohos.backgroundTaskManager.d.ts @@ -23,7 +23,7 @@ import Context from './application/BaseContext'; * @since 7 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskManager + * @useinstead ohos.resourceschedule.backgroundTaskManager */ declare namespace backgroundTaskManager { /** @@ -33,7 +33,7 @@ declare namespace backgroundTaskManager { * @since 7 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskManager.DelaySuspendInfo + * @useinstead ohos.resourceschedule.backgroundTaskManager.DelaySuspendInfo */ interface DelaySuspendInfo { /** @@ -53,7 +53,7 @@ declare namespace backgroundTaskManager { * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @param requestId Indicates the identifier of the delay request. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskManager.cancelSuspendDelay + * @useinstead ohos.resourceschedule.backgroundTaskManager.cancelSuspendDelay */ function cancelSuspendDelay(requestId: number): void; @@ -65,7 +65,7 @@ declare namespace backgroundTaskManager { * @param requestId Indicates the identifier of the delay request. * @return The remaining delay time * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskManager.getRemainingDelayTime + * @useinstead ohos.resourceschedule.backgroundTaskManager.getRemainingDelayTime */ function getRemainingDelayTime(requestId: number, callback: AsyncCallback): void; function getRemainingDelayTime(requestId: number): Promise; @@ -79,7 +79,7 @@ declare namespace backgroundTaskManager { * @param callback The callback delay time expired. * @return Info of delay request * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskManager.requestSuspendDelay + * @useinstead ohos.resourceschedule.backgroundTaskManager.requestSuspendDelay */ function requestSuspendDelay(reason: string, callback: Callback): DelaySuspendInfo; @@ -94,7 +94,7 @@ declare namespace backgroundTaskManager { * @param bgMode Indicates which background mode to request. * @param wantAgent Indicates which ability to start when user click the notification bar. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskManager.startBackgroundRunning + * @useinstead ohos.resourceschedule.backgroundTaskManager.startBackgroundRunning */ function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback): void; function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise; @@ -106,7 +106,7 @@ declare namespace backgroundTaskManager { * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @param context app running context. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskManager.stopBackgroundRunning + * @useinstead ohos.resourceschedule.backgroundTaskManager.stopBackgroundRunning */ function stopBackgroundRunning(context: Context, callback: AsyncCallback): void; function stopBackgroundRunning(context: Context): Promise; @@ -119,7 +119,7 @@ declare namespace backgroundTaskManager { * @return True if efficiency resources apply success, else false. * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskManager.applyEfficiencyResources + * @useinstead ohos.resourceschedule.backgroundTaskManager.applyEfficiencyResources */ function applyEfficiencyResources(request: EfficiencyResourcesRequest): boolean; @@ -130,17 +130,17 @@ declare namespace backgroundTaskManager { * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskManager.resetAllEfficiencyResources + * @useinstead ohos.resourceschedule.backgroundTaskManager.resetAllEfficiencyResources */ function resetAllEfficiencyResources(): void; /** - * supported background mode. + * Supported background mode. * * @since 8 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskManager.BackgroundMode + * @useinstead ohos.resourceschedule.backgroundTaskManager.BackgroundMode */ export enum BackgroundMode { /** @@ -226,7 +226,7 @@ declare namespace backgroundTaskManager { * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskManager.ResourceType + * @useinstead ohos.resourceschedule.backgroundTaskManager.ResourceType */ export enum ResourceType { /** @@ -273,7 +273,7 @@ declare namespace backgroundTaskManager { * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.backgroundTaskManager.EfficiencyResourcesRequest + * @useinstead ohos.resourceschedule.backgroundTaskManager.EfficiencyResourcesRequest */ export interface EfficiencyResourcesRequest { /** diff --git a/api/@ohos.bundleState.d.ts b/api/@ohos.bundleState.d.ts index 21955d409d..e8fdaffd52 100644 --- a/api/@ohos.bundleState.d.ts +++ b/api/@ohos.bundleState.d.ts @@ -26,7 +26,7 @@ import { AsyncCallback , Callback} from './basic'; * * @since 7 * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics + * @useinstead ohos.resourceschedule.usageStatistics */ declare namespace bundleState { @@ -34,48 +34,48 @@ declare namespace bundleState { * @since 7 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.BundleStatsInfo + * @useinstead ohos.resourceschedule.usageStatistics.BundleStatsInfo */ interface BundleStateInfo { /** - * the identifier of BundleStateInfo. + * The identifier of BundleStateInfo. */ id: number; /** - * the total duration, in milliseconds. + * The total duration, in milliseconds. */ abilityInFgTotalTime?: number; /** - * the last time when the application was accessed, in milliseconds. + * The last time when the application was accessed, in milliseconds. */ abilityPrevAccessTime?: number; /** - * the last time when the application was visible in the foreground, in milliseconds. + * The last time when the application was visible in the foreground, in milliseconds. */ abilityPrevSeenTime?: number; /** - * the total duration, in milliseconds. + * The total duration, in milliseconds. */ abilitySeenTotalTime?: number; /** - * the bundle name of the application. + * The bundle name of the application. */ bundleName?: string; /** - * the total duration, in milliseconds. + * The total duration, in milliseconds. */ fgAbilityAccessTotalTime?: number; /** - * the last time when the foreground application was accessed, in milliseconds. + * The last time when the foreground application was accessed, in milliseconds. */ fgAbilityPrevAccessTime?: number; /** - * the time of the first bundle usage record in this {@code BundleActiveInfo} object, + * The time of the first bundle usage record in this {@code BundleActiveInfo} object, * in milliseconds. */ infosBeginTime?: number; /** - * the time of the last bundle usage record in this {@code BundleActiveInfo} object, + * The time of the last bundle usage record in this {@code BundleActiveInfo} object, * in milliseconds. */ infosEndTime?: number; @@ -87,7 +87,7 @@ declare namespace bundleState { * @since 7 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @param toMerge Indicates the {@link BundleActiveInfo} object to merge. - * if the bundle names of the two {@link BundleActiveInfo} objects are different. + * If the bundle names of the two {@link BundleActiveInfo} objects are different. */ merge(toMerge: BundleStateInfo): void; } @@ -97,27 +97,27 @@ declare namespace bundleState { * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.HapFormInfo + * @useinstead ohos.resourceschedule.usageStatistics.HapFormInfo */ interface BundleActiveFormInfo { /** - * the form name. + * The form name. */ formName: string; /** - * the form dimension. + * The form dimension. */ formDimension: number; /** - * the form id. + * The form id. */ formId: number; /** - * the last time when the form was accessed, in milliseconds.. + * The last time when the form was accessed, in milliseconds.. */ formLastUsedTime: number; /** - * the click count of module. + * The click count of module. */ count: number; } @@ -127,59 +127,59 @@ declare namespace bundleState { * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.HapModuleInfo + * @useinstead ohos.resourceschedule.usageStatistics.HapModuleInfo */ interface BundleActiveModuleInfo { /** - * the device id of module. + * The device id of module. */ deviceId?: string; /** - * the bundle name. + * The bundle name. */ bundleName: string; /** - * the module name. + * The module name. */ moduleName: string; /** - * the main ability name of module. + * The main ability name of module. */ abilityName?: string; /** - * the label id of application. + * The label id of application. */ appLabelId?: number; /** - * the label id of module. + * The label id of module. */ labelId?: number; /** - * the description id of application. + * The description id of application. */ descriptionId?: number; /** - * the ability id of main ability. + * The ability id of main ability. */ abilityLableId?: number; /** - * the description id of main ability. + * The description id of main ability. */ abilityDescriptionId?: number; /** - * the icon id of main ability. + * The icon id of main ability. */ abilityIconId?: number; /** - * the launch count of module. + * The launch count of module. */ launchedCount: number; /** - * the last time when the module was accessed, in milliseconds. + * The last time when the module was accessed, in milliseconds. */ lastModuleUsedTime: number; /** - * the form usage record list of current module. + * The form usage record list of current module. */ formRecords: Array; } @@ -189,21 +189,21 @@ declare namespace bundleState { * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.DeviceEventStats + * @useinstead ohos.resourceschedule.usageStatistics.DeviceEventStats */ interface BundleActiveEventState { /** - * the bundle name or system event name. + * The bundle name or system event name. */ name: string; /** - * the event id. + * The event id. */ eventId: number; /** - * the the event occurrence number. + * The the event occurrence number. */ count: number; } @@ -212,31 +212,31 @@ declare namespace bundleState { * @since 7 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.BundleEvents + * @useinstead ohos.resourceschedule.usageStatistics.BundleEvents */ interface BundleActiveState { /** - * the usage priority group of the application. + * The usage priority group of the application. */ appUsagePriorityGroup?: number; /** - * the bundle name. + * The bundle name. */ bundleName?: string; /** - * the shortcut ID. + * The shortcut ID. */ indexOfLink?: string; /** - * the class name. + * The class name. */ nameOfClass?: string; /** - * the time when this state occurred, in milliseconds. + * The time when this state occurred, in milliseconds. */ stateOccurredTime?: number; /** - * the state type. + * The state type. */ stateType?: number; } @@ -245,27 +245,27 @@ declare namespace bundleState { * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.AppGroupCallbackInfo + * @useinstead ohos.resourceschedule.usageStatistics.AppGroupCallbackInfo */ interface BundleActiveGroupCallbackInfo { /* - * the usage old group of the application + * The usage old group of the application */ appUsageOldGroup: number; /* - * the usage new group of the application + * The usage new group of the application */ appUsageNewGroup: number; /* - * the use id + * The use id */ userId: number; /* - * the change reason + * The change reason */ changeReason: number; /* - * the bundle name + * The bundle name */ bundleName: string; } @@ -280,7 +280,7 @@ declare namespace bundleState { * returns {@code false} otherwise. The time range of the particular period is defined by the system, * which may be hours or days. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.isIdleState + * @useinstead ohos.resourceschedule.usageStatistics.isIdleState */ function isIdleState(bundleName: string, callback: AsyncCallback): void; function isIdleState(bundleName: string): Promise; @@ -295,7 +295,7 @@ declare namespace bundleState { * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @return Returns the usage priority group of the calling application. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.queryAppGroup + * @useinstead ohos.resourceschedule.usageStatistics.queryAppGroup */ function queryAppUsagePriorityGroup(callback: AsyncCallback): void; function queryAppUsagePriorityGroup(): Promise; @@ -304,7 +304,7 @@ declare namespace bundleState { * @since 7 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.BundleStatsMap + * @useinstead ohos.resourceschedule.usageStatistics.BundleStatsMap */ interface BundleActiveInfoResponse { [key: string]: BundleStateInfo; @@ -323,7 +323,7 @@ declare namespace bundleState { * @param end Indicates the end time of the query period, in milliseconds. * @return Returns the {@link BundleActiveInfoResponse} objects containing the usage information about each bundle. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.queryBundleStatsInfos + * @useinstead ohos.resourceschedule.usageStatistics.queryBundleStatsInfos */ function queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback): void; function queryBundleStateInfos(begin: number, end: number): Promise; @@ -334,7 +334,7 @@ declare namespace bundleState { * @since 7 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.IntervalType + * @useinstead ohos.resourceschedule.usageStatistics.IntervalType */ export enum IntervalType { /** @@ -377,7 +377,7 @@ declare namespace bundleState { * @param end Indicates the end time of the query period, in milliseconds. * @return Returns the list of {@link BundleStateInfo} objects containing the usage information about each bundle. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.queryBundleStatsInfoByInterval + * @useinstead ohos.resourceschedule.usageStatistics.queryBundleStatsInfoByInterval */ function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback>): void; function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise>; @@ -393,7 +393,7 @@ declare namespace bundleState { * @param end Indicates the end time of the query period, in milliseconds. * @return Returns the list of {@link BundleActiveState} objects containing the state data of all bundles. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.queryBundleEvents + * @useinstead ohos.resourceschedule.usageStatistics.queryBundleEvents */ function queryBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void; function queryBundleActiveStates(begin: number, end: number): Promise>; @@ -407,7 +407,7 @@ declare namespace bundleState { * @param end Indicates the end time of the query period, in milliseconds. * @return Returns the {@link BundleActiveState} object Array containing the state data of the current bundle. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.queryCurrentBundleEvents + * @useinstead ohos.resourceschedule.usageStatistics.queryCurrentBundleEvents */ function queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void; function queryCurrentBundleActiveStates(begin: number, end: number): Promise>; @@ -422,7 +422,7 @@ declare namespace bundleState { * @param maxNum Indicates max record number in result, max value is 1000, default value is 1000. * @return Returns the {@link BundleActiveModuleInfo} object Array containing the usage data of the modules. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.queryModuleUsageRecords + * @useinstead ohos.resourceschedule.usageStatistics.queryModuleUsageRecords */ function getRecentlyUsedModules(maxNum?: number, callback: AsyncCallback>): void; function getRecentlyUsedModules(maxNum?: number): Promise>; @@ -440,7 +440,7 @@ declare namespace bundleState { * @param bundleName, name of the application. * @return Returns the usage priority group of the calling application. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.queryAppGroup + * @useinstead ohos.resourceschedule.usageStatistics.queryAppGroup */ function queryAppUsagePriorityGroup(bundleName? : string, callback: AsyncCallback): void; function queryAppUsagePriorityGroup(bundleName? : string): Promise; @@ -452,7 +452,7 @@ declare namespace bundleState { * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.GroupType + * @useinstead ohos.resourceschedule.usageStatistics.GroupType */ export enum GroupType { /** @@ -487,7 +487,7 @@ declare namespace bundleState { } /** - * set bundle group by bundleName and number. + * Set bundle group by bundleName and number. * * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup @@ -497,13 +497,13 @@ declare namespace bundleState { * @param newGroup,the group of the application whose name is bundleName. * @return Returns the result of setBundleGroup, true of false. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.setAppGroup + * @useinstead ohos.resourceschedule.usageStatistics.setAppGroup */ function setBundleGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void; function setBundleGroup(bundleName: string, newGroup: GroupType): Promise; /** - * register callback to service. + * Register callback to service. * * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup @@ -512,13 +512,13 @@ declare namespace bundleState { * @param Callback, callback when application group change,return the BundleActiveGroupCallbackInfo. * @return Returns BundleActiveGroupCallbackInfo when the group of bundle changed. the result of AsyncCallback is true or false. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.registerAppGroupCallBack + * @useinstead ohos.resourceschedule.usageStatistics.registerAppGroupCallBack */ function registerGroupCallBack(callback: Callback, callback: AsyncCallback): void; function registerGroupCallBack(callback: Callback): Promise; /** - * unRegister callback from service. + * UnRegister callback from service. * * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup @@ -526,7 +526,7 @@ declare namespace bundleState { * @systemapi Hide this for inner system use. * @return Returns the result of unRegisterGroupCallBack, true of false. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.unRegisterAppGroupCallBack + * @useinstead ohos.resourceschedule.usageStatistics.unRegisterAppGroupCallBack */ function unRegisterGroupCallBack(callback: AsyncCallback): void; function unRegisterGroupCallBack(): Promise; @@ -542,7 +542,7 @@ declare namespace bundleState { * @param end Indicates the end time of the query period, in milliseconds. * @return Returns the {@link BundleActiveEventState} object Array containing the event states data. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.queryDeviceEventStats + * @useinstead ohos.resourceschedule.usageStatistics.queryDeviceEventStats */ function queryBundleActiveEventStates(begin: number, end: number, callback: AsyncCallback>): void; function queryBundleActiveEventStates(begin: number, end: number): Promise>; @@ -558,7 +558,7 @@ declare namespace bundleState { * @param end Indicates the end time of the query period, in milliseconds. * @return Returns the {@link BundleActiveEventState} object Array containing the event states data. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.usageStatistics.queryNotificationEventStats + * @useinstead ohos.resourceschedule.usageStatistics.queryNotificationEventStats */ function queryAppNotificationNumber(begin: number, end: number, callback: AsyncCallback>): void; function queryAppNotificationNumber(begin: number, end: number): Promise>; diff --git a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts index 691aa18916..f30c451bcb 100644 --- a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts +++ b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts @@ -169,7 +169,7 @@ declare namespace backgroundTaskManager { function resetAllEfficiencyResources(): void; /** - * supported background mode. + * Supported background mode. * * @since 9 * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.ContinuousTask diff --git a/api/@ohos.resourceschedule.usageStatistics.d.ts b/api/@ohos.resourceschedule.usageStatistics.d.ts index a4b728dd83..ae28bf4377 100644 --- a/api/@ohos.resourceschedule.usageStatistics.d.ts +++ b/api/@ohos.resourceschedule.usageStatistics.d.ts @@ -35,44 +35,44 @@ declare namespace usageStatistics { */ interface BundleStatsInfo { /** - * the identifier of BundleStatsInfo. + * The identifier of BundleStatsInfo. */ id: number; /** - * the total duration, in milliseconds. + * The total duration, in milliseconds. */ abilityInFgTotalTime?: number; /** - * the last time when the application was accessed, in milliseconds. + * The last time when the application was accessed, in milliseconds. */ abilityPrevAccessTime?: number; /** - * the last time when the application was visible in the foreground, in milliseconds. + * The last time when the application was visible in the foreground, in milliseconds. */ abilityPrevSeenTime?: number; /** - * the total duration, in milliseconds. + * The total duration, in milliseconds. */ abilitySeenTotalTime?: number; /** - * the bundle name of the application. + * The bundle name of the application. */ bundleName?: string; /** - * the total duration, in milliseconds. + * The total duration, in milliseconds. */ fgAbilityAccessTotalTime?: number; /** - * the last time when the foreground application was accessed, in milliseconds. + * The last time when the foreground application was accessed, in milliseconds. */ fgAbilityPrevAccessTime?: number; /** - * the time of the first bundle usage record in this {@code BundleActiveInfo} object, + * The time of the first bundle usage record in this {@code BundleActiveInfo} object, * in milliseconds. */ infosBeginTime?: number; /** - * the time of the last bundle usage record in this {@code BundleActiveInfo} object, + * The time of the last bundle usage record in this {@code BundleActiveInfo} object, * in milliseconds. */ infosEndTime?: number; @@ -85,23 +85,23 @@ declare namespace usageStatistics { */ interface HapFormInfo { /** - * the form name. + * The form name. */ formName: string; /** - * the form dimension. + * The form dimension. */ formDimension: number; /** - * the form id. + * The form id. */ formId: number; /** - * the last time when the form was accessed, in milliseconds.. + * The last time when the form was accessed, in milliseconds.. */ formLastUsedTime: number; /** - * the click count of module. + * The click count of module. */ count: number; } @@ -113,55 +113,55 @@ declare namespace usageStatistics { */ interface HapModuleInfo { /** - * the device id of module. + * The device id of module. */ deviceId?: string; /** - * the bundle name. + * The bundle name. */ bundleName: string; /** - * the module name. + * The module name. */ moduleName: string; /** - * the main ability name of module. + * The main ability name of module. */ abilityName?: string; /** - * the label id of application. + * The label id of application. */ appLabelId?: number; /** - * the label id of module. + * The label id of module. */ labelId?: number; /** - * the description id of application. + * The description id of application. */ descriptionId?: number; /** - * the ability id of main ability. + * The ability id of main ability. */ abilityLableId?: number; /** - * the description id of main ability. + * The description id of main ability. */ abilityDescriptionId?: number; /** - * the icon id of main ability. + * The icon id of main ability. */ abilityIconId?: number; /** - * the launch count of module. + * The launch count of module. */ launchedCount: number; /** - * the last time when the module was accessed, in milliseconds. + * The last time when the module was accessed, in milliseconds. */ lastModuleUsedTime: number; /** - * the form usage record list of current module. + * The form usage record list of current module. */ formRecords: Array; } @@ -173,17 +173,17 @@ declare namespace usageStatistics { */ interface DeviceEventStats { /** - * the bundle name or system event name. + * The bundle name or system event name. */ name: string; /** - * the event id. + * The event id. */ eventId: number; /** - * the the event occurrence number. + * The the event occurrence number. */ count: number; } @@ -194,27 +194,27 @@ declare namespace usageStatistics { */ interface BundleEvents { /** - * the usage group of the application. + * The usage group of the application. */ appGroup?: number; /** - * the bundle name. + * The bundle name. */ bundleName?: string; /** - * the shortcut ID. + * The shortcut ID. */ indexOfLink?: string; /** - * the class name. + * The class name. */ nameOfClass?: string; /** - * the time when this state occurred, in milliseconds. + * The time when this state occurred, in milliseconds. */ eventOccurredTime?: number; /** - * the event id. + * The event id. */ eventId?: number; } @@ -225,23 +225,23 @@ declare namespace usageStatistics { */ interface AppGroupCallbackInfo { /* - * the usage old group of the application + * The usage old group of the application */ appOldGroup: number; /* - * the usage new group of the application + * The usage new group of the application */ appNewGroup: number; /* - * the use id + * The use id */ userId: number; /* - * the change reason + * The change reason */ changeReason: number; /* - * the bundle name + * The bundle name */ bundleName: string; } @@ -537,7 +537,7 @@ declare namespace usageStatistics { } /** - * set app group by bundleName and number. + * Set app group by bundleName and number. * * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup @@ -559,7 +559,7 @@ declare namespace usageStatistics { function setAppGroup(bundleName: string, newGroup: GroupType): Promise; /** - * register callback to service. + * Register callback to service. * * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup @@ -580,7 +580,7 @@ declare namespace usageStatistics { function registerAppGroupCallBack(groupCallback: Callback): Promise; /** - * unRegister callback from service. + * UnRegister callback from service. * * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup diff --git a/api/@ohos.workScheduler.d.ts b/api/@ohos.workScheduler.d.ts index 483729668e..65a4879961 100644 --- a/api/@ohos.workScheduler.d.ts +++ b/api/@ohos.workScheduler.d.ts @@ -22,7 +22,7 @@ import {AsyncCallback} from './basic'; * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly * @deprecated since 9 - * @useinstead @ohos.resourceschedule.workScheduler + * @useinstead ohos.resourceschedule.workScheduler */ declare namespace workScheduler { /** @@ -33,7 +33,7 @@ declare namespace workScheduler { * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly * @deprecated since 9 - * @useinstead @ohos.resourceschedule.workScheduler.WorkInfo + * @useinstead ohos.resourceschedule.workScheduler.WorkInfo */ export interface WorkInfo { /** @@ -112,7 +112,7 @@ declare namespace workScheduler { * @param work The info of work. * @return true if success, otherwise false. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.workScheduler.startWork + * @useinstead ohos.resourceschedule.workScheduler.startWork */ function startWork(work: WorkInfo): boolean; @@ -126,7 +126,7 @@ declare namespace workScheduler { * @param needCancel True if need to be canceled after being stopped, otherwise false. * @return true if success, otherwise false. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.workScheduler.stopWork + * @useinstead ohos.resourceschedule.workScheduler.stopWork */ function stopWork(work: WorkInfo, needCancel?: boolean): boolean; @@ -138,7 +138,7 @@ declare namespace workScheduler { * @StageModelOnly * @param workId The id of work. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.workScheduler.getWorkStatus + * @useinstead ohos.resourceschedule.workScheduler.getWorkStatus */ function getWorkStatus(workId: number, callback: AsyncCallback): void; function getWorkStatus(workId: number): Promise; @@ -151,7 +151,7 @@ declare namespace workScheduler { * @StageModelOnly * @return the work info list. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.workScheduler.obtainAllWorks + * @useinstead ohos.resourceschedule.workScheduler.obtainAllWorks */ function obtainAllWorks(callback: AsyncCallback): Array; function obtainAllWorks(): Promise>; @@ -164,7 +164,7 @@ declare namespace workScheduler { * @StageModelOnly * @return true if success, otherwise false. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.workScheduler.stopAndClearWorks + * @useinstead ohos.resourceschedule.workScheduler.stopAndClearWorks */ function stopAndClearWorks(): boolean; @@ -177,7 +177,7 @@ declare namespace workScheduler { * @param workId The id of work. * @return true if last work running is timeout, otherwise false. * @deprecated since 9 - * @useinstead @ohos.resourceschedule.workScheduler.isLastWorkTimeOut + * @useinstead ohos.resourceschedule.workScheduler.isLastWorkTimeOut */ function isLastWorkTimeOut(workId: number, callback: AsyncCallback): boolean; function isLastWorkTimeOut(workId: number): Promise; @@ -190,7 +190,7 @@ declare namespace workScheduler { * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly * @deprecated since 9 - * @useinstead @ohos.resourceschedule.workScheduler.NetworkType + * @useinstead ohos.resourceschedule.workScheduler.NetworkType */ export enum NetworkType { /** @@ -227,7 +227,7 @@ declare namespace workScheduler { * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly * @deprecated since 9 - * @useinstead @ohos.resourceschedule.workScheduler.ChargingType + * @useinstead ohos.resourceschedule.workScheduler.ChargingType */ export enum ChargingType { /** @@ -256,7 +256,7 @@ declare namespace workScheduler { * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly * @deprecated since 9 - * @useinstead @ohos.resourceschedule.workScheduler.BatteryStatus + * @useinstead ohos.resourceschedule.workScheduler.BatteryStatus */ export enum BatteryStatus { /** @@ -281,7 +281,7 @@ declare namespace workScheduler { * @syscap SystemCapability.ResourceSchedule.WorkScheduler * @StageModelOnly * @deprecated since 9 - * @useinstead @ohos.resourceschedule.workScheduler.StorageRequest + * @useinstead ohos.resourceschedule.workScheduler.StorageRequest */ export enum StorageRequest { /** -- Gitee From e7387edac785206a5804341d9e1dd0c37793815a Mon Sep 17 00:00:00 2001 From: yichengzhao Date: Fri, 30 Sep 2022 12:56:19 +0800 Subject: [PATCH 124/438] errorcode for accessibility Signed-off-by: yichengzhao Change-Id: I3402b21a833ae02b28cefb73146462ed7f2a5498 --- api/@ohos.accessibility.config.d.ts | 24 ++++-- api/@ohos.accessibility.d.ts | 73 ++++++++++++++----- .../AccessibilityExtensionContext.d.ts | 19 ++++- 3 files changed, 87 insertions(+), 29 deletions(-) diff --git a/api/@ohos.accessibility.config.d.ts b/api/@ohos.accessibility.config.d.ts index 2dfac6d56a..690c702cff 100644 --- a/api/@ohos.accessibility.config.d.ts +++ b/api/@ohos.accessibility.config.d.ts @@ -77,6 +77,10 @@ declare namespace config { * Enable the accessibility extension ability. * @param name Indicates the accessibility extension name, in "bundleName/abilityName" format. * @param capability Indicates the ability. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300001 - Invalid bundle name or ability name. + * @throws { BusinessError } 9300002 - Target ability already enabled. */ function enableAbility(name: string, capability: Array): Promise; function enableAbility(name: string, capability: Array, callback: AsyncCallback): void; @@ -84,23 +88,28 @@ declare namespace config { /** * Disable the accessibility extension ability. * @param name Indicates the accessibility extension name, in "bundleName/abilityName" format. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300001 - Invalid bundle name or ability name. */ function disableAbility(name: string): Promise; function disableAbility(name: string, callback: AsyncCallback): void; /** * Register the listener that watches for changes in the enabled status of accessibility extensions. - * @param type Indicates the enableAbilityListsStateChanged type. + * @param type Indicates the type of event. * @param callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. */ - function on(type: 'enableAbilityListsStateChanged', callback: Callback): void; + function on(type: 'enabledAccessibilityExtensionListChange', callback: Callback): void; /** - * Deregister listener that watches for changes in the enabled status of accessibility extensions. - * @param type Indicates the enableAbilityListsStateChanged type. + * Unregister listener that watches for changes in the enabled status of accessibility extensions. + * @param type Indicates the type of event. * @param callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. */ - function off(type: 'enableAbilityListsStateChanged', callback?: Callback): void; + function off(type: 'enabledAccessibilityExtensionListChange', callback?: Callback): void; /** * Indicates setting, getting, and listening to changes in configuration. @@ -109,6 +118,8 @@ declare namespace config { /** * Setting configuration value. * @param value Indicates the value. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Input parameter error. */ set(value: T): Promise; set(value: T, callback: AsyncCallback): void; @@ -122,11 +133,12 @@ declare namespace config { /** * Register the listener to listen for configuration changes. * @param callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. */ on(callback: Callback): void; /** - * Deregister the listener to listen for configuration changes. + * Unregister the listener to listen for configuration changes. * @param callback Indicates the listener. */ off(callback?: Callback): void; diff --git a/api/@ohos.accessibility.d.ts b/api/@ohos.accessibility.d.ts index 50f45c0251..8b5b372e0a 100644 --- a/api/@ohos.accessibility.d.ts +++ b/api/@ohos.accessibility.d.ts @@ -24,13 +24,19 @@ import { Callback } from './basic'; * @import basic,abilityInfo */ declare namespace accessibility { - /** * The type of the Ability app. + * @type { 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual' } * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ - type AbilityType = 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual'; + /** + * The type of the Ability app. + * @type { 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual' | 'all' } + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + type AbilityType = 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual' | 'all'; /** * The action that the ability can execute. @@ -98,7 +104,7 @@ declare namespace accessibility { * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns {@code true} if the accessibility is enabled; returns {@code false} otherwise. - */ + */ function isOpenAccessibility(callback: AsyncCallback): void; function isOpenAccessibility(): Promise; @@ -108,7 +114,7 @@ declare namespace accessibility { * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Vision * @return Returns {@code true} if the touch browser is enabled; returns {@code false} otherwise. - */ + */ function isOpenTouchGuide(callback: AsyncCallback): void; function isOpenTouchGuide(): Promise; @@ -119,24 +125,26 @@ declare namespace accessibility { * @param stateType The state of the accessibility ability. {@code AbilityState} eg.installed * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns the list of abilityInfos. - */ + * @deprecated since 9 + * @useinstead ohos.accessibility#getAccessibilityExtensionList + */ function getAbilityLists(abilityType: AbilityType, stateType: AbilityState, callback: AsyncCallback>): void; function getAbilityLists(abilityType: AbilityType, stateType: AbilityState): Promise>; + /** * Queries the list of accessibility abilities. * @since 9 - * @param abilityType The all type of the accessibility ability. + * @param abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken * @param stateType The state of the accessibility ability. {@code AbilityState} eg.installed * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns the list of abilityInfos. - */ - function getAbilityLists(abilityType: 'all', stateType: AbilityState, - callback: AsyncCallback>): void; - function getAbilityLists(abilityType: 'all', - stateType: AbilityState): Promise>; + * @throws { BusinessError } 401 - Input parameter error. + */ + function getAccessibilityExtensionList(abilityType: AbilityType, stateType: AbilityState): Promise>; + function getAccessibilityExtensionList(abilityType: AbilityType, stateType: AbilityState, callback: AsyncCallback>): void; /** * Send accessibility Event. @@ -145,46 +153,64 @@ declare namespace accessibility { * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns {@code true} if success ; returns {@code false} otherwise. + * @deprecated since 9 + * @useinstead ohos.accessibility#sendAccessibilityEvent */ function sendEvent(event: EventInfo, callback: AsyncCallback): void; function sendEvent(event: EventInfo): Promise; /** - * Register the observe of the accessibility state changed. + * Send accessibility event. + * @since 9 + * @param event The object of the accessibility {@code EventInfo} . + * @param callback Asynchronous callback interface. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @return Returns {@code true} if success ; returns {@code false} otherwise. + * @throws { BusinessError } 401 - Input parameter error. + */ + function sendAccessibilityEvent(event: EventInfo, callback: AsyncCallback): void; + function sendAccessibilityEvent(event: EventInfo): Promise; + + /** + * Register the observer of the accessibility state changed. * @since 7 * @param type state event type. * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns {@code true} if the register is success ; returns {@code false} otherwise. + * @throws { BusinessError } 401 - Input parameter error. */ function on(type: 'accessibilityStateChange', callback: Callback): void; /** - * Register the observe of the touchGuide state changed. + * Register the observer of the touchGuide state changed. * @since 7 * @param type state event type. * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Vision * @return Returns {@code true} if the register is success ; returns {@code false} otherwise. + * @throws { BusinessError } 401 - Input parameter error. */ function on(type: 'touchGuideStateChange', callback: Callback): void; /** - * Deregister the observe of the accessibility state changed. + * Unregister the observer of the accessibility state changed. * @since 7 * @param type state event type * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @return Returns {@code true} if the deregister is success ; returns {@code false} otherwise. + * @return Returns {@code true} if the Unregister is success ; returns {@code false} otherwise. + * @throws { BusinessError } 401 - Input parameter error. */ function off(type: 'accessibilityStateChange', callback?: Callback): void; /** - * Deregister the observe of the touchGuide state changed. + * Unregister the observer of the touchGuide state changed. * @since 7 * @param type state event type * @param callback Asynchronous callback interface. - * @return Returns {@code true} if the deregister is success ; returns {@code false} otherwise. + * @return Returns {@code true} if the Unregister is success ; returns {@code false} otherwise. + * @throws { BusinessError } 401 - Input parameter error. */ function off(type: 'touchGuideStateChange', callback?: Callback): void; @@ -212,19 +238,26 @@ declare namespace accessibility { style: CaptionsStyle; /** - * Register the observe of the enable state. + * Register the observer of the enable state. + * @throws { BusinessError } 401 - Input parameter error. */ on(type: 'enableChange', callback: Callback): void; + /** * Register the observer of the style. + * @throws { BusinessError } 401 - Input parameter error. */ on(type: 'styleChange', callback: Callback): void; + /** - * Deregister the observe of the enable state. + * Unregister the observer of the enable state. + * @throws { BusinessError } 401 - Input parameter error. */ off(type: 'enableChange', callback?: Callback): void; + /** - * Deregister the observer of the style. + * Unregister the observer of the style. + * @throws { BusinessError } 401 - Input parameter error. */ off(type: 'styleChange', callback?: Callback): void; } diff --git a/api/application/AccessibilityExtensionContext.d.ts b/api/application/AccessibilityExtensionContext.d.ts index 1352248818..dfe285fcab 100644 --- a/api/application/AccessibilityExtensionContext.d.ts +++ b/api/application/AccessibilityExtensionContext.d.ts @@ -28,6 +28,7 @@ export default class AccessibilityExtensionContext extends ExtensionContext { /** * Set the name of the bundle name that is interested in sending the event. * @param targetNames + * @throws { BusinessError } 401 - Input parameter error. */ setTargetBundleName(targetNames: Array): Promise; setTargetBundleName(targetNames: Array, callback: AsyncCallback): void; @@ -35,6 +36,7 @@ export default class AccessibilityExtensionContext extends ExtensionContext { /** * Get focus element. * @param isAccessibilityFocus Indicates whether the acquired element has an accessibility focus. + * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. */ getFocusElement(isAccessibilityFocus?: boolean): Promise; getFocusElement(callback: AsyncCallback): void; @@ -43,6 +45,7 @@ export default class AccessibilityExtensionContext extends ExtensionContext { /** * Get window root element. * @param windowId Indicates the window ID. + * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. */ getWindowRootElement(windowId?: number): Promise; getWindowRootElement(callback: AsyncCallback): void; @@ -51,6 +54,7 @@ export default class AccessibilityExtensionContext extends ExtensionContext { /** * Get window list. * @param displayId Indicates the display ID. + * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. */ getWindows(displayId?: number): Promise>; getWindows(callback: AsyncCallback>): void; @@ -59,6 +63,8 @@ export default class AccessibilityExtensionContext extends ExtensionContext { /** * Inject gesture path events. * @param gesturePath Indicates the gesture path. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. */ injectGesture(gesturePath: GesturePath): Promise; injectGesture(gesturePath: GesturePath, callback: AsyncCallback): void; @@ -81,6 +87,8 @@ declare interface AccessibilityElement { /** * Get the value of an attribute. * @param attributeName Indicates the attribute name. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300004 - This property does not exist. */ attributeValue(attributeName: T): Promise; attributeValue(attributeName: T, @@ -96,15 +104,18 @@ declare interface AccessibilityElement { * Perform the specified action. * @param actionName Indicates the action name. * @param parameters Indicates the parameters needed to execute the action. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300005 - This action is not supported. */ - performAction(actionName: string, parameters?: object): Promise; - performAction(actionName: string, callback: AsyncCallback): void; - performAction(actionName: string, parameters: object, callback: AsyncCallback): void; + performAction(actionName: string, parameters?: object): Promise; + performAction(actionName: string, callback: AsyncCallback): void; + performAction(actionName: string, parameters: object, callback: AsyncCallback): void; /** * Find elements that match the condition. * @param type The type of query condition is content. * @param condition Indicates the specific content to be queried. + * @throws { BusinessError } 401 - Input parameter error. */ findElement(type: 'content', condition: string): Promise>; findElement(type: 'content', condition: string, callback: AsyncCallback>): void @@ -113,6 +124,7 @@ declare interface AccessibilityElement { * Find elements that match the condition. * @param type The type of query condition is focus type. * @param condition Indicates the type of focus to query. + * @throws { BusinessError } 401 - Input parameter error. */ findElement(type: 'focusType', condition: FocusType): Promise; findElement(type: 'focusType', condition: FocusType, callback: AsyncCallback): void @@ -121,6 +133,7 @@ declare interface AccessibilityElement { * Find elements that match the condition. * @param type The type of query condition is focus direction. * @param condition Indicates the direction of search focus to query. + * @throws { BusinessError } 401 - Input parameter error. */ findElement(type: 'focusDirection', condition: FocusDirection): Promise; findElement(type: 'focusDirection', condition: FocusDirection, callback: AsyncCallback): void -- Gitee From 287e8f6a6ee2bfd8aad700d6f4582daedf976a5d Mon Sep 17 00:00:00 2001 From: xuyong Date: Mon, 17 Oct 2022 17:46:45 +0800 Subject: [PATCH 125/438] =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E7=9A=84=E9=94=99=E8=AF=AF=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuyong --- api/@ohos.hiSysEvent.d.ts | 44 +++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/api/@ohos.hiSysEvent.d.ts b/api/@ohos.hiSysEvent.d.ts index 495c1362b4..ec97d25b51 100644 --- a/api/@ohos.hiSysEvent.d.ts +++ b/api/@ohos.hiSysEvent.d.ts @@ -110,15 +110,15 @@ declare namespace hiSysEvent { * @static * @param {SysEventInfo} info system event information to be written. * @param {AsyncCallback} [callback] callback function. - * @throws {BusinessError} 401 - argument is invalid - * @throws {BusinessError} 11200001 - domain is invalid - * @throws {BusinessError} 11200002 - event name is invalid - * @throws {BusinessError} 11200003 - environment is abnormal - * @throws {BusinessError} 11200004 - size of event content is over limit - * @throws {BusinessError} 11200051 - name of param is invalid - * @throws {BusinessError} 11200052 - size of string type param is over limit - * @throws {BusinessError} 11200053 - count of params is over limit - * @throws {BusinessError} 11200054 - size of array type param is over limit + * @throws {BusinessError} 401 - Invalid argument. + * @throws {BusinessError} 11200001 - Invalid event domain. + * @throws {BusinessError} 11200002 - Invalid event name. + * @throws {BusinessError} 11200003 - Abnormal environment. + * @throws {BusinessError} 11200004 - Length of the event is over limit. + * @throws {BusinessError} 11200051 - Invalid event parameter. + * @throws {BusinessError} 11200052 - Size of the event parameter of the string type is over limit. + * @throws {BusinessError} 11200053 - Count of event parameters is over limit. + * @throws {BusinessError} 11200054 - Count of event parameter of the array type is over limit. * @return {void | Promise} no callback return Promise otherwise return void. * @since 9 */ @@ -311,10 +311,10 @@ declare namespace hiSysEvent { * @systemapi hide for inner use * @permission ohos.permission.READ_DFX_SYSEVENT * @param {Watcher} watcher watch system event - * @throws {BusinessError} 201 - has no permission - * @throws {BusinessError} 401 - argument is invalid - * @throws {BusinessError} 11200101 - count of watchers is over limit - * @throws {BusinessError} 11200102 - count of watch rules is over limit + * @throws {BusinessError} 201 - Permission denied. An attempt was made to read system event forbidden by permission: ohos.permission.READ_DFX_SYSEVENT. + * @throws {BusinessError} 401 - Invalid argument. + * @throws {BusinessError} 11200101 - Count of watchers is over limit. + * @throws {BusinessError} 11200102 - Count of watch rules is over limit. * @return {void} return void. * @since 9 */ @@ -327,9 +327,9 @@ declare namespace hiSysEvent { * @systemapi hide for inner use * @permission ohos.permission.READ_DFX_SYSEVENT * @param {Watcher} watcher watch system event - * @throws {BusinessError} 201 - has no permission - * @throws {BusinessError} 401 - argument is invalid - * @throws {BusinessError} 11200201 - watcher is not exist + * @throws {BusinessError} 201 - Permission denied. An attempt was made to read system event forbidden by permission: ohos.permission.READ_DFX_SYSEVENT. + * @throws {BusinessError} 401 - Invalid argument. + * @throws {BusinessError} 11200201 - The watcher does not exist. * @return {void} return void. * @since 9 */ @@ -344,12 +344,12 @@ declare namespace hiSysEvent { * @param {QueryArg} queryArg common arguments of query system event * @param {QueryRule[]} rules rule of query system event * @param {Querier} querier receive query result - * @throws {BusinessError} 201 - has no permission - * @throws {BusinessError} 401 - argument is invalid - * @throws {BusinessError} 11200301 - count of query rules is over limit - * @throws {BusinessError} 11200302 - query rule is invalid - * @throws {BusinessError} 11200303 - count of concurrent queries is over limit - * @throws {BusinessError} 11200304 - frequency of event query is over limit + * @throws {BusinessError} 201 - Permission denied. An attempt was made to read system event forbidden by permission: ohos.permission.READ_DFX_SYSEVENT. + * @throws {BusinessError} 401 - Invalid argument. + * @throws {BusinessError} 11200301 - Count of query rules is over limit. + * @throws {BusinessError} 11200302 - Invalid query rule. + * @throws {BusinessError} 11200303 - Count of concurrent queriers is over limit. + * @throws {BusinessError} 11200304 - Query frequency is over limit. * @return {void} return void. * @since 9 */ -- Gitee From ed22a346992da99d363006c1eb8c764642211559 Mon Sep 17 00:00:00 2001 From: LeiiYB Date: Mon, 17 Oct 2022 10:53:05 +0000 Subject: [PATCH 126/438] update api/@ohos.multimedia.avsession.d.ts. Signed-off-by: LeiiYB --- api/@ohos.multimedia.avsession.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/@ohos.multimedia.avsession.d.ts b/api/@ohos.multimedia.avsession.d.ts index 4ff22ea600..5e536a8e30 100644 --- a/api/@ohos.multimedia.avsession.d.ts +++ b/api/@ohos.multimedia.avsession.d.ts @@ -99,17 +99,17 @@ declare namespace avSession { */ interface SessionToken { /** - * session id + * The unique session id of the avsession object * @since 9 */ sessionId: string; /** - * process id + * Process id of session * @since 9 */ pid: number; /** - * user id + * User id * @since 9 */ uid: number; @@ -541,7 +541,7 @@ declare namespace avSession { } /** - * Playback position defination + * Playback position definition * @interface PlaybackPosition * @syscap SystemCapability.Multimedia.AVSession.Core * @since 9 @@ -932,7 +932,7 @@ declare namespace avSession { 'seek' | 'setSpeed' | 'setLoopMode' | 'toggleFavorite'; /** - * The defination of command to be send to the session + * The definition of command to be sent to the session * @interface AVControlCommand * @syscap SystemCapability.Multimedia.AVSession.Core * @since 9 -- Gitee From ee9f286153cd7b2e18ab2bfbe661caae0ff206b9 Mon Sep 17 00:00:00 2001 From: chengjinsong2 Date: Mon, 17 Oct 2022 03:56:29 -0700 Subject: [PATCH 127/438] =?UTF-8?q?serial=20=E5=92=8C=20udid=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chengjinsong2 --- api/@ohos.deviceInfo.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/@ohos.deviceInfo.d.ts b/api/@ohos.deviceInfo.d.ts index 6c1f0bea32..55067063a7 100644 --- a/api/@ohos.deviceInfo.d.ts +++ b/api/@ohos.deviceInfo.d.ts @@ -87,6 +87,7 @@ declare namespace deviceInfo { /** * Obtains the device serial number represented by a string. + * @permission ohos.permission.sec.ACCESS_UDID * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ @@ -234,6 +235,7 @@ declare namespace deviceInfo { const buildRootHash: string; /** * Obtains the device udid. + * @permission ohos.permission.sec.ACCESS_UDID * @syscap SystemCapability.Startup.SystemInfo * @since 7 */ -- Gitee From 8a305b252b2814a74dbd086345e811e1366c8625 Mon Sep 17 00:00:00 2001 From: herunlei Date: Mon, 17 Oct 2022 21:01:22 +0800 Subject: [PATCH 128/438] add permissions converter Signed-off-by: herunlei --- build-tools/.gitignore | 5 + .../.vscode/settings.json | 3 + build-tools/permissions_converter/convert.js | 111 ++++++++++++++++++ .../permissions_converter/package.json | 6 + 4 files changed, 125 insertions(+) create mode 100644 build-tools/.gitignore create mode 100644 build-tools/permissions_converter/.vscode/settings.json create mode 100644 build-tools/permissions_converter/convert.js create mode 100644 build-tools/permissions_converter/package.json diff --git a/build-tools/.gitignore b/build-tools/.gitignore new file mode 100644 index 0000000000..788432e197 --- /dev/null +++ b/build-tools/.gitignore @@ -0,0 +1,5 @@ +**/node_modules/** +**/package-lock.json +**/.editorconfig +**/.prettierrc +api/ diff --git a/build-tools/permissions_converter/.vscode/settings.json b/build-tools/permissions_converter/.vscode/settings.json new file mode 100644 index 0000000000..51dc924211 --- /dev/null +++ b/build-tools/permissions_converter/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "editor.suggest.snippetsPreventQuickSuggestions": false +} diff --git a/build-tools/permissions_converter/convert.js b/build-tools/permissions_converter/convert.js new file mode 100644 index 0000000000..31af90f3d5 --- /dev/null +++ b/build-tools/permissions_converter/convert.js @@ -0,0 +1,111 @@ +/* + * 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. + */ + +const fs = require('fs'); + +const copyRight = `/* + * 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. + */\n\n`; +const typeHead = 'export type Permissions =\n'; +const typeTail = ';'; +const tab = ' '; +const tabs = tab.repeat(2); +const tabzz = tab.repeat(3); +const commentHead = `${tabs}/**\n`; +const commentBody = `${tabzz}* `; +const commentTail = `${tabzz}*/\n`; +const sinceTag = '@since '; +const deprecatedTag = '@deprecated '; +const orOperator = `${tabs}|${tab}`; + +const getPermissions = downloadPath => { + try { + const content = fs.readFileSync(downloadPath, { encoding: 'utf8' }); + const configMap = JSON.parse(decodeURIComponent(content)); + if (configMap.module.definePermissions) { + return configMap.module.definePermissions; + } + } catch (error) { + console.error('Convert json file to object failed'); + } + return undefined; +}; + +const convertJsonToDTS = (permissions, outputFilePath) => { + if (fs.existsSync(outputFilePath)) { + fs.rmSync(outputFilePath, { recursive: true, force: true }); + } + fs.appendFileSync(outputFilePath, copyRight, 'utf8'); + fs.appendFileSync(outputFilePath, typeHead, 'utf8'); + permissions.forEach((permission, index) => { + if (permission.since || permission.deprecated) { + fs.appendFileSync(outputFilePath, commentHead, 'utf8'); + if (permission.since) { + const since = `${commentBody}${sinceTag}${permission.since}\n`; + fs.appendFileSync(outputFilePath, since, 'utf8'); + } + if (permission.deprecated) { + const deprecated = `${commentBody}${deprecatedTag}${permission.deprecated}\n`; + fs.appendFileSync(outputFilePath, deprecated, 'utf8'); + } + fs.appendFileSync(outputFilePath, commentTail, 'utf8'); + } + const permissionName = `${index === 0 ? tabs : orOperator}'${permission.name}'${ + index === permissions.length - 1 ? '' : '\n' + }`; + fs.appendFileSync(outputFilePath, permissionName, 'utf8'); + }); + fs.appendFileSync(outputFilePath, typeTail, 'utf8'); + console.log('Convert config.json definePermissions to permissions.d.ts successfully'); +}; + +/** + * Read config.json file and convert it to permission.d.ts + * + * @param { + * filePath: name of downloaded config.json file + * outputFileName: name of converted d.ts file name + * } options + */ +const convert = options => { + const permissions = getPermissions(options.filePath); + if (permissions) { + convertJsonToDTS(permissions, options.outputFilePath); + } else { + console.error('Config file does not have definePermissions property'); + } +}; + +const arguments = process.argv; +const options = { + filePath: arguments[2], + outputFilePath: arguments[3], +}; +try { + convert(options); +} catch (error) { + console.error(`ERROR FOR CONVERTING PERMISSION: ${error}`); +} diff --git a/build-tools/permissions_converter/package.json b/build-tools/permissions_converter/package.json new file mode 100644 index 0000000000..a0dec26bd5 --- /dev/null +++ b/build-tools/permissions_converter/package.json @@ -0,0 +1,6 @@ +{ + "name": "permissions", + "version": "1.0.0", + "description": "", + "main": "./convert.js" +} -- Gitee From 843e6873c37f3c08f8937bdfc6570cdba7296b91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E6=80=A1?= Date: Mon, 17 Oct 2022 13:04:34 +0000 Subject: [PATCH 129/438] bugfix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱天怡 --- api/@ohos.resourceschedule.usageStatistics.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/@ohos.resourceschedule.usageStatistics.d.ts b/api/@ohos.resourceschedule.usageStatistics.d.ts index ae28bf4377..04bf7a289a 100644 --- a/api/@ohos.resourceschedule.usageStatistics.d.ts +++ b/api/@ohos.resourceschedule.usageStatistics.d.ts @@ -580,7 +580,7 @@ declare namespace usageStatistics { function registerAppGroupCallBack(groupCallback: Callback): Promise; /** - * UnRegister callback from service. + * Unregister callback from service. * * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup @@ -595,8 +595,8 @@ declare namespace usageStatistics { * @throws { BusinessError } 10000004 - IPC Communication failed. * @throws { BusinessError } 10100001 - Application group operation repeated. */ - function unRegisterAppGroupCallBack(callback: AsyncCallback): void; - function unRegisterAppGroupCallBack(): Promise; + function unregisterAppGroupCallBack(callback: AsyncCallback): void; + function unregisterAppGroupCallBack(): Promise; /** * Queries device event states data within a specified period identified by the start and end time. -- Gitee From efdb690207c11575c7a0f921d1e5ec5269b834c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E6=80=A1?= Date: Mon, 17 Oct 2022 13:06:59 +0000 Subject: [PATCH 130/438] bugfix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱天怡 --- api/@ohos.bundleState.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/@ohos.bundleState.d.ts b/api/@ohos.bundleState.d.ts index e8fdaffd52..8f04b96192 100644 --- a/api/@ohos.bundleState.d.ts +++ b/api/@ohos.bundleState.d.ts @@ -518,18 +518,18 @@ declare namespace bundleState { function registerGroupCallBack(callback: Callback): Promise; /** - * UnRegister callback from service. + * Unregister callback from service. * * @since 9 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup * @permission ohos.permission.BUNDLE_ACTIVE_INFO * @systemapi Hide this for inner system use. - * @return Returns the result of unRegisterGroupCallBack, true of false. + * @return Returns the result of unregisterGroupCallBack, true of false. * @deprecated since 9 - * @useinstead ohos.resourceschedule.usageStatistics.unRegisterAppGroupCallBack + * @useinstead ohos.resourceschedule.usageStatistics.unregisterAppGroupCallBack */ - function unRegisterGroupCallBack(callback: AsyncCallback): void; - function unRegisterGroupCallBack(): Promise; + function unregisterGroupCallBack(callback: AsyncCallback): void; + function unregisterGroupCallBack(): Promise; /* * Queries system event states data within a specified period identified by the start and end time. -- Gitee From 4727c0412599fc978be554964e23ba7933b8bcb2 Mon Sep 17 00:00:00 2001 From: LeiiYB Date: Mon, 17 Oct 2022 13:09:24 +0000 Subject: [PATCH 131/438] update api/@ohos.multimedia.avsession.d.ts. Signed-off-by: LeiiYB --- api/@ohos.multimedia.avsession.d.ts | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/api/@ohos.multimedia.avsession.d.ts b/api/@ohos.multimedia.avsession.d.ts index 5e536a8e30..ef501b18ea 100644 --- a/api/@ohos.multimedia.avsession.d.ts +++ b/api/@ohos.multimedia.avsession.d.ts @@ -228,19 +228,6 @@ declare namespace avSession { setLaunchAbility(ability: WantAgent, callback: AsyncCallback): void; setLaunchAbility(ability: WantAgent): Promise; - /** - * Set audio stream id. Identifies the audio streams controlled by this session. - * If multiple streams are set, these streams will be simultaneously cast to the remote during the casting operation. - * @param streamId The audio streams - * @throws {BusinessError} 401 - parameter check failed - * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception - * @throws {BusinessError} {@link #ERR_CODE_SESSION_NOT_EXIST} - session does not exist - * @syscap SystemCapability.Multimedia.AVSession.Core - * @since 10 - */ - setAudioStreamId(streamIds: Array, callback: AsyncCallback): void; - setAudioStreamId(streamIds: Array): Promise; - /** * Get the current session's own controller * @returns The instance of {@link AVSessionController} -- Gitee From a86ba3fc35f4b44d233c587d82e5f534e1c434a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E6=80=A1?= Date: Mon, 17 Oct 2022 13:11:17 +0000 Subject: [PATCH 132/438] bugfix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱天怡 --- api/@ohos.resourceschedule.usageStatistics.d.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/api/@ohos.resourceschedule.usageStatistics.d.ts b/api/@ohos.resourceschedule.usageStatistics.d.ts index 04bf7a289a..6d9061ce28 100644 --- a/api/@ohos.resourceschedule.usageStatistics.d.ts +++ b/api/@ohos.resourceschedule.usageStatistics.d.ts @@ -21,7 +21,7 @@ import { AsyncCallback , Callback} from './basic'; * *

You can use the methods defined in this class to query * the usage history and states of bundles in a specified period. - * The system stores the query result in a {@link BundleStatsInfo} instance and + * The system stores the query result in a {@link bundleStatsInfo} instance and * then returns it to you. * * @since 9 @@ -33,9 +33,9 @@ declare namespace usageStatistics { * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @systemapi Hide this for inner system use. */ - interface BundleStatsInfo { + interface bundleStatsInfo { /** - * The identifier of BundleStatsInfo. + * The identifier of bundleStatsInfo. */ id: number; /** @@ -322,7 +322,7 @@ declare namespace usageStatistics { * @systemapi Hide this for inner system use. */ interface BundleStatsMap { - [key: string]: BundleStatsInfo; + [key: string]: bundleStatsInfo; } /** @@ -405,10 +405,10 @@ declare namespace usageStatistics { * @throws { BusinessError } 10000004 - IPC Communication failed. * @throws { BusinessError } 10000006 - Get application info failed. * @throws { BusinessError } 10000007 - Get system or actual time failed. - * @return Returns the list of {@link BundleStatsInfo} objects containing the usage information about each bundle. + * @return Returns the list of {@link bundleStatsInfo} objects containing the usage information about each bundle. */ - function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback>): void; - function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise>; + function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback>): void; + function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise>; /** * Queries state data of all bundles within a specified period identified by the start and end time. -- Gitee From 446ec367f539ccbe807f8d90ad01b843e588b19b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E6=80=A1?= Date: Mon, 17 Oct 2022 13:13:38 +0000 Subject: [PATCH 133/438] BUGFIX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱天怡 --- api/@ohos.resourceschedule.usageStatistics.d.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/api/@ohos.resourceschedule.usageStatistics.d.ts b/api/@ohos.resourceschedule.usageStatistics.d.ts index 6d9061ce28..04bf7a289a 100644 --- a/api/@ohos.resourceschedule.usageStatistics.d.ts +++ b/api/@ohos.resourceschedule.usageStatistics.d.ts @@ -21,7 +21,7 @@ import { AsyncCallback , Callback} from './basic'; * *

You can use the methods defined in this class to query * the usage history and states of bundles in a specified period. - * The system stores the query result in a {@link bundleStatsInfo} instance and + * The system stores the query result in a {@link BundleStatsInfo} instance and * then returns it to you. * * @since 9 @@ -33,9 +33,9 @@ declare namespace usageStatistics { * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App * @systemapi Hide this for inner system use. */ - interface bundleStatsInfo { + interface BundleStatsInfo { /** - * The identifier of bundleStatsInfo. + * The identifier of BundleStatsInfo. */ id: number; /** @@ -322,7 +322,7 @@ declare namespace usageStatistics { * @systemapi Hide this for inner system use. */ interface BundleStatsMap { - [key: string]: bundleStatsInfo; + [key: string]: BundleStatsInfo; } /** @@ -405,10 +405,10 @@ declare namespace usageStatistics { * @throws { BusinessError } 10000004 - IPC Communication failed. * @throws { BusinessError } 10000006 - Get application info failed. * @throws { BusinessError } 10000007 - Get system or actual time failed. - * @return Returns the list of {@link bundleStatsInfo} objects containing the usage information about each bundle. + * @return Returns the list of {@link BundleStatsInfo} objects containing the usage information about each bundle. */ - function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback>): void; - function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise>; + function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback>): void; + function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise>; /** * Queries state data of all bundles within a specified period identified by the start and end time. -- Gitee From d200a5a4028ecb4c5cd3589a3f37c24eaa2ed5e9 Mon Sep 17 00:00:00 2001 From: yangzk Date: Thu, 15 Sep 2022 22:08:46 +0800 Subject: [PATCH 134/438] IssueNo: #I5RT32 Description: add dataAbilityUtils <- dataAbilityHelper Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: I1817fa445ac89ec299b4e98cf946505b4a29f99d --- api/ability/dataAbilityUtils.d.ts | 258 ++++++++++++++++++++++++++++++ 1 file changed, 258 insertions(+) create mode 100644 api/ability/dataAbilityUtils.d.ts diff --git a/api/ability/dataAbilityUtils.d.ts b/api/ability/dataAbilityUtils.d.ts new file mode 100644 index 0000000000..b31170e647 --- /dev/null +++ b/api/ability/dataAbilityUtils.d.ts @@ -0,0 +1,258 @@ +/* +* Copyright (c) 2021 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 { AsyncCallback } from '../basic'; +import ResultSet from '../data/rdb/resultSet'; +import { DataAbilityOperation } from './dataAbilityOperation'; +import { DataAbilityResult } from './dataAbilityResult'; +import dataAbility from '../@ohos.data.dataAbility'; +import rdb from '../@ohos.data.rdb'; + +/** + * DataAbilityHelper + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * + * @since 7 + * @FAModelOnly + */ +export interface DataAbilityHelper { + /** + * Opens a file in a specified remote path. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param uri Indicates the path of the file to open. + * @param mode Indicates the file open mode, which can be "r" for read-only access, "w" for write-only access + * (erasing whatever data is currently in the file), "wt" for write access that truncates any existing + * file, "wa" for write-only access to append to any existing data, "rw" for read and write access on + * any existing data, or "rwt" for read and write access that truncates any existing file. + * @param callback Indicates the callback when openfile success + * @return Returns the file descriptor. + * @FAModelOnly + */ + openFile(uri: string, mode: string, callback: AsyncCallback): void; + openFile(uri: string, mode: string): Promise; + + /** + * Registers an observer to observe data specified by the given uri. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param type dataChange. + * @param uri Indicates the path of the data to operate. + * @param callback Indicates the callback when dataChange. + * @return - + * @FAModelOnly + */ + on(type: 'dataChange', uri: string, callback: AsyncCallback): void; + + /** + * Deregisters all observers used for monitoring data specified by the given uri. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param type dataChange. + * @param uri Indicates the path of the data to operate. + * @param callback Indicates the registered callback. + * @return - + * @FAModelOnly + */ + off(type: 'dataChange', uri: string, callback?: AsyncCallback): void; + + /** + * Obtains the MIME type of the date specified by the given URI. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param uri Indicates the path of the data to operate. + * @return Returns the MIME type that matches the data specified by uri. + * @FAModelOnly + */ + getType(uri: string, callback: AsyncCallback): void; + getType(uri: string): Promise; + + /** + * Obtains the MIME types of files supported. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param uri Indicates the path of the files to obtain. + * @param mimeTypeFilter Indicates the MIME types of the files to obtain. + * @return Returns the matched MIME types Array. + * @FAModelOnly + */ + getFileTypes(uri: string, mimeTypeFilter: string, callback: AsyncCallback>): void; + getFileTypes(uri: string, mimeTypeFilter: string): Promise>; + + /** + * Converts the given uri that refers to the Data ability into a normalized uri. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param uri Indicates the uri object to normalize. + * @return Returns the normalized uri object if the Data ability supports URI normalization or null. + * @FAModelOnly + */ + normalizeUri(uri: string, callback: AsyncCallback): void; + normalizeUri(uri: string): Promise; + + /** + * Converts the given normalized uri generated by normalizeUri(uri) into a denormalized one. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param uri Indicates the uri object to normalize. + * @return Returns the denormalized uri object if the denormalization is successful. + * @FAModelOnly + */ + denormalizeUri(uri: string, callback: AsyncCallback): void; + denormalizeUri(uri: string): Promise; + + /** + * Notifies the registered observers of a change to the data resource specified by uri. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param uri Indicates the path of the data to operate. + * @return - + * @FAModelOnly + */ + notifyChange(uri: string, callback: AsyncCallback): void; + notifyChange(uri: string): Promise; + + /** + * Inserts a single data record into the database. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param uri Indicates the path of the data to insert. + * @param valuesBucket Indicates the data record to insert. If this parameter is null, a blank row will be inserted. + * @return Returns the index of the inserted data record. + * @FAModelOnly + */ + insert(uri: string, valuesBucket: rdb.ValuesBucket, callback: AsyncCallback): void; + insert(uri: string, valuesBucket: rdb.ValuesBucket): Promise; + + /** + * Inserts multiple data records into the database. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param uri Indicates the path of the data to batchInsert. + * @param valuesBuckets Indicates the data records to insert. + * @return Returns the number of data records inserted. + * @FAModelOnly + */ + batchInsert(uri: string, valuesBuckets: Array, callback: AsyncCallback): void; + batchInsert(uri: string, valuesBuckets: Array): Promise; + + /** + * Deletes one or more data records from the database. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param uri Indicates the path of the data to delete. + * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. + * @return Returns the number of data records deleted. + * @FAModelOnly + */ + delete(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; + delete(uri: string, predicates?: dataAbility.DataAbilityPredicates): Promise; + delete(uri: string, callback: AsyncCallback): void; + + /** + * Updates data records in the database. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param uri Indicates the path of data to update. + * @param valuesBucket Indicates the data to update. + * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. + * @return Returns the number of data records updated. + * @FAModelOnly + */ + update(uri: string, valuesBucket: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; + update(uri: string, valuesBucket: rdb.ValuesBucket, predicates?: dataAbility.DataAbilityPredicates): Promise; + update(uri: string, valuesBucket: rdb.ValuesBucket, callback: AsyncCallback): void; + + /** + * Queries data in the database. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param uri Indicates the path of data to query. + * @param columns Indicates the columns to query. If this parameter is null, all columns are queried. + * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. + * @return Returns the query result {@link ResultSet}. + * @FAModelOnly + */ + query(uri: string, columns: Array, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; + query(uri: string, callback: AsyncCallback): void; + query(uri: string, columns: Array, callback: AsyncCallback): void; + query(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; + query(uri: string, columns?: Array, predicates?: dataAbility.DataAbilityPredicates): Promise; + + /** + * Calls the extended API of the DataAbility. This method uses a promise to return the result. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param uri URI of the Data ability. Example: "dataability:///com.example.xxx.xxxx" + * @param method Indicates the method to call. + * @param arg Indicates the parameter of the String type. + * @param extras Indicates the parameter of the PacMap type. + * If a custom Sequenceable object is put in the PacMap object and will be transferred across processes, + * you must call BasePacMap.setClassLoader(ClassLoader) to set a class loader for the custom object. + * If the PacMap object is to be transferred to a non-OHOS process, + * values of primitive types are supported, but not custom Sequenceable objects. + * @return Returns the query result {@link PacMap}. + * @FAModelOnly + */ + call(uri: string, method: string, arg: string, extras: PacMap, callback: AsyncCallback): void; + call(uri: string, method: string, arg: string, extras: PacMap): Promise; + + /** + * Queries data in the database. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param uri Indicates the path of data to query. + * @param operations Indicates the data operation list, which can contain multiple operations on the database. + * @return Returns the result of each operation, in array {@link DataAbilityResult}. + */ + executeBatch(uri: string, operations: Array, callback: AsyncCallback>): void; + executeBatch(uri: string, operations: Array): Promise>; +} + +/** + * Defines a PacMap object for storing a series of values. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @FAModelOnly + */ +export interface PacMap { + + /** + * Indicates the parameter of the PacMap type. + * If a custom Sequenceable object is put in the PacMap object and will be transferred across processes, + * you must call BasePacMap.setClassLoader(ClassLoader) to set a class loader for the custom object. + * If the PacMap object is to be transferred to a non-OHOS process, + * values of primitive types are supported, but not custom Sequenceable objects. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @FAModelOnly + */ + [key: string]: number | string | boolean | Array | null; +} -- Gitee From 7205b05a7865bcdb994d9c2ddf6ecfa6d68e9c2b Mon Sep 17 00:00:00 2001 From: yangzk Date: Fri, 16 Sep 2022 16:12:31 +0800 Subject: [PATCH 135/438] IssueNo: #I5RT32 Description: add jsdoc for dataAbilityUtils Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: I8fadeac9ad8f2ccc3d1338c2d3e5a09e6eb04bcc --- api/ability/dataAbilityHelper.d.ts | 32 +++ api/ability/dataAbilityUtils.d.ts | 436 +++++++++++++++++++++-------- 2 files changed, 348 insertions(+), 120 deletions(-) diff --git a/api/ability/dataAbilityHelper.d.ts b/api/ability/dataAbilityHelper.d.ts index bb5cba6122..870fe0c763 100644 --- a/api/ability/dataAbilityHelper.d.ts +++ b/api/ability/dataAbilityHelper.d.ts @@ -26,6 +26,8 @@ import rdb from '../@ohos.data.rdb'; * * @since 7 * @FAModelOnly + * @deprecated since 9 + * @useinstead DataAbilityUtils */ export interface DataAbilityHelper { /** @@ -41,6 +43,8 @@ export interface DataAbilityHelper { * @param callback Indicates the callback when openfile success * @return Returns the file descriptor. * @FAModelOnly + * @deprecated since 9 + * @useinstead DataAbilityUtils.openFile */ openFile(uri: string, mode: string, callback: AsyncCallback): void; openFile(uri: string, mode: string): Promise; @@ -55,6 +59,8 @@ export interface DataAbilityHelper { * @param callback Indicates the callback when dataChange. * @return - * @FAModelOnly + * @deprecated since 9 + * @useinstead DataAbilityUtils.on */ on(type: 'dataChange', uri: string, callback: AsyncCallback): void; @@ -68,6 +74,8 @@ export interface DataAbilityHelper { * @param callback Indicates the registered callback. * @return - * @FAModelOnly + * @deprecated since 9 + * @useinstead DataAbilityUtils.off */ off(type: 'dataChange', uri: string, callback?: AsyncCallback): void; @@ -79,6 +87,8 @@ export interface DataAbilityHelper { * @param uri Indicates the path of the data to operate. * @return Returns the MIME type that matches the data specified by uri. * @FAModelOnly + * @deprecated since 9 + * @useinstead DataAbilityUtils.getType */ getType(uri: string, callback: AsyncCallback): void; getType(uri: string): Promise; @@ -92,6 +102,8 @@ export interface DataAbilityHelper { * @param mimeTypeFilter Indicates the MIME types of the files to obtain. * @return Returns the matched MIME types Array. * @FAModelOnly + * @deprecated since 9 + * @useinstead DataAbilityUtils.getFileTypes */ getFileTypes(uri: string, mimeTypeFilter: string, callback: AsyncCallback>): void; getFileTypes(uri: string, mimeTypeFilter: string): Promise>; @@ -104,6 +116,8 @@ export interface DataAbilityHelper { * @param uri Indicates the uri object to normalize. * @return Returns the normalized uri object if the Data ability supports URI normalization or null. * @FAModelOnly + * @deprecated since 9 + * @useinstead DataAbilityUtils.normalizeUri */ normalizeUri(uri: string, callback: AsyncCallback): void; normalizeUri(uri: string): Promise; @@ -116,6 +130,8 @@ export interface DataAbilityHelper { * @param uri Indicates the uri object to normalize. * @return Returns the denormalized uri object if the denormalization is successful. * @FAModelOnly + * @deprecated since 9 + * @useinstead DataAbilityUtils.denormalizeUri */ denormalizeUri(uri: string, callback: AsyncCallback): void; denormalizeUri(uri: string): Promise; @@ -128,6 +144,8 @@ export interface DataAbilityHelper { * @param uri Indicates the path of the data to operate. * @return - * @FAModelOnly + * @deprecated since 9 + * @useinstead DataAbilityUtils.notifyChange */ notifyChange(uri: string, callback: AsyncCallback): void; notifyChange(uri: string): Promise; @@ -141,6 +159,8 @@ export interface DataAbilityHelper { * @param valuesBucket Indicates the data record to insert. If this parameter is null, a blank row will be inserted. * @return Returns the index of the inserted data record. * @FAModelOnly + * @deprecated since 9 + * @useinstead DataAbilityUtils.insert */ insert(uri: string, valuesBucket: rdb.ValuesBucket, callback: AsyncCallback): void; insert(uri: string, valuesBucket: rdb.ValuesBucket): Promise; @@ -154,6 +174,8 @@ export interface DataAbilityHelper { * @param valuesBuckets Indicates the data records to insert. * @return Returns the number of data records inserted. * @FAModelOnly + * @deprecated since 9 + * @useinstead DataAbilityUtils.batchInsert */ batchInsert(uri: string, valuesBuckets: Array, callback: AsyncCallback): void; batchInsert(uri: string, valuesBuckets: Array): Promise; @@ -167,6 +189,8 @@ export interface DataAbilityHelper { * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. * @return Returns the number of data records deleted. * @FAModelOnly + * @deprecated since 9 + * @useinstead DataAbilityUtils.delete */ delete(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; delete(uri: string, predicates?: dataAbility.DataAbilityPredicates): Promise; @@ -182,6 +206,8 @@ export interface DataAbilityHelper { * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. * @return Returns the number of data records updated. * @FAModelOnly + * @deprecated since 9 + * @useinstead DataAbilityUtils.update */ update(uri: string, valuesBucket: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; update(uri: string, valuesBucket: rdb.ValuesBucket, predicates?: dataAbility.DataAbilityPredicates): Promise; @@ -197,6 +223,8 @@ export interface DataAbilityHelper { * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. * @return Returns the query result {@link ResultSet}. * @FAModelOnly + * @deprecated since 9 + * @useinstead DataAbilityUtils.query */ query(uri: string, columns: Array, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; query(uri: string, callback: AsyncCallback): void; @@ -219,6 +247,8 @@ export interface DataAbilityHelper { * values of primitive types are supported, but not custom Sequenceable objects. * @return Returns the query result {@link PacMap}. * @FAModelOnly + * @deprecated since 9 + * @useinstead DataAbilityUtils.call */ call(uri: string, method: string, arg: string, extras: PacMap, callback: AsyncCallback): void; call(uri: string, method: string, arg: string, extras: PacMap): Promise; @@ -231,6 +261,8 @@ export interface DataAbilityHelper { * @param uri Indicates the path of data to query. * @param operations Indicates the data operation list, which can contain multiple operations on the database. * @return Returns the result of each operation, in array {@link DataAbilityResult}. + * @deprecated since 9 + * @useinstead DataAbilityUtils.executeBatch */ executeBatch(uri: string, operations: Array, callback: AsyncCallback>): void; executeBatch(uri: string, operations: Array): Promise>; diff --git a/api/ability/dataAbilityUtils.d.ts b/api/ability/dataAbilityUtils.d.ts index b31170e647..48f49c99ea 100644 --- a/api/ability/dataAbilityUtils.d.ts +++ b/api/ability/dataAbilityUtils.d.ts @@ -15,244 +15,440 @@ import { AsyncCallback } from '../basic'; import ResultSet from '../data/rdb/resultSet'; +import { PacMap } from './dataAbilityHelper'; import { DataAbilityOperation } from './dataAbilityOperation'; import { DataAbilityResult } from './dataAbilityResult'; import dataAbility from '../@ohos.data.dataAbility'; import rdb from '../@ohos.data.rdb'; /** - * DataAbilityHelper + * DataAbilityUtils + * @interface * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * - * @since 7 - * @FAModelOnly + * @famodelonly + * @since 9 */ -export interface DataAbilityHelper { +export interface DataAbilityUtils { /** * Opens a file in a specified remote path. - * - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @param uri Indicates the path of the file to open. - * @param mode Indicates the file open mode, which can be "r" for read-only access, "w" for write-only access - * (erasing whatever data is currently in the file), "wt" for write access that truncates any existing - * file, "wa" for write-only access to append to any existing data, "rw" for read and write access on - * any existing data, or "rwt" for read and write access that truncates any existing file. - * @param callback Indicates the callback when openfile success - * @return Returns the file descriptor. - * @FAModelOnly + * @param { string } uri - Indicates the path of the file to open. + * @param { string } mode - Indicates the file open mode, which can be "r" for read-only access, "w" for write-only + * access (erasing whatever data is currently in the file), "wt" for write access that + * truncates any existing file, "wa" for write-only access to append to any existing data, + * "rw" for read and write access on any existing data, or "rwt" for read and write access + * that truncates any existing file. + * @param { AsyncCallback } callback - The callback is used to return the file descriptor. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 */ openFile(uri: string, mode: string, callback: AsyncCallback): void; + + /** + * Opens a file in a specified remote path. + * @param { string } uri - Indicates the path of the file to open. + * @param { string } mode - Indicates the file open mode, which can be "r" for read-only access, "w" for write-only + * access (erasing whatever data is currently in the file), "wt" for write access that + * truncates any existing file, "wa" for write-only access to append to any existing data, + * "rw" for read and write access on any existing data, or "rwt" for read and write access + * that truncates any existing file. + * @returns { Promise } Returns the promise of file descriptor. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ openFile(uri: string, mode: string): Promise; /** * Registers an observer to observe data specified by the given uri. - * - * @since 7 + * @param { string } type - dataChange. + * @param { string } uri - Indicates the path of the data to operate. + * @param { AsyncCallback } callback - The callback when dataChange. + * @throws { BusinessError } If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @param type dataChange. - * @param uri Indicates the path of the data to operate. - * @param callback Indicates the callback when dataChange. - * @return - - * @FAModelOnly + * @famodelonly + * @since 9 */ on(type: 'dataChange', uri: string, callback: AsyncCallback): void; /** * Deregisters all observers used for monitoring data specified by the given uri. - * - * @since 7 + * @param { string } type - dataChange. + * @param { string } uri - Indicates the path of the data to operate. + * @param { AsyncCallback } callback - The callback when dataChange. + * @throws { BusinessError } If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @param type dataChange. - * @param uri Indicates the path of the data to operate. - * @param callback Indicates the registered callback. - * @return - - * @FAModelOnly + * @famodelonly + * @since 9 */ off(type: 'dataChange', uri: string, callback?: AsyncCallback): void; /** * Obtains the MIME type of the date specified by the given URI. - * - * @since 7 + * @param { string } uri - Indicates the path of the data to operate. + * @param { AsyncCallback } callback - The callback is used to return the MIME type. + * @throws { BusinessError } If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @param uri Indicates the path of the data to operate. - * @return Returns the MIME type that matches the data specified by uri. - * @FAModelOnly + * @famodelonly + * @since 9 */ getType(uri: string, callback: AsyncCallback): void; + + /** + * Obtains the MIME type of the date specified by the given URI. + * @param { string } uri - Indicates the path of the data to operate. + * @returns { Promise } Returns the promise of MIME type that matches the data specified by uri. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ getType(uri: string): Promise; /** * Obtains the MIME types of files supported. - * - * @since 7 + * @param { string } uri - Indicates the path of the files to obtain. + * @param { string } mimeTypeFilter - Indicates the MIME types of the files to obtain. + * @param { AsyncCallback> } callback - The callback is used to return the matched MIME types Array. + * @throws { BusinessError } If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @param uri Indicates the path of the files to obtain. - * @param mimeTypeFilter Indicates the MIME types of the files to obtain. - * @return Returns the matched MIME types Array. - * @FAModelOnly + * @famodelonly + * @since 9 */ getFileTypes(uri: string, mimeTypeFilter: string, callback: AsyncCallback>): void; + + /** + * Obtains the MIME types of files supported. + * @param { string } uri - Indicates the path of the files to obtain. + * @param { string } mimeTypeFilter - Indicates the MIME types of the files to obtain. + * @returns { Promise> } Returns the promise of matched MIME types Array. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ getFileTypes(uri: string, mimeTypeFilter: string): Promise>; /** * Converts the given uri that refers to the Data ability into a normalized uri. - * - * @since 7 + * @param { string } uri - Indicates the uri object to normalize. + * @param { AsyncCallback } callback - The callback is used to return the normalized uri object. + * @throws { BusinessError } If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @param uri Indicates the uri object to normalize. - * @return Returns the normalized uri object if the Data ability supports URI normalization or null. - * @FAModelOnly + * @famodelonly + * @since 9 */ normalizeUri(uri: string, callback: AsyncCallback): void; + + /** + * Converts the given uri that refers to the Data ability into a normalized uri. + * @param { string } uri - Indicates the uri object to normalize. + * @returns { Promise } Returns the promise of normalized uri object. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ normalizeUri(uri: string): Promise; /** * Converts the given normalized uri generated by normalizeUri(uri) into a denormalized one. - * - * @since 7 + * @param { string } uri - Indicates the uri object to normalize. + * @param { AsyncCallback } callback - The callback is used to return the denormalized uri object. + * @throws { BusinessError } If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @param uri Indicates the uri object to normalize. - * @return Returns the denormalized uri object if the denormalization is successful. - * @FAModelOnly + * @famodelonly + * @since 9 */ denormalizeUri(uri: string, callback: AsyncCallback): void; + + /** + * Converts the given normalized uri generated by normalizeUri(uri) into a denormalized one. + * @param { string } uri - Indicates the uri object to normalize. + * @returns { Promise } Returns the denormalized uri object. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ denormalizeUri(uri: string): Promise; /** * Notifies the registered observers of a change to the data resource specified by uri. - * - * @since 7 + * @param { string } uri - Indicates the path of the data to operate. + * @param { AsyncCallback } callback - The callback of notifyChange. + * @throws { BusinessError } If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @param uri Indicates the path of the data to operate. - * @return - - * @FAModelOnly + * @famodelonly + * @since 9 */ notifyChange(uri: string, callback: AsyncCallback): void; + + /** + * Notifies the registered observers of a change to the data resource specified by uri. + * @param { string } uri - Indicates the path of the data to operate. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ notifyChange(uri: string): Promise; /** * Inserts a single data record into the database. - * - * @since 7 + * @param { string } uri - Indicates the path of the data to insert. + * @param { rdb.ValuesBucket } valuesBucket - Indicates the data record to insert. If this parameter is null, + * a blank row will be inserted. + * @param { AsyncCallback } callback - The callback is used to return the index of the inserted data record. + * @throws { BusinessError } If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @param uri Indicates the path of the data to insert. - * @param valuesBucket Indicates the data record to insert. If this parameter is null, a blank row will be inserted. - * @return Returns the index of the inserted data record. - * @FAModelOnly + * @famodelonly + * @since 9 */ insert(uri: string, valuesBucket: rdb.ValuesBucket, callback: AsyncCallback): void; + + /** + * Inserts a single data record into the database. + * @param { string } uri - Indicates the path of the data to insert. + * @param { rdb.ValuesBucket } valuesBucket - Indicates the data record to insert. If this parameter is null, + * a blank row will be inserted. + * @returns { Promise } Returns the index of the inserted data record. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ insert(uri: string, valuesBucket: rdb.ValuesBucket): Promise; /** * Inserts multiple data records into the database. - * - * @since 7 + * @param { string } uri - Indicates the path of the data to batchInsert. + * @param { Array } valuesBuckets - Indicates the data records to insert. + * @param { AsyncCallback } callback - The callback is used to return the number of data records inserted. + * @throws { BusinessError } If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @param uri Indicates the path of the data to batchInsert. - * @param valuesBuckets Indicates the data records to insert. - * @return Returns the number of data records inserted. - * @FAModelOnly + * @famodelonly + * @since 9 */ batchInsert(uri: string, valuesBuckets: Array, callback: AsyncCallback): void; + + /** + * Inserts multiple data records into the database. + * @param { string } uri - Indicates the path of the data to batchInsert. + * @param { Array } valuesBuckets - Indicates the data records to insert. + * @returns { Promise } Returns the number of data records inserted. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ batchInsert(uri: string, valuesBuckets: Array): Promise; /** * Deletes one or more data records from the database. - * - * @since 7 + * @param { string } uri - Indicates the path of the data to delete. + * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define the + * processing logic when this parameter is null. + * @param { AsyncCallback } callback - The callback is used to return the number of data records deleted. + * @returns { Promise } Returns the number of data records deleted. + * @throws { BusinessError } If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @param uri Indicates the path of the data to delete. - * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. - * @return Returns the number of data records deleted. - * @FAModelOnly + * @famodelonly + * @since 9 */ delete(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; + + /** + * Deletes one or more data records from the database. + * @param { string } uri - Indicates the path of the data to delete. + * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define the + * processing logic when this parameter is null. + * @returns { Promise } Returns the number of data records deleted. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ delete(uri: string, predicates?: dataAbility.DataAbilityPredicates): Promise; + + /** + * Deletes one or more data records from the database. + * @param { string } uri - Indicates the path of the data to delete. + * @param { AsyncCallback } callback - The callback is used to return the number of data records deleted. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ delete(uri: string, callback: AsyncCallback): void; /** * Updates data records in the database. - * - * @since 7 + * @param { string } uri - Indicates the path of data to update. + * @param { rdb.ValuesBucket } valuesBucket - Indicates the data to update. + * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define + * the processing logic when this parameter is null. + * @param { AsyncCallback } callback - The callback is used to return the number of data records updated. + * @throws { BusinessError } If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @param uri Indicates the path of data to update. - * @param valuesBucket Indicates the data to update. - * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. - * @return Returns the number of data records updated. - * @FAModelOnly + * @famodelonly + * @since 9 */ update(uri: string, valuesBucket: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; + + /** + * Updates data records in the database. + * @param { string } uri - Indicates the path of data to update. + * @param { rdb.ValuesBucket } valuesBucket - Indicates the data to update. + * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define + * the processing logic when this parameter is null. + * @returns { Promise } Returns the number of data records updated. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ update(uri: string, valuesBucket: rdb.ValuesBucket, predicates?: dataAbility.DataAbilityPredicates): Promise; + + /** + * Updates data records in the database. + * @param { string } uri - Indicates the path of data to update. + * @param { rdb.ValuesBucket } valuesBucket - Indicates the data to update. + * @param { AsyncCallback } callback - The callback is used to return the number of data records updated. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ update(uri: string, valuesBucket: rdb.ValuesBucket, callback: AsyncCallback): void; /** * Queries data in the database. - * - * @since 7 + * @param { string } uri - Indicates the path of data to query. + * @param { Array } columns - Indicates the columns to query. If this parameter is null, all columns are queried. + * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define + * the processing logic when this parameter is null. + * @param { AsyncCallback } callback - The callback is used to return the query result {@link ResultSet}. + * @throws { BusinessError } If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @param uri Indicates the path of data to query. - * @param columns Indicates the columns to query. If this parameter is null, all columns are queried. - * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. - * @return Returns the query result {@link ResultSet}. - * @FAModelOnly + * @famodelonly + * @since 9 */ query(uri: string, columns: Array, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; + + /** + * Queries data in the database. + * @param { string } uri - Indicates the path of data to query. + * @param { AsyncCallback } callback - The callback is used to return the query result {@link ResultSet}. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ query(uri: string, callback: AsyncCallback): void; + + /** + * Queries data in the database. + * @param { string } uri - Indicates the path of data to query. + * @param { Array } columns - Indicates the columns to query. If this parameter is null, all columns are queried. + * @param { AsyncCallback } callback - The callback is used to return the query result {@link ResultSet}. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ query(uri: string, columns: Array, callback: AsyncCallback): void; + + /** + * Queries data in the database. + * @param { string } uri - Indicates the path of data to query. + * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define + * the processing logic when this parameter is null. + * @param { AsyncCallback } callback - The callback is used to return the query result {@link ResultSet}. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ query(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; + + /** + * Queries data in the database. + * @param { string } uri - Indicates the path of data to query. + * @param { Array } columns - Indicates the columns to query. If this parameter is null, all columns are queried. + * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define + * the processing logic when this parameter is null. + * @returns { Promise } Returns the query result {@link ResultSet}. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ query(uri: string, columns?: Array, predicates?: dataAbility.DataAbilityPredicates): Promise; /** * Calls the extended API of the DataAbility. This method uses a promise to return the result. - * - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @param uri URI of the Data ability. Example: "dataability:///com.example.xxx.xxxx" - * @param method Indicates the method to call. - * @param arg Indicates the parameter of the String type. - * @param extras Indicates the parameter of the PacMap type. + * @param { string } uri - URI of the Data ability. Example: "dataability:///com.example.xxx.xxxx" + * @param { string } method - Indicates the method to call. + * @param { string } arg - Indicates the parameter of the String type. + * @param { PacMap } extras - Indicates the parameter of the PacMap type. * If a custom Sequenceable object is put in the PacMap object and will be transferred across processes, * you must call BasePacMap.setClassLoader(ClassLoader) to set a class loader for the custom object. * If the PacMap object is to be transferred to a non-OHOS process, * values of primitive types are supported, but not custom Sequenceable objects. - * @return Returns the query result {@link PacMap}. - * @FAModelOnly + * @param { AsyncCallback } callback - The callback is used to return the query result {@link PacMap}. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 */ call(uri: string, method: string, arg: string, extras: PacMap, callback: AsyncCallback): void; + + /** + * Calls the extended API of the DataAbility. This method uses a promise to return the result. + * @param { string } uri - URI of the Data ability. Example: "dataability:///com.example.xxx.xxxx" + * @param { string } method - Indicates the method to call. + * @param { string } arg - Indicates the parameter of the String type. + * @param { PacMap } extras - Indicates the parameter of the PacMap type. + * If a custom Sequenceable object is put in the PacMap object and will be transferred across processes, + * you must call BasePacMap.setClassLoader(ClassLoader) to set a class loader for the custom object. + * If the PacMap object is to be transferred to a non-OHOS process, + * values of primitive types are supported, but not custom Sequenceable objects. + * @returns { Promise } Returns the query result {@link PacMap}. + * @throws { BusinessError } If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ call(uri: string, method: string, arg: string, extras: PacMap): Promise; /** * Queries data in the database. - * - * @since 7 + * @param { string } uri - Indicates the path of data to query. + * @param { Array } operations - Indicates the data operation list, which can contain + * multiple operations on the database. + * @param { AsyncCallback> } callback - The callback is used to return the result of each + * operation, in array {@link DataAbilityResult}. + * @throws { BusinessError } If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @param uri Indicates the path of data to query. - * @param operations Indicates the data operation list, which can contain multiple operations on the database. - * @return Returns the result of each operation, in array {@link DataAbilityResult}. + * @famodelonly + * @since 9 */ executeBatch(uri: string, operations: Array, callback: AsyncCallback>): void; - executeBatch(uri: string, operations: Array): Promise>; -} - -/** - * Defines a PacMap object for storing a series of values. - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @FAModelOnly - */ -export interface PacMap { /** - * Indicates the parameter of the PacMap type. - * If a custom Sequenceable object is put in the PacMap object and will be transferred across processes, - * you must call BasePacMap.setClassLoader(ClassLoader) to set a class loader for the custom object. - * If the PacMap object is to be transferred to a non-OHOS process, - * values of primitive types are supported, but not custom Sequenceable objects. - * @since 7 + * Queries data in the database. + * @param { string } uri - Indicates the path of data to query. + * @param { Array } operations - Indicates the data operation list, which can contain + * multiple operations on the database. + * @returns { Promise> } Returns the result of each operation, in array {@link DataAbilityResult}. + * @throws { BusinessError } If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @FAModelOnly + * @famodelonly + * @since 9 */ - [key: string]: number | string | boolean | Array | null; + executeBatch(uri: string, operations: Array): Promise>; } -- Gitee From 238dd93f3654945438f1ad2a72ff693e29fdf58d Mon Sep 17 00:00:00 2001 From: yangzk Date: Mon, 19 Sep 2022 11:53:52 +0800 Subject: [PATCH 136/438] IssueNo: #I5RT32 Description: add Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: I9233372b40e917c757a811af0d0331ba047ac9aa --- api/@ohos.app.ability.Ability.d.ts | 317 +++++++++++++++++ api/@ohos.app.ability.AbilityContext.d.ts | 316 +++++++++++++++++ api/@ohos.app.ability.ApplicationContext.d.ts | 75 ++++ api/@ohos.app.ability.Context.d.ts | 195 +++++++++++ api/@ohos.app.ability.EventHub.d.ts | 60 ++++ ...s.app.ability.ServiceExtensionContext.d.ts | 192 ++++++++++ api/@ohos.app.ability.abilityDelegator.d.ts | 209 +++++++++++ api/@ohos.app.ability.abilityManager.d.ts | 114 ++++++ ... @ohos.app.ability.dataAbilityHelper.d.ts} | 0 api/@ohos.app.ability.dataUriUtils.d.ts | 67 ++++ api/@ohos.app.ability.errorManager.d.ts | 59 ++++ api/@ohos.app.ability.missionManager.d.ts | 186 ++++++++++ api/@ohos.app.ability.quickFixManager.d.ts | 153 ++++++++ api/@ohos.app.featureAbility.context.d.ts | 328 ++++++++++++++++++ api/@ohos.app.featureAbility.d.ts | 246 +++++++++++++ api/@ohos.app.form.FormExtensionContext.d.ts | 43 +++ api/@ohos.app.particleAbility.d.ts | 124 +++++++ api/@ohos.app.wantAgent.d.ts | 267 ++++++++++++++ 18 files changed, 2951 insertions(+) create mode 100755 api/@ohos.app.ability.Ability.d.ts create mode 100644 api/@ohos.app.ability.AbilityContext.d.ts create mode 100644 api/@ohos.app.ability.ApplicationContext.d.ts create mode 100644 api/@ohos.app.ability.Context.d.ts create mode 100644 api/@ohos.app.ability.EventHub.d.ts create mode 100644 api/@ohos.app.ability.ServiceExtensionContext.d.ts create mode 100644 api/@ohos.app.ability.abilityDelegator.d.ts create mode 100644 api/@ohos.app.ability.abilityManager.d.ts rename api/{ability/dataAbilityUtils.d.ts => @ohos.app.ability.dataAbilityHelper.d.ts} (100%) create mode 100644 api/@ohos.app.ability.dataUriUtils.d.ts create mode 100644 api/@ohos.app.ability.errorManager.d.ts create mode 100644 api/@ohos.app.ability.missionManager.d.ts create mode 100644 api/@ohos.app.ability.quickFixManager.d.ts create mode 100644 api/@ohos.app.featureAbility.context.d.ts create mode 100644 api/@ohos.app.featureAbility.d.ts create mode 100644 api/@ohos.app.form.FormExtensionContext.d.ts create mode 100644 api/@ohos.app.particleAbility.d.ts create mode 100644 api/@ohos.app.wantAgent.d.ts diff --git a/api/@ohos.app.ability.Ability.d.ts b/api/@ohos.app.ability.Ability.d.ts new file mode 100755 index 0000000000..99cfd35561 --- /dev/null +++ b/api/@ohos.app.ability.Ability.d.ts @@ -0,0 +1,317 @@ +/* + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import AbilityConstant from "./@ohos.application.AbilityConstant"; +import AbilityContext from "./application/AbilityContext"; +import Want from './@ohos.application.Want'; +import window from './@ohos.window'; +import { Configuration } from './@ohos.application.Configuration'; +import rpc from './@ohos.rpc'; + +/** + * The prototype of the listener function interface registered by the Caller. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @permission N/A + * @param msg Monitor status notification information. + * @return - + * @StageModelOnly + */ +export interface OnReleaseCallBack { + (msg: string): void; +} + +/** + * The prototype of the message listener function interface registered by the Callee. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @permission N/A + * @param indata Notification data notified from the caller. + * @return rpc.Sequenceable + * @StageModelOnly + */ +export interface CalleeCallBack { + (indata: rpc.MessageParcel): rpc.Sequenceable; +} + +/** + * The interface of a Caller. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @permission N/A + * @StageModelOnly + */ +export interface Caller { + /** + * Notify the server of Sequenceable type data. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param method The notification event string listened to by the callee. + * @param data Notification data to the callee. + * @return - + * @StageModelOnly + */ + call(method: string, data: rpc.Sequenceable): Promise; + + /** + * Notify the server of Sequenceable type data and return the notification result. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param method The notification event string listened to by the callee. + * @param data Notification data to the callee. + * @return Returns the callee's notification result data on success, and returns undefined on failure. + * @StageModelOnly + */ + callWithResult(method: string, data: rpc.Sequenceable): Promise; + + /** + * Clear service records. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @return - + * @StageModelOnly + */ + release(): void; + + /** + * Register death listener notification callback. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param callback Register a callback function for listening for notifications. + * @return - + * @StageModelOnly + */ + onRelease(callback: OnReleaseCallBack): void; + } + + /** + * The interface of a Callee. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @permission N/A + * @StageModelOnly + */ +export interface Callee { + + /** + * Register data listener callback. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param method A string registered to listen for notification events. + * @param callback Register a callback function that listens for notification events. + * @return - + * @StageModelOnly + */ + on(method: string, callback: CalleeCallBack): void; + + /** + * Unregister data listener callback. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param method A string registered to listen for notification events. + * @return - + * @StageModelOnly + */ + off(method: string): void; + } + +/** + * The class of an ability. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @permission N/A + * @StageModelOnly + */ +export default class Ability { + /** + * Indicates configuration information about an ability context. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @StageModelOnly + */ + context: AbilityContext; + + /** + * Indicates ability launch want. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @StageModelOnly + */ + launchWant: Want; + + /** + * Indicates ability last request want. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @StageModelOnly + */ + lastRequestWant: Want; + + /** + * Call Service Stub Object. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @StageModelOnly + */ + callee: Callee; + + /** + * Called back when an ability is started for initialization. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param want Indicates the want info of the created ability. + * @param param Indicates the launch param. + * @return - + * @StageModelOnly + */ + onCreate(want: Want, param: AbilityConstant.LaunchParam): void; + + /** + * Called back when an ability window stage is created. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param windowStage Indicates the created WindowStage. + * @return - + * @StageModelOnly + */ + onWindowStageCreate(windowStage: window.WindowStage): void; + + /** + * Called back when an ability window stage is destroyed. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @return - + * @StageModelOnly + */ + onWindowStageDestroy(): void; + + /** + * Called back when an ability window stage is restored. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param windowStage window stage to restore + * @return - + * @StageModelOnly + */ + onWindowStageRestore(windowStage: window.WindowStage): void; + + /** + * Called back before an ability is destroyed. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @return - + * @StageModelOnly + */ + onDestroy(): void; + + /** + * Called back when the state of an ability changes to foreground. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @return - + * @StageModelOnly + */ + onForeground(): void; + + /** + * Called back when the state of an ability changes to background. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @return - + * @StageModelOnly + */ + onBackground(): void; + + /** + * Called back when an ability prepares to continue. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param wantParam Indicates the want parameter. + * @return 0 if ability agrees to continue and saves data successfully, otherwise errcode. + * @StageModelOnly + */ + onContinue(wantParam : {[key: string]: any}): AbilityConstant.OnContinueResult; + + /** + * Called when the launch mode of an ability is set to singleton. + * This happens when you re-launch an ability that has been at the top of the ability stack. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param want Indicates the want info of ability. + * @param launchParams Indicates the launch parameters. + * @return - + * @StageModelOnly + */ + onNewWant(want: Want, launchParams: AbilityConstant.LaunchParam): void; + + /** + * Called when the system configuration is updated. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param config Indicates the updated configuration. + * @return - + * @StageModelOnly + */ + onConfigurationUpdated(config: Configuration): void; + + /** + * Called when dump client information is required. + * It is recommended that developers don't DUMP sensitive information. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param params Indicates the params from command. + * @return The dump info array. + * @StageModelOnly + */ + dump(params: Array): Array; + + /** + * Called when the system has determined to trim the memory, for example, when the ability is running in the + * background and there is no enough memory for running as many background processes as possible. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param level Indicates the memory trim level, which shows the current memory usage status. + * @return - + * @StageModelOnly + */ + onMemoryLevel(level: AbilityConstant.MemoryLevel): void; +} diff --git a/api/@ohos.app.ability.AbilityContext.d.ts b/api/@ohos.app.ability.AbilityContext.d.ts new file mode 100644 index 0000000000..4febfbf618 --- /dev/null +++ b/api/@ohos.app.ability.AbilityContext.d.ts @@ -0,0 +1,316 @@ +/* + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/// + +import { AbilityInfo } from "../bundle/abilityInfo"; +import { AbilityResult } from "../ability/abilityResult"; +import { AsyncCallback } from "../basic"; +import { ConnectOptions } from "../ability/connectOptions"; +import { HapModuleInfo } from "../bundle/hapModuleInfo"; +import Context from "./Context"; +import Want from "../@ohos.application.Want"; +import StartOptions from "../@ohos.application.StartOptions"; +import PermissionRequestResult from "./PermissionRequestResult"; +import { Configuration } from '../@ohos.application.Configuration'; +import Caller from '../@ohos.application.Ability'; +import { LocalStorage } from 'StateManagement'; +import image from '../@ohos.multimedia.image'; + +/** + * The context of an ability. It allows access to ability-specific resources. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission N/A + * @StageModelOnly + */ +export default class AbilityContext extends Context { + /** + * Indicates configuration information about an ability. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + abilityInfo: AbilityInfo; + + /** + * Indicates configuration information about an module. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + currentHapModuleInfo: HapModuleInfo; + + /** + * Indicates configuration information. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + config: Configuration; + + /** + * Starts a new ability. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @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; + + /** + * Get the caller object of the startup capability + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the ability to start. + * @return Returns to the Caller interface on success Returns empty or undefined on failure + * @StageModelOnly + */ + startAbilityByCall(want: Want): Promise; + + /** + * Starts a new ability with account. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the want info to start. + * @param accountId Indicates the account to start. + * @param options Indicates the start options. + * @systemapi hide for inner use. + * @return - + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @StageModelOnly + */ + startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; + startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; + + /** + * Starts an ability and returns the execution result when the ability is destroyed. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the ability to start. + * @param options Indicates the start options. + * @return Returns the {@link AbilityResult}. + * @StageModelOnly + */ + startAbilityForResult(want: Want, callback: AsyncCallback): void; + startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback): void; + startAbilityForResult(want: Want, options?: StartOptions): Promise; + + /** + * Starts an ability and returns the execution result when the ability is destroyed with account. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the want info to start. + * @param accountId Indicates the account to start. + * @param options Indicates the start options. + * @systemapi hide for inner use. + * @return Returns the {@link AbilityResult}. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @StageModelOnly + */ + startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; + startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; + + /** + * Starts a new service extension ability. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the want info to start. + * @systemapi hide for inner use. + * @return - + * @StageModelOnly + */ + startServiceExtensionAbility(want: Want, callback: AsyncCallback): void; + startServiceExtensionAbility(want: Want): Promise; + + /** + * Starts a new service extension ability with account. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the want info to start. + * @param accountId Indicates the account to start. + * @systemapi hide for inner use. + * @return - + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @StageModelOnly + */ + startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; + + /** + * Stops a service within the same application. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the want info to start. + * @systemapi hide for inner use. + * @return - + * @StageModelOnly + */ + stopServiceExtensionAbility(want: Want, callback: AsyncCallback): void; + stopServiceExtensionAbility(want: Want): Promise; + + /** + * Stops a service within the same application with account. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the want info to start. + * @param accountId Indicates the accountId to start. + * @systemapi hide for inner use. + * @return - + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @StageModelOnly + */ + stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; + + /** + * Destroys this Page ability. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @return - + * @StageModelOnly + */ + terminateSelf(callback: AsyncCallback): void; + terminateSelf(): Promise; + + /** + * Sets the result code and data to be returned by this Page ability to the caller + * and destroys this Page ability. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param parameter Indicates the result to return. + * @return - + * @StageModelOnly + */ + terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback): void; + terminateSelfWithResult(parameter: AbilityResult): Promise; + + /** + * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want The element name of the service ability + * @param options The remote object instance + * @systemapi Hide this for inner system use. + * @return Returns the number code of the ability connected + * @StageModelOnly + */ + connectAbility(want: Want, options: ConnectOptions): number; + + /** + * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template with account. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want The element name of the service ability + * @param accountId The account to connect + * @param options The remote object instance + * @systemapi hide for inner use. + * @return Returns the number code of the ability connected + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @StageModelOnly + */ + connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; + + /** + * The callback interface was connect successfully. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param connection The number code of the ability connected + * @systemapi Hide this for inner system use. + * @StageModelOnly + */ + disconnectAbility(connection: number, callback:AsyncCallback): void; + disconnectAbility(connection: number): Promise; + + /** + * Set mission label of current ability. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param label The label of ability that showed in recent missions. + * @StageModelOnly + */ + setMissionLabel(label: string, callback:AsyncCallback): void; + setMissionLabel(label: string): Promise; + + /** + * Set mission icon of current ability. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param icon The icon of ability that showed in recent missions. + * @systemapi hide for inner use. + * @return - + * @StageModelOnly + */ + setMissionIcon(icon: image.PixelMap, callback:AsyncCallback): void; + setMissionIcon(icon: image.PixelMap): Promise; + + /** + * Requests certain permissions from the system. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param permissions Indicates the list of permissions to be requested. This parameter cannot be null or empty. + * @return Returns the {@link PermissionRequestResult}. + * @StageModelOnly + */ + requestPermissionsFromUser(permissions: Array, requestCallback: AsyncCallback) : void; + requestPermissionsFromUser(permissions: Array) : Promise; + + /** + * Restore window stage data in ability continuation + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param LocalStorage the storage data used to restore window stage + * @StageModelOnly + */ + restoreWindowStage(localStorage: LocalStorage) : void; + + /** + * check to see ability is in terminating state. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @return Returns true when ability is in terminating state, else returns false. + * @StageModelOnly + */ + isTerminating(): boolean; +} diff --git a/api/@ohos.app.ability.ApplicationContext.d.ts b/api/@ohos.app.ability.ApplicationContext.d.ts new file mode 100644 index 0000000000..2f605c61cf --- /dev/null +++ b/api/@ohos.app.ability.ApplicationContext.d.ts @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from "../basic"; +import Context from "./Context"; +import AbilityLifecycleCallback from "../@ohos.application.AbilityLifecycleCallback"; +import EnvironmentCallback from "../@ohos.application.EnvironmentCallback"; + +/** + * The context of an application. It allows access to application-specific resources. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission N/A + * @StageModelOnly + */ +export default class ApplicationContext extends Context { + /** + * Register ability lifecycle callback. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param callback The ability lifecycle callback. + * @return Returns the number code of the callback. + * @StageModelOnly + */ + registerAbilityLifecycleCallback(callback: AbilityLifecycleCallback): number; + + /** + * Unregister ability lifecycle callback. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param callbackId Indicates the number code of the callback. + * @return - + * @StageModelOnly + */ + unregisterAbilityLifecycleCallback(callbackId: number, callback: AsyncCallback): void; + unregisterAbilityLifecycleCallback(callbackId: number): Promise; + + /** + * Register environment callback. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param callback The environment callback. + * @return Returns the number code of the callback. + * @StageModelOnly + */ + registerEnvironmentCallback(callback: EnvironmentCallback): number; + + /** + * Unregister environment callback. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param callbackId Indicates the number code of the callback. + * @return - + * @StageModelOnly + */ + unregisterEnvironmentCallback(callbackId: number, callback: AsyncCallback): void; + unregisterEnvironmentCallback(callbackId: number): Promise; +} diff --git a/api/@ohos.app.ability.Context.d.ts b/api/@ohos.app.ability.Context.d.ts new file mode 100644 index 0000000000..26c6eadcad --- /dev/null +++ b/api/@ohos.app.ability.Context.d.ts @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ApplicationInfo } from "../bundle/applicationInfo"; +import resmgr from "../@ohos.resourceManager"; +import BaseContext from "./BaseContext"; +import EventHub from "./EventHub"; +import ApplicationContext from "./ApplicationContext"; + +/** + * The base context of an ability or an application. It allows access to + * application-specific resources. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission N/A + * @StageModelOnly + */ +export default class Context extends BaseContext { + /** + * Indicates the capability of accessing application resources. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + resourceManager: resmgr.ResourceManager; + + /** + * Indicates configuration information about an application. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + applicationInfo: ApplicationInfo; + + /** + * Indicates app cache dir. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + cacheDir: string; + + /** + * Indicates app temp dir. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + tempDir: string; + + /** + * Indicates app files dir. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + filesDir : string; + + /** + * Indicates app database dir. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + databaseDir : string; + + /** + * Indicates app preferences dir. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + preferencesDir : string; + + /** + * Indicates app bundle code dir. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + bundleCodeDir : string; + + /** + * Indicates app distributed files dir. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + distributedFilesDir: string; + + /** + * Indicates event hub. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + eventHub: EventHub; + + /** + * Indicates file area. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + area: AreaMode; + + /** + * Create a bundle context + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide for inner use. + * @param bundleName Indicates the bundle name. + * @return application context + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @StageModelOnly + */ + createBundleContext(bundleName: string): Context; + + /** + * Create a module context + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param moduleName Indicates the module name. + * @return application context + * @StageModelOnly + */ + createModuleContext(moduleName: string): Context; + + /** + * Create a module context + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide for inner use. + * @param bundleName Indicates the bundle name. + * @param moduleName Indicates the module name. + * @return application context + * @StageModelOnly + */ + createModuleContext(bundleName: string, moduleName: string): Context; + + /** + * Get application context + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @return application context + * @StageModelOnly + */ + getApplicationContext(): ApplicationContext; +} + +/** + * 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 +} diff --git a/api/@ohos.app.ability.EventHub.d.ts b/api/@ohos.app.ability.EventHub.d.ts new file mode 100644 index 0000000000..7fe3d203ca --- /dev/null +++ b/api/@ohos.app.ability.EventHub.d.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2021 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. + */ + +/** + * The event center of a context, support the subscription and publication of events. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission N/A + * @StageModelOnly + */ +export default class EventHub { + /** + * Subscribe to an event. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param event Indicates the event. + * @param callback Indicates the callback. + * @return - + * @StageModelOnly + */ + on(event: string, callback: Function): void + + /** + * Unsubscribe from an event. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param event Indicates the event. + * @param callback Indicates the callback. + * @return - + * @StageModelOnly + */ + off(event: string, callback?: Function): void + + /** + * Trigger the event callbacks. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param event Indicates the event. + * @param args Indicates the callback arguments. + * @return - + * @StageModelOnly + */ + emit(event: string, ...args: Object[]): void +} \ No newline at end of file diff --git a/api/@ohos.app.ability.ServiceExtensionContext.d.ts b/api/@ohos.app.ability.ServiceExtensionContext.d.ts new file mode 100644 index 0000000000..dd21ca7d0a --- /dev/null +++ b/api/@ohos.app.ability.ServiceExtensionContext.d.ts @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from "../basic"; +import { ConnectOptions } from "../ability/connectOptions"; +import Caller from '../@ohos.application.Ability'; +import ExtensionContext from "./ExtensionContext"; +import Want from "../@ohos.application.Want"; +import StartOptions from "../@ohos.application.StartOptions"; + +/** + * The context of service extension. It allows access to + * serviceExtension-specific resources. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide for inner use. + * @permission N/A + * @StageModelOnly + */ +export default class ServiceExtensionContext extends ExtensionContext { + /** + * Service extension uses this method to start a specific ability. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the ability to start. + * @param options Indicates the start options. + * @systemapi hide for inner use. + * @return - + * @StageModelOnly + */ + startAbility(want: Want, callback: AsyncCallback): void; + startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; + startAbility(want: Want, options?: StartOptions): Promise; + + /** + * Service extension uses this method to start a specific ability with account. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the ability to start. + * @param accountId Indicates the accountId to start. + * @param options Indicates the start options. + * @systemapi hide for inner use. + * @return - + * @StageModelOnly + */ + startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; + startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; + + /** + * Starts a new service extension ability. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the want info to start. + * @systemapi hide for inner use. + * @return - + * @StageModelOnly + */ + startServiceExtensionAbility(want: Want, callback: AsyncCallback): void; + startServiceExtensionAbility(want: Want): Promise; + + /** + * Starts a new service extension ability with account. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the want info to start. + * @param accountId Indicates the account to start. + * @systemapi hide for inner use. + * @return - + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @StageModelOnly + */ + startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; + + /** + * Stops a service within the same application. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the want info to start. + * @systemapi hide for inner use. + * @return - + * @StageModelOnly + */ + stopServiceExtensionAbility(want: Want, callback: AsyncCallback): void; + stopServiceExtensionAbility(want: Want): Promise; + + /** + * Stops a service within the same application with account. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the want info to start. + * @param accountId Indicates the accountId to start. + * @systemapi hide for inner use. + * @return - + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @StageModelOnly + */ + stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; + + /** + * Destroys this service extension. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide for inner use. + * @return - + * @StageModelOnly + */ + terminateSelf(callback: AsyncCallback): void; + terminateSelf(): Promise; + + /** + * Connects an ability to a Service extension. + * + *

This method can be called by an ability or service extension, but the destination of the connection must be a + * service extension. You must implement the {@link ConnectOptions} interface to obtain the proxy of the target + * service extension when the Service extension is connected.

+ * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the service extension to connect. + * @param options Indicates the callback of connection. + * @systemapi hide for inner use. + * @return connection id, int value. + * @StageModelOnly + */ + connectAbility(want: Want, options: ConnectOptions): number; + + /** + * Connects an ability to a Service extension with account. + * + *

This method can be called by an ability or service extension, but the destination of the connection must be a + * service extension. You must implement the {@link ConnectOptions} interface to obtain the proxy of the target + * service extension when the Service extension is connected.

+ * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the service extension to connect. + * @param accountId Indicates the account to connect. + * @param options Indicates the callback of connection. + * @systemapi hide for inner use. + * @return connection id, int value. + * @StageModelOnly + */ + connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; + + /** + * Disconnects an ability to a service extension, in contrast to + * {@link connectAbility}. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param connection the connection id returned from connectAbility api. + * @systemapi hide for inner use. + * @return - + * @StageModelOnly + */ + disconnectAbility(connection: number, callback:AsyncCallback): void; + disconnectAbility(connection: number): Promise; + + /** + * Get the caller object of the startup capability + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the ability to start. + * @return Returns to the Caller interface on success Returns empty or undefined on failure + * @StageModelOnly + */ + startAbilityByCall(want: Want): Promise; +} \ No newline at end of file diff --git a/api/@ohos.app.ability.abilityDelegator.d.ts b/api/@ohos.app.ability.abilityDelegator.d.ts new file mode 100644 index 0000000000..d6e08d73b2 --- /dev/null +++ b/api/@ohos.app.ability.abilityDelegator.d.ts @@ -0,0 +1,209 @@ +/* + * Copyright (c) 2021 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 { AsyncCallback } from '../basic'; +import Ability from '../@ohos.application.Ability'; +import AbilityStage from '../@ohos.application.AbilityStage'; +import { AbilityMonitor } from './abilityMonitor'; +import { AbilityStageMonitor } from './abilityStageMonitor'; +import Context from './Context'; +import Want from "../@ohos.application.Want"; +import { ShellCmdResult } from './shellCmdResult'; + +/** + * A global test utility interface used for adding AbilityMonitor objects and control lifecycle states of abilities. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @import import AbilityDelegator from 'application/abilityDelegator.d' + * @permission N/A + */ +export interface AbilityDelegator { + /** + * Add an AbilityMonitor object for monitoring the lifecycle state changes of the specified ability. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param monitor AbilityMonitor object + */ + addAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback): void; + addAbilityMonitor(monitor: AbilityMonitor): Promise; + + /** + * Add an AbilityStageMonitor object for monitoring the lifecycle state changes of the specified abilityStage. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param monitor AbilityStageMonitor object + */ + addAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback): void; + addAbilityStageMonitor(monitor: AbilityStageMonitor): Promise; + + /** + * Remove a specified AbilityMonitor object from the application memory. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param monitor AbilityMonitor object + */ + removeAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback): void; + removeAbilityMonitor(monitor: AbilityMonitor): Promise; + + /** + * Remove a specified AbilityStageMonitor object from the application memory. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param monitor AbilityStageMonitor object + */ + removeAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback): void; + removeAbilityStageMonitor(monitor: AbilityStageMonitor): Promise; + + /** + * Wait for and returns the Ability object that matches the conditions set in the given AbilityMonitor. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param monitor AbilityMonitor object + * @param timeout Maximum wait time, in milliseconds + * @return success: return the Ability object, failure: return null + */ + waitAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback): void; + waitAbilityMonitor(monitor: AbilityMonitor, timeout: number, callback: AsyncCallback): void; + waitAbilityMonitor(monitor: AbilityMonitor, timeout?: number): Promise; + + /** + * Wait for and returns the AbilityStage object that matches the conditions set in the given AbilityStageMonitor. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param monitor AbilityStageMonitor object + * @param timeout Maximum wait time, in milliseconds + * @return success: return the AbilityStage object, failure: return null + */ + waitAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback): void; + waitAbilityStageMonitor(monitor: AbilityStageMonitor, timeout: number, callback: AsyncCallback): void; + waitAbilityStageMonitor(monitor: AbilityStageMonitor, timeout?: number): Promise; + + /** + * Obtain the application context. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @return App Context + */ + getAppContext(): Context; + + /** + * Obtain the lifecycle state of a specified ability. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param ability The Ability object + * @return The state of the Ability object. enum AbilityLifecycleState + */ + getAbilityState(ability: Ability): number; + + /** + * Obtain the ability that is currently being displayed. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @return The top ability of the current application + */ + getCurrentTopAbility(callback: AsyncCallback): void; + getCurrentTopAbility(): Promise + + /** + * Start a new ability. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the ability to start + * @return - + */ + startAbility(want: Want, callback: AsyncCallback): void; + startAbility(want: Want): Promise; + + /** + * Invoke the Ability.onForeground() callback of a specified ability without changing its lifecycle state. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param ability The ability object + * @return true: success false: failure + */ + doAbilityForeground(ability: Ability, callback: AsyncCallback): void; + doAbilityForeground(ability: Ability): Promise; + + /** + * Invoke the Ability.onBackground() callback of a specified ability without changing its lifecycle state. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param ability The ability object + * @return true: success false: failure + */ + doAbilityBackground(ability: Ability, callback: AsyncCallback): void; + doAbilityBackground(ability: Ability): Promise; + + /** + * Prints log information to the unit testing console. + * The total length of the log information to be printed cannot exceed 1000 characters. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param msg Log information + */ + print(msg: string, callback: AsyncCallback): void; + print(msg: string): Promise; + + /** + * Prints log information to the unit testing console. + * The total length of the log information to be printed cannot exceed 1000 characters. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param msg Log information + */ + printSync(msg: string): void; + + /** + * Execute the given command in the aa tools side. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param cmd Shell command + * @param timeoutSecs Timeout, in seconds + * @return ShellCmdResult object + */ + executeShellCommand(cmd: string, callback: AsyncCallback): void; + executeShellCommand(cmd: string, timeoutSecs: number, callback: AsyncCallback): void; + executeShellCommand(cmd: string, timeoutSecs?: number): Promise; + + /** + * Finish the test and print log information to the unit testing console. + * The total length of the log information to be printed cannot exceed 1000 characters. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param msg Log information + * @param code Result code + */ + finishTest(msg: string, code: number, callback: AsyncCallback): void; + finishTest(msg: string, code: number): Promise; +} + +export default AbilityDelegator; diff --git a/api/@ohos.app.ability.abilityManager.d.ts b/api/@ohos.app.ability.abilityManager.d.ts new file mode 100644 index 0000000000..298aae74f4 --- /dev/null +++ b/api/@ohos.app.ability.abilityManager.d.ts @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from './basic'; +import { Configuration } from './@ohos.application.Configuration'; +import { AbilityRunningInfo as _AbilityRunningInfo } from './application/AbilityRunningInfo'; +import { ExtensionRunningInfo as _ExtensionRunningInfo } from './application/ExtensionRunningInfo'; +import { ElementName } from './bundle/elementName'; + +/** + * The class of an ability manager. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi Hide this for inner system use + * @permission N/A + */ +declare namespace abilityManager { + /** + * @name AbilityState + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi Hide this for inner system use. + * @permission N/A + */ + export enum AbilityState { + INITIAL = 0, + FOREGROUND = 9, + BACKGROUND = 10, + FOREGROUNDING = 11, + BACKGROUNDING = 12 + } + + /** + * Updates the configuration by modifying the configuration. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param config Indicates the new configuration. + * @systemapi Hide this for inner system use. + * @return - + * @permission ohos.permission.UPDATE_CONFIGURATION + */ + function updateConfiguration(config: Configuration, callback: AsyncCallback): void; + function updateConfiguration(config: Configuration): Promise; + + /** + * Get information about running abilitys + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi Hide this for inner system use. + * @return Returns the array of {@link AbilityRunningInfo}. + * @permission ohos.permission.GET_RUNNING_INFO + */ + function getAbilityRunningInfos(): Promise>; + function getAbilityRunningInfos(callback: AsyncCallback>): void; + + /** + * Get information about running extensions + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param upperLimit Get the maximum limit of the number of messages + * @systemapi Hide this for inner system use. + * @return Returns the array of {@link ExtensionRunningInfo}. + * @permission ohos.permission.GET_RUNNING_INFO + */ + function getExtensionRunningInfos(upperLimit: number): Promise>; + function getExtensionRunningInfos(upperLimit: number, callback: AsyncCallback>): void; + + /** + * Get the top ability information of the display. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi Hide this for inner system use. + * @return Returns the {@link ElementName} info of the top ability. + */ + 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/ability/dataAbilityUtils.d.ts b/api/@ohos.app.ability.dataAbilityHelper.d.ts similarity index 100% rename from api/ability/dataAbilityUtils.d.ts rename to api/@ohos.app.ability.dataAbilityHelper.d.ts diff --git a/api/@ohos.app.ability.dataUriUtils.d.ts b/api/@ohos.app.ability.dataUriUtils.d.ts new file mode 100644 index 0000000000..0d8dafaee4 --- /dev/null +++ b/api/@ohos.app.ability.dataUriUtils.d.ts @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2021 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. + */ + +/** + * A utility class used for handling objects that use the DataAbilityHelper scheme. + * @name dataUriUtils + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission N/A + */ +declare namespace dataUriUtils { + /** + * Obtains the ID attached to the end of the path component of the given uri. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param uri Indicates the uri object from which the ID is to be obtained. + * @return Returns the ID attached to the end of the path component; + */ + function getId(uri: string): number + + /** + * Attaches the given ID to the end of the path component of the given uri. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param uri Indicates the uri string from which the ID is to be obtained. + * @param id Indicates the ID to attach. + * @return Returns the uri object with the given ID attached. + */ + function attachId(uri: string, id: number): string + + /** + * Deletes the ID from the end of the path component of the given uri. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param uri Indicates the uri object from which the ID is to be deleted. + * @return Returns the uri object with the ID deleted. + */ + function deleteId(uri: string): string + + /** + * Updates the ID in the specified uri + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param uri Indicates the uri object to be updated. + * @param id Indicates the new ID. + * @return Returns the updated uri object. + */ + function updateId(uri: string, id: number): string + +} +export default dataUriUtils; \ No newline at end of file diff --git a/api/@ohos.app.ability.errorManager.d.ts b/api/@ohos.app.ability.errorManager.d.ts new file mode 100644 index 0000000000..dda4361c79 --- /dev/null +++ b/api/@ohos.app.ability.errorManager.d.ts @@ -0,0 +1,59 @@ +/* + * 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 { AsyncCallback } from './basic'; +import * as _ErrorObserver from './application/ErrorObserver'; + +/** + * This module provides the function of error manager. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @import import errorManager from '@ohos.application.errorManager' + * @permission N/A + */ +declare namespace errorManager { + /** + * Register error observer. + * + * @default - + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param observer The error observer. + * @return Returns the number code of the observer. + */ + function registerErrorObserver(observer: ErrorObserver): number; + + /** + * Unregister error observer. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param observerId Indicates the number code of the observer. + * @return - + */ + 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.app.ability.missionManager.d.ts b/api/@ohos.app.ability.missionManager.d.ts new file mode 100644 index 0000000000..4147a91829 --- /dev/null +++ b/api/@ohos.app.ability.missionManager.d.ts @@ -0,0 +1,186 @@ +/* + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from './basic'; +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"; + +/** + * This module provides the capability to manage abilities and obtaining system task information. + * + * @name missionManager + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @permission ohos.permission.MANAGE_MISSIONS + * @systemapi hide for inner use. + */ +declare namespace missionManager { + /** + * Register the missionListener to ams. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param listener Indicates the MissionListener to be registered. + * @return The index number of the MissionListener. + */ + function registerMissionListener(listener: MissionListener): number; + + /** + * Unrgister the missionListener to ams. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param listenerId Indicates the listener id to be unregistered. + * @return - + */ + function unregisterMissionListener(listenerId: number, callback: AsyncCallback): void; + function unregisterMissionListener(listenerId: number): Promise; + + /** + * Get the missionInfo with the given missionId. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param deviceId Indicates the device to be queried. + * @param missionId Indicates mission id to be queried. + * @return the {@link MissionInfo} of the given id. + */ + function getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback): void; + function getMissionInfo(deviceId: string, missionId: number): Promise; + + /** + * Get the missionInfo with the given missionId. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param deviceId Indicates the device to be queried. + * @param numMax Indicates the maximum number of returned missions. + * @return The array of the {@link MissionInfo}. + */ + function getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback>): void; + function getMissionInfos(deviceId: string, numMax: number): Promise>; + + /** + * Get the mission snapshot with the given missionId. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param deviceId Indicates the device to be queried. + * @param missionId Indicates mission id to be queried. + * @return The {@link MissionSnapshot} of the given id. + */ + function getMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback): void; + function getMissionSnapShot(deviceId: string, missionId: number): Promise; + + /** + * Get the mission low resolution snapshot with the given missionId. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param deviceId Indicates the device to be queried. + * @param missionId Indicates mission id to be queried. + * @return The {@link MissionSnapshot} of the given id. + */ + function getLowResolutionMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback): void; + function getLowResolutionMissionSnapShot(deviceId: string, missionId: number): Promise; + + /** + * Lock the mission. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param missionId Indicates mission id to be locked. + * @return - + */ + function lockMission(missionId: number, callback: AsyncCallback): void; + function lockMission(missionId: number): Promise; + + /** + * Unlock the mission. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param missionId Indicates mission id to be unlocked. + * @return - + */ + function unlockMission(missionId: number, callback: AsyncCallback): void; + function unlockMission(missionId: number): Promise; + + /** + * Clear the given mission in the ability manager service. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param missionId Indicates mission id to be cleared. + * @return - + */ + function clearMission(missionId: number, callback: AsyncCallback): void; + function clearMission(missionId: number): Promise; + + /** + * Clear all missions in the ability manager service. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @return - + */ + function clearAllMissions(callback: AsyncCallback): void; + function clearAllMissions(): Promise; + + /** + * Schedule the given mission to foreground. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @param missionId Indicates mission id to be moved to foreground. + * @param options Indicates the start options. + * @return - + */ + 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.app.ability.quickFixManager.d.ts b/api/@ohos.app.ability.quickFixManager.d.ts new file mode 100644 index 0000000000..d30e16fe03 --- /dev/null +++ b/api/@ohos.app.ability.quickFixManager.d.ts @@ -0,0 +1,153 @@ +/* + * 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 { AsyncCallback } from "./basic"; + +/** + * Interface of quickFixManager. + * + * @name quickFixManager + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix + * @systemapi Hide this for inner system use. + */ +declare namespace quickFixManager { + /** + * Quick fix info of hap module. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix + * @systemapi Hide this for inner system use. + */ + export interface HapModuleQuickFixInfo { + /** + * Indicates hap module name. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix + * @systemapi Hide this for inner system use. + */ + readonly moduleName: string; + + /** + * Indicates hash value of a hap. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix + * @systemapi Hide this for inner system use. + */ + readonly originHapHash: string; + + /** + * Indicates installed path of quick fix file. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix + * @systemapi Hide this for inner system use. + */ + readonly quickFixFilePath: string; + } + + /** + * Quick fix info of application. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix + * @systemapi Hide this for inner system use. + */ + export interface ApplicationQuickFixInfo { + /** + * Bundle name. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix + * @systemapi Hide this for inner system use. + */ + readonly bundleName: string; + + /** + * The version number of the bundle. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix + * @systemapi Hide this for inner system use. + */ + readonly bundleVersionCode: number; + + /** + * The version name of the bundle. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix + * @systemapi Hide this for inner system use. + */ + readonly bundleVersionName: string; + + /** + * The version number of the quick fix. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix + * @systemapi Hide this for inner system use. + */ + readonly quickFixVersionCode: number; + + /** + * The version name of the quick fix. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix + * @systemapi Hide this for inner system use. + */ + readonly quickFixVersionName: string; + + /** + * Hap module quick fix info. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix + * @systemapi Hide this for inner system use. + */ + readonly hapModuleQuickFixInfo: Array; + } + + /** + * Apply quick fix files. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix + * @param hapModuleQuickFixFiles Quick fix files need to apply, this value should include file path and file name. + * @systemapi Hide this for inner system use. + * @return - + * @permission ohos.permission.INSTALL_BUNDLE + */ + function applyQuickFix(hapModuleQuickFixFiles: Array, callback: AsyncCallback): void; + function applyQuickFix(hapModuleQuickFixFiles: Array): Promise; + + /** + * Get application quick fix info by bundle name. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix + * @param bundleName Bundle name wish to query. + * @systemapi Hide this for inner system use. + * @return Returns the {@link ApplicationQuickFixInfo}. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + */ + function getApplicationQuickFixInfo(bundleName: string, callback: AsyncCallback): void; + function getApplicationQuickFixInfo(bundleName: string): Promise; +} + +export default quickFixManager; \ No newline at end of file diff --git a/api/@ohos.app.featureAbility.context.d.ts b/api/@ohos.app.featureAbility.context.d.ts new file mode 100644 index 0000000000..b3aa7ea60a --- /dev/null +++ b/api/@ohos.app.featureAbility.context.d.ts @@ -0,0 +1,328 @@ +/* +* Copyright (c) 2021 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 { AsyncCallback } from '../basic'; +import { ApplicationInfo } from '../bundle/applicationInfo'; +import { ProcessInfo } from './processInfo'; +import { ElementName } from '../bundle/elementName'; +import BaseContext from '../application/BaseContext'; +import { HapModuleInfo } from '../bundle/hapModuleInfo'; +import { AppVersionInfo } from './appVersionInfo'; +import { AbilityInfo } from '../bundle/abilityInfo'; +import bundle from '../@ohos.bundle'; + + +/** + * 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 6 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @import import abilityManager from 'app/context' + * @permission N/A + * @FAModelOnly + */ +export interface Context extends BaseContext { + + /** + * Get the local root dir of an app. If it is the first call, the dir + * will be created. + * @note If in the context of the ability, return the root dir of + * the ability; if in the context of the application, return the + * root dir of the application. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @return the root dir + * @FAModelOnly + */ + getOrCreateLocalDir(): Promise; + getOrCreateLocalDir(callback: AsyncCallback): void; + /** + * Verify whether the specified permission is allowed for a particular + * pid and uid running in the system. + * @param permission The name of the specified permission + * @param pid process id + * @param uid user id + * @note Pid and uid are optional. If you do not pass in pid and uid, + * it will check your own permission. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @return asynchronous callback with {@code 0} if the PID + * and UID have the permission; callback with {@code -1} otherwise. + * @FAModelOnly + */ + verifyPermission(permission: string, options?: PermissionOptions): Promise; + verifyPermission(permission: string, options: PermissionOptions, callback: AsyncCallback): void; + verifyPermission(permission: string, callback: AsyncCallback): void; + + /** + * Requests certain permissions from the system. + * @param permissions Indicates the list of permissions to be requested. This parameter cannot be null. + * @param requestCode Indicates the request code to be passed to the PermissionRequestResult + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + requestPermissionsFromUser(permissions: Array, requestCode: number, resultCallback: AsyncCallback): void; + requestPermissionsFromUser(permissions: Array, requestCode: number): Promise; + + /** + * Obtains information about the current application. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + getApplicationInfo(callback: AsyncCallback): void + getApplicationInfo(): Promise; + + /** + * Obtains the bundle name of the current ability. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + getBundleName(callback: AsyncCallback): void + getBundleName(): Promise; + + /** + * Obtains the current display orientation of this ability. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + getDisplayOrientation(callback: AsyncCallback): void + getDisplayOrientation(): Promise; + + /** + * Obtains the absolute path to the application-specific cache directory + * @since 6 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @deprecated since 7 + */ + getExternalCacheDir(callback: AsyncCallback): void + getExternalCacheDir(): Promise; + + /** + * Sets the display orientation of the current ability. + * @param orientation Indicates the new orientation for the current ability. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + setDisplayOrientation(orientation: bundle.DisplayOrientation, callback: AsyncCallback): void + setDisplayOrientation(orientation: bundle.DisplayOrientation): Promise; + + /** + * Sets whether to show this ability on top of the lock screen whenever the lock screen is displayed, keeping the ability in the ACTIVE state. + * @param show Specifies whether to show this ability on top of the lock screen. The value true means to show it on the lock screen, and the value false means not. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + setShowOnLockScreen(show: boolean, callback: AsyncCallback): void + setShowOnLockScreen(show: boolean): Promise; + + /** + * Sets whether to wake up the screen when this ability is restored. + * @param wakeUp Specifies whether to wake up the screen. The value true means to wake it up, and the value false means not. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + setWakeUpScreen(wakeUp: boolean, callback: AsyncCallback): void + setWakeUpScreen(wakeUp: boolean): Promise; + + /** + * Obtains information about the current process, including the process ID and name. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + getProcessInfo(callback: AsyncCallback): void + getProcessInfo(): Promise; + + /** + * Obtains the ohos.bundle.ElementName object of the current ability. This method is available only to Page abilities. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + getElementName(callback: AsyncCallback): void + getElementName(): Promise; + + /** + * Obtains the name of the current process. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + getProcessName(callback: AsyncCallback): void + getProcessName(): Promise; + + /** + * Obtains the bundle name of the ability that called the current ability. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + getCallingBundle(callback: AsyncCallback): void + getCallingBundle(): Promise; + + /** + * Obtains the file directory of this application on the internal storage. + * @since 6 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + getFilesDir(callback: AsyncCallback): void; + getFilesDir(): Promise; + + /** + * Obtains the cache directory of this application on the internal storage. + * @since 6 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + getCacheDir(callback: AsyncCallback): void; + getCacheDir(): Promise; + + /** + * Obtains the distributed file path for storing ability or application data files. + * If the distributed file path does not exist, the system will create a path and return the created path. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + getOrCreateDistributedDir(): Promise; + getOrCreateDistributedDir(callback: AsyncCallback): void; + + /** + * Obtains the application type. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + getAppType(callback: AsyncCallback): void + getAppType(): Promise; + + /** + * Obtains the ModuleInfo object for this application. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + getHapModuleInfo(callback: AsyncCallback): void + getHapModuleInfo(): Promise; + + /** + * Obtains the application version information. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + getAppVersionInfo(callback: AsyncCallback): void + getAppVersionInfo(): Promise; + + /** + * Obtains the context of this application. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + getApplicationContext(): Context; + + /** + * Checks the detailed information of this ability. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + getAbilityInfo(callback: AsyncCallback): void + getAbilityInfo(): Promise; + + /** + * Checks whether the configuration of this ability is changing. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @return true if the configuration of this ability is changing and false otherwise. + * @FAModelOnly + */ + isUpdatingConfigurations(callback: AsyncCallback): void; + isUpdatingConfigurations(): Promise; + + /** + * Informs the system of the time required for drawing this Page ability. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + printDrawnCompleted(callback: AsyncCallback): void; + printDrawnCompleted(): Promise; +} + +/** + * @name the result of requestPermissionsFromUser with asynchronous callback + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission N/A + * @FAModelOnly + */ +interface PermissionRequestResult { + /** + * @default The request code passed in by the user + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + requestCode: number; + + /** + * @default The permissions passed in by the user + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + permissions: Array; + + /** + * @default The results for the corresponding request permissions + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + authResults: Array; +} + +/** + * @name PermissionOptions + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission N/A + * @FAModelOnly + */ +interface PermissionOptions { + /** + * @default The process id + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + pid?: number; + + /** + * @default The user id + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly + */ + uid?: number; +} diff --git a/api/@ohos.app.featureAbility.d.ts b/api/@ohos.app.featureAbility.d.ts new file mode 100644 index 0000000000..090d1321b2 --- /dev/null +++ b/api/@ohos.app.featureAbility.d.ts @@ -0,0 +1,246 @@ +/* + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from './basic'; +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'; + +/** + * A Feature Ability represents an ability with a UI and is designed to interact with users. + * @name featureAbility + * @since 6 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @permission N/A + * @FAModelOnly + */ +declare namespace featureAbility { + /** + * Obtain the want sended from the source ability. + * + * @since 6 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param parameter Indicates the ability to start. + * @return - + * @FAModelOnly + */ + function getWant(callback: AsyncCallback): void; + function getWant(): Promise; + + /** + * Starts a new ability. + * + * @since 6 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param parameter Indicates the ability to start. + * @return - + * @FAModelOnly + */ + function startAbility(parameter: StartAbilityParameter, callback: AsyncCallback): void; + function startAbility(parameter: StartAbilityParameter): Promise; + + /** + * Obtains the application context. + * + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @return Returns the application context. + * @since 6 + * @FAModelOnly + */ + function getContext(): Context; + + /** + * Starts an ability and returns the execution result when the ability is destroyed. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param parameter Indicates the ability to start. + * @return Returns the {@link AbilityResult}. + * @FAModelOnly + */ + function startAbilityForResult(parameter: StartAbilityParameter, callback: AsyncCallback): void; + function startAbilityForResult(parameter: StartAbilityParameter): Promise; + + /** + * Sets the result code and data to be returned by this Page ability to the caller + * and destroys this Page ability. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param parameter Indicates the result to return. + * @return - + * @FAModelOnly + */ + function terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback): void; + function terminateSelfWithResult(parameter: AbilityResult): Promise; + + /** + * Destroys this Page ability. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @return - + * @FAModelOnly + */ + function terminateSelf(callback: AsyncCallback): void; + function terminateSelf(): Promise; + + /** + * Obtains the dataAbilityHelper. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param uri Indicates the path of the file to open. + * @return Returns the dataAbilityHelper. + * @FAModelOnly + */ + function acquireDataAbilityHelper(uri: string): DataAbilityHelper; + + /** + * Checks whether the main window of this ability has window focus. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @return Returns {@code true} if this ability currently has window focus; returns {@code false} otherwise. + * @FAModelOnly + */ + function hasWindowFocus(callback: AsyncCallback): void; + function hasWindowFocus(): Promise; + + /** + * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template. + * @default - + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param request The element name of the service ability + * @param options The remote object instance + * @return Returns the number code of the ability connected + * @FAModelOnly + */ + function connectAbility(request: Want, options:ConnectOptions ): number; + + /** + * The callback interface was connect successfully. + * @default - + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param connection The number code of the ability connected + * @FAModelOnly + */ + function disconnectAbility(connection: number, callback:AsyncCallback): void; + function disconnectAbility(connection: number): Promise; + + /** + * Obtains the window corresponding to the current ability. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @return Returns the window corresponding to the current ability. + * @FAModelOnly + */ + function getWindow(callback: AsyncCallback): void; + function getWindow(): Promise; + + /** + * Obtain the window configuration. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @FAModelOnly + */ + export enum AbilityWindowConfiguration { + WINDOW_MODE_UNDEFINED = 0, + WINDOW_MODE_FULLSCREEN = 1, + WINDOW_MODE_SPLIT_PRIMARY = 100, + WINDOW_MODE_SPLIT_SECONDARY = 101, + WINDOW_MODE_FLOATING = 102 + } + + /** + * Obtain the window properties. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @FAModelOnly + */ + export enum AbilityStartSetting { + BOUNDS_KEY = "abilityBounds", + WINDOW_MODE_KEY = "windowMode", + DISPLAY_ID_KEY = "displayId" + } + + /** + * Obtain the errorCode. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @FAModelOnly + */ + export enum ErrorCode { + NO_ERROR = 0, + INVALID_PARAMETER = -1, + ABILITY_NOT_FOUND = -2, + PERMISSION_DENY = -3 + } + + /** + * Indicates the operation type of data. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @FAModelOnly + */ + export enum DataAbilityOperationType { + TYPE_INSERT = 1, + TYPE_UPDATE = 2, + 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 + + /** + * 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.app.form.FormExtensionContext.d.ts b/api/@ohos.app.form.FormExtensionContext.d.ts new file mode 100644 index 0000000000..2f43e55ca8 --- /dev/null +++ b/api/@ohos.app.form.FormExtensionContext.d.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback } from "../basic"; +import ExtensionContext from "./ExtensionContext"; +import formBindingData from '../@ohos.application.formBindingData'; +import Want from '../@ohos.application.Want'; + +/** + * The context of form extension. It allows access to + * formExtension-specific resources. + * + * @since 9 + * @syscap SystemCapability.Ability.Form + * @permission N/A + * @StageModelOnly + */ +export default class FormExtensionContext extends ExtensionContext { + /** + * start an ability within the same bundle. + * + * @since 9 + * @syscap SystemCapability.Ability.Form + * @systemapi hide for inner use + * @param want includes ability name, parameters and relative info sending to an ability. + * @return - + * @StageModelOnly + */ + startAbility(want: Want, callback: AsyncCallback): void; + startAbility(want: Want): Promise; +} diff --git a/api/@ohos.app.particleAbility.d.ts b/api/@ohos.app.particleAbility.d.ts new file mode 100644 index 0000000000..0f9f7689b2 --- /dev/null +++ b/api/@ohos.app.particleAbility.d.ts @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2021 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 { AsyncCallback } from './basic'; +import { StartAbilityParameter } from './ability/startAbilityParameter'; +import { DataAbilityHelper } from './ability/dataAbilityHelper'; +import { NotificationRequest } from './notification/notificationRequest'; +import { ConnectOptions } from './ability/connectOptions'; +import Want from './@ohos.application.Want'; + +/** + * A Particle Ability represents an ability with service. + * @name particleAbility + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @permission N/A + * @FAModelOnly + */ +declare namespace particleAbility { + /** + * Service ability uses this method to start a specific ability. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param parameter Indicates the ability to start. + * @return - + * @FAModelOnly + */ + function startAbility(parameter: StartAbilityParameter, callback: AsyncCallback): void; + function startAbility(parameter: StartAbilityParameter): Promise; + + /** + * Destroys this service ability. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @return - + * @FAModelOnly + */ + function terminateSelf(callback: AsyncCallback): void; + function terminateSelf(): Promise; + + /** + * Obtains the dataAbilityHelper. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param uri Indicates the path of the file to open. + * @return Returns the dataAbilityHelper. + * @FAModelOnly + */ + function acquireDataAbilityHelper(uri: string): DataAbilityHelper; + + /** + * Keep this Service ability in the background and display a notification bar. + * + * @since 7 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @permission ohos.permission.KEEP_BACKGROUND_RUNNING + * @param id Identifies the notification bar information. + * @param request Indicates the notificationRequest instance containing information for displaying a notification bar. + * @FAModelOnly + * @deprecated + */ + function startBackgroundRunning(id: number, request: NotificationRequest, callback: AsyncCallback): void; + function startBackgroundRunning(id: number, request: NotificationRequest): Promise; + + /** + * Cancel background running of this ability to free up system memory. + * + * @since 7 + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask + * @FAModelOnly + * @deprecated + */ + function cancelBackgroundRunning(callback: AsyncCallback): void; + function cancelBackgroundRunning(): Promise; + + /** + * Connects an ability to a Service ability. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param request Indicates the Service ability to connect. + * @param options Callback object for the client. If this parameter is null, an exception is thrown. + * @return unique identifier of the connection between the client and the service side. + * @FAModelOnly + */ + function connectAbility(request: Want, options:ConnectOptions): number; + + /** + * Disconnects ability to a Service ability. + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @param connection the connection id returned from connectAbility api. + * @FAModelOnly + */ + function disconnectAbility(connection: number, callback:AsyncCallback): void; + function disconnectAbility(connection: number): Promise; + + /** + * Obtain the errorCode. + * + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @FAModelOnly + */ + export enum ErrorCode { + INVALID_PARAMETER = -1 + } +} +export default particleAbility; diff --git a/api/@ohos.app.wantAgent.d.ts b/api/@ohos.app.wantAgent.d.ts new file mode 100644 index 0000000000..48a996a481 --- /dev/null +++ b/api/@ohos.app.wantAgent.d.ts @@ -0,0 +1,267 @@ +/* + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback , Callback} from './basic'; +import Want from './@ohos.application.Want'; +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 + * the bundle name, UID of an {@link WantAgent} object. + * + * @name wantAgent + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @import import wantAgent from '@ohos.wantAgent'; + * @permission N/A + */ +declare namespace wantAgent { + /** + * Obtains the bundle name of a WantAgent. + * + * @param WantAgent whose bundle name to obtain. + * @return Returns the bundle name of the {@link WantAgent} if any. + */ + function getBundleName(agent: WantAgent, callback: AsyncCallback): void; + function getBundleName(agent: WantAgent): Promise; + + /** + * Obtains the UID of a WantAgent. + * + * @param WantAgent whose UID to obtain. + * @return Returns the UID of the {@link WantAgent} if any; returns {@code -1} otherwise. + */ + function getUid(agent: WantAgent, callback: AsyncCallback): void; + function getUid(agent: WantAgent): Promise; + + /** + * Obtains the {@link Want} of an {@link WantAgent}. + * + * @param agent Indicates the {@link WantAgent} whose UID is to be obtained. + * @return Returns the {@link Want} of the {@link WantAgent}. + * @systemapi Hide this for inner system use. + */ + function getWant(agent: WantAgent, callback: AsyncCallback): void; + + /** + * Obtains the {@link Want} of an {@link WantAgent}. + * + * @param agent Indicates the {@link WantAgent} whose UID is to be obtained. + * @return Returns the {@link Want} of the {@link WantAgent}. + * @systemapi Hide this for inner system use. + */ + function getWant(agent: WantAgent): Promise; + + /** + * Cancels a WantAgent. Only the application that creates the WantAgent can cancel it. + * + * @param WantAgent to cancel. + */ + function cancel(agent: WantAgent, callback: AsyncCallback): void; + function cancel(agent: WantAgent): Promise; + + /** + * Triggers a WantAgent. + * + * @param WantAgent to trigger. + * @param Trigger parameters. + * @param callback Indicates the callback method to be called after the {@link WantAgent} is triggered. + */ + function trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback): void; + + /** + * Triggers a WantAgent. + * + * @since 9 + * @param WantAgent to trigger. + * @param Trigger parameters. + * @param callback Indicates the AsyncCallback method to be called after the {@link WantAgent} is triggered. + */ + function trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: AsyncCallback): void; + + /** + * Checks whether two WantAgent objects are equal. + * + * @param WantAgent to compare. + * @param WantAgent to compare. + * @return Returns {@code true} If the two objects are the same; returns {@code false} otherwise. + */ + function equal(agent: WantAgent, otherAgent: WantAgent, callback: AsyncCallback): void; + function equal(agent: WantAgent, otherAgent: WantAgent): Promise; + + /** + * Obtains a WantAgent object. + * + * @param Information about the WantAgent object to obtain. + * @return Returns the created {@link WantAgent} object. + */ + function getWantAgent(info: WantAgentInfo, callback: AsyncCallback): void; + function getWantAgent(info: WantAgentInfo): Promise; + + /** + * Obtains the {@link OperationType} of a {@link WantAgent}. + * + * @since 9 + * @param agent Indicates the {@link WantAgent} whose {@link OperationType} is to be obtained. + * @return Returns the {@link OperationType} of the {@link WantAgent}. + */ + function getOperationType(agent: WantAgent, callback: AsyncCallback): void; + function getOperationType(agent: WantAgent): Promise; + + /** + * Enumerates flags for using a WantAgent. + */ + export enum WantAgentFlags { + /** + * Indicates that the WantAgent can be used only once. + * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT. + */ + ONE_TIME_FLAG = 0, + + /** + * Indicates that null is returned if the WantAgent does not exist. + * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT. + */ + NO_BUILD_FLAG, + + /** + * Indicates that the existing WantAgent should be canceled before a new object is generated. + * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT. + */ + CANCEL_PRESENT_FLAG, + + /** + * Indicates that the system only replaces the extra data of the existing WantAgent with that of the new object. + * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT. + */ + UPDATE_PRESENT_FLAG, + + /** + * Indicates that the created WantAgent should be immutable. + */ + CONSTANT_FLAG, + + /** + * Indicates that the current value of element can be replaced when the WantAgent is triggered. + */ + REPLACE_ELEMENT, + + /** + * Indicates that the current value of action can be replaced when the WantAgent is triggered. + */ + REPLACE_ACTION, + + /** + * Indicates that the current value of uri can be replaced when the WantAgent is triggered. + */ + REPLACE_URI, + + /** + * Indicates that the current value of entities can be replaced when the WantAgent is triggered. + */ + REPLACE_ENTITIES, + + /** + * Indicates that the current value of packageName can be replaced when the WantAgent is triggered. + */ + REPLACE_BUNDLE + } + + /** + * Identifies the operation for using a WantAgent, such as starting an ability or sending a common event. + */ + export enum OperationType { + /** + * Unknown operation. + */ + UNKNOWN_TYPE = 0, + + /** + * Starts an ability with a UI. + */ + START_ABILITY, + + /** + * Starts multiple abilities with a UI. + */ + START_ABILITIES, + + /** + * Starts an ability without a UI. + */ + START_SERVICE, + + /** + * Sends a common event. + */ + SEND_COMMON_EVENT + } + + /** + * Describes the data returned by after wantAgent.trigger is called. + */ + export interface CompleteData { + /** + * Triggered WantAgent. + */ + info: WantAgent; + + /** + * Existing Want that is triggered. + */ + want: Want; + + /** + * Request code used to trigger the WantAgent. + */ + finalCode: number; + + /** + * Final data collected by the common event. + */ + finalData: string; + + /** + * Extra data collected by the common event. + */ + 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 +} + +/** + * WantAgent object. + */ +export type WantAgent = object; + +export default wantAgent; -- Gitee From 39cb6d62b068f321cb2b31b38ab7f0bde75fc3a3 Mon Sep 17 00:00:00 2001 From: yangzk Date: Mon, 19 Sep 2022 16:22:54 +0800 Subject: [PATCH 137/438] IssueNo: #I5RT32 Description: fix import Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: I149180f21e9df71a846b4d9c6b02fed9d8014633 --- api/@ohos.ability.dataUriUtils.d.ts | 2 + api/@ohos.ability.featureAbility.d.ts | 2 + api/@ohos.ability.particleAbility.d.ts | 2 + api/@ohos.app.ability.Ability.d.ts | 251 +++---- api/@ohos.app.ability.AbilityContext.d.ts | 512 ++++++++++---- api/@ohos.app.ability.ApplicationContext.d.ts | 74 +- api/@ohos.app.ability.Context.d.ts | 145 ++-- api/@ohos.app.ability.EventHub.d.ts | 73 +- ...s.app.ability.ServiceExtensionContext.d.ts | 295 +++++--- api/@ohos.app.ability.abilityDelegator.d.ts | 309 ++++++--- api/@ohos.app.ability.abilityManager.d.ts | 112 ++- api/@ohos.app.ability.dataAbilityHelper.d.ts | 106 +-- api/@ohos.app.ability.dataUriUtils.d.ts | 85 +-- api/@ohos.app.ability.errorManager.d.ts | 35 +- api/@ohos.app.ability.missionManager.d.ts | 228 ++++-- api/@ohos.app.ability.quickFixManager.d.ts | 123 ++-- api/@ohos.app.featureAbility.context.d.ts | 653 ++++++++++++------ api/@ohos.app.featureAbility.d.ts | 482 +++++++------ api/@ohos.app.form.FormExtensionContext.d.ts | 28 +- api/@ohos.app.particleAbility.d.ts | 130 ++-- api/@ohos.app.wantAgent.d.ts | 177 +++-- api/@ohos.application.Ability.d.ts | 10 + api/@ohos.application.abilityManager.d.ts | 2 + api/@ohos.application.errorManager.d.ts | 2 + api/@ohos.application.missionManager.d.ts | 2 + api/@ohos.application.quickFixManager.d.ts | 2 + api/@ohos.wantAgent.d.ts | 2 + api/ability/dataAbilityHelper.d.ts | 34 +- api/app/context.d.ts | 6 + api/application/AbilityContext.d.ts | 2 + api/application/ApplicationContext.d.ts | 2 + api/application/Context.d.ts | 2 + api/application/EventHub.d.ts | 2 + api/application/ServiceExtensionContext.d.ts | 2 + api/application/abilityDelegator.d.ts | 2 + 35 files changed, 2470 insertions(+), 1426 deletions(-) diff --git a/api/@ohos.ability.dataUriUtils.d.ts b/api/@ohos.ability.dataUriUtils.d.ts index af7b680500..f10e53a20d 100644 --- a/api/@ohos.ability.dataUriUtils.d.ts +++ b/api/@ohos.ability.dataUriUtils.d.ts @@ -19,6 +19,8 @@ * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A + * @deprecated since 9 + * @useinstead @ohos.app.ability.dataUriUtils */ declare namespace dataUriUtils { /** diff --git a/api/@ohos.ability.featureAbility.d.ts b/api/@ohos.ability.featureAbility.d.ts index 944d6d321b..fee1526470 100644 --- a/api/@ohos.ability.featureAbility.d.ts +++ b/api/@ohos.ability.featureAbility.d.ts @@ -32,6 +32,8 @@ import window from './@ohos.window'; * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @permission N/A * @FAModelOnly + * @deprecated since 9 + * @useinstead @ohos.app.featureAbility */ declare namespace featureAbility { /** diff --git a/api/@ohos.ability.particleAbility.d.ts b/api/@ohos.ability.particleAbility.d.ts index 04321ffcd7..f822ef4578 100644 --- a/api/@ohos.ability.particleAbility.d.ts +++ b/api/@ohos.ability.particleAbility.d.ts @@ -27,6 +27,8 @@ import Want from './@ohos.application.Want'; * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @permission N/A * @FAModelOnly + * @deprecated since 9 + * @useinstead @ohos.app.particleAbility */ declare namespace particleAbility { /** diff --git a/api/@ohos.app.ability.Ability.d.ts b/api/@ohos.app.ability.Ability.d.ts index 99cfd35561..340c4e952a 100755 --- a/api/@ohos.app.ability.Ability.d.ts +++ b/api/@ohos.app.ability.Ability.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -14,7 +14,7 @@ */ import AbilityConstant from "./@ohos.application.AbilityConstant"; -import AbilityContext from "./application/AbilityContext"; +import AbilityContext from "./@ohos.app.ability.AbilityContext"; import Want from './@ohos.application.Want'; import window from './@ohos.window'; import { Configuration } from './@ohos.application.Configuration'; @@ -22,13 +22,10 @@ import rpc from './@ohos.rpc'; /** * The prototype of the listener function interface registered by the Caller. - * - * @since 9 + * @typedef OnReleaseCallBack * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @permission N/A - * @param msg Monitor status notification information. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ export interface OnReleaseCallBack { (msg: string): void; @@ -36,13 +33,10 @@ export interface OnReleaseCallBack { /** * The prototype of the message listener function interface registered by the Callee. - * - * @since 9 + * @typedef CalleeCallBack * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @permission N/A - * @param indata Notification data notified from the caller. - * @return rpc.Sequenceable - * @StageModelOnly + * @stagemodelonly + * @since 9 */ export interface CalleeCallBack { (indata: rpc.MessageParcel): rpc.Sequenceable; @@ -50,268 +44,237 @@ export interface CalleeCallBack { /** * The interface of a Caller. - * - * @since 9 + * @interface * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @permission N/A - * @StageModelOnly + * @stagemodelonly + * @since 9 */ export interface Caller { - /** + /** * Notify the server of Sequenceable type data. - * - * @since 9 + * @param { string } method - The notification event string listened to by the callee. + * @param { rpc.Sequenceable } data - Notification data to the callee. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @param method The notification event string listened to by the callee. - * @param data Notification data to the callee. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ - call(method: string, data: rpc.Sequenceable): Promise; + call(method: string, data: rpc.Sequenceable): Promise; /** * Notify the server of Sequenceable type data and return the notification result. - * - * @since 9 + * @param { string } method - The notification event string listened to by the callee. + * @param { rpc.Sequenceable } data - Notification data to the callee. + * @returns { Promise } Returns the callee's notification result data. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @param method The notification event string listened to by the callee. - * @param data Notification data to the callee. - * @return Returns the callee's notification result data on success, and returns undefined on failure. - * @StageModelOnly + * @stagemodelonly + * @since 9 */ - callWithResult(method: string, data: rpc.Sequenceable): Promise; + callWithResult(method: string, data: rpc.Sequenceable): Promise; /** * Clear service records. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ - release(): void; + release(): void; /** * Register death listener notification callback. - * - * @since 9 + * @param { OnReleaseCallBack } callback - Register a callback function for listening for notifications. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @param callback Register a callback function for listening for notifications. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ - onRelease(callback: OnReleaseCallBack): void; - } + onRelease(callback: OnReleaseCallBack): void; +} - /** +/** * The interface of a Callee. - * - * @since 9 + * @interface * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @permission N/A - * @StageModelOnly + * @stagemodelonly + * @since 9 */ export interface Callee { - - /** + /** * Register data listener callback. - * - * @since 9 + * @param { string } method - A string registered to listen for notification events. + * @param { CalleeCallBack } callback - Register a callback function that listens for notification events. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @param method A string registered to listen for notification events. - * @param callback Register a callback function that listens for notification events. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ - on(method: string, callback: CalleeCallBack): void; + on(method: string, callback: CalleeCallBack): void; - /** + /** * Unregister data listener callback. - * - * @since 9 + * @param { string } method - A string registered to listen for notification events. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @param method A string registered to listen for notification events. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ - off(method: string): void; - } + off(method: string): void; +} /** * The class of an ability. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @permission N/A - * @StageModelOnly + * @stagemodelonly + * @since 9 */ export default class Ability { /** * Indicates configuration information about an ability context. - * - * @since 9 + * @type { AbilityContext } * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @StageModelOnly + * @stagemodelonly + * @since 9 */ context: AbilityContext; /** * Indicates ability launch want. - * - * @since 9 + * @type { Want } * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @StageModelOnly + * @stagemodelonly + * @since 9 */ launchWant: Want; /** * Indicates ability last request want. - * - * @since 9 + * @type { Want } * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @StageModelOnly + * @stagemodelonly + * @since 9 */ lastRequestWant: Want; /** * Call Service Stub Object. - * - * @since 9 + * @type { Callee } * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @StageModelOnly + * @stagemodelonly + * @since 9 */ - callee: Callee; + callee: Callee; /** * Called back when an ability is started for initialization. - * - * @since 9 + * @param { Want } want - Indicates the want info of the created ability. + * @param { AbilityConstant.LaunchParam } param - Indicates the launch param. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @param want Indicates the want info of the created ability. - * @param param Indicates the launch param. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onCreate(want: Want, param: AbilityConstant.LaunchParam): void; /** * Called back when an ability window stage is created. - * - * @since 9 + * @param { window.WindowStage } windowStage - Indicates the created WindowStage. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @param windowStage Indicates the created WindowStage. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onWindowStageCreate(windowStage: window.WindowStage): void; /** * Called back when an ability window stage is destroyed. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onWindowStageDestroy(): void; /** * Called back when an ability window stage is restored. - * - * @since 9 + * @param { window.WindowStage } windowStage - window stage to restore * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @param windowStage window stage to restore - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onWindowStageRestore(windowStage: window.WindowStage): void; /** * Called back before an ability is destroyed. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onDestroy(): void; /** * Called back when the state of an ability changes to foreground. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onForeground(): void; /** * Called back when the state of an ability changes to background. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onBackground(): void; /** * Called back when an ability prepares to continue. - * - * @since 9 + * @param { {[key: string]: any} } wantParam - Indicates the want parameter. + * @returns { AbilityConstant.OnContinueResult } Return the result of onContinue. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @param wantParam Indicates the want parameter. - * @return 0 if ability agrees to continue and saves data successfully, otherwise errcode. - * @StageModelOnly + * @stagemodelonly + * @since 9 */ - onContinue(wantParam : {[key: string]: any}): AbilityConstant.OnContinueResult; + onContinue(wantParam: { [key: string]: any }): AbilityConstant.OnContinueResult; /** * Called when the launch mode of an ability is set to singleton. * This happens when you re-launch an ability that has been at the top of the ability stack. - * - * @since 9 + * @param { Want } want - Indicates the want info of ability. + * @param { AbilityConstant.LaunchParam } launchParams - Indicates the launch parameters. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @param want Indicates the want info of ability. - * @param launchParams Indicates the launch parameters. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onNewWant(want: Want, launchParams: AbilityConstant.LaunchParam): void; /** * Called when the system configuration is updated. - * - * @since 9 + * @param { Configuration } config - Indicates the updated configuration. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @param config Indicates the updated configuration. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onConfigurationUpdated(config: Configuration): void; /** * Called when dump client information is required. * It is recommended that developers don't DUMP sensitive information. - * - * @since 9 + * @param { Array } params - Indicates the params from command. + * @returns { Array } Return the dump info array. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @param params Indicates the params from command. - * @return The dump info array. - * @StageModelOnly + * @stagemodelonly + * @since 9 */ dump(params: Array): Array; /** * Called when the system has determined to trim the memory, for example, when the ability is running in the * background and there is no enough memory for running as many background processes as possible. - * - * @since 9 + * @param { AbilityConstant.MemoryLevel } level - Indicates the memory trim level, which shows the current memory + * usage status. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @param level Indicates the memory trim level, which shows the current memory usage status. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ - onMemoryLevel(level: AbilityConstant.MemoryLevel): void; + onMemoryLevel(level: AbilityConstant.MemoryLevel): void; } diff --git a/api/@ohos.app.ability.AbilityContext.d.ts b/api/@ohos.app.ability.AbilityContext.d.ts index 4febfbf618..9549de949e 100644 --- a/api/@ohos.app.ability.AbilityContext.d.ts +++ b/api/@ohos.app.ability.AbilityContext.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -13,304 +13,516 @@ * limitations under the License. */ -/// - -import { AbilityInfo } from "../bundle/abilityInfo"; -import { AbilityResult } from "../ability/abilityResult"; -import { AsyncCallback } from "../basic"; -import { ConnectOptions } from "../ability/connectOptions"; -import { HapModuleInfo } from "../bundle/hapModuleInfo"; -import Context from "./Context"; -import Want from "../@ohos.application.Want"; -import StartOptions from "../@ohos.application.StartOptions"; -import PermissionRequestResult from "./PermissionRequestResult"; -import { Configuration } from '../@ohos.application.Configuration'; -import Caller from '../@ohos.application.Ability'; +/// + +import { AbilityInfo } from "./bundle/abilityInfo"; +import { AbilityResult } from "./ability/abilityResult"; +import { AsyncCallback } from "./basic"; +import { ConnectOptions } from "./ability/connectOptions"; +import { HapModuleInfo } from "./bundle/hapModuleInfo"; +import Context from "./@ohos.app.ability.Context"; +import Want from "./@ohos.application.Want"; +import StartOptions from "./@ohos.application.StartOptions"; +import PermissionRequestResult from "./application/PermissionRequestResult"; +import { Configuration } from './@ohos.application.Configuration'; +import { Caller } from './@ohos.app.ability.Ability'; import { LocalStorage } from 'StateManagement'; -import image from '../@ohos.multimedia.image'; +import image from './@ohos.multimedia.image'; /** * The context of an ability. It allows access to ability-specific resources. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A - * @StageModelOnly + * @stagemodelonly + * @since 9 */ export default class AbilityContext extends Context { /** * Indicates configuration information about an ability. - * - * @since 9 + * @type { AbilityInfo } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ abilityInfo: AbilityInfo; /** - * Indicates configuration information about an module. - * - * @since 9 + * Indicates configuration information about the module. + * @type { HapModuleInfo } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ currentHapModuleInfo: HapModuleInfo; /** * Indicates configuration information. - * - * @since 9 + * @type { Configuration } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ config: Configuration; /** * Starts a new ability. - * - * @since 9 + * @param want { Want } - Indicates the ability to start. + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the ability to start. - * @param options Indicates the start options. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ startAbility(want: Want, callback: AsyncCallback): void; + + /** + * Starts a new ability. + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; + + /** + * Starts a new ability. + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } options - Indicates the start options. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ startAbility(want: Want, options?: StartOptions): Promise; /** * Get the caller object of the startup capability - * - * @since 9 + * @param { Want } want - Indicates the ability to start. + * @returns { Promise } Returns the Caller interface. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the ability to start. - * @return Returns to the Caller interface on success Returns empty or undefined on failure - * @StageModelOnly + * @stagemodelonly + * @since 9 */ startAbilityByCall(want: Want): Promise; /** * Starts a new ability with account. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want info to start. - * @param accountId Indicates the account to start. - * @param options Indicates the start options. - * @systemapi hide for inner use. - * @return - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS - * @StageModelOnly + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { AsyncCallback } callback - The callback of startAbilityWithAccount. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 */ startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + + /** + * Starts a new ability with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback of startAbilityWithAccount. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; + + /** + * Starts a new ability with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { StartOptions } options - Indicates the start options. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; /** * Starts an ability and returns the execution result when the ability is destroyed. - * - * @since 9 + * @param { Want } want - Indicates the ability to start. + * @param { AsyncCallback } callback - The callback is used to return the result of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the ability to start. - * @param options Indicates the start options. - * @return Returns the {@link AbilityResult}. - * @StageModelOnly + * @stagemodelonly + * @since 9 */ startAbilityForResult(want: Want, callback: AsyncCallback): void; + + /** + * Starts an ability and returns the execution result when the ability is destroyed. + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback is used to return the result of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback): void; + + /** + * Starts an ability and returns the execution result when the ability is destroyed. + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } options - Indicates the start options. + * @returns { Promise } Returns the result of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ startAbilityForResult(want: Want, options?: StartOptions): Promise; /** * Starts an ability and returns the execution result when the ability is destroyed with account. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want info to start. - * @param accountId Indicates the account to start. - * @param options Indicates the start options. - * @systemapi hide for inner use. - * @return Returns the {@link AbilityResult}. * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS - * @StageModelOnly + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { AsyncCallback } callback - The callback is used to return the result of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 */ startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + + /** + * Starts an ability and returns the execution result when the ability is destroyed with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback is used to return the result of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; + + /** + * Starts an ability and returns the execution result when the ability is destroyed with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { StartOptions } options - Indicates the start options. + * @returns { Promise } Returns the result of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; /** * Starts a new service extension ability. - * - * @since 9 + * @param { Want } want - Indicates the want info to start. + * @param { AsyncCallback } callback - The callback of startServiceExtensionAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want info to start. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ startServiceExtensionAbility(want: Want, callback: AsyncCallback): void; + + /** + * Starts a new service extension ability. + * @param { Want } want - Indicates the want info to start. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ startServiceExtensionAbility(want: Want): Promise; /** * Starts a new service extension ability with account. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want info to start. - * @param accountId Indicates the account to start. - * @systemapi hide for inner use. - * @return - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. - * @StageModelOnly + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { AsyncCallback } callback - The callback of startServiceExtensionAbilityWithAccount. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 */ startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + + /** + * Starts a new service extension ability with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; /** * Stops a service within the same application. - * - * @since 9 + * @param { Want } want - Indicates the want info to start. + * @param { AsyncCallback } callback - The callback of stopServiceExtensionAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want info to start. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ stopServiceExtensionAbility(want: Want, callback: AsyncCallback): void; + + /** + * Stops a service within the same application. + * @param { Want } want - Indicates the want info to start. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ stopServiceExtensionAbility(want: Want): Promise; /** * Stops a service within the same application with account. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want info to start. - * @param accountId Indicates the accountId to start. - * @systemapi hide for inner use. - * @return - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. - * @StageModelOnly + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the accountId to start. + * @param { AsyncCallback } callback - The callback of stopServiceExtensionAbilityWithAccount. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 */ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + + /** + * Stops a service within the same application with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the accountId to start. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; /** * Destroys this Page ability. - * - * @since 9 + * @param { AsyncCallback } callback - The callback of terminateSelf. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ terminateSelf(callback: AsyncCallback): void; + + /** + * Destroys this Page ability. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ terminateSelf(): Promise; /** * Sets the result code and data to be returned by this Page ability to the caller * and destroys this Page ability. - * - * @since 9 + * @param { AbilityResult } parameter - Indicates the result to return. + * @param { AsyncCallback } callback - The callback of terminateSelfWithResult. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param parameter Indicates the result to return. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback): void; + + /** + * Sets the result code and data to be returned by this Page ability to the caller + * and destroys this Page ability. + * @param { AbilityResult } parameter - Indicates the result to return. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ terminateSelfWithResult(parameter: AbilityResult): Promise; /** * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template. - * - * @since 9 + * @param { Want } want - The element name of the service ability + * @param { ConnectOptions } options - The remote object instance + * @returns { number } Returns the number code of the ability connected + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want The element name of the service ability - * @param options The remote object instance - * @systemapi Hide this for inner system use. - * @return Returns the number code of the ability connected - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ connectAbility(want: Want, options: ConnectOptions): number; /** * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template with account. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want The element name of the service ability - * @param accountId The account to connect - * @param options The remote object instance - * @systemapi hide for inner use. - * @return Returns the number code of the ability connected * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS - * @StageModelOnly + * @param { Want } want - The element name of the service ability + * @param { number } accountId - The account to connect + * @param { ConnectOptions } options - The remote object instance + * @returns { number } Returns the number code of the ability connected + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 */ connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; /** * The callback interface was connect successfully. - * + * @param { number } connection - The number code of the ability connected + * @param { AsyncCallback } callback - The callback of disconnectAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly * @since 9 + */ + disconnectAbility(connection: number, callback: AsyncCallback): void; + + /** + * The callback interface was connect successfully. + * @param { number } connection - The number code of the ability connected + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param connection The number code of the ability connected - * @systemapi Hide this for inner system use. - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ - disconnectAbility(connection: number, callback:AsyncCallback): void; disconnectAbility(connection: number): Promise; /** * Set mission label of current ability. - * + * @param { string } label - The label of ability that showed in recent missions. + * @param { AsyncCallback } callback - The callback of setMissionLabel. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly * @since 9 + */ + setMissionLabel(label: string, callback: AsyncCallback): void; + + /** + * Set mission label of current ability. + * @param { string } label - The label of ability that showed in recent missions. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param label The label of ability that showed in recent missions. - * @StageModelOnly + * @stagemodelonly + * @since 9 */ - setMissionLabel(label: string, callback:AsyncCallback): void; - setMissionLabel(label: string): Promise; + setMissionLabel(label: string): Promise; /** * Set mission icon of current ability. - * + * @param { image.PixelMap } icon - The icon of ability that showed in recent missions. + * @param { AsyncCallback } callback - The callback of setMissionIcon. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly * @since 9 + */ + setMissionIcon(icon: image.PixelMap, callback: AsyncCallback): void; + + /** + * Set mission icon of current ability. + * @param { image.PixelMap } icon - The icon of ability that showed in recent missions. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param icon The icon of ability that showed in recent missions. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ - setMissionIcon(icon: image.PixelMap, callback:AsyncCallback): void; - setMissionIcon(icon: image.PixelMap): Promise; + setMissionIcon(icon: image.PixelMap): Promise; - /** + /** * Requests certain permissions from the system. - * + * @param { Array } permissions - Indicates the list of permissions to be requested. This parameter + * cannot be null or empty. + * @param { AsyncCallback } requestCallback - The callback is used to return the permission + * request result. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly * @since 9 + */ + requestPermissionsFromUser(permissions: Array, requestCallback: AsyncCallback): void; + + /** + * Requests certain permissions from the system. + * @param { Array } permissions - Indicates the list of permissions to be requested. This parameter + * cannot be null or empty. + * @returns { Promise } Returns the permission request result. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param permissions Indicates the list of permissions to be requested. This parameter cannot be null or empty. - * @return Returns the {@link PermissionRequestResult}. - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ - requestPermissionsFromUser(permissions: Array, requestCallback: AsyncCallback) : void; - requestPermissionsFromUser(permissions: Array) : Promise; + requestPermissionsFromUser(permissions: Array): Promise; /** * Restore window stage data in ability continuation - * - * @since 9 + * @param { LocalStorage } localStorage - the storage data used to restore window stage + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param LocalStorage the storage data used to restore window stage - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ - restoreWindowStage(localStorage: LocalStorage) : void; + restoreWindowStage(localStorage: LocalStorage): void; /** * check to see ability is in terminating state. - * - * @since 9 + * @returns { boolean } Returns true when ability is in terminating state, else returns false. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return Returns true when ability is in terminating state, else returns false. - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ isTerminating(): boolean; } diff --git a/api/@ohos.app.ability.ApplicationContext.d.ts b/api/@ohos.app.ability.ApplicationContext.d.ts index 2f605c61cf..065247fca6 100644 --- a/api/@ohos.app.ability.ApplicationContext.d.ts +++ b/api/@ohos.app.ability.ApplicationContext.d.ts @@ -13,63 +13,81 @@ * limitations under the License. */ -import { AsyncCallback } from "../basic"; -import Context from "./Context"; -import AbilityLifecycleCallback from "../@ohos.application.AbilityLifecycleCallback"; -import EnvironmentCallback from "../@ohos.application.EnvironmentCallback"; +import { AsyncCallback } from "./basic"; +import Context from "./@ohos.app.ability.Context"; +import AbilityLifecycleCallback from "./@ohos.application.AbilityLifecycleCallback"; +import EnvironmentCallback from "./@ohos.application.EnvironmentCallback"; /** * The context of an application. It allows access to application-specific resources. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A - * @StageModelOnly + * @stagemodelonly + * @since 9 */ export default class ApplicationContext extends Context { /** * Register ability lifecycle callback. - * - * @since 9 + * @param { AbilityLifecycleCallback } callback - The ability lifecycle callback. + * @returns { number } Returns the number code of the callback. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param callback The ability lifecycle callback. - * @return Returns the number code of the callback. - * @StageModelOnly + * @stagemodelonly + * @since 9 */ registerAbilityLifecycleCallback(callback: AbilityLifecycleCallback): number; /** * Unregister ability lifecycle callback. - * + * @param { number } callbackId - Indicates the number code of the callback. + * @param { AsyncCallback } callback - The callback of unregisterAbilityLifecycleCallback. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly * @since 9 + */ + unregisterAbilityLifecycleCallback(callbackId: number, callback: AsyncCallback): void; + + /** + * Unregister ability lifecycle callback. + * @param { number } callbackId - Indicates the number code of the callback. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param callbackId Indicates the number code of the callback. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ - unregisterAbilityLifecycleCallback(callbackId: number, callback: AsyncCallback): void; unregisterAbilityLifecycleCallback(callbackId: number): Promise; /** * Register environment callback. - * - * @since 9 + * @param { EnvironmentCallback } callback - The environment callback. + * @returns { number } Returns the number code of the callback. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param callback The environment callback. - * @return Returns the number code of the callback. - * @StageModelOnly + * @stagemodelonly + * @since 9 */ registerEnvironmentCallback(callback: EnvironmentCallback): number; /** * Unregister environment callback. - * + * @param { number } callbackId - Indicates the number code of the callback. + * @param { AsyncCallback } callback - The callback of unregisterEnvironmentCallback. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly * @since 9 + */ + unregisterEnvironmentCallback(callbackId: number, callback: AsyncCallback): void; + + /** + * Unregister environment callback. + * @param { number } callbackId - Indicates the number code of the callback. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param callbackId Indicates the number code of the callback. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ - unregisterEnvironmentCallback(callbackId: number, callback: AsyncCallback): void; unregisterEnvironmentCallback(callbackId: number): Promise; } diff --git a/api/@ohos.app.ability.Context.d.ts b/api/@ohos.app.ability.Context.d.ts index 26c6eadcad..674cefb9e1 100644 --- a/api/@ohos.app.ability.Context.d.ts +++ b/api/@ohos.app.ability.Context.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -13,175 +13,172 @@ * limitations under the License. */ -import { ApplicationInfo } from "../bundle/applicationInfo"; -import resmgr from "../@ohos.resourceManager"; -import BaseContext from "./BaseContext"; -import EventHub from "./EventHub"; -import ApplicationContext from "./ApplicationContext"; +import { ApplicationInfo } from "./bundle/applicationInfo"; +import resmgr from "./@ohos.resourceManager"; +import BaseContext from "./application/BaseContext"; +import EventHub from "./@ohos.app.ability.EventHub"; +import ApplicationContext from "./@ohos.app.ability.ApplicationContext"; /** * The base context of an ability or an application. It allows access to * application-specific resources. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A - * @StageModelOnly + * @stagemodelonly + * @since 9 */ export default class Context extends BaseContext { /** * Indicates the capability of accessing application resources. - * - * @since 9 + * @type { resmgr.ResourceManager } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ resourceManager: resmgr.ResourceManager; /** * Indicates configuration information about an application. - * - * @since 9 + * @type { ApplicationInfo } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ applicationInfo: ApplicationInfo; /** * Indicates app cache dir. - * - * @since 9 + * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ cacheDir: string; /** * Indicates app temp dir. - * - * @since 9 + * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ tempDir: string; /** * Indicates app files dir. - * - * @since 9 + * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ - filesDir : string; + filesDir: string; /** * Indicates app database dir. - * - * @since 9 + * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ - databaseDir : string; + databaseDir: string; /** * Indicates app preferences dir. - * - * @since 9 + * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ - preferencesDir : string; + preferencesDir: string; /** * Indicates app bundle code dir. - * - * @since 9 + * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ - bundleCodeDir : string; + bundleCodeDir: string; /** * Indicates app distributed files dir. - * - * @since 9 + * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ distributedFilesDir: string; /** * Indicates event hub. - * - * @since 9 + * @type { EventHub } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ eventHub: EventHub; /** * Indicates file area. - * - * @since 9 + * @type { AreaMode } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ area: AreaMode; /** * Create a bundle context - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide for inner use. - * @param bundleName Indicates the bundle name. - * @return application context * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED - * @StageModelOnly + * @param { string } bundleName - Indicates the bundle name. + * @returns { Context } Returns the application context. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 */ createBundleContext(bundleName: string): Context; /** * Create a module context - * - * @since 9 + * @param { string } moduleName - Indicates the module name. + * @returns { Context } Returns the application context. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param moduleName Indicates the module name. - * @return application context - * @StageModelOnly + * @stagemodelonly + * @since 9 */ createModuleContext(moduleName: string): Context; /** * Create a module context - * - * @since 9 + * @param { string } bundleName - Indicates the bundle name. + * @param { string } moduleName - Indicates the module name. + * @returns { Context } Returns the application context. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide for inner use. - * @param bundleName Indicates the bundle name. - * @param moduleName Indicates the module name. - * @return application context - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ createModuleContext(bundleName: string, moduleName: string): Context; /** * Get application context - * - * @since 9 + * @returns { ApplicationContext } Returns the application context. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return application context - * @StageModelOnly + * @stagemodelonly + * @since 9 */ getApplicationContext(): ApplicationContext; } /** - * File area mode - * - * @since 9 + * Enum for the file area mode + * @enum { number } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ export enum AreaMode { /** diff --git a/api/@ohos.app.ability.EventHub.d.ts b/api/@ohos.app.ability.EventHub.d.ts index 7fe3d203ca..708e937969 100644 --- a/api/@ohos.app.ability.EventHub.d.ts +++ b/api/@ohos.app.ability.EventHub.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -13,48 +13,45 @@ * limitations under the License. */ +import { BusinessError } from './basic'; + /** * The event center of a context, support the subscription and publication of events. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A - * @StageModelOnly + * @stagemodelonly + * @since 9 */ export default class EventHub { - /** - * Subscribe to an event. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param event Indicates the event. - * @param callback Indicates the callback. - * @return - - * @StageModelOnly - */ - on(event: string, callback: Function): void + /** + * Subscribe to an event. + * @param { string } event - Indicates the event. + * @param { Function } callback - Indicates the callback. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + on(event: string, callback: Function): void - /** - * Unsubscribe from an event. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param event Indicates the event. - * @param callback Indicates the callback. - * @return - - * @StageModelOnly - */ - off(event: string, callback?: Function): void + /** + * Unsubscribe from an event. + * @param { string } event - Indicates the event. + * @param { Function } callback - Indicates the callback. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + off(event: string, callback?: Function): void - /** - * Trigger the event callbacks. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param event Indicates the event. - * @param args Indicates the callback arguments. - * @return - - * @StageModelOnly - */ - emit(event: string, ...args: Object[]): void + /** + * Trigger the event callbacks. + * @param { string } event - Indicates the event. + * @param { Object[] } args - Indicates the callback arguments. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + emit(event: string, ...args: Object[]): void } \ No newline at end of file diff --git a/api/@ohos.app.ability.ServiceExtensionContext.d.ts b/api/@ohos.app.ability.ServiceExtensionContext.d.ts index dd21ca7d0a..9b9b3afa18 100644 --- a/api/@ohos.app.ability.ServiceExtensionContext.d.ts +++ b/api/@ohos.app.ability.ServiceExtensionContext.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -13,180 +13,293 @@ * limitations under the License. */ -import { AsyncCallback } from "../basic"; -import { ConnectOptions } from "../ability/connectOptions"; -import Caller from '../@ohos.application.Ability'; -import ExtensionContext from "./ExtensionContext"; -import Want from "../@ohos.application.Want"; -import StartOptions from "../@ohos.application.StartOptions"; +import { AsyncCallback } from "./basic"; +import { ConnectOptions } from "./ability/connectOptions"; +import { Caller } from './@ohos.app.ability.Ability'; +import ExtensionContext from "./application/ExtensionContext"; +import Want from "./@ohos.application.Want"; +import StartOptions from "./@ohos.application.StartOptions"; /** * The context of service extension. It allows access to * serviceExtension-specific resources. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide for inner use. - * @permission N/A - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ export default class ServiceExtensionContext extends ExtensionContext { /** * Service extension uses this method to start a specific ability. - * - * @since 9 + * @param { Want } want - Indicates the ability to start. + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the ability to start. - * @param options Indicates the start options. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ startAbility(want: Want, callback: AsyncCallback): void; + + /** + * Service extension uses this method to start a specific ability. + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; + + /** + * Service extension uses this method to start a specific ability. + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } options - Indicates the start options. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ startAbility(want: Want, options?: StartOptions): Promise; /** * Service extension uses this method to start a specific ability with account. - * - * @since 9 + * @param { Want } want - Indicates the ability to start. + * @param { number } accountId - Indicates the accountId to start. + * @param { AsyncCallback } callback - The callback of startAbilityWithAccount. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the ability to start. - * @param accountId Indicates the accountId to start. - * @param options Indicates the start options. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + + /** + * Service extension uses this method to start a specific ability with account. + * @param { Want } want - Indicates the ability to start. + * @param { number } accountId - Indicates the accountId to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback of startAbilityWithAccount. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; + + /** + * Service extension uses this method to start a specific ability with account. + * @param { Want } want - Indicates the ability to start. + * @param { number } accountId - Indicates the accountId to start. + * @param { StartOptions } options - Indicates the start options. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; /** * Starts a new service extension ability. - * - * @since 9 + * @param { Want } want - Indicates the want info to start. + * @param { AsyncCallback } callback - The callback of startServiceExtensionAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want info to start. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ startServiceExtensionAbility(want: Want, callback: AsyncCallback): void; + + /** + * Starts a new service extension ability. + * @param { Want } want - Indicates the want info to start. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ startServiceExtensionAbility(want: Want): Promise; /** * Starts a new service extension ability with account. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want info to start. - * @param accountId Indicates the account to start. - * @systemapi hide for inner use. - * @return - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. - * @StageModelOnly + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { AsyncCallback } callback - The callback of startServiceExtensionAbilityWithAccount. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 */ startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + + /** + * Starts a new service extension ability with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; /** * Stops a service within the same application. - * - * @since 9 + * @param { Want } want - Indicates the want info to start. + * @param { AsyncCallback } callback - The callback of stopServiceExtensionAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want info to start. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ stopServiceExtensionAbility(want: Want, callback: AsyncCallback): void; + + /** + * Stops a service within the same application. + * @param { Want } want - Indicates the want info to start. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ stopServiceExtensionAbility(want: Want): Promise; /** * Stops a service within the same application with account. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want info to start. - * @param accountId Indicates the accountId to start. - * @systemapi hide for inner use. - * @return - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. - * @StageModelOnly + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the accountId to start. + * @param { AsyncCallback } callback - The callback of stopServiceExtensionAbilityWithAccount. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 */ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + + /** + * Stops a service within the same application with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the accountId to start. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; /** * Destroys this service extension. - * - * @since 9 + * @param { AsyncCallback } callback - The callback of terminateSelf. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide for inner use. - * @return - - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ terminateSelf(callback: AsyncCallback): void; + + /** + * Destroys this service extension. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ terminateSelf(): Promise; /** * Connects an ability to a Service extension. - * *

This method can be called by an ability or service extension, but the destination of the connection must be a * service extension. You must implement the {@link ConnectOptions} interface to obtain the proxy of the target * service extension when the Service extension is connected.

- * - * @since 9 + * @param { Want } want - Indicates the service extension to connect. + * @param { ConnectOptions } options - Indicates the callback of connection. + * @returns { number } Returns the connection id. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the service extension to connect. - * @param options Indicates the callback of connection. - * @systemapi hide for inner use. - * @return connection id, int value. - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ connectAbility(want: Want, options: ConnectOptions): number; /** * Connects an ability to a Service extension with account. - * *

This method can be called by an ability or service extension, but the destination of the connection must be a * service extension. You must implement the {@link ConnectOptions} interface to obtain the proxy of the target * service extension when the Service extension is connected.

- * - * @since 9 + * @param { Want } want - Indicates the service extension to connect. + * @param { number } accountId - Indicates the account to connect. + * @param { ConnectOptions } options - Indicates the callback of connection. + * @returns { number } Returns the connection id. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the service extension to connect. - * @param accountId Indicates the account to connect. - * @param options Indicates the callback of connection. - * @systemapi hide for inner use. - * @return connection id, int value. - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; /** - * Disconnects an ability to a service extension, in contrast to - * {@link connectAbility}. - * + * Disconnects an ability to a service extension, in contrast to {@link connectAbility}. + * @param { number } connection - the connection id returned from connectAbility api. + * @param { AsyncCallback } callback - The callback of disconnectAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly * @since 9 + */ + disconnectAbility(connection: number, callback: AsyncCallback): void; + + /** + * Disconnects an ability to a service extension, in contrast to {@link connectAbility}. + * @param { number } connection - the connection id returned from connectAbility api. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param connection the connection id returned from connectAbility api. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ - disconnectAbility(connection: number, callback:AsyncCallback): void; disconnectAbility(connection: number): Promise; /** * Get the caller object of the startup capability - * - * @since 9 + * @param { Want } want - Indicates the ability to start. + * @returns { Promise } Returns the Caller interface. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the ability to start. - * @return Returns to the Caller interface on success Returns empty or undefined on failure - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ - startAbilityByCall(want: Want): Promise; + startAbilityByCall(want: Want): Promise; } \ No newline at end of file diff --git a/api/@ohos.app.ability.abilityDelegator.d.ts b/api/@ohos.app.ability.abilityDelegator.d.ts index d6e08d73b2..0e9bde748c 100644 --- a/api/@ohos.app.ability.abilityDelegator.d.ts +++ b/api/@ohos.app.ability.abilityDelegator.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -13,196 +13,347 @@ * limitations under the License. */ -import { AsyncCallback } from '../basic'; -import Ability from '../@ohos.application.Ability'; -import AbilityStage from '../@ohos.application.AbilityStage'; -import { AbilityMonitor } from './abilityMonitor'; -import { AbilityStageMonitor } from './abilityStageMonitor'; -import Context from './Context'; -import Want from "../@ohos.application.Want"; -import { ShellCmdResult } from './shellCmdResult'; +import { AsyncCallback } from './basic'; +import Ability from './@ohos.app.ability.Ability'; +import AbilityStage from './@ohos.application.AbilityStage'; +import { AbilityMonitor } from './application/abilityMonitor'; +import { AbilityStageMonitor } from './application/abilityStageMonitor'; +import Context from './@ohos.app.ability.Context'; +import Want from "./@ohos.application.Want"; +import { ShellCmdResult } from './application/shellCmdResult'; /** * A global test utility interface used for adding AbilityMonitor objects and control lifecycle states of abilities. - * - * @since 8 + * @interface * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @import import AbilityDelegator from 'application/abilityDelegator.d' - * @permission N/A + * @since 9 */ export interface AbilityDelegator { /** * Add an AbilityMonitor object for monitoring the lifecycle state changes of the specified ability. - * - * @since 9 + * @param { AbilityMonitor } monitor - AbilityMonitor object + * @param { AsyncCallback } callback - The callback of addAbilityMonitor. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param monitor AbilityMonitor object + * @since 9 */ addAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback): void; + + /** + * Add an AbilityMonitor object for monitoring the lifecycle state changes of the specified ability. + * @param { AbilityMonitor } monitor - AbilityMonitor object + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ addAbilityMonitor(monitor: AbilityMonitor): Promise; /** * Add an AbilityStageMonitor object for monitoring the lifecycle state changes of the specified abilityStage. - * + * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. + * @param { AsyncCallback } callback - The callback of addAbilityStageMonitor. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 + */ + addAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback): void; + + /** + * Add an AbilityStageMonitor object for monitoring the lifecycle state changes of the specified abilityStage. + * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param monitor AbilityStageMonitor object + * @since 9 */ - addAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback): void; - addAbilityStageMonitor(monitor: AbilityStageMonitor): Promise; + addAbilityStageMonitor(monitor: AbilityStageMonitor): Promise; /** * Remove a specified AbilityMonitor object from the application memory. - * - * @since 9 + * @param { AbilityMonitor } monitor - AbilityMonitor object. + * @param { AsyncCallback } callback - The callback of removeAbilityMonitor. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param monitor AbilityMonitor object + * @since 9 */ removeAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback): void; + + /** + * Remove a specified AbilityMonitor object from the application memory. + * @param { AbilityMonitor } monitor - AbilityMonitor object. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ removeAbilityMonitor(monitor: AbilityMonitor): Promise; /** * Remove a specified AbilityStageMonitor object from the application memory. - * + * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. + * @param { AsyncCallback } callback - The callback of removeAbilityStageMonitor. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 + */ + removeAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback): void; + + /** + * Remove a specified AbilityStageMonitor object from the application memory. + * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param monitor AbilityStageMonitor object + * @since 9 */ - removeAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback): void; - removeAbilityStageMonitor(monitor: AbilityStageMonitor): Promise; + removeAbilityStageMonitor(monitor: AbilityStageMonitor): Promise; /** * Wait for and returns the Ability object that matches the conditions set in the given AbilityMonitor. - * - * @since 9 + * @param { AbilityMonitor } monitor - AbilityMonitor object. + * @param { AsyncCallback } callback - The callback is used to return the Ability object. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param monitor AbilityMonitor object - * @param timeout Maximum wait time, in milliseconds - * @return success: return the Ability object, failure: return null + * @since 9 */ waitAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback): void; + + /** + * Wait for and returns the Ability object that matches the conditions set in the given AbilityMonitor. + * @param { AbilityMonitor } monitor - AbilityMonitor object. + * @param { number } timeout - Maximum wait time, in milliseconds. + * @param { AsyncCallback } callback - The callback is used to return the Ability object. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ waitAbilityMonitor(monitor: AbilityMonitor, timeout: number, callback: AsyncCallback): void; + + /** + * Wait for and returns the Ability object that matches the conditions set in the given AbilityMonitor. + * @param { AbilityMonitor } monitor - AbilityMonitor object. + * @param { number } timeout - Maximum wait time, in milliseconds. + * @returns { Promise } Returns the Ability object. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ waitAbilityMonitor(monitor: AbilityMonitor, timeout?: number): Promise; /** * Wait for and returns the AbilityStage object that matches the conditions set in the given AbilityStageMonitor. - * + * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. + * @param { AsyncCallback } callback - The callback is used to return the AbilityStage object. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ + waitAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback): void; + + /** + * Wait for and returns the AbilityStage object that matches the conditions set in the given AbilityStageMonitor. + * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. + * @param { number } timeout - Maximum wait time, in milliseconds. + * @param { AsyncCallback } callback - The callback is used to return the AbilityStage object. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 + */ + waitAbilityStageMonitor(monitor: AbilityStageMonitor, timeout: number, callback: AsyncCallback): void; + + /** + * Wait for and returns the AbilityStage object that matches the conditions set in the given AbilityStageMonitor. + * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. + * @param { number } timeout - Maximum wait time, in milliseconds. + * @returns { Promise } Returns the AbilityStage object. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param monitor AbilityStageMonitor object - * @param timeout Maximum wait time, in milliseconds - * @return success: return the AbilityStage object, failure: return null + * @since 9 */ - waitAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback): void; - waitAbilityStageMonitor(monitor: AbilityStageMonitor, timeout: number, callback: AsyncCallback): void; - waitAbilityStageMonitor(monitor: AbilityStageMonitor, timeout?: number): Promise; + waitAbilityStageMonitor(monitor: AbilityStageMonitor, timeout?: number): Promise; /** * Obtain the application context. - * - * @since 9 + * @returns { Context } Returns the app Context. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return App Context + * @since 9 */ getAppContext(): Context; /** * Obtain the lifecycle state of a specified ability. - * - * @since 9 + * @param { Ability } ability - The Ability object. + * @returns { number } Returns the state of the Ability object. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param ability The Ability object - * @return The state of the Ability object. enum AbilityLifecycleState + * @since 9 */ getAbilityState(ability: Ability): number; /** * Obtain the ability that is currently being displayed. - * - * @since 9 + * @param { AsyncCallback } callback - The callback is used to return the Ability object. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return The top ability of the current application + * @since 9 */ getCurrentTopAbility(callback: AsyncCallback): void; + + /** + * Obtain the ability that is currently being displayed. + * @returns { Promise } Returns the Ability object. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ getCurrentTopAbility(): Promise /** * Start a new ability. - * - * @since 9 + * @param { Want } want - Indicates the ability to start + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the ability to start - * @return - + * @since 9 */ startAbility(want: Want, callback: AsyncCallback): void; + + /** + * Start a new ability. + * @param { Want } want - Indicates the ability to start + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ startAbility(want: Want): Promise; /** * Invoke the Ability.onForeground() callback of a specified ability without changing its lifecycle state. - * + * @param { Ability } ability - The ability object. + * @param { AsyncCallback } callback - The callback of doAbilityForeground. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 + */ + doAbilityForeground(ability: Ability, callback: AsyncCallback): void; + + /** + * Invoke the Ability.onForeground() callback of a specified ability without changing its lifecycle state. + * @param { Ability } ability - The ability object. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param ability The ability object - * @return true: success false: failure + * @since 9 */ - doAbilityForeground(ability: Ability, callback: AsyncCallback): void; - doAbilityForeground(ability: Ability): Promise; + doAbilityForeground(ability: Ability): Promise; /** * Invoke the Ability.onBackground() callback of a specified ability without changing its lifecycle state. - * + * @param { Ability } ability - The ability object. + * @param { AsyncCallback } callback - The callback of doAbilityBackground. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 + */ + doAbilityBackground(ability: Ability, callback: AsyncCallback): void; + + /** + * Invoke the Ability.onBackground() callback of a specified ability without changing its lifecycle state. + * @param { Ability } ability - The ability object. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param ability The ability object - * @return true: success false: failure + * @since 9 */ - doAbilityBackground(ability: Ability, callback: AsyncCallback): void; - doAbilityBackground(ability: Ability): Promise; + doAbilityBackground(ability: Ability): Promise; /** * Prints log information to the unit testing console. * The total length of the log information to be printed cannot exceed 1000 characters. - * - * @since 8 + * @param { string } msg - Log information. + * @param { AsyncCallback } callback - The callback of print. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param msg Log information + * @since 9 */ print(msg: string, callback: AsyncCallback): void; - print(msg: string): Promise; /** * Prints log information to the unit testing console. * The total length of the log information to be printed cannot exceed 1000 characters. - * + * @param { string } msg - Log information. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 + */ + print(msg: string): Promise; + + /** + * Prints log information to the unit testing console. + * The total length of the log information to be printed cannot exceed 1000 characters. + * @param { string } msg - Log information. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param msg Log information + * @since 9 */ - printSync(msg: string): void; + printSync(msg: string): void; /** * Execute the given command in the aa tools side. - * - * @since 8 + * @param { string } cmd - The shell command. + * @param { AsyncCallback } callback - The callback is used to return the ShellCmdResult object. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param cmd Shell command - * @param timeoutSecs Timeout, in seconds - * @return ShellCmdResult object + * @since 9 */ executeShellCommand(cmd: string, callback: AsyncCallback): void; + + /** + * Execute the given command in the aa tools side. + * @param { string } cmd - Shell command. + * @param { number } timeoutSecs - Timeout, in seconds. + * @param { AsyncCallback } callback - The callback is used to return the ShellCmdResult object. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ executeShellCommand(cmd: string, timeoutSecs: number, callback: AsyncCallback): void; + + /** + * Execute the given command in the aa tools side. + * @param { string } cmd - Shell command. + * @param { number } timeoutSecs - Timeout, in seconds. + * @returns { Promise } Returns the ShellCmdResult object. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ executeShellCommand(cmd: string, timeoutSecs?: number): Promise; /** * Finish the test and print log information to the unit testing console. * The total length of the log information to be printed cannot exceed 1000 characters. - * - * @since 9 + * @param { string } msg - Log information. + * @param { number } code - Result code. + * @param { AsyncCallback } callback - The callback of finishTest. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param msg Log information - * @param code Result code + * @since 9 */ finishTest(msg: string, code: number, callback: AsyncCallback): void; + + /** + * Finish the test and print log information to the unit testing console. + * The total length of the log information to be printed cannot exceed 1000 characters. + * @param { string } msg - Log information. + * @param { number } code - Result code. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ finishTest(msg: string, code: number): Promise; } diff --git a/api/@ohos.app.ability.abilityManager.d.ts b/api/@ohos.app.ability.abilityManager.d.ts index 298aae74f4..a904da0cb8 100644 --- a/api/@ohos.app.ability.abilityManager.d.ts +++ b/api/@ohos.app.ability.abilityManager.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -21,19 +21,18 @@ import { ElementName } from './bundle/elementName'; /** * The class of an ability manager. - * - * @since 8 + * @namespace abilityManager * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi Hide this for inner system use - * @permission N/A + * @systemapi + * @since 9 */ declare namespace abilityManager { /** - * @name AbilityState - * @since 8 + * Enum for the ability state + * @enum { number } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi Hide this for inner system use. - * @permission N/A + * @systemapi + * @since 9 */ export enum AbilityState { INITIAL = 0, @@ -45,68 +44,107 @@ declare namespace abilityManager { /** * Updates the configuration by modifying the configuration. - * - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param config Indicates the new configuration. - * @systemapi Hide this for inner system use. - * @return - * @permission ohos.permission.UPDATE_CONFIGURATION + * @param { Configuration } config - Indicates the new configuration. + * @param { AsyncCallback } callback - The callback of updateConfiguration. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @since 9 */ function updateConfiguration(config: Configuration, callback: AsyncCallback): void; - function updateConfiguration(config: Configuration): Promise; /** - * Get information about running abilitys - * - * @since 8 + * Updates the configuration by modifying the configuration. + * @permission ohos.permission.UPDATE_CONFIGURATION + * @param { Configuration } config - Indicates the new configuration. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi Hide this for inner system use. - * @return Returns the array of {@link AbilityRunningInfo}. + * @systemapi + * @since 9 + */ + function updateConfiguration(config: Configuration): Promise; + + /** + * Get information about running abilities * @permission ohos.permission.GET_RUNNING_INFO + * @returns { Promise> } Returns the array of AbilityRunningInfo. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @since 9 */ function getAbilityRunningInfos(): Promise>; + + /** + * Get information about running abilities + * @permission ohos.permission.GET_RUNNING_INFO + * @param { AsyncCallback> } callback - The callback is used to return the array of AbilityRunningInfo. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @since 9 + */ function getAbilityRunningInfos(callback: AsyncCallback>): void; /** * Get information about running extensions - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param upperLimit Get the maximum limit of the number of messages - * @systemapi Hide this for inner system use. - * @return Returns the array of {@link ExtensionRunningInfo}. * @permission ohos.permission.GET_RUNNING_INFO + * @param { number } upperLimit - Get the maximum limit of the number of messages. + * @returns { Promise> } Returns the array of ExtensionRunningInfo. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @since 9 */ function getExtensionRunningInfos(upperLimit: number): Promise>; + + /** + * Get information about running extensions + * @permission ohos.permission.GET_RUNNING_INFO + * @param { number } upperLimit - Get the maximum limit of the number of messages. + * @param { AsyncCallback> } callback - The callback is used to return the array of ExtensionRunningInfo. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @since 9 + */ function getExtensionRunningInfos(upperLimit: number, callback: AsyncCallback>): void; /** * Get the top ability information of the display. - * - * @since 9 + * @returns { Promise } Returns the elementName info of the top ability. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi Hide this for inner system use. - * @return Returns the {@link ElementName} info of the top ability. + * @systemapi + * @since 9 */ function getTopAbility(): Promise; + + /** + * Get the top ability information of the display. + * @param { AsyncCallback } callback - The callback is used to return the elementName info of the top ability. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @since 9 + */ 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 + * @systemapi + * @since 9 */ 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 + * @systemapi + * @since 9 */ export type ExtensionRunningInfo = _ExtensionRunningInfo } diff --git a/api/@ohos.app.ability.dataAbilityHelper.d.ts b/api/@ohos.app.ability.dataAbilityHelper.d.ts index 48f49c99ea..d1defbdf63 100644 --- a/api/@ohos.app.ability.dataAbilityHelper.d.ts +++ b/api/@ohos.app.ability.dataAbilityHelper.d.ts @@ -1,5 +1,5 @@ /* -* Copyright (c) 2021 Huawei Device Co., Ltd. +* 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 @@ -13,22 +13,21 @@ * limitations under the License. */ -import { AsyncCallback } from '../basic'; -import ResultSet from '../data/rdb/resultSet'; -import { PacMap } from './dataAbilityHelper'; -import { DataAbilityOperation } from './dataAbilityOperation'; -import { DataAbilityResult } from './dataAbilityResult'; -import dataAbility from '../@ohos.data.dataAbility'; -import rdb from '../@ohos.data.rdb'; +import { AsyncCallback } from './basic'; +import { ResultSet } from './data/rdb/resultSet'; +import { DataAbilityOperation } from './ability/dataAbilityOperation'; +import { DataAbilityResult } from './ability/dataAbilityResult'; +import dataAbility from './@ohos.data.dataAbility'; +import rdb from './@ohos.data.rdb'; /** - * DataAbilityUtils + * DataAbilityHelper * @interface * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 */ -export interface DataAbilityUtils { +export interface DataAbilityHelper { /** * Opens a file in a specified remote path. * @param { string } uri - Indicates the path of the file to open. @@ -38,7 +37,7 @@ export interface DataAbilityUtils { * "rw" for read and write access on any existing data, or "rwt" for read and write access * that truncates any existing file. * @param { AsyncCallback } callback - The callback is used to return the file descriptor. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -54,7 +53,7 @@ export interface DataAbilityUtils { * "rw" for read and write access on any existing data, or "rwt" for read and write access * that truncates any existing file. * @returns { Promise } Returns the promise of file descriptor. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -66,7 +65,7 @@ export interface DataAbilityUtils { * @param { string } type - dataChange. * @param { string } uri - Indicates the path of the data to operate. * @param { AsyncCallback } callback - The callback when dataChange. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -78,7 +77,7 @@ export interface DataAbilityUtils { * @param { string } type - dataChange. * @param { string } uri - Indicates the path of the data to operate. * @param { AsyncCallback } callback - The callback when dataChange. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -89,7 +88,7 @@ export interface DataAbilityUtils { * Obtains the MIME type of the date specified by the given URI. * @param { string } uri - Indicates the path of the data to operate. * @param { AsyncCallback } callback - The callback is used to return the MIME type. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -100,7 +99,7 @@ export interface DataAbilityUtils { * Obtains the MIME type of the date specified by the given URI. * @param { string } uri - Indicates the path of the data to operate. * @returns { Promise } Returns the promise of MIME type that matches the data specified by uri. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -112,7 +111,7 @@ export interface DataAbilityUtils { * @param { string } uri - Indicates the path of the files to obtain. * @param { string } mimeTypeFilter - Indicates the MIME types of the files to obtain. * @param { AsyncCallback> } callback - The callback is used to return the matched MIME types Array. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -124,7 +123,7 @@ export interface DataAbilityUtils { * @param { string } uri - Indicates the path of the files to obtain. * @param { string } mimeTypeFilter - Indicates the MIME types of the files to obtain. * @returns { Promise> } Returns the promise of matched MIME types Array. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -135,7 +134,7 @@ export interface DataAbilityUtils { * Converts the given uri that refers to the Data ability into a normalized uri. * @param { string } uri - Indicates the uri object to normalize. * @param { AsyncCallback } callback - The callback is used to return the normalized uri object. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -146,7 +145,7 @@ export interface DataAbilityUtils { * Converts the given uri that refers to the Data ability into a normalized uri. * @param { string } uri - Indicates the uri object to normalize. * @returns { Promise } Returns the promise of normalized uri object. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -157,7 +156,7 @@ export interface DataAbilityUtils { * Converts the given normalized uri generated by normalizeUri(uri) into a denormalized one. * @param { string } uri - Indicates the uri object to normalize. * @param { AsyncCallback } callback - The callback is used to return the denormalized uri object. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -168,7 +167,7 @@ export interface DataAbilityUtils { * Converts the given normalized uri generated by normalizeUri(uri) into a denormalized one. * @param { string } uri - Indicates the uri object to normalize. * @returns { Promise } Returns the denormalized uri object. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -179,7 +178,7 @@ export interface DataAbilityUtils { * Notifies the registered observers of a change to the data resource specified by uri. * @param { string } uri - Indicates the path of the data to operate. * @param { AsyncCallback } callback - The callback of notifyChange. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -190,7 +189,7 @@ export interface DataAbilityUtils { * Notifies the registered observers of a change to the data resource specified by uri. * @param { string } uri - Indicates the path of the data to operate. * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -203,7 +202,7 @@ export interface DataAbilityUtils { * @param { rdb.ValuesBucket } valuesBucket - Indicates the data record to insert. If this parameter is null, * a blank row will be inserted. * @param { AsyncCallback } callback - The callback is used to return the index of the inserted data record. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -216,7 +215,7 @@ export interface DataAbilityUtils { * @param { rdb.ValuesBucket } valuesBucket - Indicates the data record to insert. If this parameter is null, * a blank row will be inserted. * @returns { Promise } Returns the index of the inserted data record. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -228,7 +227,7 @@ export interface DataAbilityUtils { * @param { string } uri - Indicates the path of the data to batchInsert. * @param { Array } valuesBuckets - Indicates the data records to insert. * @param { AsyncCallback } callback - The callback is used to return the number of data records inserted. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -240,7 +239,7 @@ export interface DataAbilityUtils { * @param { string } uri - Indicates the path of the data to batchInsert. * @param { Array } valuesBuckets - Indicates the data records to insert. * @returns { Promise } Returns the number of data records inserted. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -254,7 +253,7 @@ export interface DataAbilityUtils { * processing logic when this parameter is null. * @param { AsyncCallback } callback - The callback is used to return the number of data records deleted. * @returns { Promise } Returns the number of data records deleted. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -267,7 +266,7 @@ export interface DataAbilityUtils { * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define the * processing logic when this parameter is null. * @returns { Promise } Returns the number of data records deleted. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -278,7 +277,7 @@ export interface DataAbilityUtils { * Deletes one or more data records from the database. * @param { string } uri - Indicates the path of the data to delete. * @param { AsyncCallback } callback - The callback is used to return the number of data records deleted. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -292,7 +291,7 @@ export interface DataAbilityUtils { * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define * the processing logic when this parameter is null. * @param { AsyncCallback } callback - The callback is used to return the number of data records updated. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -306,7 +305,7 @@ export interface DataAbilityUtils { * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define * the processing logic when this parameter is null. * @returns { Promise } Returns the number of data records updated. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -318,7 +317,7 @@ export interface DataAbilityUtils { * @param { string } uri - Indicates the path of data to update. * @param { rdb.ValuesBucket } valuesBucket - Indicates the data to update. * @param { AsyncCallback } callback - The callback is used to return the number of data records updated. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -332,7 +331,7 @@ export interface DataAbilityUtils { * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define * the processing logic when this parameter is null. * @param { AsyncCallback } callback - The callback is used to return the query result {@link ResultSet}. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -343,7 +342,7 @@ export interface DataAbilityUtils { * Queries data in the database. * @param { string } uri - Indicates the path of data to query. * @param { AsyncCallback } callback - The callback is used to return the query result {@link ResultSet}. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -355,7 +354,7 @@ export interface DataAbilityUtils { * @param { string } uri - Indicates the path of data to query. * @param { Array } columns - Indicates the columns to query. If this parameter is null, all columns are queried. * @param { AsyncCallback } callback - The callback is used to return the query result {@link ResultSet}. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -368,7 +367,7 @@ export interface DataAbilityUtils { * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define * the processing logic when this parameter is null. * @param { AsyncCallback } callback - The callback is used to return the query result {@link ResultSet}. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -382,7 +381,7 @@ export interface DataAbilityUtils { * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define * the processing logic when this parameter is null. * @returns { Promise } Returns the query result {@link ResultSet}. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -400,7 +399,7 @@ export interface DataAbilityUtils { * If the PacMap object is to be transferred to a non-OHOS process, * values of primitive types are supported, but not custom Sequenceable objects. * @param { AsyncCallback } callback - The callback is used to return the query result {@link PacMap}. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -418,7 +417,7 @@ export interface DataAbilityUtils { * If the PacMap object is to be transferred to a non-OHOS process, * values of primitive types are supported, but not custom Sequenceable objects. * @returns { Promise } Returns the query result {@link PacMap}. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -432,7 +431,7 @@ export interface DataAbilityUtils { * multiple operations on the database. * @param { AsyncCallback> } callback - The callback is used to return the result of each * operation, in array {@link DataAbilityResult}. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 @@ -445,10 +444,31 @@ export interface DataAbilityUtils { * @param { Array } operations - Indicates the data operation list, which can contain * multiple operations on the database. * @returns { Promise> } Returns the result of each operation, in array {@link DataAbilityResult}. - * @throws { BusinessError } If the input parameter is not valid parameter. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @famodelonly * @since 9 */ executeBatch(uri: string, operations: Array): Promise>; } + +/** + * Defines a PacMap object for storing a series of values. + * @typedef PacMap + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ +export interface PacMap { + /** + * Indicates the parameter of the PacMap type. + * If a custom Sequenceable object is put in the PacMap object and will be transferred across processes, + * you must call BasePacMap.setClassLoader(ClassLoader) to set a class loader for the custom object. + * If the PacMap object is to be transferred to a non-OHOS process, + * values of primitive types are supported, but not custom Sequenceable objects. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ + [key: string]: number | string | boolean | Array | null; +} diff --git a/api/@ohos.app.ability.dataUriUtils.d.ts b/api/@ohos.app.ability.dataUriUtils.d.ts index 0d8dafaee4..e3f47a7138 100644 --- a/api/@ohos.app.ability.dataUriUtils.d.ts +++ b/api/@ohos.app.ability.dataUriUtils.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -13,55 +13,56 @@ * limitations under the License. */ +import { BusinessError } from './basic'; + /** * A utility class used for handling objects that use the DataAbilityHelper scheme. - * @name dataUriUtils - * @since 7 + * @namespace dataUriUtils * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A + * @since 9 */ declare namespace dataUriUtils { - /** - * Obtains the ID attached to the end of the path component of the given uri. - * - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param uri Indicates the uri object from which the ID is to be obtained. - * @return Returns the ID attached to the end of the path component; - */ - function getId(uri: string): number + /** + * Obtains the ID attached to the end of the path component of the given uri. + * @param { string } uri - Indicates the uri object from which the ID is to be obtained. + * @returns { number } Returns the ID attached to the end of the path component. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ + function getId(uri: string): number - /** - * Attaches the given ID to the end of the path component of the given uri. - * - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param uri Indicates the uri string from which the ID is to be obtained. - * @param id Indicates the ID to attach. - * @return Returns the uri object with the given ID attached. - */ - function attachId(uri: string, id: number): string + /** + * Attaches the given ID to the end of the path component of the given uri. + * @param { string } uri - Indicates the uri string from which the ID is to be obtained. + * @param { number } id - Indicates the ID to attach. + * @returns { number } Returns the uri object with the given ID attached. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ + function attachId(uri: string, id: number): string - /** - * Deletes the ID from the end of the path component of the given uri. - * - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param uri Indicates the uri object from which the ID is to be deleted. - * @return Returns the uri object with the ID deleted. - */ - function deleteId(uri: string): string + /** + * Deletes the ID from the end of the path component of the given uri. + * @param { string } uri - Indicates the uri object from which the ID is to be deleted. + * @returns { string } Returns the uri object with the ID deleted. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ + function deleteId(uri: string): string - /** - * Updates the ID in the specified uri - * - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param uri Indicates the uri object to be updated. - * @param id Indicates the new ID. - * @return Returns the updated uri object. - */ - function updateId(uri: string, id: number): string + /** + * Updates the ID in the specified uri. + * @param { string } uri - Indicates the uri object to be updated. + * @param { number } id - Indicates the new ID. + * @returns { string } Returns the updated uri object. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ + function updateId(uri: string, id: number): string } export default dataUriUtils; \ No newline at end of file diff --git a/api/@ohos.app.ability.errorManager.d.ts b/api/@ohos.app.ability.errorManager.d.ts index dda4361c79..903e9d89f5 100644 --- a/api/@ohos.app.ability.errorManager.d.ts +++ b/api/@ohos.app.ability.errorManager.d.ts @@ -18,40 +18,45 @@ import * as _ErrorObserver from './application/ErrorObserver'; /** * This module provides the function of error manager. - * - * @since 9 + * @namespace errorManager * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @import import errorManager from '@ohos.application.errorManager' - * @permission N/A + * @since 9 */ declare namespace errorManager { /** * Register error observer. - * - * @default - - * @since 9 + * @param { ErrorObserver } observer - The error observer. + * @returns { number } Returns the number code of the observer. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param observer The error observer. - * @return Returns the number code of the observer. + * @since 9 */ function registerErrorObserver(observer: ErrorObserver): number; /** * Unregister error observer. - * + * @param { number } observerId - Indicates the number code of the observer. + * @param { AsyncCallback } callback - The callback of unregisterErrorObserver. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 + */ + function unregisterErrorObserver(observerId: number, callback: AsyncCallback): void; + + /** + * Unregister error observer. + * @param { number } observerId - Indicates the number code of the observer. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param observerId Indicates the number code of the observer. - * @return - + * @since 9 */ - 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 + * @since 9 */ export type ErrorObserver = _ErrorObserver.default } diff --git a/api/@ohos.app.ability.missionManager.d.ts b/api/@ohos.app.ability.missionManager.d.ts index 4147a91829..7a0eac2e0d 100644 --- a/api/@ohos.app.ability.missionManager.d.ts +++ b/api/@ohos.app.ability.missionManager.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -21,164 +21,262 @@ import StartOptions from "./@ohos.application.StartOptions"; /** * This module provides the capability to manage abilities and obtaining system task information. - * - * @name missionManager - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @permission ohos.permission.MANAGE_MISSIONS - * @systemapi hide for inner use. + * @namespace missionManager + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @systemapi + * @since 9 */ declare namespace missionManager { /** * Register the missionListener to ams. - * - * @since 8 + * @param { MissionListener } listener - Indicates the MissionListener to be registered. + * @returns { number } Returns the index number of the MissionListener. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @param listener Indicates the MissionListener to be registered. - * @return The index number of the MissionListener. + * @since 9 */ function registerMissionListener(listener: MissionListener): number; /** * Unrgister the missionListener to ams. - * - * @since 8 + * @param { number } listenerId - Indicates the listener id to be unregistered. + * @param { AsyncCallback } callback - The callback of unregisterMissionListener. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @param listenerId Indicates the listener id to be unregistered. - * @return - + * @since 9 */ function unregisterMissionListener(listenerId: number, callback: AsyncCallback): void; + + /** + * Unrgister the missionListener to ams. + * @param { number } listenerId - Indicates the listener id to be unregistered. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @since 9 + */ function unregisterMissionListener(listenerId: number): Promise; /** * Get the missionInfo with the given missionId. - * - * @since 8 + * @param { string } deviceId - Indicates the device to be queried. + * @param { number } missionId - Indicates mission id to be queried. + * @param { AsyncCallback } callback - The callback is used to return the MissionInfo of the given id. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @param deviceId Indicates the device to be queried. - * @param missionId Indicates mission id to be queried. - * @return the {@link MissionInfo} of the given id. + * @since 9 */ function getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback): void; + + /** + * Get the missionInfo with the given missionId. + * @param { string } deviceId - Indicates the device to be queried. + * @param { number } missionId - Indicates mission id to be queried. + * @returns { Promise } Returns the MissionInfo of the given id. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @since 9 + */ function getMissionInfo(deviceId: string, missionId: number): Promise; /** * Get the missionInfo with the given missionId. - * - * @since 8 + * @param { string } deviceId - Indicates the device to be queried. + * @param { number } numMax - Indicates the maximum number of returned missions. + * @param { AsyncCallback> } callback - The callback is used to return the array of the MissionInfo. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @param deviceId Indicates the device to be queried. - * @param numMax Indicates the maximum number of returned missions. - * @return The array of the {@link MissionInfo}. + * @since 9 */ function getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback>): void; + + /** + * Get the missionInfo with the given missionId. + * @param { string } deviceId - Indicates the device to be queried. + * @param { number } numMax - Indicates the maximum number of returned missions. + * @returns { Promise> } Returns the array of the MissionInfo. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @since 9 + */ function getMissionInfos(deviceId: string, numMax: number): Promise>; /** * Get the mission snapshot with the given missionId. - * - * @since 8 + * @param { string } deviceId - Indicates the device to be queried. + * @param { number } missionId - Indicates mission id to be queried. + * @param { AsyncCallback } callback - The callback is used to return the MissionSnapshot of the given id. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @param deviceId Indicates the device to be queried. - * @param missionId Indicates mission id to be queried. - * @return The {@link MissionSnapshot} of the given id. + * @since 9 */ function getMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback): void; + + /** + * Get the mission snapshot with the given missionId. + * @param { string } deviceId - Indicates the device to be queried. + * @param { number } missionId - Indicates mission id to be queried. + * @returns { Promise } Returns the MissionSnapshot of the given id. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @since 9 + */ function getMissionSnapShot(deviceId: string, missionId: number): Promise; /** * Get the mission low resolution snapshot with the given missionId. - * + * @param { string } deviceId - Indicates the device to be queried. + * @param { number } missionId - Indicates mission id to be queried. + * @param { AsyncCallback } callback - The callback is used to return the MissionSnapshot of the given id. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @since 9 + */ + function getLowResolutionMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback): void; + + /** + * Get the mission low resolution snapshot with the given missionId. + * @param { string } deviceId - Indicates the device to be queried. + * @param { number } missionId - Indicates mission id to be queried. + * @returns { Promise } Returns the MissionSnapshot of the given id. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @param deviceId Indicates the device to be queried. - * @param missionId Indicates mission id to be queried. - * @return The {@link MissionSnapshot} of the given id. + * @since 9 */ - function getLowResolutionMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback): void; - function getLowResolutionMissionSnapShot(deviceId: string, missionId: number): Promise; + function getLowResolutionMissionSnapShot(deviceId: string, missionId: number): Promise; /** * Lock the mission. - * - * @since 8 + * @param { number } missionId - Indicates mission id to be locked. + * @param { AsyncCallback } callback - The callback of lockMission. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @param missionId Indicates mission id to be locked. - * @return - + * @since 9 */ function lockMission(missionId: number, callback: AsyncCallback): void; + + /** + * Lock the mission. + * @param { number } missionId - Indicates mission id to be locked. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @since 9 + */ function lockMission(missionId: number): Promise; /** * Unlock the mission. - * - * @since 8 + * @param { number } missionId - Indicates mission id to be unlocked. + * @param { AsyncCallback } callback - The callback of unlockMission. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @param missionId Indicates mission id to be unlocked. - * @return - + * @since 9 */ function unlockMission(missionId: number, callback: AsyncCallback): void; + + /** + * Unlock the mission. + * @param { number } missionId - Indicates mission id to be unlocked. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @since 9 + */ function unlockMission(missionId: number): Promise; /** * Clear the given mission in the ability manager service. - * - * @since 8 + * @param { number } missionId - Indicates mission id to be cleared. + * @param { AsyncCallback } callback - The callback of clearMission. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @param missionId Indicates mission id to be cleared. - * @return - + * @since 9 */ function clearMission(missionId: number, callback: AsyncCallback): void; + + /** + * Clear the given mission in the ability manager service. + * @param { number } missionId - Indicates mission id to be cleared. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @since 9 + */ function clearMission(missionId: number): Promise; /** * Clear all missions in the ability manager service. - * - * @since 8 + * @param { AsyncCallback } callback - The callback of clearAllMissions. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @return - + * @since 9 */ function clearAllMissions(callback: AsyncCallback): void; + + /** + * Clear all missions in the ability manager service. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @since 9 + */ function clearAllMissions(): Promise; /** * Schedule the given mission to foreground. - * - * @since 8 + * @param { number } missionId - Indicates mission id to be moved to foreground. + * @param { AsyncCallback } callback - The callback of moveMissionToFront. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @param missionId Indicates mission id to be moved to foreground. - * @param options Indicates the start options. - * @return - + * @since 9 */ function moveMissionToFront(missionId: number, callback: AsyncCallback): void; + + /** + * Schedule the given mission to foreground. + * @param { number } missionId - Indicates mission id to be moved to foreground. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback of moveMissionToFront. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @since 9 + */ function moveMissionToFront(missionId: number, options: StartOptions, callback: AsyncCallback): void; + + /** + * Schedule the given mission to foreground. + * @param { number } missionId - Indicates mission id to be moved to foreground. + * @param { StartOptions } options - Indicates the start options. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @since 9 + */ function moveMissionToFront(missionId: number, options?: StartOptions): Promise; /** * Mission information corresponding to ability. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @systemapi hide for inner use. + * @systemapi + * @since 9 */ export type MissionInfo = _MissionInfo /** * MissionListener registered by app. - * - * @name MissionListener - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @systemapi hide for inner use. + * @systemapi + * @since 9 */ export type MissionListener = _MissionListener /** * Mission snapshot corresponding to mission. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @systemapi hide for inner use. + * @systemapi + * @since 9 */ export type MissionSnapshot = _MissionSnapshot } diff --git a/api/@ohos.app.ability.quickFixManager.d.ts b/api/@ohos.app.ability.quickFixManager.d.ts index d30e16fe03..89cf51bc87 100644 --- a/api/@ohos.app.ability.quickFixManager.d.ts +++ b/api/@ohos.app.ability.quickFixManager.d.ts @@ -17,137 +17,160 @@ import { AsyncCallback } from "./basic"; /** * Interface of quickFixManager. - * - * @name quickFixManager - * @since 9 + * @namespace quickFixManager * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. + * @systemapi + * @since 9 */ declare namespace quickFixManager { /** * Quick fix info of hap module. - * - * @since 9 + * @typedef HapModuleQuickFixInfo * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. + * @systemapi + * @since 9 */ export interface HapModuleQuickFixInfo { /** * Indicates hap module name. - * - * @since 9 + * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. + * @systemapi + * @since 9 */ readonly moduleName: string; /** * Indicates hash value of a hap. - * - * @since 9 + * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. + * @systemapi + * @since 9 */ readonly originHapHash: string; /** * Indicates installed path of quick fix file. - * - * @since 9 + * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. + * @systemapi + * @since 9 */ readonly quickFixFilePath: string; } /** * Quick fix info of application. - * - * @since 9 + * @typedef ApplicationQuickFixInfo * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. + * @systemapi + * @since 9 */ export interface ApplicationQuickFixInfo { /** * Bundle name. - * - * @since 9 + * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. + * @systemapi + * @since 9 */ readonly bundleName: string; /** * The version number of the bundle. - * - * @since 9 + * @type { number } * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. + * @systemapi + * @since 9 */ readonly bundleVersionCode: number; /** * The version name of the bundle. - * - * @since 9 + * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. + * @systemapi + * @since 9 */ readonly bundleVersionName: string; /** * The version number of the quick fix. - * - * @since 9 + * @type { number } * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. + * @systemapi + * @since 9 */ readonly quickFixVersionCode: number; /** * The version name of the quick fix. - * - * @since 9 + * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. + * @systemapi + * @since 9 */ readonly quickFixVersionName: string; /** * Hap module quick fix info. - * - * @since 9 + * @type { Array } * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. + * @systemapi + * @since 9 */ readonly hapModuleQuickFixInfo: Array; } /** * Apply quick fix files. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @param hapModuleQuickFixFiles Quick fix files need to apply, this value should include file path and file name. - * @systemapi Hide this for inner system use. - * @return - * @permission ohos.permission.INSTALL_BUNDLE + * @param { Array } hapModuleQuickFixFiles - Quick fix files need to apply, this value should include file + * path and file name. + * @param { AsyncCallback } callback - The callback of applyQuickFix. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix + * @systemapi + * @since 9 */ function applyQuickFix(hapModuleQuickFixFiles: Array, callback: AsyncCallback): void; + + /** + * Apply quick fix files. + * @permission ohos.permission.INSTALL_BUNDLE + * @param { Array } hapModuleQuickFixFiles - Quick fix files need to apply, this value should include file + * path and file name. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix + * @systemapi + * @since 9 + */ function applyQuickFix(hapModuleQuickFixFiles: Array): Promise; /** * Get application quick fix info by bundle name. - * - * @since 9 + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Bundle name wish to query. + * @param { AsyncCallback } callback - The callback is used to return the ApplicationQuickFixInfo. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @param bundleName Bundle name wish to query. - * @systemapi Hide this for inner system use. - * @return Returns the {@link ApplicationQuickFixInfo}. + * @systemapi + * @since 9 + */ + function getApplicationQuickFixInfo(bundleName: string, callback: AsyncCallback): void; + + /** + * Get application quick fix info by bundle name. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Bundle name wish to query. + * @returns { Promise } Returns the ApplicationQuickFixInfo. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix + * @systemapi + * @since 9 */ - function getApplicationQuickFixInfo(bundleName: string, callback: AsyncCallback): void; - function getApplicationQuickFixInfo(bundleName: string): Promise; + function getApplicationQuickFixInfo(bundleName: string): Promise; } export default quickFixManager; \ No newline at end of file diff --git a/api/@ohos.app.featureAbility.context.d.ts b/api/@ohos.app.featureAbility.context.d.ts index b3aa7ea60a..4bfd481abd 100644 --- a/api/@ohos.app.featureAbility.context.d.ts +++ b/api/@ohos.app.featureAbility.context.d.ts @@ -1,5 +1,5 @@ /* -* Copyright (c) 2021 Huawei Device Co., Ltd. +* 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 @@ -13,316 +13,581 @@ * limitations under the License. */ -import { AsyncCallback } from '../basic'; -import { ApplicationInfo } from '../bundle/applicationInfo'; -import { ProcessInfo } from './processInfo'; -import { ElementName } from '../bundle/elementName'; -import BaseContext from '../application/BaseContext'; -import { HapModuleInfo } from '../bundle/hapModuleInfo'; -import { AppVersionInfo } from './appVersionInfo'; -import { AbilityInfo } from '../bundle/abilityInfo'; -import bundle from '../@ohos.bundle'; - +import { AsyncCallback } from './basic'; +import { ApplicationInfo } from './bundle/applicationInfo'; +import { ProcessInfo } from './app/processInfo'; +import { ElementName } from './bundle/elementName'; +import BaseContext from './application/BaseContext'; +import { HapModuleInfo } from './bundle/hapModuleInfo'; +import { AppVersionInfo } from './app/appVersionInfo'; +import { AbilityInfo } from './bundle/abilityInfo'; +import bundle from './@ohos.bundle'; /** * 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 6 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @import import abilityManager from 'app/context' - * @permission N/A - * @FAModelOnly + * @famodelonly + * @since 9 */ export interface Context extends BaseContext { - /** - * Get the local root dir of an app. If it is the first call, the dir - * will be created. - * @note If in the context of the ability, return the root dir of - * the ability; if in the context of the application, return the - * root dir of the application. - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return the root dir - * @FAModelOnly - */ + * Get the local root dir of an app. If it is the first call, the dir + * will be created. + * @note If in the context of the ability, return the root dir of + * the ability; if in the context of the application, return the + * root dir of the application. + * @returns { Promise } Returns the root dir. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getOrCreateLocalDir(): Promise; + + /** + * Get the local root dir of an app. If it is the first call, the dir + * will be created. + * @note If in the context of the ability, return the root dir of + * the ability; if in the context of the application, return the + * root dir of the application. + * @param { AsyncCallback } callback - The callback is used to return the root dir. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getOrCreateLocalDir(callback: AsyncCallback): void; + /** - * Verify whether the specified permission is allowed for a particular - * pid and uid running in the system. - * @param permission The name of the specified permission - * @param pid process id - * @param uid user id - * @note Pid and uid are optional. If you do not pass in pid and uid, - * it will check your own permission. - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return asynchronous callback with {@code 0} if the PID - * and UID have the permission; callback with {@code -1} otherwise. - * @FAModelOnly - */ + * Verify whether the specified permission is allowed for a particular + * pid and uid running in the system. + * @note Pid and uid are optional. If you do not pass in pid and uid, it will check your own permission. + * @param { string } permission - The name of the specified permission. + * @param { PermissionOptions } options - Indicates the permission options. + * @returns { Promise } Returns {@code 0} if the PID and UID have the permission. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ verifyPermission(permission: string, options?: PermissionOptions): Promise; + + /** + * Verify whether the specified permission is allowed for a particular + * pid and uid running in the system. + * @note Pid and uid are optional. If you do not pass in pid and uid, it will check your own permission. + * @param { string } permission - The name of the specified permission. + * @param { PermissionOptions } options - Indicates the permission options. + * @param { AsyncCallback } callback - Returns {@code 0} if the PID and UID have the permission. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ verifyPermission(permission: string, options: PermissionOptions, callback: AsyncCallback): void; + + /** + * Verify whether the specified permission is allowed for a particular + * pid and uid running in the system. + * @note Pid and uid are optional. If you do not pass in pid and uid, it will check your own permission. + * @param { string } permission - The name of the specified permission. + * @param { AsyncCallback } callback - Returns {@code 0} if the PID and UID have the permission. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ verifyPermission(permission: string, callback: AsyncCallback): void; /** - * Requests certain permissions from the system. - * @param permissions Indicates the list of permissions to be requested. This parameter cannot be null. - * @param requestCode Indicates the request code to be passed to the PermissionRequestResult - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @FAModelOnly - */ + * Requests certain permissions from the system. + * @param { Array } permissions - Indicates the list of permissions to be requested. This parameter cannot be null. + * @param { number } requestCode - Indicates the request code to be passed to the PermissionRequestResult. + * @param { AsyncCallback } resultCallback - The callback is used to return the PermissionRequestResult. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ requestPermissionsFromUser(permissions: Array, requestCode: number, resultCallback: AsyncCallback): void; + + /** + * Requests certain permissions from the system. + * @param { Array } permissions - Indicates the list of permissions to be requested. This parameter cannot be null. + * @param { number } requestCode - Indicates the request code to be passed to the PermissionRequestResult. + * @returns { Promise } Returns the PermissionRequestResult. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ requestPermissionsFromUser(permissions: Array, requestCode: number): Promise; /** - * Obtains information about the current application. - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @FAModelOnly - */ + * Obtains information about the current application. + * @param { AsyncCallback } callback - The callback is used to return the ApplicationInfo. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getApplicationInfo(callback: AsyncCallback): void + + /** + * Obtains information about the current application. + * @returns { Promise } Returns the ApplicationInfo. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getApplicationInfo(): Promise; /** - * Obtains the bundle name of the current ability. - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @FAModelOnly - */ + * Obtains the bundle name of the current ability. + * @param { AsyncCallback } callback - The callback is used to return the bundle name. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getBundleName(callback: AsyncCallback): void + + /** + * Obtains the bundle name of the current ability. + * @returns { Promise } Returns the bundle name. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getBundleName(): Promise; /** - * Obtains the current display orientation of this ability. - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - */ + * Obtains the current display orientation of this ability. + * @param { AsyncCallback } callback - The callback is used to return the display orientation. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getDisplayOrientation(callback: AsyncCallback): void - getDisplayOrientation(): Promise; /** - * Obtains the absolute path to the application-specific cache directory - * @since 6 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @deprecated since 7 - */ - getExternalCacheDir(callback: AsyncCallback): void - getExternalCacheDir(): Promise; + * Obtains the current display orientation of this ability. + * @returns { Promise } Returns the display orientation. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ + getDisplayOrientation(): Promise; /** - * Sets the display orientation of the current ability. - * @param orientation Indicates the new orientation for the current ability. - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - */ + * Sets the display orientation of the current ability. + * @param { bundle.DisplayOrientation } orientation - Indicates the new orientation for the current ability. + * @param { AsyncCallback } callback - The callback of setDisplayOrientation. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ setDisplayOrientation(orientation: bundle.DisplayOrientation, callback: AsyncCallback): void + + /** + * Sets the display orientation of the current ability. + * @param { bundle.DisplayOrientation } orientation - Indicates the new orientation for the current ability. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ setDisplayOrientation(orientation: bundle.DisplayOrientation): Promise; /** - * Sets whether to show this ability on top of the lock screen whenever the lock screen is displayed, keeping the ability in the ACTIVE state. - * @param show Specifies whether to show this ability on top of the lock screen. The value true means to show it on the lock screen, and the value false means not. - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - */ + * Sets whether to show this ability on top of the lock screen whenever the lock screen is displayed, + * keeping the ability in the ACTIVE state. + * @param { boolean } show - Specifies whether to show this ability on top of the lock screen. The value true + * means to show it on the lock screen, and the value false means not. + * @param { AsyncCallback } callback - The callback of setShowOnLockScreen. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ setShowOnLockScreen(show: boolean, callback: AsyncCallback): void + + /** + * Sets whether to show this ability on top of the lock screen whenever the lock screen is displayed, + * keeping the ability in the ACTIVE state. + * @param { boolean } show - Specifies whether to show this ability on top of the lock screen. The value true + * means to show it on the lock screen, and the value false means not. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ setShowOnLockScreen(show: boolean): Promise; /** - * Sets whether to wake up the screen when this ability is restored. - * @param wakeUp Specifies whether to wake up the screen. The value true means to wake it up, and the value false means not. - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - */ + * Sets whether to wake up the screen when this ability is restored. + * @param { boolean } wakeUp - Specifies whether to wake up the screen. The value true means to wake it up, + * and the value false means not. + * @param { AsyncCallback } callback - The callback of setWakeUpScreen. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ setWakeUpScreen(wakeUp: boolean, callback: AsyncCallback): void + + /** + * Sets whether to wake up the screen when this ability is restored. + * @param { boolean } wakeUp - Specifies whether to wake up the screen. The value true means to wake it up, + * and the value false means not. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ setWakeUpScreen(wakeUp: boolean): Promise; /** - * Obtains information about the current process, including the process ID and name. - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @FAModelOnly - */ + * Obtains information about the current process, including the process ID and name. + * @param { AsyncCallback } callback - The callback is used to return the ProcessInfo. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getProcessInfo(callback: AsyncCallback): void + + /** + * Obtains information about the current process, including the process ID and name. + * @returns { Promise } Returns the ProcessInfo. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getProcessInfo(): Promise; /** - * Obtains the ohos.bundle.ElementName object of the current ability. This method is available only to Page abilities. - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @FAModelOnly - */ + * Obtains the ohos.bundle.ElementName object of the current ability. This method is available only to Page abilities. + * @param { AsyncCallback } callback - The callback is used to return the ElementName. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getElementName(callback: AsyncCallback): void + + /** + * Obtains the ohos.bundle.ElementName object of the current ability. This method is available only to Page abilities. + * @returns { Promise } Returns the ElementName. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getElementName(): Promise; /** - * Obtains the name of the current process. - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @FAModelOnly - */ + * Obtains the name of the current process. + * @param { AsyncCallback } callback - The callback is used to return the process name. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getProcessName(callback: AsyncCallback): void + + /** + * Obtains the name of the current process. + * @returns { Promise } Returns the process name. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getProcessName(): Promise; /** - * Obtains the bundle name of the ability that called the current ability. - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @FAModelOnly - */ + * Obtains the bundle name of the ability that called the current ability. + * @param { AsyncCallback } callback - The callback is used to return the calling bundle name. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getCallingBundle(callback: AsyncCallback): void + + /** + * Obtains the bundle name of the ability that called the current ability. + * @returns { Promise } Returns the calling bundle name. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getCallingBundle(): Promise; /** - * Obtains the file directory of this application on the internal storage. - * @since 6 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @FAModelOnly - */ + * Obtains the file directory of this application on the internal storage. + * @param { AsyncCallback } callback - The callback is used to return the file directory. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getFilesDir(callback: AsyncCallback): void; + + /** + * Obtains the file directory of this application on the internal storage. + * @returns { Promise } Returns the file directory. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getFilesDir(): Promise; /** - * Obtains the cache directory of this application on the internal storage. - * @since 6 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @FAModelOnly - */ + * Obtains the cache directory of this application on the internal storage. + * @param { AsyncCallback } callback - The callback is used to return the cache directory. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getCacheDir(callback: AsyncCallback): void; + + /** + * Obtains the cache directory of this application on the internal storage. + * @returns { Promise } Returns the cache directory. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getCacheDir(): Promise; /** - * Obtains the distributed file path for storing ability or application data files. - * If the distributed file path does not exist, the system will create a path and return the created path. - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @FAModelOnly - */ + * Obtains the distributed file path for storing ability or application data files. + * If the distributed file path does not exist, the system will create a path and return the created path. + * @returns { Promise } Returns the distributed file path. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getOrCreateDistributedDir(): Promise; + + /** + * Obtains the distributed file path for storing ability or application data files. + * If the distributed file path does not exist, the system will create a path and return the created path. + * @param { AsyncCallback } callback - The callback is used to return the distributed file path. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getOrCreateDistributedDir(callback: AsyncCallback): void; /** - * Obtains the application type. - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @FAModelOnly - */ + * Obtains the application type. + * @param { AsyncCallback } callback - The callback is used to return the application type. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getAppType(callback: AsyncCallback): void + + /** + * Obtains the application type. + * @returns { Promise } Returns the application type. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getAppType(): Promise; /** - * Obtains the ModuleInfo object for this application. - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @FAModelOnly - */ + * Obtains the ModuleInfo object for this application. + * @param { AsyncCallback } callback - The callback is used to return the HapModuleInfo. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getHapModuleInfo(callback: AsyncCallback): void + + /** + * Obtains the ModuleInfo object for this application. + * @returns { Promise } Returns the HapModuleInfo. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getHapModuleInfo(): Promise; /** - * Obtains the application version information. - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @FAModelOnly - */ + * Obtains the application version information. + * @param { AsyncCallback } callback - The callback is used to return the application version info. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getAppVersionInfo(callback: AsyncCallback): void + + /** + * Obtains the application version information. + * @returns { Promise } Returns the application version info. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getAppVersionInfo(): Promise; /** - * Obtains the context of this application. - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @FAModelOnly - */ + * Obtains the context of this application. + * @returns { Context } Returns the context of this application. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getApplicationContext(): Context; /** - * Checks the detailed information of this ability. - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @FAModelOnly - */ + * Checks the detailed information of this ability. + * @param { AsyncCallback } callback - The callback is used to return the AbilityInfo. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getAbilityInfo(callback: AsyncCallback): void + + /** + * Checks the detailed information of this ability. + * @returns { Promise } Returns the AbilityInfo. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ getAbilityInfo(): Promise; /** - * Checks whether the configuration of this ability is changing. - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return true if the configuration of this ability is changing and false otherwise. - * @FAModelOnly - */ + * Checks whether the configuration of this ability is changing. + * @param { AsyncCallback } callback - Returns true if the configuration of this ability is changing and false otherwise. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ isUpdatingConfigurations(callback: AsyncCallback): void; + + /** + * Checks whether the configuration of this ability is changing. + * @returns { Promise } Returns true if the configuration of this ability is changing and false otherwise. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ isUpdatingConfigurations(): Promise; /** - * Informs the system of the time required for drawing this Page ability. - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @FAModelOnly - */ + * Informs the system of the time required for drawing this Page ability. + * @param { AsyncCallback } callback - The callback of printDrawnCompleted. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ printDrawnCompleted(callback: AsyncCallback): void; + + /** + * Informs the system of the time required for drawing this Page ability. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ printDrawnCompleted(): Promise; } /** - * @name the result of requestPermissionsFromUser with asynchronous callback - * @since 7 + * the result of requestPermissionsFromUser with asynchronous callback + * @typedef PermissionRequestResult * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A - * @FAModelOnly + * @famodelonly + * @since 9 */ interface PermissionRequestResult { /** - * @default The request code passed in by the user - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @FAModelOnly - */ + * The request code passed in by the user + * @type { number } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ requestCode: number; /** - * @default The permissions passed in by the user - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @FAModelOnly - */ + * The permissions passed in by the user + * @type { Array } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ permissions: Array; /** - * @default The results for the corresponding request permissions - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @FAModelOnly - */ + * The results for the corresponding request permissions + * @type { Array } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ authResults: Array; } /** - * @name PermissionOptions - * @since 7 + * @typedef PermissionOptions * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A - * @FAModelOnly + * @famodelonly + * @since 9 */ interface PermissionOptions { - /** - * @default The process id - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @FAModelOnly - */ - pid?: number; - - /** - * @default The user id - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @FAModelOnly - */ - uid?: number; + /** + * The process id + * @type { number } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ + pid?: number; + + /** + * The user id + * @type { number } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ + uid?: number; } diff --git a/api/@ohos.app.featureAbility.d.ts b/api/@ohos.app.featureAbility.d.ts index 090d1321b2..4662f9b078 100644 --- a/api/@ohos.app.featureAbility.d.ts +++ b/api/@ohos.app.featureAbility.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -19,228 +19,280 @@ 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 { Context } from './@ohos.app.featureAbility.context'; +import { DataAbilityHelper } from './@ohos.app.ability.dataAbilityHelper'; import { ConnectOptions } from './ability/connectOptions'; import { ProcessInfo as _ProcessInfo } from './app/processInfo'; import window from './@ohos.window'; /** * A Feature Ability represents an ability with a UI and is designed to interact with users. - * @name featureAbility - * @since 6 + * @namespace featureAbility * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @permission N/A - * @FAModelOnly + * @famodelonly + * @since 9 */ declare namespace featureAbility { - /** - * Obtain the want sended from the source ability. - * - * @since 6 - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @param parameter Indicates the ability to start. - * @return - - * @FAModelOnly - */ - function getWant(callback: AsyncCallback): void; - function getWant(): Promise; - - /** - * Starts a new ability. - * - * @since 6 - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @param parameter Indicates the ability to start. - * @return - - * @FAModelOnly - */ - function startAbility(parameter: StartAbilityParameter, callback: AsyncCallback): void; - function startAbility(parameter: StartAbilityParameter): Promise; - - /** - * Obtains the application context. - * - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @return Returns the application context. - * @since 6 - * @FAModelOnly - */ - function getContext(): Context; - - /** - * Starts an ability and returns the execution result when the ability is destroyed. - * - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @param parameter Indicates the ability to start. - * @return Returns the {@link AbilityResult}. - * @FAModelOnly - */ - function startAbilityForResult(parameter: StartAbilityParameter, callback: AsyncCallback): void; - function startAbilityForResult(parameter: StartAbilityParameter): Promise; - - /** - * Sets the result code and data to be returned by this Page ability to the caller - * and destroys this Page ability. - * - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @param parameter Indicates the result to return. - * @return - - * @FAModelOnly - */ - function terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback): void; - function terminateSelfWithResult(parameter: AbilityResult): Promise; - - /** - * Destroys this Page ability. - * - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @return - - * @FAModelOnly - */ - function terminateSelf(callback: AsyncCallback): void; - function terminateSelf(): Promise; - - /** - * Obtains the dataAbilityHelper. - * - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @param uri Indicates the path of the file to open. - * @return Returns the dataAbilityHelper. - * @FAModelOnly - */ - function acquireDataAbilityHelper(uri: string): DataAbilityHelper; - - /** - * Checks whether the main window of this ability has window focus. - * - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @return Returns {@code true} if this ability currently has window focus; returns {@code false} otherwise. - * @FAModelOnly - */ - function hasWindowFocus(callback: AsyncCallback): void; - function hasWindowFocus(): Promise; - - /** - * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template. - * @default - - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @param request The element name of the service ability - * @param options The remote object instance - * @return Returns the number code of the ability connected - * @FAModelOnly - */ - function connectAbility(request: Want, options:ConnectOptions ): number; - - /** - * The callback interface was connect successfully. - * @default - - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @param connection The number code of the ability connected - * @FAModelOnly - */ - function disconnectAbility(connection: number, callback:AsyncCallback): void; - function disconnectAbility(connection: number): Promise; - - /** - * Obtains the window corresponding to the current ability. - * - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @return Returns the window corresponding to the current ability. - * @FAModelOnly - */ - function getWindow(callback: AsyncCallback): void; - function getWindow(): Promise; - - /** - * Obtain the window configuration. - * - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @FAModelOnly - */ - export enum AbilityWindowConfiguration { - WINDOW_MODE_UNDEFINED = 0, - WINDOW_MODE_FULLSCREEN = 1, - WINDOW_MODE_SPLIT_PRIMARY = 100, - WINDOW_MODE_SPLIT_SECONDARY = 101, - WINDOW_MODE_FLOATING = 102 - } - - /** - * Obtain the window properties. - * - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @FAModelOnly - */ - export enum AbilityStartSetting { - BOUNDS_KEY = "abilityBounds", - WINDOW_MODE_KEY = "windowMode", - DISPLAY_ID_KEY = "displayId" - } - - /** - * Obtain the errorCode. - * - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @FAModelOnly - */ - export enum ErrorCode { - NO_ERROR = 0, - INVALID_PARAMETER = -1, - ABILITY_NOT_FOUND = -2, - PERMISSION_DENY = -3 - } - - /** - * Indicates the operation type of data. - * - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @FAModelOnly - */ - export enum DataAbilityOperationType { - TYPE_INSERT = 1, - TYPE_UPDATE = 2, - 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 - - /** - * 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 + /** + * Obtain the want sent from the source ability. + * @param { AsyncCallback } callback - The callback is used to return the want sent from the source ability. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ + function getWant(callback: AsyncCallback): void; + + /** + * Obtain the want sent from the source ability. + * @returns { Promise } Returns the want sent from the source ability. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ + function getWant(): Promise; + + /** + * Starts a new ability. + * @param { StartAbilityParameter } parameter - Indicates the ability to start. + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ + function startAbility(parameter: StartAbilityParameter, callback: AsyncCallback): void; + + /** + * Starts a new ability. + * @param { StartAbilityParameter } parameter - Indicates the ability to start. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ + function startAbility(parameter: StartAbilityParameter): Promise; + + /** + * Obtains the application context. + * @returns { Context } Returns the application context. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ + function getContext(): Context; + + /** + * Starts an ability and returns the execution result when the ability is destroyed. + * @param { StartAbilityParameter } parameter - Indicates the ability to start. + * @param { AsyncCallback } callback - The callback is used to return the AbilityResult. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ + function startAbilityForResult(parameter: StartAbilityParameter, callback: AsyncCallback): void; + + /** + * Starts an ability and returns the execution result when the ability is destroyed. + * @param { StartAbilityParameter } parameter - Indicates the ability to start. + * @returns { Promise } Returns the AbilityResult. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ + function startAbilityForResult(parameter: StartAbilityParameter): Promise; + + /** + * Sets the result code and data to be returned by this Page ability to the caller + * and destroys this Page ability. + * @param { AbilityResult } parameter - Indicates the result to return. + * @param { AsyncCallback } callback - The callback of terminateSelfWithResult. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ + function terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback): void; + + /** + * Sets the result code and data to be returned by this Page ability to the caller + * and destroys this Page ability. + * @param { AbilityResult } parameter - Indicates the result to return. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ + function terminateSelfWithResult(parameter: AbilityResult): Promise; + + /** + * Destroys this Page ability. + * @param { AsyncCallback } callback - The callback of terminateSelf. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ + function terminateSelf(callback: AsyncCallback): void; + + /** + * Destroys this Page ability. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ + function terminateSelf(): Promise; + + /** + * Obtains the dataAbilityHelper. + * @param uri Indicates the path of the file to open. + * @returns { DataAbilityHelper } Returns the DataAbilityHelper. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ + function acquireDataAbilityHelper(uri: string): DataAbilityHelper; + + /** + * Checks whether the main window of this ability has window focus. + * @param { AsyncCallback } callback - The callback is used to return {@code true} if this ability currently has window focus. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ + function hasWindowFocus(callback: AsyncCallback): void; + + /** + * Checks whether the main window of this ability has window focus. + * @returns { Promise } Returns {@code true} if this ability currently has window focus. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ + function hasWindowFocus(): Promise; + + /** + * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template. + * @param { Want } request - The element name of the service ability + * @param { ConnectOptions } options - The remote object instance + * @returns { number } Returns the number code of the ability connected. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ + function connectAbility(request: Want, options: ConnectOptions): number; + + /** + * The callback interface was connect successfully. + * @param { number } connection - The number code of the ability connected + * @param { AsyncCallback } callback - The callback of disconnectAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ + function disconnectAbility(connection: number, callback: AsyncCallback): void; + + /** + * The callback interface was connect successfully. + * @param { number } connection - The number code of the ability connected + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ + function disconnectAbility(connection: number): Promise; + + /** + * Obtains the window corresponding to the current ability. + * @param { AsyncCallback } callback - The callback is used to return the window corresponding to the current ability. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ + function getWindow(callback: AsyncCallback): void; + + /** + * Obtains the window corresponding to the current ability. + * @returns { Promise } Returns the window corresponding to the current ability. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ + function getWindow(): Promise; + + /** + * Obtain the window configuration + * @enum { number } + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ + export enum AbilityWindowConfiguration { + WINDOW_MODE_UNDEFINED = 0, + WINDOW_MODE_FULLSCREEN = 1, + WINDOW_MODE_SPLIT_PRIMARY = 100, + WINDOW_MODE_SPLIT_SECONDARY = 101, + WINDOW_MODE_FLOATING = 102 + } + + /** + * Obtain the window properties. + * @enum { string } + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ + export enum AbilityStartSetting { + BOUNDS_KEY = "abilityBounds", + WINDOW_MODE_KEY = "windowMode", + DISPLAY_ID_KEY = "displayId" + } + + /** + * Indicates the operation type of data. + * @enum { number } + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ + export enum DataAbilityOperationType { + TYPE_INSERT = 1, + TYPE_UPDATE = 2, + TYPE_DELETE = 3, + TYPE_ASSERT = 4, + } + + /** + * Defines an AppVersionInfo object. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ + export type AppVersionInfo = _AppVersionInfo + + /** + * This class saves process information about an application + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @famodelonly + * @since 9 + */ + export type ProcessInfo = _ProcessInfo } export default featureAbility; diff --git a/api/@ohos.app.form.FormExtensionContext.d.ts b/api/@ohos.app.form.FormExtensionContext.d.ts index 2f43e55ca8..36d2b54ebb 100644 --- a/api/@ohos.app.form.FormExtensionContext.d.ts +++ b/api/@ohos.app.form.FormExtensionContext.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -13,30 +13,28 @@ * limitations under the License. */ -import { AsyncCallback } from "../basic"; -import ExtensionContext from "./ExtensionContext"; -import formBindingData from '../@ohos.application.formBindingData'; -import Want from '../@ohos.application.Want'; +import { AsyncCallback } from "./basic"; +import ExtensionContext from "./application/ExtensionContext"; +import formBindingData from './@ohos.app.form.formBindingData'; +import Want from './@ohos.application.Want'; /** * The context of form extension. It allows access to * formExtension-specific resources. - * - * @since 9 * @syscap SystemCapability.Ability.Form - * @permission N/A - * @StageModelOnly + * @stagemodelonly + * @since 9 */ export default class FormExtensionContext extends ExtensionContext { /** * start an ability within the same bundle. - * - * @since 9 + * @param { Want } want - includes ability name, parameters and relative info sending to an ability. + * @param { AsyncCallback } callback - The callback of startAbility. + * @returns { Promise } The promise returned by the function. * @syscap SystemCapability.Ability.Form - * @systemapi hide for inner use - * @param want includes ability name, parameters and relative info sending to an ability. - * @return - - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ startAbility(want: Want, callback: AsyncCallback): void; startAbility(want: Want): Promise; diff --git a/api/@ohos.app.particleAbility.d.ts b/api/@ohos.app.particleAbility.d.ts index 0f9f7689b2..720bd45ed8 100644 --- a/api/@ohos.app.particleAbility.d.ts +++ b/api/@ohos.app.particleAbility.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -15,110 +15,104 @@ import { AsyncCallback } from './basic'; import { StartAbilityParameter } from './ability/startAbilityParameter'; -import { DataAbilityHelper } from './ability/dataAbilityHelper'; +import { DataAbilityHelper } from './@ohos.app.ability.dataAbilityHelper'; import { NotificationRequest } from './notification/notificationRequest'; import { ConnectOptions } from './ability/connectOptions'; import Want from './@ohos.application.Want'; /** * A Particle Ability represents an ability with service. - * @name particleAbility - * @since 7 + * @namespace particleAbility * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @permission N/A - * @FAModelOnly + * @famodelonly + * @since 9 */ declare namespace particleAbility { /** * Service ability uses this method to start a specific ability. - * - * @since 7 + * @param { StartAbilityParameter } parameter - Indicates the ability to start. + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @param parameter Indicates the ability to start. - * @return - - * @FAModelOnly + * @famodelonly + * @since 9 */ function startAbility(parameter: StartAbilityParameter, callback: AsyncCallback): void; + + /** + * Service ability uses this method to start a specific ability. + * @param { StartAbilityParameter } parameter - Indicates the ability to start. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ function startAbility(parameter: StartAbilityParameter): Promise; /** * Destroys this service ability. - * - * @since 7 + * @param { AsyncCallback } callback - The callback of terminateSelf. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @return - - * @FAModelOnly + * @famodelonly + * @since 9 */ function terminateSelf(callback: AsyncCallback): void; + + /** + * Destroys this service ability. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 + */ function terminateSelf(): Promise; /** * Obtains the dataAbilityHelper. - * - * @since 7 + * @param { string } uri - Indicates the path of the file to open. + * @returns { DataAbilityHelper } Returns the dataAbilityHelper. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @param uri Indicates the path of the file to open. - * @return Returns the dataAbilityHelper. - * @FAModelOnly + * @famodelonly + * @since 9 */ function acquireDataAbilityHelper(uri: string): DataAbilityHelper; /** - * Keep this Service ability in the background and display a notification bar. - * - * @since 7 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask - * @permission ohos.permission.KEEP_BACKGROUND_RUNNING - * @param id Identifies the notification bar information. - * @param request Indicates the notificationRequest instance containing information for displaying a notification bar. - * @FAModelOnly - * @deprecated + * Connects an ability to a Service ability. + * @param { Want } request - Indicates the Service ability to connect. + * @param { ConnectOptions } options - Callback object for the client. If this parameter is null, an exception is thrown. + * @returns { number } Returns the unique identifier of the connection between the client and the service side. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 */ - function startBackgroundRunning(id: number, request: NotificationRequest, callback: AsyncCallback): void; - function startBackgroundRunning(id: number, request: NotificationRequest): Promise; + function connectAbility(request: Want, options: ConnectOptions): number; /** - * Cancel background running of this ability to free up system memory. - * - * @since 7 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask - * @FAModelOnly - * @deprecated + * Disconnects ability to a Service ability. + * @param { number } connection - the connection id returned from connectAbility api. + * @param { AsyncCallback } callback - The callback of disconnectAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @famodelonly + * @since 9 */ - function cancelBackgroundRunning(callback: AsyncCallback): void; - function cancelBackgroundRunning(): Promise; + function disconnectAbility(connection: number, callback: AsyncCallback): void; /** - * Connects an ability to a Service ability. - * - * @since 7 + * Disconnects ability to a Service ability. + * @param { number } connection - the connection id returned from connectAbility api. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @param request Indicates the Service ability to connect. - * @param options Callback object for the client. If this parameter is null, an exception is thrown. - * @return unique identifier of the connection between the client and the service side. - * @FAModelOnly + * @famodelonly + * @since 9 */ - function connectAbility(request: Want, options:ConnectOptions): number; - - /** - * Disconnects ability to a Service ability. - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @param connection the connection id returned from connectAbility api. - * @FAModelOnly - */ - function disconnectAbility(connection: number, callback:AsyncCallback): void; - function disconnectAbility(connection: number): Promise; - - /** - * Obtain the errorCode. - * - * @since 7 - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @FAModelOnly - */ - export enum ErrorCode { - INVALID_PARAMETER = -1 - } + function disconnectAbility(connection: number): Promise; } export default particleAbility; diff --git a/api/@ohos.app.wantAgent.d.ts b/api/@ohos.app.wantAgent.d.ts index 48a996a481..0dd77890e8 100644 --- a/api/@ohos.app.wantAgent.d.ts +++ b/api/@ohos.app.wantAgent.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -21,108 +21,174 @@ import { TriggerInfo as _TriggerInfo } from './wantAgent/triggerInfo'; /** * Provide the method obtain trigger, cancel, and compare and to obtain * the bundle name, UID of an {@link WantAgent} object. - * - * @name wantAgent - * @since 7 + * @namespace wantAgent * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @import import wantAgent from '@ohos.wantAgent'; - * @permission N/A + * @since 9 */ declare namespace wantAgent { /** * Obtains the bundle name of a WantAgent. - * - * @param WantAgent whose bundle name to obtain. - * @return Returns the bundle name of the {@link WantAgent} if any. + * @param { WantAgent } agent - Indicates the WantAgent. + * @param { AsyncCallback } callback - The callback is used to return the bundle name. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 */ function getBundleName(agent: WantAgent, callback: AsyncCallback): void; + + /** + * Obtains the bundle name of a WantAgent. + * @param { WantAgent } agent - Indicates the WantAgent. + * @returns { Promise } Returns the bundle name. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ function getBundleName(agent: WantAgent): Promise; /** * Obtains the UID of a WantAgent. - * - * @param WantAgent whose UID to obtain. - * @return Returns the UID of the {@link WantAgent} if any; returns {@code -1} otherwise. + * @param { WantAgent } agent - Indicates the WantAgent. + * @param { AsyncCallback } callback - The callback is used to return the UID. + * @returns { Promise } Returns the UID. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 */ function getUid(agent: WantAgent, callback: AsyncCallback): void; function getUid(agent: WantAgent): Promise; /** * Obtains the {@link Want} of an {@link WantAgent}. - * - * @param agent Indicates the {@link WantAgent} whose UID is to be obtained. - * @return Returns the {@link Want} of the {@link WantAgent}. - * @systemapi Hide this for inner system use. + * @param { WantAgent } agent - Indicates the WantAgent. + * @param { AsyncCallback } callback - The callback is used to return the Want. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @since 9 */ function getWant(agent: WantAgent, callback: AsyncCallback): void; /** * Obtains the {@link Want} of an {@link WantAgent}. - * - * @param agent Indicates the {@link WantAgent} whose UID is to be obtained. - * @return Returns the {@link Want} of the {@link WantAgent}. - * @systemapi Hide this for inner system use. + * @param { WantAgent } agent - Indicates the WantAgent. + * @returns { Promise } Returns the Want. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @since 9 */ function getWant(agent: WantAgent): Promise; /** * Cancels a WantAgent. Only the application that creates the WantAgent can cancel it. - * - * @param WantAgent to cancel. + * @param { WantAgent } agent - Indicates the WantAgent. + * @param { AsyncCallback } callback - The callback of cancel. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 */ function cancel(agent: WantAgent, callback: AsyncCallback): void; + + /** + * Cancels a WantAgent. Only the application that creates the WantAgent can cancel it. + * @param { WantAgent } agent - Indicates the WantAgent. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ function cancel(agent: WantAgent): Promise; /** * Triggers a WantAgent. - * - * @param WantAgent to trigger. - * @param Trigger parameters. - * @param callback Indicates the callback method to be called after the {@link WantAgent} is triggered. + * @param { WantAgent } agent - Indicates the WantAgent. + * @param { TriggerInfo } triggerInfo - Indicates the information required for triggering a WantAgent. + * @param { Callback } callback - The callback is used to return the CompleteData. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 */ function trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback): void; /** * Triggers a WantAgent. - * + * @param { WantAgent } agent - Indicates the WantAgent. + * @param { TriggerInfo } triggerInfo - Indicates the information required for triggering a WantAgent. + * @param { AsyncCallback } callback - The callback is used to return the CompleteData. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 - * @param WantAgent to trigger. - * @param Trigger parameters. - * @param callback Indicates the AsyncCallback method to be called after the {@link WantAgent} is triggered. */ function trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: AsyncCallback): void; /** * Checks whether two WantAgent objects are equal. - * - * @param WantAgent to compare. - * @param WantAgent to compare. - * @return Returns {@code true} If the two objects are the same; returns {@code false} otherwise. + * @param { WantAgent } agent - Indicates the WantAgent. + * @param { WantAgent } otherAgent - Indicates the other WantAgent. + * @param { AsyncCallback } callback - Returns true if the two WantAgents are the same. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 */ function equal(agent: WantAgent, otherAgent: WantAgent, callback: AsyncCallback): void; + + /** + * Checks whether two WantAgent objects are equal. + * @param { WantAgent } agent - Indicates the WantAgent. + * @param { WantAgent } otherAgent - Indicates the other WantAgent. + * @returns { Promise } Returns true if the two WantAgents are the same. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ function equal(agent: WantAgent, otherAgent: WantAgent): Promise; /** * Obtains a WantAgent object. - * - * @param Information about the WantAgent object to obtain. - * @return Returns the created {@link WantAgent} object. + * @param { WantAgentInfo } info - Information about the WantAgent object to obtain. + * @param { AsyncCallback } callback - The callback is used to return the created WantAgent. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 */ function getWantAgent(info: WantAgentInfo, callback: AsyncCallback): void; + + /** + * Obtains a WantAgent object. + * @param { WantAgentInfo } info - Information about the WantAgent object to obtain. + * @returns { Promise } Returns the created WantAgent. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ function getWantAgent(info: WantAgentInfo): Promise; /** * Obtains the {@link OperationType} of a {@link WantAgent}. - * + * @param { WantAgent } agent - Indicates the WantAgent. + * @param { AsyncCallback } callback - The callback is used to return the OperationType of the WantAgent. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 - * @param agent Indicates the {@link WantAgent} whose {@link OperationType} is to be obtained. - * @return Returns the {@link OperationType} of the {@link WantAgent}. */ function getOperationType(agent: WantAgent, callback: AsyncCallback): void; + + /** + * Obtains the {@link OperationType} of a {@link WantAgent}. + * @param { WantAgent } agent - Indicates the WantAgent. + * @returns { Promise } Returns the OperationType of the WantAgent. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ function getOperationType(agent: WantAgent): Promise; /** * Enumerates flags for using a WantAgent. + * @enum { number } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 */ export enum WantAgentFlags { /** @@ -182,6 +248,9 @@ declare namespace wantAgent { /** * Identifies the operation for using a WantAgent, such as starting an ability or sending a common event. + * @enum { number } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 */ export enum OperationType { /** @@ -212,49 +281,63 @@ declare namespace wantAgent { /** * Describes the data returned by after wantAgent.trigger is called. + * @typedef CompleteData + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 */ export interface CompleteData { /** * Triggered WantAgent. + * @type { WantAgent } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 */ info: WantAgent; /** * Existing Want that is triggered. + * @type { Want } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 */ want: Want; /** * Request code used to trigger the WantAgent. + * @type { number } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 */ finalCode: number; /** * Final data collected by the common event. + * @type { string } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 */ finalData: string; /** * Extra data collected by the common event. + * @type { { [key: string]: any } } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 */ - extraInfo?: {[key: string]: any}; + extraInfo?: { [key: string]: any }; } /** * Provides the information required for triggering a WantAgent. - * - * @name TriggerInfo - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 */ export type TriggerInfo = _TriggerInfo /** * Provides the information required for triggering a WantAgent. - * - * @name WantAgentInfo - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 */ export type WantAgentInfo = _WantAgentInfo } diff --git a/api/@ohos.application.Ability.d.ts b/api/@ohos.application.Ability.d.ts index 99cfd35561..1d74c2371f 100755 --- a/api/@ohos.application.Ability.d.ts +++ b/api/@ohos.application.Ability.d.ts @@ -29,6 +29,8 @@ import rpc from './@ohos.rpc'; * @param msg Monitor status notification information. * @return - * @StageModelOnly + * @deprecated since 9 + * @useinstead @ohos.app.ability.Ability */ export interface OnReleaseCallBack { (msg: string): void; @@ -43,6 +45,8 @@ export interface OnReleaseCallBack { * @param indata Notification data notified from the caller. * @return rpc.Sequenceable * @StageModelOnly + * @deprecated since 9 + * @useinstead @ohos.app.ability.Ability */ export interface CalleeCallBack { (indata: rpc.MessageParcel): rpc.Sequenceable; @@ -55,6 +59,8 @@ export interface CalleeCallBack { * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @permission N/A * @StageModelOnly + * @deprecated since 9 + * @useinstead @ohos.app.ability.Ability */ export interface Caller { /** @@ -110,6 +116,8 @@ export interface Caller { * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @permission N/A * @StageModelOnly + * @deprecated since 9 + * @useinstead @ohos.app.ability.Ability */ export interface Callee { @@ -144,6 +152,8 @@ export interface Callee { * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @permission N/A * @StageModelOnly + * @deprecated since 9 + * @useinstead @ohos.app.ability.Ability */ export default class Ability { /** diff --git a/api/@ohos.application.abilityManager.d.ts b/api/@ohos.application.abilityManager.d.ts index a35eebd583..a161cc8290 100644 --- a/api/@ohos.application.abilityManager.d.ts +++ b/api/@ohos.application.abilityManager.d.ts @@ -26,6 +26,8 @@ import { ElementName } from './bundle/elementName'; * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi Hide this for inner system use * @permission N/A + * @deprecated since 9 + * @useinstead @ohos.app.ability.abilityManager */ declare namespace abilityManager { /** diff --git a/api/@ohos.application.errorManager.d.ts b/api/@ohos.application.errorManager.d.ts index dda4361c79..912f35efd4 100644 --- a/api/@ohos.application.errorManager.d.ts +++ b/api/@ohos.application.errorManager.d.ts @@ -23,6 +23,8 @@ import * as _ErrorObserver from './application/ErrorObserver'; * @syscap SystemCapability.Ability.AbilityRuntime.Core * @import import errorManager from '@ohos.application.errorManager' * @permission N/A + * @deprecated since 9 + * @useinstead @ohos.app.ability.errorManager */ declare namespace errorManager { /** diff --git a/api/@ohos.application.missionManager.d.ts b/api/@ohos.application.missionManager.d.ts index 3f43e85ddc..3398ce0a51 100644 --- a/api/@ohos.application.missionManager.d.ts +++ b/api/@ohos.application.missionManager.d.ts @@ -27,6 +27,8 @@ import StartOptions from "./@ohos.application.StartOptions"; * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @permission ohos.permission.MANAGE_MISSIONS * @systemapi hide for inner use. + * @deprecated since 9 + * @useinstead @ohos.app.ability.missionManager */ declare namespace missionManager { /** diff --git a/api/@ohos.application.quickFixManager.d.ts b/api/@ohos.application.quickFixManager.d.ts index d30e16fe03..4db4e87d7c 100644 --- a/api/@ohos.application.quickFixManager.d.ts +++ b/api/@ohos.application.quickFixManager.d.ts @@ -22,6 +22,8 @@ import { AsyncCallback } from "./basic"; * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix * @systemapi Hide this for inner system use. + * @deprecated since 9 + * @useinstead @ohos.app.ability.quickFixManager */ declare namespace quickFixManager { /** diff --git a/api/@ohos.wantAgent.d.ts b/api/@ohos.wantAgent.d.ts index 48a996a481..a6344ef34f 100644 --- a/api/@ohos.wantAgent.d.ts +++ b/api/@ohos.wantAgent.d.ts @@ -27,6 +27,8 @@ import { TriggerInfo as _TriggerInfo } from './wantAgent/triggerInfo'; * @syscap SystemCapability.Ability.AbilityRuntime.Core * @import import wantAgent from '@ohos.wantAgent'; * @permission N/A + * @deprecated since 9 + * @useinstead @ohos.app.wantAgent */ declare namespace wantAgent { /** diff --git a/api/ability/dataAbilityHelper.d.ts b/api/ability/dataAbilityHelper.d.ts index 870fe0c763..2ffbfefded 100644 --- a/api/ability/dataAbilityHelper.d.ts +++ b/api/ability/dataAbilityHelper.d.ts @@ -27,7 +27,7 @@ import rdb from '../@ohos.data.rdb'; * @since 7 * @FAModelOnly * @deprecated since 9 - * @useinstead DataAbilityUtils + * @useinstead @ohos.app.ability.dataAbilityHelper */ export interface DataAbilityHelper { /** @@ -43,8 +43,6 @@ export interface DataAbilityHelper { * @param callback Indicates the callback when openfile success * @return Returns the file descriptor. * @FAModelOnly - * @deprecated since 9 - * @useinstead DataAbilityUtils.openFile */ openFile(uri: string, mode: string, callback: AsyncCallback): void; openFile(uri: string, mode: string): Promise; @@ -59,8 +57,6 @@ export interface DataAbilityHelper { * @param callback Indicates the callback when dataChange. * @return - * @FAModelOnly - * @deprecated since 9 - * @useinstead DataAbilityUtils.on */ on(type: 'dataChange', uri: string, callback: AsyncCallback): void; @@ -74,8 +70,6 @@ export interface DataAbilityHelper { * @param callback Indicates the registered callback. * @return - * @FAModelOnly - * @deprecated since 9 - * @useinstead DataAbilityUtils.off */ off(type: 'dataChange', uri: string, callback?: AsyncCallback): void; @@ -87,8 +81,6 @@ export interface DataAbilityHelper { * @param uri Indicates the path of the data to operate. * @return Returns the MIME type that matches the data specified by uri. * @FAModelOnly - * @deprecated since 9 - * @useinstead DataAbilityUtils.getType */ getType(uri: string, callback: AsyncCallback): void; getType(uri: string): Promise; @@ -102,8 +94,6 @@ export interface DataAbilityHelper { * @param mimeTypeFilter Indicates the MIME types of the files to obtain. * @return Returns the matched MIME types Array. * @FAModelOnly - * @deprecated since 9 - * @useinstead DataAbilityUtils.getFileTypes */ getFileTypes(uri: string, mimeTypeFilter: string, callback: AsyncCallback>): void; getFileTypes(uri: string, mimeTypeFilter: string): Promise>; @@ -116,8 +106,6 @@ export interface DataAbilityHelper { * @param uri Indicates the uri object to normalize. * @return Returns the normalized uri object if the Data ability supports URI normalization or null. * @FAModelOnly - * @deprecated since 9 - * @useinstead DataAbilityUtils.normalizeUri */ normalizeUri(uri: string, callback: AsyncCallback): void; normalizeUri(uri: string): Promise; @@ -130,8 +118,6 @@ export interface DataAbilityHelper { * @param uri Indicates the uri object to normalize. * @return Returns the denormalized uri object if the denormalization is successful. * @FAModelOnly - * @deprecated since 9 - * @useinstead DataAbilityUtils.denormalizeUri */ denormalizeUri(uri: string, callback: AsyncCallback): void; denormalizeUri(uri: string): Promise; @@ -144,8 +130,6 @@ export interface DataAbilityHelper { * @param uri Indicates the path of the data to operate. * @return - * @FAModelOnly - * @deprecated since 9 - * @useinstead DataAbilityUtils.notifyChange */ notifyChange(uri: string, callback: AsyncCallback): void; notifyChange(uri: string): Promise; @@ -159,8 +143,6 @@ export interface DataAbilityHelper { * @param valuesBucket Indicates the data record to insert. If this parameter is null, a blank row will be inserted. * @return Returns the index of the inserted data record. * @FAModelOnly - * @deprecated since 9 - * @useinstead DataAbilityUtils.insert */ insert(uri: string, valuesBucket: rdb.ValuesBucket, callback: AsyncCallback): void; insert(uri: string, valuesBucket: rdb.ValuesBucket): Promise; @@ -174,8 +156,6 @@ export interface DataAbilityHelper { * @param valuesBuckets Indicates the data records to insert. * @return Returns the number of data records inserted. * @FAModelOnly - * @deprecated since 9 - * @useinstead DataAbilityUtils.batchInsert */ batchInsert(uri: string, valuesBuckets: Array, callback: AsyncCallback): void; batchInsert(uri: string, valuesBuckets: Array): Promise; @@ -189,8 +169,6 @@ export interface DataAbilityHelper { * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. * @return Returns the number of data records deleted. * @FAModelOnly - * @deprecated since 9 - * @useinstead DataAbilityUtils.delete */ delete(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; delete(uri: string, predicates?: dataAbility.DataAbilityPredicates): Promise; @@ -206,8 +184,6 @@ export interface DataAbilityHelper { * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. * @return Returns the number of data records updated. * @FAModelOnly - * @deprecated since 9 - * @useinstead DataAbilityUtils.update */ update(uri: string, valuesBucket: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; update(uri: string, valuesBucket: rdb.ValuesBucket, predicates?: dataAbility.DataAbilityPredicates): Promise; @@ -223,8 +199,6 @@ export interface DataAbilityHelper { * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. * @return Returns the query result {@link ResultSet}. * @FAModelOnly - * @deprecated since 9 - * @useinstead DataAbilityUtils.query */ query(uri: string, columns: Array, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; query(uri: string, callback: AsyncCallback): void; @@ -247,8 +221,6 @@ export interface DataAbilityHelper { * values of primitive types are supported, but not custom Sequenceable objects. * @return Returns the query result {@link PacMap}. * @FAModelOnly - * @deprecated since 9 - * @useinstead DataAbilityUtils.call */ call(uri: string, method: string, arg: string, extras: PacMap, callback: AsyncCallback): void; call(uri: string, method: string, arg: string, extras: PacMap): Promise; @@ -261,8 +233,6 @@ export interface DataAbilityHelper { * @param uri Indicates the path of data to query. * @param operations Indicates the data operation list, which can contain multiple operations on the database. * @return Returns the result of each operation, in array {@link DataAbilityResult}. - * @deprecated since 9 - * @useinstead DataAbilityUtils.executeBatch */ executeBatch(uri: string, operations: Array, callback: AsyncCallback>): void; executeBatch(uri: string, operations: Array): Promise>; @@ -273,6 +243,8 @@ export interface DataAbilityHelper { * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @FAModelOnly + * @deprecated since 9 + * @useinstead @ohos.app.ability.dataAbilityHelper */ export interface PacMap { diff --git a/api/app/context.d.ts b/api/app/context.d.ts index e24a3dd24b..570a4802e0 100644 --- a/api/app/context.d.ts +++ b/api/app/context.d.ts @@ -34,6 +34,8 @@ import bundle from '../@ohos.bundle'; * @import import abilityManager from 'app/context' * @permission N/A * @FAModelOnly + * @deprecated since 9 + * @useinstead @ohos.app.featureAbility.context */ export interface Context extends BaseContext { @@ -275,6 +277,8 @@ export interface Context extends BaseContext { * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A * @FAModelOnly + * @deprecated since 9 + * @useinstead @ohos.app.featureAbility.context */ interface PermissionRequestResult { /** @@ -308,6 +312,8 @@ interface PermissionRequestResult { * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A * @FAModelOnly + * @deprecated since 9 + * @useinstead @ohos.app.featureAbility.context */ interface PermissionOptions { /** diff --git a/api/application/AbilityContext.d.ts b/api/application/AbilityContext.d.ts index c42a2a2981..7c774d9812 100755 --- a/api/application/AbilityContext.d.ts +++ b/api/application/AbilityContext.d.ts @@ -36,6 +36,8 @@ import image from '../@ohos.multimedia.image'; * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A * @StageModelOnly + * @deprecated since 9 + * @useinstead @ohos.app.ability.AbilityContext */ export default class AbilityContext extends Context { /** diff --git a/api/application/ApplicationContext.d.ts b/api/application/ApplicationContext.d.ts index 2f605c61cf..6191bcdd48 100755 --- a/api/application/ApplicationContext.d.ts +++ b/api/application/ApplicationContext.d.ts @@ -25,6 +25,8 @@ import EnvironmentCallback from "../@ohos.application.EnvironmentCallback"; * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A * @StageModelOnly + * @deprecated since 9 + * @useinstead @ohos.app.ability.ApplicationContext */ export default class ApplicationContext extends Context { /** diff --git a/api/application/Context.d.ts b/api/application/Context.d.ts index 26c6eadcad..8563121f3a 100755 --- a/api/application/Context.d.ts +++ b/api/application/Context.d.ts @@ -27,6 +27,8 @@ import ApplicationContext from "./ApplicationContext"; * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A * @StageModelOnly + * @deprecated since 9 + * @useinstead @ohos.app.ability.Context */ export default class Context extends BaseContext { /** diff --git a/api/application/EventHub.d.ts b/api/application/EventHub.d.ts index 7fe3d203ca..ed61b12efc 100644 --- a/api/application/EventHub.d.ts +++ b/api/application/EventHub.d.ts @@ -20,6 +20,8 @@ * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A * @StageModelOnly + * @deprecated since 9 + * @useinstead @ohos.app.ability.EventHub */ export default class EventHub { /** diff --git a/api/application/ServiceExtensionContext.d.ts b/api/application/ServiceExtensionContext.d.ts index dd21ca7d0a..757cea7ffc 100644 --- a/api/application/ServiceExtensionContext.d.ts +++ b/api/application/ServiceExtensionContext.d.ts @@ -29,6 +29,8 @@ import StartOptions from "../@ohos.application.StartOptions"; * @systemapi hide for inner use. * @permission N/A * @StageModelOnly + * @deprecated since 9 + * @useinstead @ohos.app.ability.ServiceExtensionContext */ export default class ServiceExtensionContext extends ExtensionContext { /** diff --git a/api/application/abilityDelegator.d.ts b/api/application/abilityDelegator.d.ts index d6e08d73b2..46cb8dcfb4 100644 --- a/api/application/abilityDelegator.d.ts +++ b/api/application/abilityDelegator.d.ts @@ -29,6 +29,8 @@ import { ShellCmdResult } from './shellCmdResult'; * @syscap SystemCapability.Ability.AbilityRuntime.Core * @import import AbilityDelegator from 'application/abilityDelegator.d' * @permission N/A + * @deprecated since 9 + * @useinstead @ohos.app.ability.abilityDelegator */ export interface AbilityDelegator { /** -- Gitee From 677987ddd1892908036fc76610ce0b1fff19cc9a Mon Sep 17 00:00:00 2001 From: yangzk Date: Fri, 14 Oct 2022 20:22:24 +0800 Subject: [PATCH 138/438] IssueNo: #I5RT32 Description: move back Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- api/@ohos.app.ability.Ability.d.ts | 2 +- api/@ohos.app.ability.AbilityContext.d.ts | 528 ------------------ api/@ohos.app.ability.ApplicationContext.d.ts | 93 --- api/@ohos.app.ability.Context.d.ts | 192 ------- api/@ohos.app.ability.EventHub.d.ts | 57 -- ...s.app.ability.ServiceExtensionContext.d.ts | 305 ---------- api/@ohos.app.ability.abilityDelegator.d.ts | 360 ------------ api/@ohos.app.featureAbility.d.ts | 4 +- api/@ohos.app.form.FormExtensionContext.d.ts | 41 -- api/@ohos.app.particleAbility.d.ts | 2 +- .../dataAbilityUtils.d.ts} | 12 +- .../featureAbilityContext.d.ts} | 18 +- api/application/AbilityContext.d.ts | 486 +++++++++++----- api/application/ApplicationContext.d.ts | 68 ++- api/application/Context.d.ts | 135 +++-- api/application/EventHub.d.ts | 45 +- api/application/ServiceExtensionContext.d.ts | 287 +++++++--- api/application/abilityDelegator.d.ts | 303 +++++++--- 18 files changed, 931 insertions(+), 2007 deletions(-) delete mode 100644 api/@ohos.app.ability.AbilityContext.d.ts delete mode 100644 api/@ohos.app.ability.ApplicationContext.d.ts delete mode 100644 api/@ohos.app.ability.Context.d.ts delete mode 100644 api/@ohos.app.ability.EventHub.d.ts delete mode 100644 api/@ohos.app.ability.ServiceExtensionContext.d.ts delete mode 100644 api/@ohos.app.ability.abilityDelegator.d.ts delete mode 100644 api/@ohos.app.form.FormExtensionContext.d.ts rename api/{@ohos.app.ability.dataAbilityHelper.d.ts => ability/dataAbilityUtils.d.ts} (98%) rename api/{@ohos.app.featureAbility.context.d.ts => app/featureAbilityContext.d.ts} (98%) diff --git a/api/@ohos.app.ability.Ability.d.ts b/api/@ohos.app.ability.Ability.d.ts index 340c4e952a..c75fe2d93c 100755 --- a/api/@ohos.app.ability.Ability.d.ts +++ b/api/@ohos.app.ability.Ability.d.ts @@ -14,7 +14,7 @@ */ import AbilityConstant from "./@ohos.application.AbilityConstant"; -import AbilityContext from "./@ohos.app.ability.AbilityContext"; +import AbilityContext from "./application/AbilityContext"; import Want from './@ohos.application.Want'; import window from './@ohos.window'; import { Configuration } from './@ohos.application.Configuration'; diff --git a/api/@ohos.app.ability.AbilityContext.d.ts b/api/@ohos.app.ability.AbilityContext.d.ts deleted file mode 100644 index 9549de949e..0000000000 --- a/api/@ohos.app.ability.AbilityContext.d.ts +++ /dev/null @@ -1,528 +0,0 @@ -/* - * 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 { AbilityInfo } from "./bundle/abilityInfo"; -import { AbilityResult } from "./ability/abilityResult"; -import { AsyncCallback } from "./basic"; -import { ConnectOptions } from "./ability/connectOptions"; -import { HapModuleInfo } from "./bundle/hapModuleInfo"; -import Context from "./@ohos.app.ability.Context"; -import Want from "./@ohos.application.Want"; -import StartOptions from "./@ohos.application.StartOptions"; -import PermissionRequestResult from "./application/PermissionRequestResult"; -import { Configuration } from './@ohos.application.Configuration'; -import { Caller } from './@ohos.app.ability.Ability'; -import { LocalStorage } from 'StateManagement'; -import image from './@ohos.multimedia.image'; - -/** - * The context of an ability. It allows access to ability-specific resources. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ -export default class AbilityContext extends Context { - /** - * Indicates configuration information about an ability. - * @type { AbilityInfo } - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - abilityInfo: AbilityInfo; - - /** - * Indicates configuration information about the module. - * @type { HapModuleInfo } - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - currentHapModuleInfo: HapModuleInfo; - - /** - * Indicates configuration information. - * @type { Configuration } - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - config: Configuration; - - /** - * Starts a new ability. - * @param want { Want } - Indicates the ability to start. - * @param { AsyncCallback } callback - The callback of startAbility. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - startAbility(want: Want, callback: AsyncCallback): void; - - /** - * Starts a new ability. - * @param { Want } want - Indicates the ability to start. - * @param { StartOptions } options - Indicates the start options. - * @param { AsyncCallback } callback - The callback of startAbility. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; - - /** - * Starts a new ability. - * @param { Want } want - Indicates the ability to start. - * @param { StartOptions } options - Indicates the start options. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - startAbility(want: Want, options?: StartOptions): Promise; - - /** - * Get the caller object of the startup capability - * @param { Want } want - Indicates the ability to start. - * @returns { Promise } Returns the Caller interface. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - startAbilityByCall(want: Want): Promise; - - /** - * Starts a new ability with account. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS - * @param { Want } want - Indicates the want info to start. - * @param { number } accountId - Indicates the account to start. - * @param { AsyncCallback } callback - The callback of startAbilityWithAccount. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; - - /** - * Starts a new ability with account. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS - * @param { Want } want - Indicates the want info to start. - * @param { number } accountId - Indicates the account to start. - * @param { StartOptions } options - Indicates the start options. - * @param { AsyncCallback } callback - The callback of startAbilityWithAccount. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; - - /** - * Starts a new ability with account. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS - * @param { Want } want - Indicates the want info to start. - * @param { number } accountId - Indicates the account to start. - * @param { StartOptions } options - Indicates the start options. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; - - /** - * Starts an ability and returns the execution result when the ability is destroyed. - * @param { Want } want - Indicates the ability to start. - * @param { AsyncCallback } callback - The callback is used to return the result of startAbility. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - startAbilityForResult(want: Want, callback: AsyncCallback): void; - - /** - * Starts an ability and returns the execution result when the ability is destroyed. - * @param { Want } want - Indicates the ability to start. - * @param { StartOptions } options - Indicates the start options. - * @param { AsyncCallback } callback - The callback is used to return the result of startAbility. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback): void; - - /** - * Starts an ability and returns the execution result when the ability is destroyed. - * @param { Want } want - Indicates the ability to start. - * @param { StartOptions } options - Indicates the start options. - * @returns { Promise } Returns the result of startAbility. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - startAbilityForResult(want: Want, options?: StartOptions): Promise; - - /** - * Starts an ability and returns the execution result when the ability is destroyed with account. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS - * @param { Want } want - Indicates the want info to start. - * @param { number } accountId - Indicates the account to start. - * @param { AsyncCallback } callback - The callback is used to return the result of startAbility. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; - - /** - * Starts an ability and returns the execution result when the ability is destroyed with account. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS - * @param { Want } want - Indicates the want info to start. - * @param { number } accountId - Indicates the account to start. - * @param { StartOptions } options - Indicates the start options. - * @param { AsyncCallback } callback - The callback is used to return the result of startAbility. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; - - /** - * Starts an ability and returns the execution result when the ability is destroyed with account. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS - * @param { Want } want - Indicates the want info to start. - * @param { number } accountId - Indicates the account to start. - * @param { StartOptions } options - Indicates the start options. - * @returns { Promise } Returns the result of startAbility. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; - - /** - * Starts a new service extension ability. - * @param { Want } want - Indicates the want info to start. - * @param { AsyncCallback } callback - The callback of startServiceExtensionAbility. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - startServiceExtensionAbility(want: Want, callback: AsyncCallback): void; - - /** - * Starts a new service extension ability. - * @param { Want } want - Indicates the want info to start. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - startServiceExtensionAbility(want: Want): Promise; - - /** - * Starts a new service extension ability with account. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. - * @param { Want } want - Indicates the want info to start. - * @param { number } accountId - Indicates the account to start. - * @param { AsyncCallback } callback - The callback of startServiceExtensionAbilityWithAccount. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; - - /** - * Starts a new service extension ability with account. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. - * @param { Want } want - Indicates the want info to start. - * @param { number } accountId - Indicates the account to start. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; - - /** - * Stops a service within the same application. - * @param { Want } want - Indicates the want info to start. - * @param { AsyncCallback } callback - The callback of stopServiceExtensionAbility. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - stopServiceExtensionAbility(want: Want, callback: AsyncCallback): void; - - /** - * Stops a service within the same application. - * @param { Want } want - Indicates the want info to start. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - stopServiceExtensionAbility(want: Want): Promise; - - /** - * Stops a service within the same application with account. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. - * @param { Want } want - Indicates the want info to start. - * @param { number } accountId - Indicates the accountId to start. - * @param { AsyncCallback } callback - The callback of stopServiceExtensionAbilityWithAccount. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; - - /** - * Stops a service within the same application with account. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. - * @param { Want } want - Indicates the want info to start. - * @param { number } accountId - Indicates the accountId to start. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; - - /** - * Destroys this Page ability. - * @param { AsyncCallback } callback - The callback of terminateSelf. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - terminateSelf(callback: AsyncCallback): void; - - /** - * Destroys this Page ability. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - terminateSelf(): Promise; - - /** - * Sets the result code and data to be returned by this Page ability to the caller - * and destroys this Page ability. - * @param { AbilityResult } parameter - Indicates the result to return. - * @param { AsyncCallback } callback - The callback of terminateSelfWithResult. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback): void; - - /** - * Sets the result code and data to be returned by this Page ability to the caller - * and destroys this Page ability. - * @param { AbilityResult } parameter - Indicates the result to return. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - terminateSelfWithResult(parameter: AbilityResult): Promise; - - /** - * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template. - * @param { Want } want - The element name of the service ability - * @param { ConnectOptions } options - The remote object instance - * @returns { number } Returns the number code of the ability connected - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - connectAbility(want: Want, options: ConnectOptions): number; - - /** - * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template with account. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS - * @param { Want } want - The element name of the service ability - * @param { number } accountId - The account to connect - * @param { ConnectOptions } options - The remote object instance - * @returns { number } Returns the number code of the ability connected - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; - - /** - * The callback interface was connect successfully. - * @param { number } connection - The number code of the ability connected - * @param { AsyncCallback } callback - The callback of disconnectAbility. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - disconnectAbility(connection: number, callback: AsyncCallback): void; - - /** - * The callback interface was connect successfully. - * @param { number } connection - The number code of the ability connected - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - disconnectAbility(connection: number): Promise; - - /** - * Set mission label of current ability. - * @param { string } label - The label of ability that showed in recent missions. - * @param { AsyncCallback } callback - The callback of setMissionLabel. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - setMissionLabel(label: string, callback: AsyncCallback): void; - - /** - * Set mission label of current ability. - * @param { string } label - The label of ability that showed in recent missions. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - setMissionLabel(label: string): Promise; - - /** - * Set mission icon of current ability. - * @param { image.PixelMap } icon - The icon of ability that showed in recent missions. - * @param { AsyncCallback } callback - The callback of setMissionIcon. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - setMissionIcon(icon: image.PixelMap, callback: AsyncCallback): void; - - /** - * Set mission icon of current ability. - * @param { image.PixelMap } icon - The icon of ability that showed in recent missions. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - setMissionIcon(icon: image.PixelMap): Promise; - - /** - * Requests certain permissions from the system. - * @param { Array } permissions - Indicates the list of permissions to be requested. This parameter - * cannot be null or empty. - * @param { AsyncCallback } requestCallback - The callback is used to return the permission - * request result. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - requestPermissionsFromUser(permissions: Array, requestCallback: AsyncCallback): void; - - /** - * Requests certain permissions from the system. - * @param { Array } permissions - Indicates the list of permissions to be requested. This parameter - * cannot be null or empty. - * @returns { Promise } Returns the permission request result. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - requestPermissionsFromUser(permissions: Array): Promise; - - /** - * Restore window stage data in ability continuation - * @param { LocalStorage } localStorage - the storage data used to restore window stage - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - restoreWindowStage(localStorage: LocalStorage): void; - - /** - * check to see ability is in terminating state. - * @returns { boolean } Returns true when ability is in terminating state, else returns false. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - isTerminating(): boolean; -} diff --git a/api/@ohos.app.ability.ApplicationContext.d.ts b/api/@ohos.app.ability.ApplicationContext.d.ts deleted file mode 100644 index 065247fca6..0000000000 --- a/api/@ohos.app.ability.ApplicationContext.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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 { AsyncCallback } from "./basic"; -import Context from "./@ohos.app.ability.Context"; -import AbilityLifecycleCallback from "./@ohos.application.AbilityLifecycleCallback"; -import EnvironmentCallback from "./@ohos.application.EnvironmentCallback"; - -/** - * The context of an application. It allows access to application-specific resources. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ -export default class ApplicationContext extends Context { - /** - * Register ability lifecycle callback. - * @param { AbilityLifecycleCallback } callback - The ability lifecycle callback. - * @returns { number } Returns the number code of the callback. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - registerAbilityLifecycleCallback(callback: AbilityLifecycleCallback): number; - - /** - * Unregister ability lifecycle callback. - * @param { number } callbackId - Indicates the number code of the callback. - * @param { AsyncCallback } callback - The callback of unregisterAbilityLifecycleCallback. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - unregisterAbilityLifecycleCallback(callbackId: number, callback: AsyncCallback): void; - - /** - * Unregister ability lifecycle callback. - * @param { number } callbackId - Indicates the number code of the callback. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - unregisterAbilityLifecycleCallback(callbackId: number): Promise; - - /** - * Register environment callback. - * @param { EnvironmentCallback } callback - The environment callback. - * @returns { number } Returns the number code of the callback. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - registerEnvironmentCallback(callback: EnvironmentCallback): number; - - /** - * Unregister environment callback. - * @param { number } callbackId - Indicates the number code of the callback. - * @param { AsyncCallback } callback - The callback of unregisterEnvironmentCallback. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - unregisterEnvironmentCallback(callbackId: number, callback: AsyncCallback): void; - - /** - * Unregister environment callback. - * @param { number } callbackId - Indicates the number code of the callback. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - unregisterEnvironmentCallback(callbackId: number): Promise; -} diff --git a/api/@ohos.app.ability.Context.d.ts b/api/@ohos.app.ability.Context.d.ts deleted file mode 100644 index 674cefb9e1..0000000000 --- a/api/@ohos.app.ability.Context.d.ts +++ /dev/null @@ -1,192 +0,0 @@ -/* - * 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 { ApplicationInfo } from "./bundle/applicationInfo"; -import resmgr from "./@ohos.resourceManager"; -import BaseContext from "./application/BaseContext"; -import EventHub from "./@ohos.app.ability.EventHub"; -import ApplicationContext from "./@ohos.app.ability.ApplicationContext"; - -/** - * The base context of an ability or an application. It allows access to - * application-specific resources. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ -export default class Context extends BaseContext { - /** - * Indicates the capability of accessing application resources. - * @type { resmgr.ResourceManager } - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - resourceManager: resmgr.ResourceManager; - - /** - * Indicates configuration information about an application. - * @type { ApplicationInfo } - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - applicationInfo: ApplicationInfo; - - /** - * Indicates app cache dir. - * @type { string } - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - cacheDir: string; - - /** - * Indicates app temp dir. - * @type { string } - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - tempDir: string; - - /** - * Indicates app files dir. - * @type { string } - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - filesDir: string; - - /** - * Indicates app database dir. - * @type { string } - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - databaseDir: string; - - /** - * Indicates app preferences dir. - * @type { string } - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - preferencesDir: string; - - /** - * Indicates app bundle code dir. - * @type { string } - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - bundleCodeDir: string; - - /** - * Indicates app distributed files dir. - * @type { string } - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - distributedFilesDir: string; - - /** - * Indicates event hub. - * @type { EventHub } - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - eventHub: EventHub; - - /** - * Indicates file area. - * @type { AreaMode } - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - area: AreaMode; - - /** - * Create a bundle context - * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED - * @param { string } bundleName - Indicates the bundle name. - * @returns { Context } Returns the application context. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - createBundleContext(bundleName: string): Context; - - /** - * Create a module context - * @param { string } moduleName - Indicates the module name. - * @returns { Context } Returns the application context. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - createModuleContext(moduleName: string): Context; - - /** - * Create a module context - * @param { string } bundleName - Indicates the bundle name. - * @param { string } moduleName - Indicates the module name. - * @returns { Context } Returns the application context. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - createModuleContext(bundleName: string, moduleName: string): Context; - - /** - * Get application context - * @returns { ApplicationContext } Returns the application context. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - getApplicationContext(): ApplicationContext; -} - -/** - * Enum for the file area mode - * @enum { number } - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ -export enum AreaMode { - /** - * @syscap SystemCapability.Ability.AbilityRuntime.Core - */ - EL1 = 0, - /** - * @syscap SystemCapability.Ability.AbilityRuntime.Core - */ - EL2 = 1 -} diff --git a/api/@ohos.app.ability.EventHub.d.ts b/api/@ohos.app.ability.EventHub.d.ts deleted file mode 100644 index 708e937969..0000000000 --- a/api/@ohos.app.ability.EventHub.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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 { BusinessError } from './basic'; - -/** - * The event center of a context, support the subscription and publication of events. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ -export default class EventHub { - /** - * Subscribe to an event. - * @param { string } event - Indicates the event. - * @param { Function } callback - Indicates the callback. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - on(event: string, callback: Function): void - - /** - * Unsubscribe from an event. - * @param { string } event - Indicates the event. - * @param { Function } callback - Indicates the callback. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - off(event: string, callback?: Function): void - - /** - * Trigger the event callbacks. - * @param { string } event - Indicates the event. - * @param { Object[] } args - Indicates the callback arguments. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - emit(event: string, ...args: Object[]): void -} \ No newline at end of file diff --git a/api/@ohos.app.ability.ServiceExtensionContext.d.ts b/api/@ohos.app.ability.ServiceExtensionContext.d.ts deleted file mode 100644 index 9b9b3afa18..0000000000 --- a/api/@ohos.app.ability.ServiceExtensionContext.d.ts +++ /dev/null @@ -1,305 +0,0 @@ -/* - * 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 { AsyncCallback } from "./basic"; -import { ConnectOptions } from "./ability/connectOptions"; -import { Caller } from './@ohos.app.ability.Ability'; -import ExtensionContext from "./application/ExtensionContext"; -import Want from "./@ohos.application.Want"; -import StartOptions from "./@ohos.application.StartOptions"; - -/** - * The context of service extension. It allows access to - * serviceExtension-specific resources. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ -export default class ServiceExtensionContext extends ExtensionContext { - /** - * Service extension uses this method to start a specific ability. - * @param { Want } want - Indicates the ability to start. - * @param { AsyncCallback } callback - The callback of startAbility. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - startAbility(want: Want, callback: AsyncCallback): void; - - /** - * Service extension uses this method to start a specific ability. - * @param { Want } want - Indicates the ability to start. - * @param { StartOptions } options - Indicates the start options. - * @param { AsyncCallback } callback - The callback of startAbility. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; - - /** - * Service extension uses this method to start a specific ability. - * @param { Want } want - Indicates the ability to start. - * @param { StartOptions } options - Indicates the start options. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - startAbility(want: Want, options?: StartOptions): Promise; - - /** - * Service extension uses this method to start a specific ability with account. - * @param { Want } want - Indicates the ability to start. - * @param { number } accountId - Indicates the accountId to start. - * @param { AsyncCallback } callback - The callback of startAbilityWithAccount. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; - - /** - * Service extension uses this method to start a specific ability with account. - * @param { Want } want - Indicates the ability to start. - * @param { number } accountId - Indicates the accountId to start. - * @param { StartOptions } options - Indicates the start options. - * @param { AsyncCallback } callback - The callback of startAbilityWithAccount. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; - - /** - * Service extension uses this method to start a specific ability with account. - * @param { Want } want - Indicates the ability to start. - * @param { number } accountId - Indicates the accountId to start. - * @param { StartOptions } options - Indicates the start options. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; - - /** - * Starts a new service extension ability. - * @param { Want } want - Indicates the want info to start. - * @param { AsyncCallback } callback - The callback of startServiceExtensionAbility. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - startServiceExtensionAbility(want: Want, callback: AsyncCallback): void; - - /** - * Starts a new service extension ability. - * @param { Want } want - Indicates the want info to start. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - startServiceExtensionAbility(want: Want): Promise; - - /** - * Starts a new service extension ability with account. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. - * @param { Want } want - Indicates the want info to start. - * @param { number } accountId - Indicates the account to start. - * @param { AsyncCallback } callback - The callback of startServiceExtensionAbilityWithAccount. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; - - /** - * Starts a new service extension ability with account. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. - * @param { Want } want - Indicates the want info to start. - * @param { number } accountId - Indicates the account to start. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; - - /** - * Stops a service within the same application. - * @param { Want } want - Indicates the want info to start. - * @param { AsyncCallback } callback - The callback of stopServiceExtensionAbility. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - stopServiceExtensionAbility(want: Want, callback: AsyncCallback): void; - - /** - * Stops a service within the same application. - * @param { Want } want - Indicates the want info to start. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - stopServiceExtensionAbility(want: Want): Promise; - - /** - * Stops a service within the same application with account. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. - * @param { Want } want - Indicates the want info to start. - * @param { number } accountId - Indicates the accountId to start. - * @param { AsyncCallback } callback - The callback of stopServiceExtensionAbilityWithAccount. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; - - /** - * Stops a service within the same application with account. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. - * @param { Want } want - Indicates the want info to start. - * @param { number } accountId - Indicates the accountId to start. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; - - /** - * Destroys this service extension. - * @param { AsyncCallback } callback - The callback of terminateSelf. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - terminateSelf(callback: AsyncCallback): void; - - /** - * Destroys this service extension. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - terminateSelf(): Promise; - - /** - * Connects an ability to a Service extension. - *

This method can be called by an ability or service extension, but the destination of the connection must be a - * service extension. You must implement the {@link ConnectOptions} interface to obtain the proxy of the target - * service extension when the Service extension is connected.

- * @param { Want } want - Indicates the service extension to connect. - * @param { ConnectOptions } options - Indicates the callback of connection. - * @returns { number } Returns the connection id. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - connectAbility(want: Want, options: ConnectOptions): number; - - /** - * Connects an ability to a Service extension with account. - *

This method can be called by an ability or service extension, but the destination of the connection must be a - * service extension. You must implement the {@link ConnectOptions} interface to obtain the proxy of the target - * service extension when the Service extension is connected.

- * @param { Want } want - Indicates the service extension to connect. - * @param { number } accountId - Indicates the account to connect. - * @param { ConnectOptions } options - Indicates the callback of connection. - * @returns { number } Returns the connection id. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; - - /** - * Disconnects an ability to a service extension, in contrast to {@link connectAbility}. - * @param { number } connection - the connection id returned from connectAbility api. - * @param { AsyncCallback } callback - The callback of disconnectAbility. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - disconnectAbility(connection: number, callback: AsyncCallback): void; - - /** - * Disconnects an ability to a service extension, in contrast to {@link connectAbility}. - * @param { number } connection - the connection id returned from connectAbility api. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - disconnectAbility(connection: number): Promise; - - /** - * Get the caller object of the startup capability - * @param { Want } want - Indicates the ability to start. - * @returns { Promise } Returns the Caller interface. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi - * @stagemodelonly - * @since 9 - */ - startAbilityByCall(want: Want): Promise; -} \ No newline at end of file diff --git a/api/@ohos.app.ability.abilityDelegator.d.ts b/api/@ohos.app.ability.abilityDelegator.d.ts deleted file mode 100644 index 0e9bde748c..0000000000 --- a/api/@ohos.app.ability.abilityDelegator.d.ts +++ /dev/null @@ -1,360 +0,0 @@ -/* - * 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 { AsyncCallback } from './basic'; -import Ability from './@ohos.app.ability.Ability'; -import AbilityStage from './@ohos.application.AbilityStage'; -import { AbilityMonitor } from './application/abilityMonitor'; -import { AbilityStageMonitor } from './application/abilityStageMonitor'; -import Context from './@ohos.app.ability.Context'; -import Want from "./@ohos.application.Want"; -import { ShellCmdResult } from './application/shellCmdResult'; - -/** - * A global test utility interface used for adding AbilityMonitor objects and control lifecycle states of abilities. - * @interface - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ -export interface AbilityDelegator { - /** - * Add an AbilityMonitor object for monitoring the lifecycle state changes of the specified ability. - * @param { AbilityMonitor } monitor - AbilityMonitor object - * @param { AsyncCallback } callback - The callback of addAbilityMonitor. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - addAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback): void; - - /** - * Add an AbilityMonitor object for monitoring the lifecycle state changes of the specified ability. - * @param { AbilityMonitor } monitor - AbilityMonitor object - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - addAbilityMonitor(monitor: AbilityMonitor): Promise; - - /** - * Add an AbilityStageMonitor object for monitoring the lifecycle state changes of the specified abilityStage. - * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. - * @param { AsyncCallback } callback - The callback of addAbilityStageMonitor. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - addAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback): void; - - /** - * Add an AbilityStageMonitor object for monitoring the lifecycle state changes of the specified abilityStage. - * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - addAbilityStageMonitor(monitor: AbilityStageMonitor): Promise; - - /** - * Remove a specified AbilityMonitor object from the application memory. - * @param { AbilityMonitor } monitor - AbilityMonitor object. - * @param { AsyncCallback } callback - The callback of removeAbilityMonitor. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - removeAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback): void; - - /** - * Remove a specified AbilityMonitor object from the application memory. - * @param { AbilityMonitor } monitor - AbilityMonitor object. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - removeAbilityMonitor(monitor: AbilityMonitor): Promise; - - /** - * Remove a specified AbilityStageMonitor object from the application memory. - * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. - * @param { AsyncCallback } callback - The callback of removeAbilityStageMonitor. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - removeAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback): void; - - /** - * Remove a specified AbilityStageMonitor object from the application memory. - * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - removeAbilityStageMonitor(monitor: AbilityStageMonitor): Promise; - - /** - * Wait for and returns the Ability object that matches the conditions set in the given AbilityMonitor. - * @param { AbilityMonitor } monitor - AbilityMonitor object. - * @param { AsyncCallback } callback - The callback is used to return the Ability object. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - waitAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback): void; - - /** - * Wait for and returns the Ability object that matches the conditions set in the given AbilityMonitor. - * @param { AbilityMonitor } monitor - AbilityMonitor object. - * @param { number } timeout - Maximum wait time, in milliseconds. - * @param { AsyncCallback } callback - The callback is used to return the Ability object. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - waitAbilityMonitor(monitor: AbilityMonitor, timeout: number, callback: AsyncCallback): void; - - /** - * Wait for and returns the Ability object that matches the conditions set in the given AbilityMonitor. - * @param { AbilityMonitor } monitor - AbilityMonitor object. - * @param { number } timeout - Maximum wait time, in milliseconds. - * @returns { Promise } Returns the Ability object. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - waitAbilityMonitor(monitor: AbilityMonitor, timeout?: number): Promise; - - /** - * Wait for and returns the AbilityStage object that matches the conditions set in the given AbilityStageMonitor. - * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. - * @param { AsyncCallback } callback - The callback is used to return the AbilityStage object. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - waitAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback): void; - - /** - * Wait for and returns the AbilityStage object that matches the conditions set in the given AbilityStageMonitor. - * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. - * @param { number } timeout - Maximum wait time, in milliseconds. - * @param { AsyncCallback } callback - The callback is used to return the AbilityStage object. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - waitAbilityStageMonitor(monitor: AbilityStageMonitor, timeout: number, callback: AsyncCallback): void; - - /** - * Wait for and returns the AbilityStage object that matches the conditions set in the given AbilityStageMonitor. - * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. - * @param { number } timeout - Maximum wait time, in milliseconds. - * @returns { Promise } Returns the AbilityStage object. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - waitAbilityStageMonitor(monitor: AbilityStageMonitor, timeout?: number): Promise; - - /** - * Obtain the application context. - * @returns { Context } Returns the app Context. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - getAppContext(): Context; - - /** - * Obtain the lifecycle state of a specified ability. - * @param { Ability } ability - The Ability object. - * @returns { number } Returns the state of the Ability object. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - getAbilityState(ability: Ability): number; - - /** - * Obtain the ability that is currently being displayed. - * @param { AsyncCallback } callback - The callback is used to return the Ability object. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - getCurrentTopAbility(callback: AsyncCallback): void; - - /** - * Obtain the ability that is currently being displayed. - * @returns { Promise } Returns the Ability object. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - getCurrentTopAbility(): Promise - - /** - * Start a new ability. - * @param { Want } want - Indicates the ability to start - * @param { AsyncCallback } callback - The callback of startAbility. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - startAbility(want: Want, callback: AsyncCallback): void; - - /** - * Start a new ability. - * @param { Want } want - Indicates the ability to start - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - startAbility(want: Want): Promise; - - /** - * Invoke the Ability.onForeground() callback of a specified ability without changing its lifecycle state. - * @param { Ability } ability - The ability object. - * @param { AsyncCallback } callback - The callback of doAbilityForeground. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - doAbilityForeground(ability: Ability, callback: AsyncCallback): void; - - /** - * Invoke the Ability.onForeground() callback of a specified ability without changing its lifecycle state. - * @param { Ability } ability - The ability object. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - doAbilityForeground(ability: Ability): Promise; - - /** - * Invoke the Ability.onBackground() callback of a specified ability without changing its lifecycle state. - * @param { Ability } ability - The ability object. - * @param { AsyncCallback } callback - The callback of doAbilityBackground. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - doAbilityBackground(ability: Ability, callback: AsyncCallback): void; - - /** - * Invoke the Ability.onBackground() callback of a specified ability without changing its lifecycle state. - * @param { Ability } ability - The ability object. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - doAbilityBackground(ability: Ability): Promise; - - /** - * Prints log information to the unit testing console. - * The total length of the log information to be printed cannot exceed 1000 characters. - * @param { string } msg - Log information. - * @param { AsyncCallback } callback - The callback of print. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - print(msg: string, callback: AsyncCallback): void; - - /** - * Prints log information to the unit testing console. - * The total length of the log information to be printed cannot exceed 1000 characters. - * @param { string } msg - Log information. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - print(msg: string): Promise; - - /** - * Prints log information to the unit testing console. - * The total length of the log information to be printed cannot exceed 1000 characters. - * @param { string } msg - Log information. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - printSync(msg: string): void; - - /** - * Execute the given command in the aa tools side. - * @param { string } cmd - The shell command. - * @param { AsyncCallback } callback - The callback is used to return the ShellCmdResult object. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - executeShellCommand(cmd: string, callback: AsyncCallback): void; - - /** - * Execute the given command in the aa tools side. - * @param { string } cmd - Shell command. - * @param { number } timeoutSecs - Timeout, in seconds. - * @param { AsyncCallback } callback - The callback is used to return the ShellCmdResult object. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - executeShellCommand(cmd: string, timeoutSecs: number, callback: AsyncCallback): void; - - /** - * Execute the given command in the aa tools side. - * @param { string } cmd - Shell command. - * @param { number } timeoutSecs - Timeout, in seconds. - * @returns { Promise } Returns the ShellCmdResult object. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - executeShellCommand(cmd: string, timeoutSecs?: number): Promise; - - /** - * Finish the test and print log information to the unit testing console. - * The total length of the log information to be printed cannot exceed 1000 characters. - * @param { string } msg - Log information. - * @param { number } code - Result code. - * @param { AsyncCallback } callback - The callback of finishTest. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - finishTest(msg: string, code: number, callback: AsyncCallback): void; - - /** - * Finish the test and print log information to the unit testing console. - * The total length of the log information to be printed cannot exceed 1000 characters. - * @param { string } msg - Log information. - * @param { number } code - Result code. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - finishTest(msg: string, code: number): Promise; -} - -export default AbilityDelegator; diff --git a/api/@ohos.app.featureAbility.d.ts b/api/@ohos.app.featureAbility.d.ts index 4662f9b078..839d320813 100644 --- a/api/@ohos.app.featureAbility.d.ts +++ b/api/@ohos.app.featureAbility.d.ts @@ -19,8 +19,8 @@ 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 } from './@ohos.app.featureAbility.context'; -import { DataAbilityHelper } from './@ohos.app.ability.dataAbilityHelper'; +import { Context } from './app/featureAbilityContext'; +import { DataAbilityHelper } from './ability/dataAbilityUtils'; import { ConnectOptions } from './ability/connectOptions'; import { ProcessInfo as _ProcessInfo } from './app/processInfo'; import window from './@ohos.window'; diff --git a/api/@ohos.app.form.FormExtensionContext.d.ts b/api/@ohos.app.form.FormExtensionContext.d.ts deleted file mode 100644 index 36d2b54ebb..0000000000 --- a/api/@ohos.app.form.FormExtensionContext.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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 { AsyncCallback } from "./basic"; -import ExtensionContext from "./application/ExtensionContext"; -import formBindingData from './@ohos.app.form.formBindingData'; -import Want from './@ohos.application.Want'; - -/** - * The context of form extension. It allows access to - * formExtension-specific resources. - * @syscap SystemCapability.Ability.Form - * @stagemodelonly - * @since 9 - */ -export default class FormExtensionContext extends ExtensionContext { - /** - * start an ability within the same bundle. - * @param { Want } want - includes ability name, parameters and relative info sending to an ability. - * @param { AsyncCallback } callback - The callback of startAbility. - * @returns { Promise } The promise returned by the function. - * @syscap SystemCapability.Ability.Form - * @systemapi - * @stagemodelonly - * @since 9 - */ - startAbility(want: Want, callback: AsyncCallback): void; - startAbility(want: Want): Promise; -} diff --git a/api/@ohos.app.particleAbility.d.ts b/api/@ohos.app.particleAbility.d.ts index 720bd45ed8..1e31a0c94d 100644 --- a/api/@ohos.app.particleAbility.d.ts +++ b/api/@ohos.app.particleAbility.d.ts @@ -15,7 +15,7 @@ import { AsyncCallback } from './basic'; import { StartAbilityParameter } from './ability/startAbilityParameter'; -import { DataAbilityHelper } from './@ohos.app.ability.dataAbilityHelper'; +import { DataAbilityHelper } from './ability/dataAbilityUtils'; import { NotificationRequest } from './notification/notificationRequest'; import { ConnectOptions } from './ability/connectOptions'; import Want from './@ohos.application.Want'; diff --git a/api/@ohos.app.ability.dataAbilityHelper.d.ts b/api/ability/dataAbilityUtils.d.ts similarity index 98% rename from api/@ohos.app.ability.dataAbilityHelper.d.ts rename to api/ability/dataAbilityUtils.d.ts index d1defbdf63..79ad8e7d7d 100644 --- a/api/@ohos.app.ability.dataAbilityHelper.d.ts +++ b/api/ability/dataAbilityUtils.d.ts @@ -13,12 +13,12 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; -import { ResultSet } from './data/rdb/resultSet'; -import { DataAbilityOperation } from './ability/dataAbilityOperation'; -import { DataAbilityResult } from './ability/dataAbilityResult'; -import dataAbility from './@ohos.data.dataAbility'; -import rdb from './@ohos.data.rdb'; +import { AsyncCallback } from '../basic'; +import { ResultSet } from '../data/rdb/resultSet'; +import { DataAbilityOperation } from './dataAbilityOperation'; +import { DataAbilityResult } from './dataAbilityResult'; +import dataAbility from '../@ohos.data.dataAbility'; +import rdb from '../@ohos.data.rdb'; /** * DataAbilityHelper diff --git a/api/@ohos.app.featureAbility.context.d.ts b/api/app/featureAbilityContext.d.ts similarity index 98% rename from api/@ohos.app.featureAbility.context.d.ts rename to api/app/featureAbilityContext.d.ts index 4bfd481abd..8d0dca6422 100644 --- a/api/@ohos.app.featureAbility.context.d.ts +++ b/api/app/featureAbilityContext.d.ts @@ -13,15 +13,15 @@ * limitations under the License. */ -import { AsyncCallback } from './basic'; -import { ApplicationInfo } from './bundle/applicationInfo'; -import { ProcessInfo } from './app/processInfo'; -import { ElementName } from './bundle/elementName'; -import BaseContext from './application/BaseContext'; -import { HapModuleInfo } from './bundle/hapModuleInfo'; -import { AppVersionInfo } from './app/appVersionInfo'; -import { AbilityInfo } from './bundle/abilityInfo'; -import bundle from './@ohos.bundle'; +import { AsyncCallback } from '../basic'; +import { ApplicationInfo } from '../bundle/applicationInfo'; +import { ProcessInfo } from './processInfo'; +import { ElementName } from '../bundle/elementName'; +import BaseContext from '../application/BaseContext'; +import { HapModuleInfo } from '../bundle/hapModuleInfo'; +import { AppVersionInfo } from './appVersionInfo'; +import { AbilityInfo } from '../bundle/abilityInfo'; +import bundle from '../@ohos.bundle'; /** * The context of an ability or an application. It allows access to diff --git a/api/application/AbilityContext.d.ts b/api/application/AbilityContext.d.ts index 7c774d9812..8b6a4c32f1 100755 --- a/api/application/AbilityContext.d.ts +++ b/api/application/AbilityContext.d.ts @@ -25,294 +25,504 @@ import Want from "../@ohos.application.Want"; import StartOptions from "../@ohos.application.StartOptions"; import PermissionRequestResult from "./PermissionRequestResult"; import { Configuration } from '../@ohos.application.Configuration'; -import Caller from '../@ohos.application.Ability'; +import { Caller } from '../@ohos.app.ability.Ability'; import { LocalStorage } from 'StateManagement'; import image from '../@ohos.multimedia.image'; /** * The context of an ability. It allows access to ability-specific resources. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A - * @StageModelOnly - * @deprecated since 9 - * @useinstead @ohos.app.ability.AbilityContext + * @stagemodelonly + * @since 9 */ export default class AbilityContext extends Context { /** * Indicates configuration information about an ability. - * - * @since 9 + * @type { AbilityInfo } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ abilityInfo: AbilityInfo; /** - * Indicates configuration information about an module. - * - * @since 9 + * Indicates configuration information about the module. + * @type { HapModuleInfo } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ currentHapModuleInfo: HapModuleInfo; /** * Indicates configuration information. - * - * @since 9 + * @type { Configuration } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ config: Configuration; /** * Starts a new ability. - * - * @since 9 + * @param want { Want } - Indicates the ability to start. + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the ability to start. - * @param options Indicates the start options. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ startAbility(want: Want, callback: AsyncCallback): void; + + /** + * Starts a new ability. + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; + + /** + * Starts a new ability. + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } options - Indicates the start options. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ startAbility(want: Want, options?: StartOptions): Promise; /** * Get the caller object of the startup capability - * - * @since 9 + * @param { Want } want - Indicates the ability to start. + * @returns { Promise } Returns the Caller interface. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the ability to start. - * @return Returns to the Caller interface on success Returns empty or undefined on failure - * @StageModelOnly + * @stagemodelonly + * @since 9 */ startAbilityByCall(want: Want): Promise; /** * Starts a new ability with account. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want info to start. - * @param accountId Indicates the account to start. - * @param options Indicates the start options. - * @systemapi hide for inner use. - * @return - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS - * @StageModelOnly + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { AsyncCallback } callback - The callback of startAbilityWithAccount. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 */ startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + + /** + * Starts a new ability with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback of startAbilityWithAccount. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; + + /** + * Starts a new ability with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { StartOptions } options - Indicates the start options. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; /** * Starts an ability and returns the execution result when the ability is destroyed. - * - * @since 9 + * @param { Want } want - Indicates the ability to start. + * @param { AsyncCallback } callback - The callback is used to return the result of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the ability to start. - * @param options Indicates the start options. - * @return Returns the {@link AbilityResult}. - * @StageModelOnly + * @stagemodelonly + * @since 9 */ startAbilityForResult(want: Want, callback: AsyncCallback): void; + + /** + * Starts an ability and returns the execution result when the ability is destroyed. + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback is used to return the result of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback): void; + + /** + * Starts an ability and returns the execution result when the ability is destroyed. + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } options - Indicates the start options. + * @returns { Promise } Returns the result of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ startAbilityForResult(want: Want, options?: StartOptions): Promise; /** * Starts an ability and returns the execution result when the ability is destroyed with account. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want info to start. - * @param accountId Indicates the account to start. - * @param options Indicates the start options. - * @systemapi hide for inner use. - * @return Returns the {@link AbilityResult}. * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS - * @StageModelOnly + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { AsyncCallback } callback - The callback is used to return the result of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 */ startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + + /** + * Starts an ability and returns the execution result when the ability is destroyed with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback is used to return the result of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; + + /** + * Starts an ability and returns the execution result when the ability is destroyed with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { StartOptions } options - Indicates the start options. + * @returns { Promise } Returns the result of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; /** * Starts a new service extension ability. - * - * @since 9 + * @param { Want } want - Indicates the want info to start. + * @param { AsyncCallback } callback - The callback of startServiceExtensionAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want info to start. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ startServiceExtensionAbility(want: Want, callback: AsyncCallback): void; + + /** + * Starts a new service extension ability. + * @param { Want } want - Indicates the want info to start. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ startServiceExtensionAbility(want: Want): Promise; /** * Starts a new service extension ability with account. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want info to start. - * @param accountId Indicates the account to start. - * @systemapi hide for inner use. - * @return - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. - * @StageModelOnly + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { AsyncCallback } callback - The callback of startServiceExtensionAbilityWithAccount. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 */ startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + + /** + * Starts a new service extension ability with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; /** * Stops a service within the same application. - * - * @since 9 + * @param { Want } want - Indicates the want info to start. + * @param { AsyncCallback } callback - The callback of stopServiceExtensionAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want info to start. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ stopServiceExtensionAbility(want: Want, callback: AsyncCallback): void; + + /** + * Stops a service within the same application. + * @param { Want } want - Indicates the want info to start. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ stopServiceExtensionAbility(want: Want): Promise; /** * Stops a service within the same application with account. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want info to start. - * @param accountId Indicates the accountId to start. - * @systemapi hide for inner use. - * @return - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. - * @StageModelOnly + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the accountId to start. + * @param { AsyncCallback } callback - The callback of stopServiceExtensionAbilityWithAccount. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 */ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + + /** + * Stops a service within the same application with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the accountId to start. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; /** * Destroys this Page ability. - * - * @since 9 + * @param { AsyncCallback } callback - The callback of terminateSelf. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ terminateSelf(callback: AsyncCallback): void; + + /** + * Destroys this Page ability. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ terminateSelf(): Promise; /** * Sets the result code and data to be returned by this Page ability to the caller * and destroys this Page ability. - * - * @since 9 + * @param { AbilityResult } parameter - Indicates the result to return. + * @param { AsyncCallback } callback - The callback of terminateSelfWithResult. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param parameter Indicates the result to return. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback): void; + + /** + * Sets the result code and data to be returned by this Page ability to the caller + * and destroys this Page ability. + * @param { AbilityResult } parameter - Indicates the result to return. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ terminateSelfWithResult(parameter: AbilityResult): Promise; /** * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template. - * - * @since 9 + * @param { Want } want - The element name of the service ability + * @param { ConnectOptions } options - The remote object instance + * @returns { number } Returns the number code of the ability connected + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want The element name of the service ability - * @param options The remote object instance - * @systemapi Hide this for inner system use. - * @return Returns the number code of the ability connected - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ connectAbility(want: Want, options: ConnectOptions): number; /** * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template with account. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want The element name of the service ability - * @param accountId The account to connect - * @param options The remote object instance - * @systemapi hide for inner use. - * @return Returns the number code of the ability connected * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS - * @StageModelOnly + * @param { Want } want - The element name of the service ability + * @param { number } accountId - The account to connect + * @param { ConnectOptions } options - The remote object instance + * @returns { number } Returns the number code of the ability connected + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 */ connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; /** * The callback interface was connect successfully. - * + * @param { number } connection - The number code of the ability connected + * @param { AsyncCallback } callback - The callback of disconnectAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly * @since 9 + */ + disconnectAbility(connection: number, callback: AsyncCallback): void; + + /** + * The callback interface was connect successfully. + * @param { number } connection - The number code of the ability connected + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param connection The number code of the ability connected - * @systemapi Hide this for inner system use. - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ - disconnectAbility(connection: number, callback:AsyncCallback): void; disconnectAbility(connection: number): Promise; /** * Set mission label of current ability. - * + * @param { string } label - The label of ability that showed in recent missions. + * @param { AsyncCallback } callback - The callback of setMissionLabel. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly * @since 9 + */ + setMissionLabel(label: string, callback: AsyncCallback): void; + + /** + * Set mission label of current ability. + * @param { string } label - The label of ability that showed in recent missions. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param label The label of ability that showed in recent missions. - * @StageModelOnly + * @stagemodelonly + * @since 9 */ - setMissionLabel(label: string, callback:AsyncCallback): void; - setMissionLabel(label: string): Promise; + setMissionLabel(label: string): Promise; /** * Set mission icon of current ability. - * + * @param { image.PixelMap } icon - The icon of ability that showed in recent missions. + * @param { AsyncCallback } callback - The callback of setMissionIcon. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly * @since 9 + */ + setMissionIcon(icon: image.PixelMap, callback: AsyncCallback): void; + + /** + * Set mission icon of current ability. + * @param { image.PixelMap } icon - The icon of ability that showed in recent missions. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param icon The icon of ability that showed in recent missions. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ - setMissionIcon(icon: image.PixelMap, callback:AsyncCallback): void; - setMissionIcon(icon: image.PixelMap): Promise; + setMissionIcon(icon: image.PixelMap): Promise; - /** + /** * Requests certain permissions from the system. - * + * @param { Array } permissions - Indicates the list of permissions to be requested. This parameter + * cannot be null or empty. + * @param { AsyncCallback } requestCallback - The callback is used to return the permission + * request result. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly * @since 9 + */ + requestPermissionsFromUser(permissions: Array, requestCallback: AsyncCallback): void; + + /** + * Requests certain permissions from the system. + * @param { Array } permissions - Indicates the list of permissions to be requested. This parameter + * cannot be null or empty. + * @returns { Promise } Returns the permission request result. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param permissions Indicates the list of permissions to be requested. This parameter cannot be null or empty. - * @return Returns the {@link PermissionRequestResult}. - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ - requestPermissionsFromUser(permissions: Array, requestCallback: AsyncCallback) : void; - requestPermissionsFromUser(permissions: Array) : Promise; + requestPermissionsFromUser(permissions: Array): Promise; /** * Restore window stage data in ability continuation - * - * @since 9 + * @param { LocalStorage } localStorage - the storage data used to restore window stage + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param LocalStorage the storage data used to restore window stage - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ - restoreWindowStage(localStorage: LocalStorage) : void; + restoreWindowStage(localStorage: LocalStorage): void; /** * check to see ability is in terminating state. - * - * @since 9 + * @returns { boolean } Returns true when ability is in terminating state, else returns false. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return Returns true when ability is in terminating state, else returns false. - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ isTerminating(): boolean; } diff --git a/api/application/ApplicationContext.d.ts b/api/application/ApplicationContext.d.ts index 6191bcdd48..516973add4 100755 --- a/api/application/ApplicationContext.d.ts +++ b/api/application/ApplicationContext.d.ts @@ -20,58 +20,74 @@ import EnvironmentCallback from "../@ohos.application.EnvironmentCallback"; /** * The context of an application. It allows access to application-specific resources. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A - * @StageModelOnly - * @deprecated since 9 - * @useinstead @ohos.app.ability.ApplicationContext + * @stagemodelonly + * @since 9 */ export default class ApplicationContext extends Context { /** * Register ability lifecycle callback. - * - * @since 9 + * @param { AbilityLifecycleCallback } callback - The ability lifecycle callback. + * @returns { number } Returns the number code of the callback. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param callback The ability lifecycle callback. - * @return Returns the number code of the callback. - * @StageModelOnly + * @stagemodelonly + * @since 9 */ registerAbilityLifecycleCallback(callback: AbilityLifecycleCallback): number; /** * Unregister ability lifecycle callback. - * + * @param { number } callbackId - Indicates the number code of the callback. + * @param { AsyncCallback } callback - The callback of unregisterAbilityLifecycleCallback. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly * @since 9 + */ + unregisterAbilityLifecycleCallback(callbackId: number, callback: AsyncCallback): void; + + /** + * Unregister ability lifecycle callback. + * @param { number } callbackId - Indicates the number code of the callback. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param callbackId Indicates the number code of the callback. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ - unregisterAbilityLifecycleCallback(callbackId: number, callback: AsyncCallback): void; unregisterAbilityLifecycleCallback(callbackId: number): Promise; /** * Register environment callback. - * - * @since 9 + * @param { EnvironmentCallback } callback - The environment callback. + * @returns { number } Returns the number code of the callback. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param callback The environment callback. - * @return Returns the number code of the callback. - * @StageModelOnly + * @stagemodelonly + * @since 9 */ registerEnvironmentCallback(callback: EnvironmentCallback): number; /** * Unregister environment callback. - * + * @param { number } callbackId - Indicates the number code of the callback. + * @param { AsyncCallback } callback - The callback of unregisterEnvironmentCallback. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly * @since 9 + */ + unregisterEnvironmentCallback(callbackId: number, callback: AsyncCallback): void; + + /** + * Unregister environment callback. + * @param { number } callbackId - Indicates the number code of the callback. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param callbackId Indicates the number code of the callback. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ - unregisterEnvironmentCallback(callbackId: number, callback: AsyncCallback): void; unregisterEnvironmentCallback(callbackId: number): Promise; } diff --git a/api/application/Context.d.ts b/api/application/Context.d.ts index 8563121f3a..32aeb23e08 100755 --- a/api/application/Context.d.ts +++ b/api/application/Context.d.ts @@ -22,168 +22,163 @@ import ApplicationContext from "./ApplicationContext"; /** * The base context of an ability or an application. It allows access to * application-specific resources. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A - * @StageModelOnly - * @deprecated since 9 - * @useinstead @ohos.app.ability.Context + * @stagemodelonly + * @since 9 */ export default class Context extends BaseContext { /** * Indicates the capability of accessing application resources. - * - * @since 9 + * @type { resmgr.ResourceManager } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ resourceManager: resmgr.ResourceManager; /** * Indicates configuration information about an application. - * - * @since 9 + * @type { ApplicationInfo } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ applicationInfo: ApplicationInfo; /** * Indicates app cache dir. - * - * @since 9 + * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ cacheDir: string; /** * Indicates app temp dir. - * - * @since 9 + * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ tempDir: string; /** * Indicates app files dir. - * - * @since 9 + * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ - filesDir : string; + filesDir: string; /** * Indicates app database dir. - * - * @since 9 + * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ - databaseDir : string; + databaseDir: string; /** * Indicates app preferences dir. - * - * @since 9 + * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ - preferencesDir : string; + preferencesDir: string; /** * Indicates app bundle code dir. - * - * @since 9 + * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ - bundleCodeDir : string; + bundleCodeDir: string; /** * Indicates app distributed files dir. - * - * @since 9 + * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ distributedFilesDir: string; /** * Indicates event hub. - * - * @since 9 + * @type { EventHub } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ eventHub: EventHub; /** * Indicates file area. - * - * @since 9 + * @type { AreaMode } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ area: AreaMode; /** * Create a bundle context - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide for inner use. - * @param bundleName Indicates the bundle name. - * @return application context * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED - * @StageModelOnly + * @param { string } bundleName - Indicates the bundle name. + * @returns { Context } Returns the application context. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 */ createBundleContext(bundleName: string): Context; /** * Create a module context - * - * @since 9 + * @param { string } moduleName - Indicates the module name. + * @returns { Context } Returns the application context. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param moduleName Indicates the module name. - * @return application context - * @StageModelOnly + * @stagemodelonly + * @since 9 */ createModuleContext(moduleName: string): Context; /** * Create a module context - * - * @since 9 + * @param { string } bundleName - Indicates the bundle name. + * @param { string } moduleName - Indicates the module name. + * @returns { Context } Returns the application context. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide for inner use. - * @param bundleName Indicates the bundle name. - * @param moduleName Indicates the module name. - * @return application context - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ createModuleContext(bundleName: string, moduleName: string): Context; /** * Get application context - * - * @since 9 + * @returns { ApplicationContext } Returns the application context. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return application context - * @StageModelOnly + * @stagemodelonly + * @since 9 */ getApplicationContext(): ApplicationContext; } /** - * File area mode - * - * @since 9 + * Enum for the file area mode + * @enum { number } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ export enum AreaMode { /** diff --git a/api/application/EventHub.d.ts b/api/application/EventHub.d.ts index ed61b12efc..6947fca11f 100644 --- a/api/application/EventHub.d.ts +++ b/api/application/EventHub.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"), * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -13,50 +13,45 @@ * limitations under the License. */ +import { BusinessError } from '../basic'; + /** * The event center of a context, support the subscription and publication of events. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A - * @StageModelOnly - * @deprecated since 9 - * @useinstead @ohos.app.ability.EventHub + * @stagemodelonly + * @since 9 */ export default class EventHub { /** * Subscribe to an event. - * - * @since 9 + * @param { string } event - Indicates the event. + * @param { Function } callback - Indicates the callback. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param event Indicates the event. - * @param callback Indicates the callback. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ on(event: string, callback: Function): void /** * Unsubscribe from an event. - * - * @since 9 + * @param { string } event - Indicates the event. + * @param { Function } callback - Indicates the callback. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param event Indicates the event. - * @param callback Indicates the callback. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ off(event: string, callback?: Function): void /** * Trigger the event callbacks. - * - * @since 9 + * @param { string } event - Indicates the event. + * @param { Object[] } args - Indicates the callback arguments. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param event Indicates the event. - * @param args Indicates the callback arguments. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ emit(event: string, ...args: Object[]): void } \ No newline at end of file diff --git a/api/application/ServiceExtensionContext.d.ts b/api/application/ServiceExtensionContext.d.ts index 757cea7ffc..552e964ccf 100644 --- a/api/application/ServiceExtensionContext.d.ts +++ b/api/application/ServiceExtensionContext.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -15,7 +15,7 @@ import { AsyncCallback } from "../basic"; import { ConnectOptions } from "../ability/connectOptions"; -import Caller from '../@ohos.application.Ability'; +import { Caller } from '../@ohos.app.ability.Ability'; import ExtensionContext from "./ExtensionContext"; import Want from "../@ohos.application.Want"; import StartOptions from "../@ohos.application.StartOptions"; @@ -23,172 +23,283 @@ import StartOptions from "../@ohos.application.StartOptions"; /** * The context of service extension. It allows access to * serviceExtension-specific resources. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide for inner use. - * @permission N/A - * @StageModelOnly - * @deprecated since 9 - * @useinstead @ohos.app.ability.ServiceExtensionContext + * @systemapi + * @stagemodelonly + * @since 9 */ export default class ServiceExtensionContext extends ExtensionContext { /** * Service extension uses this method to start a specific ability. - * - * @since 9 + * @param { Want } want - Indicates the ability to start. + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the ability to start. - * @param options Indicates the start options. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ startAbility(want: Want, callback: AsyncCallback): void; + + /** + * Service extension uses this method to start a specific ability. + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; + + /** + * Service extension uses this method to start a specific ability. + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } options - Indicates the start options. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ startAbility(want: Want, options?: StartOptions): Promise; /** * Service extension uses this method to start a specific ability with account. - * - * @since 9 + * @param { Want } want - Indicates the ability to start. + * @param { number } accountId - Indicates the accountId to start. + * @param { AsyncCallback } callback - The callback of startAbilityWithAccount. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the ability to start. - * @param accountId Indicates the accountId to start. - * @param options Indicates the start options. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + + /** + * Service extension uses this method to start a specific ability with account. + * @param { Want } want - Indicates the ability to start. + * @param { number } accountId - Indicates the accountId to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback of startAbilityWithAccount. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; + + /** + * Service extension uses this method to start a specific ability with account. + * @param { Want } want - Indicates the ability to start. + * @param { number } accountId - Indicates the accountId to start. + * @param { StartOptions } options - Indicates the start options. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; /** * Starts a new service extension ability. - * - * @since 9 + * @param { Want } want - Indicates the want info to start. + * @param { AsyncCallback } callback - The callback of startServiceExtensionAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want info to start. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ startServiceExtensionAbility(want: Want, callback: AsyncCallback): void; + + /** + * Starts a new service extension ability. + * @param { Want } want - Indicates the want info to start. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ startServiceExtensionAbility(want: Want): Promise; /** * Starts a new service extension ability with account. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want info to start. - * @param accountId Indicates the account to start. - * @systemapi hide for inner use. - * @return - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. - * @StageModelOnly + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { AsyncCallback } callback - The callback of startServiceExtensionAbilityWithAccount. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 */ startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + + /** + * Starts a new service extension ability with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; /** * Stops a service within the same application. - * - * @since 9 + * @param { Want } want - Indicates the want info to start. + * @param { AsyncCallback } callback - The callback of stopServiceExtensionAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want info to start. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ stopServiceExtensionAbility(want: Want, callback: AsyncCallback): void; + + /** + * Stops a service within the same application. + * @param { Want } want - Indicates the want info to start. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ stopServiceExtensionAbility(want: Want): Promise; /** * Stops a service within the same application with account. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want info to start. - * @param accountId Indicates the accountId to start. - * @systemapi hide for inner use. - * @return - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. - * @StageModelOnly + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the accountId to start. + * @param { AsyncCallback } callback - The callback of stopServiceExtensionAbilityWithAccount. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 */ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + + /** + * Stops a service within the same application with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the accountId to start. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; /** * Destroys this service extension. - * - * @since 9 + * @param { AsyncCallback } callback - The callback of terminateSelf. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide for inner use. - * @return - - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ terminateSelf(callback: AsyncCallback): void; + + /** + * Destroys this service extension. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ terminateSelf(): Promise; /** * Connects an ability to a Service extension. - * *

This method can be called by an ability or service extension, but the destination of the connection must be a * service extension. You must implement the {@link ConnectOptions} interface to obtain the proxy of the target * service extension when the Service extension is connected.

- * - * @since 9 + * @param { Want } want - Indicates the service extension to connect. + * @param { ConnectOptions } options - Indicates the callback of connection. + * @returns { number } Returns the connection id. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the service extension to connect. - * @param options Indicates the callback of connection. - * @systemapi hide for inner use. - * @return connection id, int value. - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ connectAbility(want: Want, options: ConnectOptions): number; /** * Connects an ability to a Service extension with account. - * *

This method can be called by an ability or service extension, but the destination of the connection must be a * service extension. You must implement the {@link ConnectOptions} interface to obtain the proxy of the target * service extension when the Service extension is connected.

- * - * @since 9 + * @param { Want } want - Indicates the service extension to connect. + * @param { number } accountId - Indicates the account to connect. + * @param { ConnectOptions } options - Indicates the callback of connection. + * @returns { number } Returns the connection id. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the service extension to connect. - * @param accountId Indicates the account to connect. - * @param options Indicates the callback of connection. - * @systemapi hide for inner use. - * @return connection id, int value. - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; /** - * Disconnects an ability to a service extension, in contrast to - * {@link connectAbility}. - * + * Disconnects an ability to a service extension, in contrast to {@link connectAbility}. + * @param { number } connection - the connection id returned from connectAbility api. + * @param { AsyncCallback } callback - The callback of disconnectAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly * @since 9 + */ + disconnectAbility(connection: number, callback: AsyncCallback): void; + + /** + * Disconnects an ability to a service extension, in contrast to {@link connectAbility}. + * @param { number } connection - the connection id returned from connectAbility api. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param connection the connection id returned from connectAbility api. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ - disconnectAbility(connection: number, callback:AsyncCallback): void; disconnectAbility(connection: number): Promise; /** * Get the caller object of the startup capability - * - * @since 9 + * @param { Want } want - Indicates the ability to start. + * @returns { Promise } Returns the Caller interface. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the ability to start. - * @return Returns to the Caller interface on success Returns empty or undefined on failure - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ - startAbilityByCall(want: Want): Promise; + startAbilityByCall(want: Want): Promise; } \ No newline at end of file diff --git a/api/application/abilityDelegator.d.ts b/api/application/abilityDelegator.d.ts index 46cb8dcfb4..520bd8ce43 100644 --- a/api/application/abilityDelegator.d.ts +++ b/api/application/abilityDelegator.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -14,7 +14,7 @@ */ import { AsyncCallback } from '../basic'; -import Ability from '../@ohos.application.Ability'; +import Ability from '../@ohos.app.ability.Ability'; import AbilityStage from '../@ohos.application.AbilityStage'; import { AbilityMonitor } from './abilityMonitor'; import { AbilityStageMonitor } from './abilityStageMonitor'; @@ -24,142 +24,249 @@ import { ShellCmdResult } from './shellCmdResult'; /** * A global test utility interface used for adding AbilityMonitor objects and control lifecycle states of abilities. - * - * @since 8 + * @interface * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @import import AbilityDelegator from 'application/abilityDelegator.d' - * @permission N/A - * @deprecated since 9 - * @useinstead @ohos.app.ability.abilityDelegator + * @since 9 */ export interface AbilityDelegator { /** * Add an AbilityMonitor object for monitoring the lifecycle state changes of the specified ability. - * - * @since 9 + * @param { AbilityMonitor } monitor - AbilityMonitor object + * @param { AsyncCallback } callback - The callback of addAbilityMonitor. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param monitor AbilityMonitor object + * @since 9 */ addAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback): void; + + /** + * Add an AbilityMonitor object for monitoring the lifecycle state changes of the specified ability. + * @param { AbilityMonitor } monitor - AbilityMonitor object + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ addAbilityMonitor(monitor: AbilityMonitor): Promise; /** * Add an AbilityStageMonitor object for monitoring the lifecycle state changes of the specified abilityStage. - * + * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. + * @param { AsyncCallback } callback - The callback of addAbilityStageMonitor. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 + */ + addAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback): void; + + /** + * Add an AbilityStageMonitor object for monitoring the lifecycle state changes of the specified abilityStage. + * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param monitor AbilityStageMonitor object + * @since 9 */ - addAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback): void; - addAbilityStageMonitor(monitor: AbilityStageMonitor): Promise; + addAbilityStageMonitor(monitor: AbilityStageMonitor): Promise; /** * Remove a specified AbilityMonitor object from the application memory. - * - * @since 9 + * @param { AbilityMonitor } monitor - AbilityMonitor object. + * @param { AsyncCallback } callback - The callback of removeAbilityMonitor. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param monitor AbilityMonitor object + * @since 9 */ removeAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback): void; + + /** + * Remove a specified AbilityMonitor object from the application memory. + * @param { AbilityMonitor } monitor - AbilityMonitor object. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ removeAbilityMonitor(monitor: AbilityMonitor): Promise; /** * Remove a specified AbilityStageMonitor object from the application memory. - * + * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. + * @param { AsyncCallback } callback - The callback of removeAbilityStageMonitor. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 + */ + removeAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback): void; + + /** + * Remove a specified AbilityStageMonitor object from the application memory. + * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param monitor AbilityStageMonitor object + * @since 9 */ - removeAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback): void; - removeAbilityStageMonitor(monitor: AbilityStageMonitor): Promise; + removeAbilityStageMonitor(monitor: AbilityStageMonitor): Promise; /** * Wait for and returns the Ability object that matches the conditions set in the given AbilityMonitor. - * - * @since 9 + * @param { AbilityMonitor } monitor - AbilityMonitor object. + * @param { AsyncCallback } callback - The callback is used to return the Ability object. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param monitor AbilityMonitor object - * @param timeout Maximum wait time, in milliseconds - * @return success: return the Ability object, failure: return null + * @since 9 */ waitAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback): void; + + /** + * Wait for and returns the Ability object that matches the conditions set in the given AbilityMonitor. + * @param { AbilityMonitor } monitor - AbilityMonitor object. + * @param { number } timeout - Maximum wait time, in milliseconds. + * @param { AsyncCallback } callback - The callback is used to return the Ability object. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ waitAbilityMonitor(monitor: AbilityMonitor, timeout: number, callback: AsyncCallback): void; + + /** + * Wait for and returns the Ability object that matches the conditions set in the given AbilityMonitor. + * @param { AbilityMonitor } monitor - AbilityMonitor object. + * @param { number } timeout - Maximum wait time, in milliseconds. + * @returns { Promise } Returns the Ability object. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ waitAbilityMonitor(monitor: AbilityMonitor, timeout?: number): Promise; /** * Wait for and returns the AbilityStage object that matches the conditions set in the given AbilityStageMonitor. - * + * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. + * @param { AsyncCallback } callback - The callback is used to return the AbilityStage object. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ + waitAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback): void; + + /** + * Wait for and returns the AbilityStage object that matches the conditions set in the given AbilityStageMonitor. + * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. + * @param { number } timeout - Maximum wait time, in milliseconds. + * @param { AsyncCallback } callback - The callback is used to return the AbilityStage object. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 + */ + waitAbilityStageMonitor(monitor: AbilityStageMonitor, timeout: number, callback: AsyncCallback): void; + + /** + * Wait for and returns the AbilityStage object that matches the conditions set in the given AbilityStageMonitor. + * @param { AbilityStageMonitor } monitor - AbilityStageMonitor object. + * @param { number } timeout - Maximum wait time, in milliseconds. + * @returns { Promise } Returns the AbilityStage object. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param monitor AbilityStageMonitor object - * @param timeout Maximum wait time, in milliseconds - * @return success: return the AbilityStage object, failure: return null + * @since 9 */ - waitAbilityStageMonitor(monitor: AbilityStageMonitor, callback: AsyncCallback): void; - waitAbilityStageMonitor(monitor: AbilityStageMonitor, timeout: number, callback: AsyncCallback): void; - waitAbilityStageMonitor(monitor: AbilityStageMonitor, timeout?: number): Promise; + waitAbilityStageMonitor(monitor: AbilityStageMonitor, timeout?: number): Promise; /** * Obtain the application context. - * - * @since 9 + * @returns { Context } Returns the app Context. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return App Context + * @since 9 */ getAppContext(): Context; /** * Obtain the lifecycle state of a specified ability. - * - * @since 9 + * @param { Ability } ability - The Ability object. + * @returns { number } Returns the state of the Ability object. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param ability The Ability object - * @return The state of the Ability object. enum AbilityLifecycleState + * @since 9 */ getAbilityState(ability: Ability): number; /** * Obtain the ability that is currently being displayed. - * - * @since 9 + * @param { AsyncCallback } callback - The callback is used to return the Ability object. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return The top ability of the current application + * @since 9 */ getCurrentTopAbility(callback: AsyncCallback): void; + + /** + * Obtain the ability that is currently being displayed. + * @returns { Promise } Returns the Ability object. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ getCurrentTopAbility(): Promise /** * Start a new ability. - * - * @since 9 + * @param { Want } want - Indicates the ability to start + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the ability to start - * @return - + * @since 9 */ startAbility(want: Want, callback: AsyncCallback): void; + + /** + * Start a new ability. + * @param { Want } want - Indicates the ability to start + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ startAbility(want: Want): Promise; /** * Invoke the Ability.onForeground() callback of a specified ability without changing its lifecycle state. - * + * @param { Ability } ability - The ability object. + * @param { AsyncCallback } callback - The callback of doAbilityForeground. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 + */ + doAbilityForeground(ability: Ability, callback: AsyncCallback): void; + + /** + * Invoke the Ability.onForeground() callback of a specified ability without changing its lifecycle state. + * @param { Ability } ability - The ability object. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param ability The ability object - * @return true: success false: failure + * @since 9 */ - doAbilityForeground(ability: Ability, callback: AsyncCallback): void; - doAbilityForeground(ability: Ability): Promise; + doAbilityForeground(ability: Ability): Promise; /** * Invoke the Ability.onBackground() callback of a specified ability without changing its lifecycle state. - * + * @param { Ability } ability - The ability object. + * @param { AsyncCallback } callback - The callback of doAbilityBackground. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 + */ + doAbilityBackground(ability: Ability, callback: AsyncCallback): void; + + /** + * Invoke the Ability.onBackground() callback of a specified ability without changing its lifecycle state. + * @param { Ability } ability - The ability object. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param ability The ability object - * @return true: success false: failure + * @since 9 */ - doAbilityBackground(ability: Ability, callback: AsyncCallback): void; - doAbilityBackground(ability: Ability): Promise; + doAbilityBackground(ability: Ability): Promise; /** * Prints log information to the unit testing console. @@ -175,12 +282,34 @@ export interface AbilityDelegator { /** * Prints log information to the unit testing console. * The total length of the log information to be printed cannot exceed 1000 characters. - * + * @param { string } msg - Log information. + * @param { AsyncCallback } callback - The callback of printMsg. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 + */ + printMsg(msg: string, callback: AsyncCallback): void; + + /** + * Prints log information to the unit testing console. + * The total length of the log information to be printed cannot exceed 1000 characters. + * @param { string } msg - Log information. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param msg Log information + * @since 9 */ - printSync(msg: string): void; + printMsg(msg: string): Promise; + + /** + * Prints log information to the unit testing console. + * The total length of the log information to be printed cannot exceed 1000 characters. + * @param { string } msg - Log information. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ + printSync(msg: string): void; /** * Execute the given command in the aa tools side. @@ -195,16 +324,60 @@ export interface AbilityDelegator { executeShellCommand(cmd: string, timeoutSecs: number, callback: AsyncCallback): void; executeShellCommand(cmd: string, timeoutSecs?: number): Promise; + /** + * Execute the given command in the aa tools side. + * @param { string } cmd - The shell command. + * @param { AsyncCallback } callback - The callback is used to return the ShellCmdResult object. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ + executeShellCmd(cmd: string, callback: AsyncCallback): void; + + /** + * Execute the given command in the aa tools side. + * @param { string } cmd - Shell command. + * @param { number } timeoutSecs - Timeout, in seconds. + * @param { AsyncCallback } callback - The callback is used to return the ShellCmdResult object. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ + executeShellCmd(cmd: string, timeoutSecs: number, callback: AsyncCallback): void; + + /** + * Execute the given command in the aa tools side. + * @param { string } cmd - Shell command. + * @param { number } timeoutSecs - Timeout, in seconds. + * @returns { Promise } Returns the ShellCmdResult object. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ + executeShellCmd(cmd: string, timeoutSecs?: number): Promise; + /** * Finish the test and print log information to the unit testing console. * The total length of the log information to be printed cannot exceed 1000 characters. - * - * @since 9 + * @param { string } msg - Log information. + * @param { number } code - Result code. + * @param { AsyncCallback } callback - The callback of finishTest. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param msg Log information - * @param code Result code + * @since 9 */ finishTest(msg: string, code: number, callback: AsyncCallback): void; + + /** + * Finish the test and print log information to the unit testing console. + * The total length of the log information to be printed cannot exceed 1000 characters. + * @param { string } msg - Log information. + * @param { number } code - Result code. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ finishTest(msg: string, code: number): Promise; } -- Gitee From 80ac72f27085c0669b99331b37a5497166ee070e Mon Sep 17 00:00:00 2001 From: yangzk Date: Fri, 14 Oct 2022 20:53:39 +0800 Subject: [PATCH 139/438] IssueNo: #I5RT32 Description: add Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- api/@ohos.app.form.FormExtensionAbility.d.ts | 154 +++++++++++++++++++ api/@ohos.app.form.formHost.d.ts | 39 ++++- 2 files changed, 192 insertions(+), 1 deletion(-) create mode 100644 api/@ohos.app.form.FormExtensionAbility.d.ts diff --git a/api/@ohos.app.form.FormExtensionAbility.d.ts b/api/@ohos.app.form.FormExtensionAbility.d.ts new file mode 100644 index 0000000000..81c522c223 --- /dev/null +++ b/api/@ohos.app.form.FormExtensionAbility.d.ts @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import formBindingData from './@ohos.app.form.formBindingData'; +import formInfo from "./@ohos.application.formInfo"; +import FormExtensionContext from "./application/FormExtensionContext"; +import Want from './@ohos.application.Want'; +import { Configuration } from './@ohos.application.Configuration'; + +/** + * class of form extension. + * + * @since 9 + * @syscap SystemCapability.Ability.Form + * @StageModelOnly + */ +export default class FormExtension { + /** + * Indicates form extension context. + * + * @since 9 + * @syscap SystemCapability.Ability.Form + * @StageModelOnly + */ + context: FormExtensionContext; + + /** + * Called to return a {@link formBindingData#FormBindingData} object. + * + * @since 9 + * @syscap SystemCapability.Ability.Form + * @param want Indicates the detailed information for creating a {@link formBindingData#FormBindingData}. + * The {@code Want} object must include the form ID, form name, and grid style of the form. + * Such form information must be managed as persistent data for further form + * acquisition, update, and deletion. + * @return Returns the created {@link formBindingData#FormBindingData} object. + * @StageModelOnly + */ + onCreate(want: Want): formBindingData.FormBindingData; + + /** + * Called when the form provider is notified that a temporary form is successfully converted to a normal form. + * + * @since 9 + * @syscap SystemCapability.Ability.Form + * @param formId Indicates the ID of the form. + * @return - + * @StageModelOnly + */ + onCastToNormal(formId: string): void; + + /** + * Called to notify the form provider to update a specified form. + * + * @since 9 + * @syscap SystemCapability.Ability.Form + * @param formId Indicates the ID of the form to update. + * @return - + * @StageModelOnly + */ + onUpdate(formId: string): void; + + /** + * Called when the form provider receives form events from the system. + * + * @since 9 + * @syscap SystemCapability.Ability.Form + * @param newStatus Indicates the form events occurred. The key in the {@code Map} object indicates the form ID, + * and the value indicates the event type, which can be either {@link formInfo#VisibilityType#FORM_VISIBLE} + * or {@link formInfo#VisibilityType#FORM_INVISIBLE}. {@link formInfo#VisibilityType#FORM_VISIBLE} + * means that the form becomes visible, and {@link formInfo#VisibilityType#FORM_INVISIBLE} + * means that the form becomes invisible. + * @return - + * @StageModelOnly + */ + onVisibilityChange(newStatus: { [key: string]: number }): void; + + /** + * Called when a specified message event defined by the form provider is triggered. This method is valid only for + * JS forms. + * + * @since 9 + * @syscap SystemCapability.Ability.Form + * @param formId Indicates the ID of the form on which the message event is triggered, which is provided by + * the client to the form provider. + * @param message Indicates the value of the {@code params} field of the message event. This parameter is + * used to identify the specific component on which the event is triggered. + * @return - + * @StageModelOnly + */ + onEvent(formId: string, message: string): void; + + /** + * Called to notify the form provider that a specified form has been destroyed. Override this method if + * you want your application, as the form provider, to be notified of form deletion. + * + * @since 9 + * @syscap SystemCapability.Ability.Form + * @param formId Indicates the ID of the destroyed form. + * @return - + * @StageModelOnly + */ + onDestroy(formId: string): void; + + /** + * Called when the system configuration is updated. + * + * @since 9 + * @syscap SystemCapability.Ability.Form + * @param configuration Indicates the system configuration, such as language and color mode. + * @return - + * @StageModelOnly + */ + onConfigurationUpdated(config: Configuration): void; + + /** + * Called to return a {@link FormState} object. + * + *

You must override this callback if you want this ability to return the actual form state. Otherwise, + * this method returns {@link FormState#DEFAULT} by default.

+ * + * @since 9 + * @syscap SystemCapability.Ability.Form + * @param want Indicates the description of the form for which the {@link formInfo#FormState} is obtained. + * The description covers the bundle name, ability name, module name, form name, and form dimensions. + * @return Returns the {@link formInfo#FormState} object. + * @StageModelOnly + */ + onAcquireFormState?(want: Want): formInfo.FormState; + + /** + * Called when the system shares the form. + * + * @since 9 + * @syscap SystemCapability.Ability.Form + * @param formId Indicates the ID of the form. + * @systemapi hide for inner use. + * @return Returns the wantParams object. + * @StageModelOnly + */ + onShare?(formId: string): {[key: string]: any}; +} diff --git a/api/@ohos.app.form.formHost.d.ts b/api/@ohos.app.form.formHost.d.ts index 4e066920eb..e6d6bf84a9 100644 --- a/api/@ohos.app.form.formHost.d.ts +++ b/api/@ohos.app.form.formHost.d.ts @@ -490,13 +490,50 @@ declare namespace formHost { * @param { string } formId - Indicates the form ID. * @param { string } deviceId - Indicates the remote device ID. * @param { AsyncCallback } callback - The callback of shareForm. - * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.Form * @systemapi * @since 9 */ function shareForm(formId: string, deviceId: string, callback: AsyncCallback): void; + + /** + * Share form by formId and deviceId. + * @permission ohos.permission.REQUIRE_FORM and ohos.permission.DISTRIBUTED_DATASYNC + * @param { string } formId - Indicates the form ID. + * @param { string } deviceId - Indicates the remote device ID. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ function shareForm(formId: string, deviceId: string): Promise; + + /** + * Notify form that privacy whether to be protected. + * @permission ohos.permission.REQUIRE_FORM. + * @param { Array } formIds - Indicates the specified form id. + * @param { boolean } isProtected - Indicates whether to be protected. + * @param { AsyncCallback } callback - The callback of notifyFormsPrivacyProtected. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function notifyFormsPrivacyProtected(formIds: Array, isProtected: boolean, callback: AsyncCallback): void; + + /** + * Notify form that privacy whether to be protected. + * @permission ohos.permission.REQUIRE_FORM. + * @param { Array } formIds - Indicates the specified form id. + * @param { boolean } isProtected - Indicates whether to be protected. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + function notifyFormsPrivacyProtected(formIds: Array, isProtected: boolean): Promise; } export default formHost; \ No newline at end of file -- Gitee From 466ec56627d1c6ea45d538d006a312b6ccf43ce2 Mon Sep 17 00:00:00 2001 From: yangzk Date: Fri, 14 Oct 2022 21:20:40 +0800 Subject: [PATCH 140/438] IssueNo: #I5RT32 Description: add appManager Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- api/@ohos.app.ability.appManager.d.ts | 247 ++++++++++++++++++++++++++ 1 file changed, 247 insertions(+) create mode 100644 api/@ohos.app.ability.appManager.d.ts diff --git a/api/@ohos.app.ability.appManager.d.ts b/api/@ohos.app.ability.appManager.d.ts new file mode 100644 index 0000000000..242edc1cba --- /dev/null +++ b/api/@ohos.app.ability.appManager.d.ts @@ -0,0 +1,247 @@ +/* + * 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 { AsyncCallback } from './basic'; +import * as _ApplicationStateObserver from './application/ApplicationStateObserver'; +import * as _AbilityStateData from './application/AbilityStateData'; +import * as _AppStateData from './application/AppStateData'; +import { ProcessRunningInfo as _ProcessRunningInfo } from './application/ProcessRunningInfo'; +import { ProcessRunningInformation as _ProcessRunningInformation } from './application/ProcessRunningInformation'; + +/** + * This module provides the function of app manager service. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @import import appManager from '@ohos.application.appManager' + * @permission N/A + */ +declare namespace appManager { + /** + * @name ApplicationState + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi Hide this for inner system use. + * @permission N/A + */ + export enum ApplicationState { + STATE_CREATE, + STATE_FOREGROUND, + STATE_ACTIVE, + STATE_BACKGROUND, + STATE_DESTROY + } + + + /** + * @name ProcessState + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi Hide this for inner system use. + * @permission N/A + */ + export enum ProcessState { + STATE_CREATE, + STATE_FOREGROUND, + STATE_ACTIVE, + STATE_BACKGROUND, + STATE_DESTROY + } + + /** + * Register application state observer. + * + * @default - + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param observer The application state observer. + * @systemapi hide this for inner system use + * @return Returns the number code of the observer. + * @permission ohos.permission.RUNNING_STATE_OBSERVER + */ + function registerApplicationStateObserver(observer: ApplicationStateObserver): number; + + /** + * Register application state observer. + * + * @default - + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param observer The application state observer. + * @param bundleNameList The list of bundleName. The max length is 128. + * @systemapi + * @return Returns the number code of the observer. + * @permission ohos.permission.RUNNING_STATE_OBSERVER + */ + function registerApplicationStateObserver(observer: ApplicationStateObserver, bundleNameList: Array): number; + + /** + * Unregister application state observer. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param observerId Indicates the number code of the observer. + * @systemapi hide this for inner system use + * @return - + * @permission ohos.permission.RUNNING_STATE_OBSERVER + */ + function unregisterApplicationStateObserver(observerId: number, callback: AsyncCallback): void; + function unregisterApplicationStateObserver(observerId: number): Promise; + + /** + * getForegroundApplications. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide this for inner system use + * @return Returns the list of AppStateData. + * @permission ohos.permission.GET_RUNNING_INFO + */ + function getForegroundApplications(callback: AsyncCallback>): void; + function getForegroundApplications(): Promise>; + + /** + * Kill process with account. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param bundleName The process bundle name. + * @param accountId The account id. + * @systemapi hide this for inner system use + * @return - + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS and ohos.permission.CLEAN_BACKGROUND_PROCESSES + */ + function killProcessWithAccount(bundleName: string, accountId: number): Promise; + function killProcessWithAccount(bundleName: string, accountId: number, callback: AsyncCallback): void; + + /** + * Is user running in stability test. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @return Returns true if user is running stability test. + */ + function isRunningInStabilityTest(callback: AsyncCallback): void; + function isRunningInStabilityTest(): Promise; + + /** + * Get information about running processes + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @return Returns the array of {@link ProcessRunningInfo}. + * @permission ohos.permission.GET_RUNNING_INFO + * @deprecated since 9 + * @useinstead getProcessRunningInformation + */ + function getProcessRunningInfos(): Promise>; + function getProcessRunningInfos(callback: AsyncCallback>): void; + + /** + * Kill processes by bundle name + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param bundleName bundle name. + * @systemapi hide this for inner system use + * @permission ohos.permission.CLEAN_BACKGROUND_PROCESSES + */ + function killProcessesByBundleName(bundleName: string): Promise; + function killProcessesByBundleName(bundleName: string, callback: AsyncCallback); + + /** + * Clear up application data by bundle name + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param bundleName bundle name. + * @systemapi hide this for inner system use + * @permission ohos.permission.CLEAN_APPLICATION_DATA + */ + function clearUpApplicationData(bundleName: string): Promise; + function clearUpApplicationData(bundleName: string, callback: AsyncCallback); + + /** + * Is it a ram-constrained device + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @return whether a ram-constrained device. + */ + function isRamConstrainedDevice(): Promise; + function isRamConstrainedDevice(callback: AsyncCallback): void; + + /** + * Get the memory size of the application + * @since 7 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @return application memory size. + */ + function getAppMemorySize(): Promise; + function getAppMemorySize(callback: AsyncCallback): void; + + /** + * Get information about running processes + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @return Returns the array of {@link ProcessRunningInformation}. + * @permission ohos.permission.GET_RUNNING_INFO + */ + function getProcessRunningInformation(): Promise>; + function getProcessRunningInformation(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 class of an process running information. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + export type ProcessRunningInfo = _ProcessRunningInfo + + /** + * The class of an process running information. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + export type ProcessRunningInformation = _ProcessRunningInformation +} + +export default appManager; -- Gitee From 92db8e3a7f0eebf96cefbfa683a56cc5e5e10f3e Mon Sep 17 00:00:00 2001 From: yangzk Date: Fri, 14 Oct 2022 21:40:09 +0800 Subject: [PATCH 141/438] IssueNo: #I5RT32 Description: add appManager Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- api/@ohos.app.ability.appManager.d.ts | 272 ++++++++++++++++---------- 1 file changed, 173 insertions(+), 99 deletions(-) diff --git a/api/@ohos.app.ability.appManager.d.ts b/api/@ohos.app.ability.appManager.d.ts index 242edc1cba..69193ed0d5 100644 --- a/api/@ohos.app.ability.appManager.d.ts +++ b/api/@ohos.app.ability.appManager.d.ts @@ -22,19 +22,18 @@ import { ProcessRunningInformation as _ProcessRunningInformation } from './appli /** * This module provides the function of app manager service. - * - * @since 8 + * @namespace appManager * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @import import appManager from '@ohos.application.appManager' - * @permission N/A + * @since 9 + * */ declare namespace appManager { /** - * @name ApplicationState - * @since 9 + * Enum for the application state + * @enum { number } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi Hide this for inner system use. - * @permission N/A + * @systemapi + * @since 9 */ export enum ApplicationState { STATE_CREATE, @@ -44,13 +43,12 @@ declare namespace appManager { STATE_DESTROY } - /** - * @name ProcessState - * @since 9 + * Enum for the process state + * @enum { number } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi Hide this for inner system use. - * @permission N/A + * @systemapi + * @since 9 */ export enum ProcessState { STATE_CREATE, @@ -62,184 +60,260 @@ declare namespace appManager { /** * Register application state observer. - * - * @default - - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param observer The application state observer. - * @systemapi hide this for inner system use - * @return Returns the number code of the observer. * @permission ohos.permission.RUNNING_STATE_OBSERVER + * @param { ApplicationStateObserver } observer - The application state observer. + * @return { number } Returns the number code of the observer. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @since 9 */ function registerApplicationStateObserver(observer: ApplicationStateObserver): number; /** * Register application state observer. - * - * @default - - * @since 9 + * @permission ohos.permission.RUNNING_STATE_OBSERVER + * @param { ApplicationStateObserver } observer - The application state observer. + * @param { Array } bundleNameList - The list of bundleName. The max length is 128. + * @return { number } Returns the number code of the observer. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param observer The application state observer. - * @param bundleNameList The list of bundleName. The max length is 128. * @systemapi - * @return Returns the number code of the observer. - * @permission ohos.permission.RUNNING_STATE_OBSERVER + * @since 9 */ - function registerApplicationStateObserver(observer: ApplicationStateObserver, bundleNameList: Array): number; + function registerApplicationStateObserver(observer: ApplicationStateObserver, bundleNameList: Array): number; /** * Unregister application state observer. - * - * @since 8 + * @permission ohos.permission.RUNNING_STATE_OBSERVER + * @param { number } observerId - Indicates the number code of the observer. + * @param { AsyncCallback } callback - The callback of unregisterApplicationStateObserver. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param observerId Indicates the number code of the observer. - * @systemapi hide this for inner system use - * @return - + * @systemapi + * @since 9 + */ + function unregisterApplicationStateObserver(observerId: number, callback: AsyncCallback): void; + + /** + * Unregister application state observer. * @permission ohos.permission.RUNNING_STATE_OBSERVER + * @param { number } observerId - Indicates the number code of the observer. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @since 9 */ - function unregisterApplicationStateObserver(observerId: number, callback: AsyncCallback): void; function unregisterApplicationStateObserver(observerId: number): Promise; /** * getForegroundApplications. - * - * @since 8 + * @permission ohos.permission.GET_RUNNING_INFO + * @param { AsyncCallback> } callback - The callback is used to return the list of AppStateData. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide this for inner system use - * @return Returns the list of AppStateData. + * @systemapi + * @since 9 + */ + function getForegroundApplications(callback: AsyncCallback>): void; + + /** + * getForegroundApplications. * @permission ohos.permission.GET_RUNNING_INFO + * @returns { Promise> } Returns the list of AppStateData. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @since 9 */ - function getForegroundApplications(callback: AsyncCallback>): void; - function getForegroundApplications(): Promise>; + function getForegroundApplications(): Promise>; /** * Kill process with account. - * - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param bundleName The process bundle name. - * @param accountId The account id. - * @systemapi hide this for inner system use - * @return - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS and ohos.permission.CLEAN_BACKGROUND_PROCESSES + * @param { string } bundleName - The process bundle name. + * @param { number } accountId - The account id. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @since 9 */ function killProcessWithAccount(bundleName: string, accountId: number): Promise; + + /** + * Kill process with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS and ohos.permission.CLEAN_BACKGROUND_PROCESSES + * @param { string } bundleName - The process bundle name. + * @param { number } accountId - The account id. + * @param { AsyncCallback } callback - The callback of killProcessWithAccount. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @since 9 + */ function killProcessWithAccount(bundleName: string, accountId: number, callback: AsyncCallback): void; - /** + /** * Is user running in stability test. - * - * @since 8 + * @param { AsyncCallback } callback - The callback is used to return true if user is running stability test. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return Returns true if user is running stability test. + * @since 9 */ - function isRunningInStabilityTest(callback: AsyncCallback): void; - function isRunningInStabilityTest(): Promise; + function isRunningInStabilityTest(callback: AsyncCallback): void; /** - * Get information about running processes - * - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return Returns the array of {@link ProcessRunningInfo}. - * @permission ohos.permission.GET_RUNNING_INFO - * @deprecated since 9 - * @useinstead getProcessRunningInformation - */ - function getProcessRunningInfos(): Promise>; - function getProcessRunningInfos(callback: AsyncCallback>): void; + * Is user running in stability test. + * @returns { Promise } Returns true if user is running stability test. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ + function isRunningInStabilityTest(): Promise; /** * Kill processes by bundle name - * @since 8 + * @permission ohos.permission.CLEAN_BACKGROUND_PROCESSES + * @param { string } bundleName - bundle name. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param bundleName bundle name. - * @systemapi hide this for inner system use + * @systemapi + * @since 9 + */ + function killProcessesByBundleName(bundleName: string): Promise; + + /** + * Kill processes by bundle name * @permission ohos.permission.CLEAN_BACKGROUND_PROCESSES + * @param { string } bundleName - bundle name. + * @param { AsyncCallback } callback - The callback of killProcessesByBundleName. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @since 9 */ - function killProcessesByBundleName(bundleName: string): Promise; - function killProcessesByBundleName(bundleName: string, callback: AsyncCallback); + function killProcessesByBundleName(bundleName: string, callback: AsyncCallback); /** * Clear up application data by bundle name - * @since 8 + * @permission ohos.permission.CLEAN_APPLICATION_DATA + * @param { string } bundleName - bundle name. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param bundleName bundle name. - * @systemapi hide this for inner system use + * @systemapi + * @since 9 + */ + function clearUpApplicationData(bundleName: string): Promise; + + /** + * Clear up application data by bundle name * @permission ohos.permission.CLEAN_APPLICATION_DATA + * @param { string } bundleName - bundle name. + * @param { AsyncCallback } callback - The callback of clearUpApplicationData. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @since 9 */ - function clearUpApplicationData(bundleName: string): Promise; - function clearUpApplicationData(bundleName: string, callback: AsyncCallback); + function clearUpApplicationData(bundleName: string, callback: AsyncCallback); /** * Is it a ram-constrained device - * @since 7 + * @returns { Promise } Returns true if the device is ram-constrained. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return whether a ram-constrained device. + * @since 9 */ function isRamConstrainedDevice(): Promise; + + /** + * Is it a ram-constrained device + * @param { AsyncCallback } callback - The callback is used to return true if the device is ram-constrained. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ function isRamConstrainedDevice(callback: AsyncCallback): void; /** * Get the memory size of the application - * @since 7 + * @returns { Promise } Returns the application memory size. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return application memory size. + * @since 9 */ function getAppMemorySize(): Promise; + + /** + * Get the memory size of the application + * @param { AsyncCallback } callback - The callback is used to return the application memory size. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ function getAppMemorySize(callback: AsyncCallback): void; /** - * Get information about running processes - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return Returns the array of {@link ProcessRunningInformation}. - * @permission ohos.permission.GET_RUNNING_INFO - */ + * Get information about running processes + * @permission ohos.permission.GET_RUNNING_INFO + * @returns { Promise> } Returns the array of {@link ProcessRunningInformation}. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @since 9 + */ function getProcessRunningInformation(): Promise>; + + /** + * Get information about running processes + * @permission ohos.permission.GET_RUNNING_INFO + * @param { AsyncCallback> } callback - The callback is used to return the array of {@link ProcessRunningInformation}. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @since 9 + */ function getProcessRunningInformation(callback: AsyncCallback>): void; /** * The ability or extension state data. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide for inner use. + * @systemapi + * @since 9 */ export type AbilityStateData = _AbilityStateData.default /** * The application state data. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide for inner use. + * @systemapi + * @since 9 */ export type AppStateData = _AppStateData.default /** * The application state observer. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide for inner use. + * @systemapi + * @since 9 */ export type ApplicationStateObserver = _ApplicationStateObserver.default /** * The class of an process running information. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 */ export type ProcessRunningInfo = _ProcessRunningInfo /** - * The class of an process running information. - * - * @since 9 + * The class of a process running information. * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 */ export type ProcessRunningInformation = _ProcessRunningInformation } -- Gitee From be6f52616aa4c4b1533073e415567c3fc3309c92 Mon Sep 17 00:00:00 2001 From: yangzk Date: Fri, 14 Oct 2022 21:48:31 +0800 Subject: [PATCH 142/438] IssueNo: #I5RT32 Description: mod interface Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- api/@ohos.ability.ability.d.ts | 2 +- api/@ohos.app.ability.Ability.d.ts | 26 +++++++- api/@ohos.app.ability.appManager.d.ts | 14 +++-- api/@ohos.app.ability.errorManager.d.ts | 11 ++-- api/@ohos.app.ability.missionManager.d.ts | 11 ++-- api/@ohos.app.form.FormExtensionAbility.d.ts | 16 ++--- api/@ohos.app.form.formHost.d.ts | 6 +- ...s.application.ServiceExtensionAbility.d.ts | 2 +- api/@ohos.application.formInfo.d.ts | 10 ++- api/application/AbilityContext.d.ts | 12 ++-- api/application/ApplicationContext.d.ts | 61 ++++++++++++++++--- api/application/ServiceExtensionContext.d.ts | 11 ++-- api/application/abilityMonitor.d.ts | 22 ++++--- 13 files changed, 147 insertions(+), 57 deletions(-) diff --git a/api/@ohos.ability.ability.d.ts b/api/@ohos.ability.ability.d.ts index 44be58f12e..d710852e0a 100755 --- a/api/@ohos.ability.ability.d.ts +++ b/api/@ohos.ability.ability.d.ts @@ -26,7 +26,7 @@ import { StartAbilityParameter as _StartAbilityParameter } from './ability/star * * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @StageModelOnly + * @FAModelOnly */ declare namespace ability { diff --git a/api/@ohos.app.ability.Ability.d.ts b/api/@ohos.app.ability.Ability.d.ts index c75fe2d93c..9495a9745f 100755 --- a/api/@ohos.app.ability.Ability.d.ts +++ b/api/@ohos.app.ability.Ability.d.ts @@ -84,13 +84,35 @@ export interface Caller { /** * Register death listener notification callback. + * @param { string } type - release. * @param { OnReleaseCallBack } callback - Register a callback function for listening for notifications. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @stagemodelonly * @since 9 */ - onRelease(callback: OnReleaseCallBack): void; + on(type: "release", callback: OnReleaseCallBack): void; + + /** + * Unregister death listener notification callback. + * @param { string } type - release. + * @param { OnReleaseCallBack } callback - Unregister a callback function for listening for notifications. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ + off(type: "release", callback: OnReleaseCallBack): void; + + /** + * Unregister all death listener notification callback. + * @param { string } type - release. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ + off(type: "release"): void; } /** @@ -265,7 +287,7 @@ export default class Ability { * @stagemodelonly * @since 9 */ - dump(params: Array): Array; + onDump(params: Array): Array; /** * Called when the system has determined to trim the memory, for example, when the ability is running in the diff --git a/api/@ohos.app.ability.appManager.d.ts b/api/@ohos.app.ability.appManager.d.ts index 69193ed0d5..ebc1872c80 100644 --- a/api/@ohos.app.ability.appManager.d.ts +++ b/api/@ohos.app.ability.appManager.d.ts @@ -61,6 +61,7 @@ declare namespace appManager { /** * Register application state observer. * @permission ohos.permission.RUNNING_STATE_OBSERVER + * @param { string } type - applicationState. * @param { ApplicationStateObserver } observer - The application state observer. * @return { number } Returns the number code of the observer. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. @@ -68,11 +69,12 @@ declare namespace appManager { * @systemapi * @since 9 */ - function registerApplicationStateObserver(observer: ApplicationStateObserver): number; + function on(type: "applicationState", observer: ApplicationStateObserver): number; /** * Register application state observer. * @permission ohos.permission.RUNNING_STATE_OBSERVER + * @param { string } type - applicationState. * @param { ApplicationStateObserver } observer - The application state observer. * @param { Array } bundleNameList - The list of bundleName. The max length is 128. * @return { number } Returns the number code of the observer. @@ -81,23 +83,25 @@ declare namespace appManager { * @systemapi * @since 9 */ - function registerApplicationStateObserver(observer: ApplicationStateObserver, bundleNameList: Array): number; + function on(type: "applicationState", observer: ApplicationStateObserver, bundleNameList: Array): number; /** * Unregister application state observer. * @permission ohos.permission.RUNNING_STATE_OBSERVER + * @param { string } type - applicationState. * @param { number } observerId - Indicates the number code of the observer. - * @param { AsyncCallback } callback - The callback of unregisterApplicationStateObserver. + * @param { AsyncCallback } callback - The callback of off. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @since 9 */ - function unregisterApplicationStateObserver(observerId: number, callback: AsyncCallback): void; + function off(type: "applicationState", observerId: number, callback: AsyncCallback): void; /** * Unregister application state observer. * @permission ohos.permission.RUNNING_STATE_OBSERVER + * @param { string } type - applicationState. * @param { number } observerId - Indicates the number code of the observer. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. @@ -105,7 +109,7 @@ declare namespace appManager { * @systemapi * @since 9 */ - function unregisterApplicationStateObserver(observerId: number): Promise; + function off(type: "applicationState", observerId: number): Promise; /** * getForegroundApplications. diff --git a/api/@ohos.app.ability.errorManager.d.ts b/api/@ohos.app.ability.errorManager.d.ts index 903e9d89f5..10573f876d 100644 --- a/api/@ohos.app.ability.errorManager.d.ts +++ b/api/@ohos.app.ability.errorManager.d.ts @@ -25,33 +25,36 @@ import * as _ErrorObserver from './application/ErrorObserver'; declare namespace errorManager { /** * Register error observer. + * @param { string } type - error. * @param { ErrorObserver } observer - The error observer. * @returns { number } Returns the number code of the observer. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 */ - function registerErrorObserver(observer: ErrorObserver): number; + function on(type: "error", observer: ErrorObserver): number; /** * Unregister error observer. + * @param { string } type - error. * @param { number } observerId - Indicates the number code of the observer. - * @param { AsyncCallback } callback - The callback of unregisterErrorObserver. + * @param { AsyncCallback } callback - The callback of off. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 */ - function unregisterErrorObserver(observerId: number, callback: AsyncCallback): void; + function off(type: "error", observerId: number, callback: AsyncCallback): void; /** * Unregister error observer. + * @param { string } type - error. * @param { number } observerId - Indicates the number code of the observer. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 */ - function unregisterErrorObserver(observerId: number): Promise; + function off(type: "error", observerId: number): Promise; /** * The observer will be called by system when an error occurs. diff --git a/api/@ohos.app.ability.missionManager.d.ts b/api/@ohos.app.ability.missionManager.d.ts index 7a0eac2e0d..d8fee24cb5 100644 --- a/api/@ohos.app.ability.missionManager.d.ts +++ b/api/@ohos.app.ability.missionManager.d.ts @@ -30,33 +30,36 @@ import StartOptions from "./@ohos.application.StartOptions"; declare namespace missionManager { /** * Register the missionListener to ams. + * @param { string } type - mission. * @param { MissionListener } listener - Indicates the MissionListener to be registered. * @returns { number } Returns the index number of the MissionListener. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @since 9 */ - function registerMissionListener(listener: MissionListener): number; + function on(type: "mission", listener: MissionListener): number; /** * Unrgister the missionListener to ams. + * @param { string } type - mission. * @param { number } listenerId - Indicates the listener id to be unregistered. - * @param { AsyncCallback } callback - The callback of unregisterMissionListener. + * @param { AsyncCallback } callback - The callback of off. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @since 9 */ - function unregisterMissionListener(listenerId: number, callback: AsyncCallback): void; + function off(type: "mission", listenerId: number, callback: AsyncCallback): void; /** * Unrgister the missionListener to ams. + * @param { string } type - mission. * @param { number } listenerId - Indicates the listener id to be unregistered. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @since 9 */ - function unregisterMissionListener(listenerId: number): Promise; + function off(type: "mission", listenerId: number): Promise; /** * Get the missionInfo with the given missionId. diff --git a/api/@ohos.app.form.FormExtensionAbility.d.ts b/api/@ohos.app.form.FormExtensionAbility.d.ts index 81c522c223..56dacc5b62 100644 --- a/api/@ohos.app.form.FormExtensionAbility.d.ts +++ b/api/@ohos.app.form.FormExtensionAbility.d.ts @@ -26,7 +26,7 @@ import { Configuration } from './@ohos.application.Configuration'; * @syscap SystemCapability.Ability.Form * @StageModelOnly */ -export default class FormExtension { +export default class FormExtensionAbility { /** * Indicates form extension context. * @@ -48,7 +48,7 @@ export default class FormExtension { * @return Returns the created {@link formBindingData#FormBindingData} object. * @StageModelOnly */ - onCreate(want: Want): formBindingData.FormBindingData; + onAddForm(want: Want): formBindingData.FormBindingData; /** * Called when the form provider is notified that a temporary form is successfully converted to a normal form. @@ -59,7 +59,7 @@ export default class FormExtension { * @return - * @StageModelOnly */ - onCastToNormal(formId: string): void; + onCastToNormalForm(formId: string): void; /** * Called to notify the form provider to update a specified form. @@ -70,7 +70,7 @@ export default class FormExtension { * @return - * @StageModelOnly */ - onUpdate(formId: string): void; + onUpdateForm(formId: string): void; /** * Called when the form provider receives form events from the system. @@ -85,7 +85,7 @@ export default class FormExtension { * @return - * @StageModelOnly */ - onVisibilityChange(newStatus: { [key: string]: number }): void; + onChangeFormVisibility(newStatus: { [key: string]: number }): void; /** * Called when a specified message event defined by the form provider is triggered. This method is valid only for @@ -100,7 +100,7 @@ export default class FormExtension { * @return - * @StageModelOnly */ - onEvent(formId: string, message: string): void; + onFormEvent(formId: string, message: string): void; /** * Called to notify the form provider that a specified form has been destroyed. Override this method if @@ -112,7 +112,7 @@ export default class FormExtension { * @return - * @StageModelOnly */ - onDestroy(formId: string): void; + onRemoveForm(formId: string): void; /** * Called when the system configuration is updated. @@ -150,5 +150,5 @@ export default class FormExtension { * @return Returns the wantParams object. * @StageModelOnly */ - onShare?(formId: string): {[key: string]: any}; + onFormToBeShared?(formId: string): {[key: string]: any}; } diff --git a/api/@ohos.app.form.formHost.d.ts b/api/@ohos.app.form.formHost.d.ts index e6d6bf84a9..3f696e72a4 100644 --- a/api/@ohos.app.form.formHost.d.ts +++ b/api/@ohos.app.form.formHost.d.ts @@ -137,13 +137,13 @@ declare namespace formHost { * Converts a specified temporary form that has been obtained by the application into a normal form. * @permission ohos.permission.REQUIRE_FORM * @param { string } formId - Indicates the ID of the temporary form to convert. - * @param { AsyncCallback } callback - The callback of castTempForm. + * @param { AsyncCallback } callback - The callback of castToNormalForm. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.Form * @systemapi * @since 9 */ - function castTempForm(formId: string, callback: AsyncCallback): void; + function castToNormalForm(formId: string, callback: AsyncCallback): void; /** * Converts a specified temporary form that has been obtained by the application into a normal form. @@ -155,7 +155,7 @@ declare namespace formHost { * @systemapi * @since 9 */ - function castTempForm(formId: string): Promise; + function castToNormalForm(formId: string): Promise; /** * Sends a notification to the form framework to make the specified forms visible. diff --git a/api/@ohos.application.ServiceExtensionAbility.d.ts b/api/@ohos.application.ServiceExtensionAbility.d.ts index 9b7e74eb47..93d3064b2e 100644 --- a/api/@ohos.application.ServiceExtensionAbility.d.ts +++ b/api/@ohos.application.ServiceExtensionAbility.d.ts @@ -133,6 +133,6 @@ export default class ServiceExtensionAbility { * @return The dump info array. * @StageModelOnly */ - dump(params: Array): Array; + onDump(params: Array): Array; } diff --git a/api/@ohos.application.formInfo.d.ts b/api/@ohos.application.formInfo.d.ts index 46c60e5274..774eb4d383 100644 --- a/api/@ohos.application.formInfo.d.ts +++ b/api/@ohos.application.formInfo.d.ts @@ -190,7 +190,15 @@ declare namespace formInfo { * @since 8 * @syscap SystemCapability.Ability.Form */ - JS = 1 + JS = 1, + + /** + * eTS form. + * + * @since 9 + * @syscap SystemCapability.Ability.Form + */ + eTS = 2 } /** diff --git a/api/application/AbilityContext.d.ts b/api/application/AbilityContext.d.ts index 8b6a4c32f1..5174f3e58d 100755 --- a/api/application/AbilityContext.d.ts +++ b/api/application/AbilityContext.d.ts @@ -104,6 +104,7 @@ export default class AbilityContext extends Context { * @returns { Promise } Returns the Caller interface. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi * @stagemodelonly * @since 9 */ @@ -387,11 +388,10 @@ export default class AbilityContext extends Context { * @returns { number } Returns the number code of the ability connected * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi * @stagemodelonly * @since 9 */ - connectAbility(want: Want, options: ConnectOptions): number; + connectServiceExtensionAbility(want: Want, options: ConnectOptions): number; /** * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template with account. @@ -406,7 +406,7 @@ export default class AbilityContext extends Context { * @stagemodelonly * @since 9 */ - connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; + connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; /** * The callback interface was connect successfully. @@ -414,11 +414,10 @@ export default class AbilityContext extends Context { * @param { AsyncCallback } callback - The callback of disconnectAbility. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi * @stagemodelonly * @since 9 */ - disconnectAbility(connection: number, callback: AsyncCallback): void; + disconnectServiceExtensionAbility(connection: number, callback: AsyncCallback): void; /** * The callback interface was connect successfully. @@ -426,11 +425,10 @@ export default class AbilityContext extends Context { * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi * @stagemodelonly * @since 9 */ - disconnectAbility(connection: number): Promise; + disconnectServiceExtensionAbility(connection: number): Promise; /** * Set mission label of current ability. diff --git a/api/application/ApplicationContext.d.ts b/api/application/ApplicationContext.d.ts index 516973add4..54ef9d985f 100755 --- a/api/application/ApplicationContext.d.ts +++ b/api/application/ApplicationContext.d.ts @@ -17,6 +17,7 @@ import { AsyncCallback } from "../basic"; import Context from "./Context"; import AbilityLifecycleCallback from "../@ohos.application.AbilityLifecycleCallback"; import EnvironmentCallback from "../@ohos.application.EnvironmentCallback"; +import { ProcessRunningInformation } from "./ProcessRunningInformation"; /** * The context of an application. It allows access to application-specific resources. @@ -27,6 +28,7 @@ import EnvironmentCallback from "../@ohos.application.EnvironmentCallback"; export default class ApplicationContext extends Context { /** * Register ability lifecycle callback. + * @param { string } type - abilityLifecycle. * @param { AbilityLifecycleCallback } callback - The ability lifecycle callback. * @returns { number } Returns the number code of the callback. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. @@ -34,21 +36,23 @@ export default class ApplicationContext extends Context { * @stagemodelonly * @since 9 */ - registerAbilityLifecycleCallback(callback: AbilityLifecycleCallback): number; + on(type: "abilityLifecycle", callback: AbilityLifecycleCallback): number; /** * Unregister ability lifecycle callback. + * @param { string } type - abilityLifecycle. * @param { number } callbackId - Indicates the number code of the callback. - * @param { AsyncCallback } callback - The callback of unregisterAbilityLifecycleCallback. + * @param { AsyncCallback } callback - The callback of off. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @stagemodelonly * @since 9 */ - unregisterAbilityLifecycleCallback(callbackId: number, callback: AsyncCallback): void; + off(type: "abilityLifecycle", callbackId: number, callback: AsyncCallback): void; /** * Unregister ability lifecycle callback. + * @param { string } type - abilityLifecycle. * @param { number } callbackId - Indicates the number code of the callback. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. @@ -56,10 +60,11 @@ export default class ApplicationContext extends Context { * @stagemodelonly * @since 9 */ - unregisterAbilityLifecycleCallback(callbackId: number): Promise; + off(type: "abilityLifecycle", callbackId: number): Promise; /** * Register environment callback. + * @param { string } type - environment. * @param { EnvironmentCallback } callback - The environment callback. * @returns { number } Returns the number code of the callback. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. @@ -67,10 +72,11 @@ export default class ApplicationContext extends Context { * @stagemodelonly * @since 9 */ - registerEnvironmentCallback(callback: EnvironmentCallback): number; + on(type: "environment", callback: EnvironmentCallback): number; /** * Unregister environment callback. + * @param { string } type - environment. * @param { number } callbackId - Indicates the number code of the callback. * @param { AsyncCallback } callback - The callback of unregisterEnvironmentCallback. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. @@ -78,10 +84,11 @@ export default class ApplicationContext extends Context { * @stagemodelonly * @since 9 */ - unregisterEnvironmentCallback(callbackId: number, callback: AsyncCallback): void; + off(type: "environment", callbackId: number, callback: AsyncCallback): void; /** * Unregister environment callback. + * @param { string } type - environment. * @param { number } callbackId - Indicates the number code of the callback. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. @@ -89,5 +96,45 @@ export default class ApplicationContext extends Context { * @stagemodelonly * @since 9 */ - unregisterEnvironmentCallback(callbackId: number): Promise; + off(type: "environment", callbackId: number): Promise; + + /** + * Get information about running processes + * @returns { Promise> } Returns the array of {@link ProcessRunningInformation}. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + getProcessRunningInformation(): Promise>; + + /** + * Get information about running processes + * @param { AsyncCallback> } callback - The callback is used to return the array of {@link ProcessRunningInformation}. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + getProcessRunningInformation(callback: AsyncCallback>): void; + + /** + * Kill processes by self + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + killProcessesBySelf(): Promise; + + /** + * Kill processes by self + * @param { AsyncCallback } callback - The callback of killProcessesBySelf. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + killProcessesBySelf(callback: AsyncCallback); } diff --git a/api/application/ServiceExtensionContext.d.ts b/api/application/ServiceExtensionContext.d.ts index 552e964ccf..414f3d38f1 100644 --- a/api/application/ServiceExtensionContext.d.ts +++ b/api/application/ServiceExtensionContext.d.ts @@ -244,11 +244,10 @@ export default class ServiceExtensionContext extends ExtensionContext { * @returns { number } Returns the connection id. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi * @stagemodelonly * @since 9 */ - connectAbility(want: Want, options: ConnectOptions): number; + connectServiceExtensionAbility(want: Want, options: ConnectOptions): number; /** * Connects an ability to a Service extension with account. @@ -265,7 +264,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * @stagemodelonly * @since 9 */ - connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; + connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; /** * Disconnects an ability to a service extension, in contrast to {@link connectAbility}. @@ -273,11 +272,10 @@ export default class ServiceExtensionContext extends ExtensionContext { * @param { AsyncCallback } callback - The callback of disconnectAbility. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi * @stagemodelonly * @since 9 */ - disconnectAbility(connection: number, callback: AsyncCallback): void; + disconnectServiceExtensionAbility(connection: number, callback: AsyncCallback): void; /** * Disconnects an ability to a service extension, in contrast to {@link connectAbility}. @@ -285,11 +283,10 @@ export default class ServiceExtensionContext extends ExtensionContext { * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi * @stagemodelonly * @since 9 */ - disconnectAbility(connection: number): Promise; + disconnectServiceExtensionAbility(connection: number): Promise; /** * Get the caller object of the startup capability diff --git a/api/application/abilityMonitor.d.ts b/api/application/abilityMonitor.d.ts index 6af8397d2a..8dec39ad4f 100644 --- a/api/application/abilityMonitor.d.ts +++ b/api/application/abilityMonitor.d.ts @@ -33,13 +33,21 @@ export interface AbilityMonitor { */ abilityName: string; + /** + * The name of the module to monitor. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + moduleName: string; + /** * Called back when the ability is started for initialization. * * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core */ - onAbilityCreate?:(data: Ability) => void; + onAbilityCreate?:(ability: Ability) => void; /** * Called back when the state of the ability changes to foreground. @@ -47,7 +55,7 @@ export interface AbilityMonitor { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core */ - onAbilityForeground?:(data: Ability) => void; + onAbilityForeground?:(ability: Ability) => void; /** * Called back when the state of the ability changes to background. @@ -55,7 +63,7 @@ export interface AbilityMonitor { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core */ - onAbilityBackground?:(data: Ability) => void; + onAbilityBackground?:(ability: Ability) => void; /** * Called back before the ability is destroyed. @@ -63,7 +71,7 @@ export interface AbilityMonitor { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core */ - onAbilityDestroy?:(data: Ability) => void; + onAbilityDestroy?:(ability: Ability) => void; /** * Called back when an ability window stage is created. @@ -71,7 +79,7 @@ export interface AbilityMonitor { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core */ - onWindowStageCreate?:(data: Ability) => void; + onWindowStageCreate?:(ability: Ability) => void; /** * Called back when an ability window stage is restored. @@ -79,7 +87,7 @@ export interface AbilityMonitor { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core */ - onWindowStageRestore?:(data: Ability) => void; + onWindowStageRestore?:(ability: Ability) => void; /** * Called back when an ability window stage is destroyed. @@ -87,7 +95,7 @@ export interface AbilityMonitor { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core */ - onWindowStageDestroy?:(data: Ability) => void; + onWindowStageDestroy?:(ability: Ability) => void; } export default AbilityMonitor; \ No newline at end of file -- Gitee From c58e56836bac88ef374536292de2b97029fb97cb Mon Sep 17 00:00:00 2001 From: yangzk Date: Mon, 17 Oct 2022 16:12:15 +0800 Subject: [PATCH 143/438] IssueNo: #I5RT32 Description: revert FAModelOnly interface Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- api/@ohos.ability.dataUriUtils.d.ts | 2 - api/@ohos.ability.featureAbility.d.ts | 2 - api/@ohos.ability.particleAbility.d.ts | 2 - api/@ohos.app.ability.dataUriUtils.d.ts | 68 ---- ....d.ts => @ohos.app.ability.wantAgent.d.ts} | 0 api/@ohos.app.featureAbility.d.ts | 298 ------------------ api/@ohos.app.particleAbility.d.ts | 118 ------- 7 files changed, 490 deletions(-) delete mode 100644 api/@ohos.app.ability.dataUriUtils.d.ts rename api/{@ohos.app.wantAgent.d.ts => @ohos.app.ability.wantAgent.d.ts} (100%) delete mode 100644 api/@ohos.app.featureAbility.d.ts delete mode 100644 api/@ohos.app.particleAbility.d.ts diff --git a/api/@ohos.ability.dataUriUtils.d.ts b/api/@ohos.ability.dataUriUtils.d.ts index f10e53a20d..af7b680500 100644 --- a/api/@ohos.ability.dataUriUtils.d.ts +++ b/api/@ohos.ability.dataUriUtils.d.ts @@ -19,8 +19,6 @@ * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A - * @deprecated since 9 - * @useinstead @ohos.app.ability.dataUriUtils */ declare namespace dataUriUtils { /** diff --git a/api/@ohos.ability.featureAbility.d.ts b/api/@ohos.ability.featureAbility.d.ts index fee1526470..944d6d321b 100644 --- a/api/@ohos.ability.featureAbility.d.ts +++ b/api/@ohos.ability.featureAbility.d.ts @@ -32,8 +32,6 @@ import window from './@ohos.window'; * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @permission N/A * @FAModelOnly - * @deprecated since 9 - * @useinstead @ohos.app.featureAbility */ declare namespace featureAbility { /** diff --git a/api/@ohos.ability.particleAbility.d.ts b/api/@ohos.ability.particleAbility.d.ts index f822ef4578..04321ffcd7 100644 --- a/api/@ohos.ability.particleAbility.d.ts +++ b/api/@ohos.ability.particleAbility.d.ts @@ -27,8 +27,6 @@ import Want from './@ohos.application.Want'; * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @permission N/A * @FAModelOnly - * @deprecated since 9 - * @useinstead @ohos.app.particleAbility */ declare namespace particleAbility { /** diff --git a/api/@ohos.app.ability.dataUriUtils.d.ts b/api/@ohos.app.ability.dataUriUtils.d.ts deleted file mode 100644 index e3f47a7138..0000000000 --- a/api/@ohos.app.ability.dataUriUtils.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 { BusinessError } from './basic'; - -/** - * A utility class used for handling objects that use the DataAbilityHelper scheme. - * @namespace dataUriUtils - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ -declare namespace dataUriUtils { - /** - * Obtains the ID attached to the end of the path component of the given uri. - * @param { string } uri - Indicates the uri object from which the ID is to be obtained. - * @returns { number } Returns the ID attached to the end of the path component. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - function getId(uri: string): number - - /** - * Attaches the given ID to the end of the path component of the given uri. - * @param { string } uri - Indicates the uri string from which the ID is to be obtained. - * @param { number } id - Indicates the ID to attach. - * @returns { number } Returns the uri object with the given ID attached. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - function attachId(uri: string, id: number): string - - /** - * Deletes the ID from the end of the path component of the given uri. - * @param { string } uri - Indicates the uri object from which the ID is to be deleted. - * @returns { string } Returns the uri object with the ID deleted. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - function deleteId(uri: string): string - - /** - * Updates the ID in the specified uri. - * @param { string } uri - Indicates the uri object to be updated. - * @param { number } id - Indicates the new ID. - * @returns { string } Returns the updated uri object. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - function updateId(uri: string, id: number): string - -} -export default dataUriUtils; \ No newline at end of file diff --git a/api/@ohos.app.wantAgent.d.ts b/api/@ohos.app.ability.wantAgent.d.ts similarity index 100% rename from api/@ohos.app.wantAgent.d.ts rename to api/@ohos.app.ability.wantAgent.d.ts diff --git a/api/@ohos.app.featureAbility.d.ts b/api/@ohos.app.featureAbility.d.ts deleted file mode 100644 index 839d320813..0000000000 --- a/api/@ohos.app.featureAbility.d.ts +++ /dev/null @@ -1,298 +0,0 @@ -/* - * 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 { AsyncCallback } from './basic'; -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 } from './app/featureAbilityContext'; -import { DataAbilityHelper } from './ability/dataAbilityUtils'; -import { ConnectOptions } from './ability/connectOptions'; -import { ProcessInfo as _ProcessInfo } from './app/processInfo'; -import window from './@ohos.window'; - -/** - * A Feature Ability represents an ability with a UI and is designed to interact with users. - * @namespace featureAbility - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ -declare namespace featureAbility { - /** - * Obtain the want sent from the source ability. - * @param { AsyncCallback } callback - The callback is used to return the want sent from the source ability. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - function getWant(callback: AsyncCallback): void; - - /** - * Obtain the want sent from the source ability. - * @returns { Promise } Returns the want sent from the source ability. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - function getWant(): Promise; - - /** - * Starts a new ability. - * @param { StartAbilityParameter } parameter - Indicates the ability to start. - * @param { AsyncCallback } callback - The callback of startAbility. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - function startAbility(parameter: StartAbilityParameter, callback: AsyncCallback): void; - - /** - * Starts a new ability. - * @param { StartAbilityParameter } parameter - Indicates the ability to start. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - function startAbility(parameter: StartAbilityParameter): Promise; - - /** - * Obtains the application context. - * @returns { Context } Returns the application context. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - function getContext(): Context; - - /** - * Starts an ability and returns the execution result when the ability is destroyed. - * @param { StartAbilityParameter } parameter - Indicates the ability to start. - * @param { AsyncCallback } callback - The callback is used to return the AbilityResult. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - function startAbilityForResult(parameter: StartAbilityParameter, callback: AsyncCallback): void; - - /** - * Starts an ability and returns the execution result when the ability is destroyed. - * @param { StartAbilityParameter } parameter - Indicates the ability to start. - * @returns { Promise } Returns the AbilityResult. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - function startAbilityForResult(parameter: StartAbilityParameter): Promise; - - /** - * Sets the result code and data to be returned by this Page ability to the caller - * and destroys this Page ability. - * @param { AbilityResult } parameter - Indicates the result to return. - * @param { AsyncCallback } callback - The callback of terminateSelfWithResult. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - function terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback): void; - - /** - * Sets the result code and data to be returned by this Page ability to the caller - * and destroys this Page ability. - * @param { AbilityResult } parameter - Indicates the result to return. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - function terminateSelfWithResult(parameter: AbilityResult): Promise; - - /** - * Destroys this Page ability. - * @param { AsyncCallback } callback - The callback of terminateSelf. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - function terminateSelf(callback: AsyncCallback): void; - - /** - * Destroys this Page ability. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - function terminateSelf(): Promise; - - /** - * Obtains the dataAbilityHelper. - * @param uri Indicates the path of the file to open. - * @returns { DataAbilityHelper } Returns the DataAbilityHelper. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - function acquireDataAbilityHelper(uri: string): DataAbilityHelper; - - /** - * Checks whether the main window of this ability has window focus. - * @param { AsyncCallback } callback - The callback is used to return {@code true} if this ability currently has window focus. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - function hasWindowFocus(callback: AsyncCallback): void; - - /** - * Checks whether the main window of this ability has window focus. - * @returns { Promise } Returns {@code true} if this ability currently has window focus. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - function hasWindowFocus(): Promise; - - /** - * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template. - * @param { Want } request - The element name of the service ability - * @param { ConnectOptions } options - The remote object instance - * @returns { number } Returns the number code of the ability connected. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - function connectAbility(request: Want, options: ConnectOptions): number; - - /** - * The callback interface was connect successfully. - * @param { number } connection - The number code of the ability connected - * @param { AsyncCallback } callback - The callback of disconnectAbility. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - function disconnectAbility(connection: number, callback: AsyncCallback): void; - - /** - * The callback interface was connect successfully. - * @param { number } connection - The number code of the ability connected - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - function disconnectAbility(connection: number): Promise; - - /** - * Obtains the window corresponding to the current ability. - * @param { AsyncCallback } callback - The callback is used to return the window corresponding to the current ability. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - function getWindow(callback: AsyncCallback): void; - - /** - * Obtains the window corresponding to the current ability. - * @returns { Promise } Returns the window corresponding to the current ability. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - function getWindow(): Promise; - - /** - * Obtain the window configuration - * @enum { number } - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - export enum AbilityWindowConfiguration { - WINDOW_MODE_UNDEFINED = 0, - WINDOW_MODE_FULLSCREEN = 1, - WINDOW_MODE_SPLIT_PRIMARY = 100, - WINDOW_MODE_SPLIT_SECONDARY = 101, - WINDOW_MODE_FLOATING = 102 - } - - /** - * Obtain the window properties. - * @enum { string } - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - export enum AbilityStartSetting { - BOUNDS_KEY = "abilityBounds", - WINDOW_MODE_KEY = "windowMode", - DISPLAY_ID_KEY = "displayId" - } - - /** - * Indicates the operation type of data. - * @enum { number } - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - export enum DataAbilityOperationType { - TYPE_INSERT = 1, - TYPE_UPDATE = 2, - TYPE_DELETE = 3, - TYPE_ASSERT = 4, - } - - /** - * Defines an AppVersionInfo object. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - export type AppVersionInfo = _AppVersionInfo - - /** - * This class saves process information about an application - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - export type ProcessInfo = _ProcessInfo -} -export default featureAbility; diff --git a/api/@ohos.app.particleAbility.d.ts b/api/@ohos.app.particleAbility.d.ts deleted file mode 100644 index 1e31a0c94d..0000000000 --- a/api/@ohos.app.particleAbility.d.ts +++ /dev/null @@ -1,118 +0,0 @@ -/* - * 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 { AsyncCallback } from './basic'; -import { StartAbilityParameter } from './ability/startAbilityParameter'; -import { DataAbilityHelper } from './ability/dataAbilityUtils'; -import { NotificationRequest } from './notification/notificationRequest'; -import { ConnectOptions } from './ability/connectOptions'; -import Want from './@ohos.application.Want'; - -/** - * A Particle Ability represents an ability with service. - * @namespace particleAbility - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ -declare namespace particleAbility { - /** - * Service ability uses this method to start a specific ability. - * @param { StartAbilityParameter } parameter - Indicates the ability to start. - * @param { AsyncCallback } callback - The callback of startAbility. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - function startAbility(parameter: StartAbilityParameter, callback: AsyncCallback): void; - - /** - * Service ability uses this method to start a specific ability. - * @param { StartAbilityParameter } parameter - Indicates the ability to start. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - function startAbility(parameter: StartAbilityParameter): Promise; - - /** - * Destroys this service ability. - * @param { AsyncCallback } callback - The callback of terminateSelf. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - function terminateSelf(callback: AsyncCallback): void; - - /** - * Destroys this service ability. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - function terminateSelf(): Promise; - - /** - * Obtains the dataAbilityHelper. - * @param { string } uri - Indicates the path of the file to open. - * @returns { DataAbilityHelper } Returns the dataAbilityHelper. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - function acquireDataAbilityHelper(uri: string): DataAbilityHelper; - - /** - * Connects an ability to a Service ability. - * @param { Want } request - Indicates the Service ability to connect. - * @param { ConnectOptions } options - Callback object for the client. If this parameter is null, an exception is thrown. - * @returns { number } Returns the unique identifier of the connection between the client and the service side. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - function connectAbility(request: Want, options: ConnectOptions): number; - - /** - * Disconnects ability to a Service ability. - * @param { number } connection - the connection id returned from connectAbility api. - * @param { AsyncCallback } callback - The callback of disconnectAbility. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - function disconnectAbility(connection: number, callback: AsyncCallback): void; - - /** - * Disconnects ability to a Service ability. - * @param { number } connection - the connection id returned from connectAbility api. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - function disconnectAbility(connection: number): Promise; -} -export default particleAbility; -- Gitee From ee21d6e91643665f4720b98c2d7430a23e3939db Mon Sep 17 00:00:00 2001 From: yangzk Date: Mon, 17 Oct 2022 16:21:55 +0800 Subject: [PATCH 144/438] IssueNo: #I5RT32 Description: add AbilityConstant Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- api/@ohos.app.ability.AbilityConstant.d.ts | 121 +++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 api/@ohos.app.ability.AbilityConstant.d.ts diff --git a/api/@ohos.app.ability.AbilityConstant.d.ts b/api/@ohos.app.ability.AbilityConstant.d.ts new file mode 100644 index 0000000000..515d419899 --- /dev/null +++ b/api/@ohos.app.ability.AbilityConstant.d.ts @@ -0,0 +1,121 @@ +/* + * 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. + */ + +/** + * The definition of AbilityConstant. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission N/A + * @StageModelOnly + */ +declare namespace AbilityConstant { + /** + * Interface of launch param. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + export interface LaunchParam { + /** + * Indicates launch reason. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + launchReason: LaunchReason; + + /** + * Indicates last exit reason. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + lastExitReason: LastExitReason; + } + + /** + * Type of launch reason. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + export enum LaunchReason { + UNKNOWN = 0, + START_ABILITY = 1, + CALL = 2, + CONTINUATION = 3, + } + + /** + * Type of last exit reason. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + export enum LastExitReason { + UNKNOWN = 0, + ABILITY_NOT_RESPONDING = 1, + NORMAL = 2, + } + + /** + * Type of onContinue result. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + export enum OnContinueResult { + AGREE = 0, + REJECT = 1, + MISMATCH = 2, + } + + /** + * Type of memory level. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + export enum MemoryLevel { + MEMORY_LEVEL_MODERATE = 0, + MEMORY_LEVEL_LOW = 1, + MEMORY_LEVEL_CRITICAL = 2, + } + + /** + * Type of window mode. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + export enum WindowMode { + WINDOW_MODE_UNDEFINED = 0, + WINDOW_MODE_FULLSCREEN = 1, + WINDOW_MODE_SPLIT_PRIMARY = 100, + WINDOW_MODE_SPLIT_SECONDARY = 101, + WINDOW_MODE_FLOATING = 102, + } +} + +export default AbilityConstant -- Gitee From 8faa6841f281fcf20cd549a1452d17058421005f Mon Sep 17 00:00:00 2001 From: yangzk Date: Mon, 17 Oct 2022 16:24:24 +0800 Subject: [PATCH 145/438] IssueNo: #I5RT32 Description: fix jsdoc for AbilityConstant Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- api/@ohos.app.ability.AbilityConstant.d.ts | 53 ++++++++++------------ 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/api/@ohos.app.ability.AbilityConstant.d.ts b/api/@ohos.app.ability.AbilityConstant.d.ts index 515d419899..f5c61caeb2 100644 --- a/api/@ohos.app.ability.AbilityConstant.d.ts +++ b/api/@ohos.app.ability.AbilityConstant.d.ts @@ -15,46 +15,43 @@ /** * The definition of AbilityConstant. - * - * @since 9 + * @namespace AbilityConstant * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A - * @StageModelOnly + * @stagemodelonly + * @since 9 */ declare namespace AbilityConstant { /** * Interface of launch param. - * - * @since 9 + * @typedef LaunchParam * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ export interface LaunchParam { /** * Indicates launch reason. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ launchReason: LaunchReason; /** * Indicates last exit reason. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ lastExitReason: LastExitReason; } /** * Type of launch reason. - * - * @since 9 + * @enum { number } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ export enum LaunchReason { UNKNOWN = 0, @@ -65,10 +62,10 @@ declare namespace AbilityConstant { /** * Type of last exit reason. - * - * @since 9 + * @enum { number } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ export enum LastExitReason { UNKNOWN = 0, @@ -78,10 +75,10 @@ declare namespace AbilityConstant { /** * Type of onContinue result. - * - * @since 9 + * @enum { number } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ export enum OnContinueResult { AGREE = 0, @@ -91,10 +88,10 @@ declare namespace AbilityConstant { /** * Type of memory level. - * - * @since 9 + * @enum { number } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ export enum MemoryLevel { MEMORY_LEVEL_MODERATE = 0, @@ -104,10 +101,10 @@ declare namespace AbilityConstant { /** * Type of window mode. - * - * @since 9 + * @enum { number } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ export enum WindowMode { WINDOW_MODE_UNDEFINED = 0, -- Gitee From 948221fccc3e0c840363b197a5a09d16855bc17c Mon Sep 17 00:00:00 2001 From: yangzk Date: Mon, 17 Oct 2022 16:25:40 +0800 Subject: [PATCH 146/438] IssueNo: #I5RT32 Description: add abilityDelegatorRegistry Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- ....app.ability.abilityDelegatorRegistry.d.ts | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 api/@ohos.app.ability.abilityDelegatorRegistry.d.ts diff --git a/api/@ohos.app.ability.abilityDelegatorRegistry.d.ts b/api/@ohos.app.ability.abilityDelegatorRegistry.d.ts new file mode 100644 index 0000000000..ad936320c5 --- /dev/null +++ b/api/@ohos.app.ability.abilityDelegatorRegistry.d.ts @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2021 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 { 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 + * during application startup. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @import import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + * @permission N/A + */ +declare namespace abilityDelegatorRegistry { + /** + * Get the AbilityDelegator object of the application. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @return the AbilityDelegator object initialized when the application is started. + */ + function getAbilityDelegator(): AbilityDelegator; + + /** + * Get unit test parameters stored in the AbilityDelegatorArgs object. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @return the previously registered AbilityDelegatorArgs object. + */ + function getArguments(): AbilityDelegatorArgs; + + /** + * Describes all lifecycle states of an ability. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + */ + export enum AbilityLifecycleState { + UNINITIALIZED, + CREATE, + FOREGROUND, + 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 -- Gitee From b31e02aaa11dc146723dbd7a7eccbdbf91bb49f8 Mon Sep 17 00:00:00 2001 From: yangzk Date: Mon, 17 Oct 2022 16:29:42 +0800 Subject: [PATCH 147/438] IssueNo: #I5RT32 Description: fix jsdoc for abilityDelegatorRegistry Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- ....app.ability.abilityDelegatorRegistry.d.ts | 38 +++++++------------ 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/api/@ohos.app.ability.abilityDelegatorRegistry.d.ts b/api/@ohos.app.ability.abilityDelegatorRegistry.d.ts index ad936320c5..5d4d9147aa 100644 --- a/api/@ohos.app.ability.abilityDelegatorRegistry.d.ts +++ b/api/@ohos.app.ability.abilityDelegatorRegistry.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * 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 @@ -21,36 +21,32 @@ import { ShellCmdResult as _ShellCmdResult } from './application/shellCmdResult' /** * A global register used to store the AbilityDelegator and AbilityDelegatorArgs objects registered * during application startup. - * - * @since 8 + * @namespace abilityDelegatorRegistry * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @import import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - * @permission N/A + * @since 9 */ declare namespace abilityDelegatorRegistry { /** * Get the AbilityDelegator object of the application. - * - * @since 8 + * @returns { AbilityDelegator } Return the AbilityDelegator object initialized when the application is started. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return the AbilityDelegator object initialized when the application is started. + * @since 9 */ function getAbilityDelegator(): AbilityDelegator; /** * Get unit test parameters stored in the AbilityDelegatorArgs object. - * - * @since 8 + * @returns { AbilityDelegator } Return the previously registered AbilityDelegatorArgs object. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return the previously registered AbilityDelegatorArgs object. + * @since 9 */ function getArguments(): AbilityDelegatorArgs; /** * Describes all lifecycle states of an ability. - * - * @since 8 + * @enum { number } * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 */ export enum AbilityLifecycleState { UNINITIALIZED, @@ -62,38 +58,30 @@ declare namespace abilityDelegatorRegistry { /** * 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' + * @since 9 */ 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' + * @since 9 */ 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' + * @since 9 */ 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' + * @since 9 */ export type ShellCmdResult = _ShellCmdResult } -- Gitee From 7dee85f984ca2153bde83a367829e08d11971b7c Mon Sep 17 00:00:00 2001 From: yangzk Date: Mon, 17 Oct 2022 16:31:07 +0800 Subject: [PATCH 148/438] IssueNo: #I5RT32 Description: add AbilityLifecycleCallback Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- ....app.ability.AbilityLifecycleCallback.d.ts | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 api/@ohos.app.ability.AbilityLifecycleCallback.d.ts diff --git a/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts b/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts new file mode 100644 index 0000000000..39cd4eb594 --- /dev/null +++ b/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts @@ -0,0 +1,121 @@ +/* + * 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 Ability from "./@ohos.application.Ability"; +import dataAbility from "./@ohos.data.dataAbility"; +import window from './@ohos.window'; + +/** + * The ability lifecycle callback. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission N/A + */ +export default class AbilityLifecycleCallback { + /** + * Called back when an ability is started for initialization. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param ability: Indicates the ability to register for listening. + * @StageModelOnly + */ + onAbilityCreate(ability: Ability): void; + + /** + * Called back when a window stage is created. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param ability: Indicates the ability to register for listening. + * @param windowStage window stage to create + * @StageModelOnly + */ + onWindowStageCreate(ability: Ability, windowStage: window.WindowStage): void; + + /** + * Called back when a window stage is actived. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param ability: Indicates the ability to register for listening. + * @param windowStage window stage to active + * @StageModelOnly + */ + onWindowStageActive(ability: Ability, windowStage: window.WindowStage): void; + + /** + * Called back when a window stage is inactived. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param ability: Indicates the ability to register for listening. + * @param windowStage window stage to inactive + * @StageModelOnly + */ + onWindowStageInactive(ability: Ability, windowStage: window.WindowStage): void; + + /** + * Called back when a window stage is destroyed. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param ability: Indicates the ability to register for listening. + * @param windowStage window stage to destroy + * @StageModelOnly + */ + onWindowStageDestroy(ability: Ability, windowStage: window.WindowStage): void; + + /** + * Called back when an ability is destroyed. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param ability: Indicates the ability to register for listening. + * @StageModelOnly + */ + onAbilityDestroy(ability: Ability): void; + + /** + * Called back when the state of an ability changes to foreground. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param ability: Indicates the ability to register for listening. + * @StageModelOnly + */ + onAbilityForeground(ability: Ability): void; + + /** + * Called back when the state of an ability changes to background. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param ability: Indicates the ability to register for listening. + * @StageModelOnly + */ + onAbilityBackground(ability: Ability): void; + + /** + * Called back when an ability prepares to continue. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param ability: Indicates the ability to register for listening. + * @StageModelOnly + */ + onAbilityContinue(ability: Ability): void; +} \ No newline at end of file -- Gitee From edd24c199435d0034846b2cb6679f43eff98aa5a Mon Sep 17 00:00:00 2001 From: yangzk Date: Mon, 17 Oct 2022 16:36:06 +0800 Subject: [PATCH 149/438] IssueNo: #I5RT32 Description: fix jsdoc for AbilityLifecycleCallback Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- ....app.ability.AbilityLifecycleCallback.d.ts | 78 ++++++++----------- 1 file changed, 34 insertions(+), 44 deletions(-) diff --git a/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts b/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts index 39cd4eb594..a94e3e71d4 100644 --- a/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts +++ b/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts @@ -13,109 +13,99 @@ * limitations under the License. */ -import Ability from "./@ohos.application.Ability"; +import Ability from "./@ohos.app.ability.Ability"; import dataAbility from "./@ohos.data.dataAbility"; import window from './@ohos.window'; /** * The ability lifecycle callback. - * + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A */ export default class AbilityLifecycleCallback { /** * Called back when an ability is started for initialization. - * - * @since 9 + * @param { Ability } ability - Indicates the ability to register for listening. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @param ability: Indicates the ability to register for listening. - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onAbilityCreate(ability: Ability): void; /** * Called back when a window stage is created. - * - * @since 9 + * @param { Ability } ability - Indicates the ability to register for listening. + * @param { window.WindowStage } windowStage - window stage to create * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @param ability: Indicates the ability to register for listening. - * @param windowStage window stage to create - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onWindowStageCreate(ability: Ability, windowStage: window.WindowStage): void; /** * Called back when a window stage is actived. - * - * @since 9 + * @param { Ability } ability - Indicates the ability to register for listening. + * @param { window.WindowStage } windowStage - window stage to active * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @param ability: Indicates the ability to register for listening. - * @param windowStage window stage to active - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onWindowStageActive(ability: Ability, windowStage: window.WindowStage): void; /** * Called back when a window stage is inactived. - * - * @since 9 + * @param { Ability } ability - Indicates the ability to register for listening. + * @param { window.WindowStage } windowStage - window stage to inactive * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @param ability: Indicates the ability to register for listening. - * @param windowStage window stage to inactive - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onWindowStageInactive(ability: Ability, windowStage: window.WindowStage): void; /** * Called back when a window stage is destroyed. - * - * @since 9 + * @param { Ability } ability - Indicates the ability to register for listening. + * @param { window.WindowStage } windowStage - window stage to destroy * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @param ability: Indicates the ability to register for listening. - * @param windowStage window stage to destroy - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onWindowStageDestroy(ability: Ability, windowStage: window.WindowStage): void; /** * Called back when an ability is destroyed. - * - * @since 9 + * @param { Ability } ability - Indicates the ability to register for listening. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @param ability: Indicates the ability to register for listening. - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onAbilityDestroy(ability: Ability): void; /** * Called back when the state of an ability changes to foreground. - * - * @since 9 + * @param { Ability } ability - Indicates the ability to register for listening. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @param ability: Indicates the ability to register for listening. - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onAbilityForeground(ability: Ability): void; /** * Called back when the state of an ability changes to background. - * - * @since 9 + * @param { Ability } ability - Indicates the ability to register for listening. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @param ability: Indicates the ability to register for listening. - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onAbilityBackground(ability: Ability): void; /** * Called back when an ability prepares to continue. - * - * @since 9 + * @param { Ability } ability - Indicates the ability to register for listening. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @param ability: Indicates the ability to register for listening. - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onAbilityContinue(ability: Ability): void; } \ No newline at end of file -- Gitee From 326a6d1af2a696a2af46eb12341564b35f9b102e Mon Sep 17 00:00:00 2001 From: yangzk Date: Mon, 17 Oct 2022 16:41:13 +0800 Subject: [PATCH 150/438] IssueNo: #I5RT32 Description: add AbilityStage Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- api/@ohos.app.ability.AbilityStage.d.ts | 84 +++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 api/@ohos.app.ability.AbilityStage.d.ts diff --git a/api/@ohos.app.ability.AbilityStage.d.ts b/api/@ohos.app.ability.AbilityStage.d.ts new file mode 100644 index 0000000000..a0369329ce --- /dev/null +++ b/api/@ohos.app.ability.AbilityStage.d.ts @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import AbilityConstant from "./@ohos.application.AbilityConstant"; +import AbilityStageContext from "./application/AbilityStageContext"; +import Want from './@ohos.application.Want'; +import { Configuration } from './@ohos.application.Configuration'; + +/** + * The class of an ability stage. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission N/A + * @StageModelOnly + */ +export default class AbilityStage { + /** + * Indicates configuration information about context. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + context: AbilityStageContext; + + /** + * Called back when an ability stage is started for initialization. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @return - + * @StageModelOnly + */ + onCreate(): void; + + /** + * Called back when start specified ability. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the want info of startd ability. + * @return The user returns an ability string ID. If the ability of this ID has been started before, + * do not create a new instance and pull it back to the top of the stack. + * Otherwise, create a new instance and start it. + * @StageModelOnly + */ + onAcceptWant(want: Want): string; + + /** + * Called when the system configuration is updated. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param config Indicates the updated configuration. + * @return - + * @StageModelOnly + */ + onConfigurationUpdated(config: Configuration): void; + + /** + * Called when the system has determined to trim the memory, for example, when the ability is running in the + * background and there is no enough memory for running as many background processes as possible. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param level Indicates the memory trim level, which shows the current memory usage status. + * @return - + * @StageModelOnly + */ + onMemoryLevel(level: AbilityConstant.MemoryLevel): void; +} -- Gitee From c42092a928881a7e3661df5ec5de05c6fbb7a9f0 Mon Sep 17 00:00:00 2001 From: yangzk Date: Mon, 17 Oct 2022 16:51:36 +0800 Subject: [PATCH 151/438] IssueNo: #I5RT32 Description: fix jsdoc for AbilityStage Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- api/@ohos.app.ability.AbilityStage.d.ts | 49 ++++++++++--------------- 1 file changed, 20 insertions(+), 29 deletions(-) diff --git a/api/@ohos.app.ability.AbilityStage.d.ts b/api/@ohos.app.ability.AbilityStage.d.ts index a0369329ce..be54070e1d 100644 --- a/api/@ohos.app.ability.AbilityStage.d.ts +++ b/api/@ohos.app.ability.AbilityStage.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -20,65 +20,56 @@ import { Configuration } from './@ohos.application.Configuration'; /** * The class of an ability stage. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A - * @StageModelOnly + * @stagemodelonly + * @since 9 */ export default class AbilityStage { /** * Indicates configuration information about context. - * - * @since 9 + * @type { AbilityStageContext } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @StageModelOnly + * @stagemodelonly + * @since 9 */ context: AbilityStageContext; /** * Called back when an ability stage is started for initialization. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onCreate(): void; /** * Called back when start specified ability. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want info of startd ability. - * @return The user returns an ability string ID. If the ability of this ID has been started before, + * @param { Want } want - Indicates the want info of startd ability. + * @return { string } The user returns an ability string ID. If the ability of this ID has been started before, * do not create a new instance and pull it back to the top of the stack. * Otherwise, create a new instance and start it. - * @StageModelOnly + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 */ onAcceptWant(want: Want): string; /** * Called when the system configuration is updated. - * - * @since 9 + * @param { Configuration } config - Indicates the updated configuration. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param config Indicates the updated configuration. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onConfigurationUpdated(config: Configuration): void; /** * Called when the system has determined to trim the memory, for example, when the ability is running in the * background and there is no enough memory for running as many background processes as possible. - * + * @param { AbilityConstant.MemoryLevel } level - Indicates the memory trim level, which shows the current memory usage status. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @param level Indicates the memory trim level, which shows the current memory usage status. - * @return - - * @StageModelOnly */ - onMemoryLevel(level: AbilityConstant.MemoryLevel): void; + onMemoryLevel(level: AbilityConstant.MemoryLevel): void; } -- Gitee From 85aec8b3910a5e56da9147de85ba854b05e5ff79 Mon Sep 17 00:00:00 2001 From: yangzk Date: Mon, 17 Oct 2022 16:58:12 +0800 Subject: [PATCH 152/438] IssueNo: #I5RT32 Description: add common Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- api/@ohos.app.ability.common.d.ts | 125 ++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100755 api/@ohos.app.ability.common.d.ts diff --git a/api/@ohos.app.ability.common.d.ts b/api/@ohos.app.ability.common.d.ts new file mode 100755 index 0000000000..698635543d --- /dev/null +++ b/api/@ohos.app.ability.common.d.ts @@ -0,0 +1,125 @@ +/* + * 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'; +import * as _EventHub from './application/EventHub'; +import * as _PermissionRequestResult from './application/PermissionRequestResult'; + +/** + * The context of an application. It allows access to application-specific resources. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ +declare namespace common { + + /** + * The context of an ability. It allows access to ability-specific resources. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + export type AbilityContext = _AbilityContext.default + + /** + * The context of an abilityStage. It allows access to abilityStage-specific resources. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + export type AbilityStageContext = _AbilityStageContext.default + + /** + * The context of an application. It allows access to application-specific resources. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + export type ApplicationContext = _ApplicationContext.default + + /** + * The base context of 'app.Context' for FA Mode or 'application.Context' for Stage Mode. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 + */ + export type BaseContext = _BaseContext.default + + /** + * The base context of an ability or an application. It allows access to + * application-specific resources. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + export type Context = _Context.default + + /** + * The context of an extension. It allows access to extension-specific resources. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + export type ExtensionContext = _ExtensionContext.default + + /** + * The context of form extension. It allows access to + * formExtension-specific resources. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + export type FormExtensionContext = _FormExtensionContext.default + + /** + * File area mode + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + 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. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + export type EventHub = _EventHub.default + + /** + * The result of requestPermissionsFromUser with asynchronous callback. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + export type PermissionRequestResult = _PermissionRequestResult.default +} + +export default common; -- Gitee From 074350d15d9c55b2cb71aaf4c2781bd897fdc41a Mon Sep 17 00:00:00 2001 From: yangzk Date: Mon, 17 Oct 2022 16:59:09 +0800 Subject: [PATCH 153/438] IssueNo: #I5RT32 Description: add EnvironmentCallback Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- ...@ohos.app.ability.EnvironmentCallback.d.ts | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 api/@ohos.app.ability.EnvironmentCallback.d.ts diff --git a/api/@ohos.app.ability.EnvironmentCallback.d.ts b/api/@ohos.app.ability.EnvironmentCallback.d.ts new file mode 100755 index 0000000000..e2c910976b --- /dev/null +++ b/api/@ohos.app.ability.EnvironmentCallback.d.ts @@ -0,0 +1,35 @@ +/* + * 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 { Configuration } from './@ohos.application.Configuration'; + +/** + * The environment callback. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @permission N/A + */ +export default class EnvironmentCallback { + /** + * Called when the system configuration is updated. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param config: Indicates the updated configuration. + * @StageModelOnly + */ + onConfigurationUpdated(config: Configuration): void; +} -- Gitee From 3ae71d9dbab611367262cd80aee161de9389f805 Mon Sep 17 00:00:00 2001 From: yangzk Date: Mon, 17 Oct 2022 17:00:52 +0800 Subject: [PATCH 154/438] IssueNo: #I5RT32 Description: fix jsdoc for EnvironmentCallback Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- api/@ohos.app.ability.EnvironmentCallback.d.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/api/@ohos.app.ability.EnvironmentCallback.d.ts b/api/@ohos.app.ability.EnvironmentCallback.d.ts index e2c910976b..1e1a9419ad 100755 --- a/api/@ohos.app.ability.EnvironmentCallback.d.ts +++ b/api/@ohos.app.ability.EnvironmentCallback.d.ts @@ -17,19 +17,16 @@ import { Configuration } from './@ohos.application.Configuration'; /** * The environment callback. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @permission N/A + * @since 9 */ export default class EnvironmentCallback { /** * Called when the system configuration is updated. - * - * @since 9 + * @param { Configuration } config - Indicates the updated configuration. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @param config: Indicates the updated configuration. - * @StageModelOnly + * @stagemodelonly + * @since 9 */ - onConfigurationUpdated(config: Configuration): void; + onConfigurationUpdated(config: Configuration): void; } -- Gitee From 32c8d37a673a4a1b1b58b6b4525e294363f9f17b Mon Sep 17 00:00:00 2001 From: yangzk Date: Mon, 17 Oct 2022 17:04:03 +0800 Subject: [PATCH 155/438] IssueNo: #I5RT32 Description: add ExtensionAbility Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- api/@ohos.app.ability.ExtensionAbility.d.ts | 44 +++++++++++++++++++++ api/@ohos.app.ability.common.d.ts | 18 ++++----- 2 files changed, 53 insertions(+), 9 deletions(-) create mode 100644 api/@ohos.app.ability.ExtensionAbility.d.ts diff --git a/api/@ohos.app.ability.ExtensionAbility.d.ts b/api/@ohos.app.ability.ExtensionAbility.d.ts new file mode 100644 index 0000000000..744d45605a --- /dev/null +++ b/api/@ohos.app.ability.ExtensionAbility.d.ts @@ -0,0 +1,44 @@ +/* + * 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 AbilityConstant from "./@ohos.application.AbilityConstant"; +import { Configuration } from './@ohos.application.Configuration'; + +/** + * class of extension. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ +export default class ExtensionAbility { + /** + * Called when the system configuration is updated. + * @param { Configuration } newConfig - Indicates the updated configuration. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + onConfigurationUpdated(newConfig: Configuration): void; + + /** + * Called when the system has determined to trim the memory, for example, when the ability is running in the + * background and there is no enough memory for running as many background processes as possible. + * @param { AbilityConstant.MemoryLevel } level - Indicates the memory trim level, which shows the current memory usage status. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + onMemoryLevel(level: AbilityConstant.MemoryLevel): void; +} \ No newline at end of file diff --git a/api/@ohos.app.ability.common.d.ts b/api/@ohos.app.ability.common.d.ts index 698635543d..7c2d786101 100755 --- a/api/@ohos.app.ability.common.d.ts +++ b/api/@ohos.app.ability.common.d.ts @@ -13,15 +13,15 @@ * 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'; -import * as _EventHub from './application/EventHub'; -import * as _PermissionRequestResult from './application/PermissionRequestResult'; +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'; +import * as _EventHub from './application/EventHub'; +import * as _PermissionRequestResult from './application/PermissionRequestResult'; /** * The context of an application. It allows access to application-specific resources. -- Gitee From 8715487baf729b237bb91d2b86167cfc030207f8 Mon Sep 17 00:00:00 2001 From: yangzk Date: Mon, 17 Oct 2022 17:10:21 +0800 Subject: [PATCH 156/438] IssueNo: #I5RT32 Description: fix jsdoc for FormExtensionAbility Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- api/@ohos.app.form.FormExtensionAbility.d.ts | 114 ++++++++----------- 1 file changed, 49 insertions(+), 65 deletions(-) diff --git a/api/@ohos.app.form.FormExtensionAbility.d.ts b/api/@ohos.app.form.FormExtensionAbility.d.ts index 56dacc5b62..a3d519049a 100644 --- a/api/@ohos.app.form.FormExtensionAbility.d.ts +++ b/api/@ohos.app.form.FormExtensionAbility.d.ts @@ -21,134 +21,118 @@ import { Configuration } from './@ohos.application.Configuration'; /** * class of form extension. - * - * @since 9 * @syscap SystemCapability.Ability.Form - * @StageModelOnly + * @stagemodelonly + * @since 9 */ export default class FormExtensionAbility { /** * Indicates form extension context. - * - * @since 9 + * @type { FormExtensionContext } * @syscap SystemCapability.Ability.Form - * @StageModelOnly + * @stagemodelonly + * @since 9 */ context: FormExtensionContext; /** * Called to return a {@link formBindingData#FormBindingData} object. - * - * @since 9 + * @param { Want } want - Indicates the detailed information for creating a {@link formBindingData#FormBindingData}. + * The {@code Want} object must include the form ID, form name, and grid style of the form. + * Such form information must be managed as persistent data for further form + * acquisition, update, and deletion. + * @return { formBindingData.FormBindingData } Returns the created {@link formBindingData#FormBindingData} object. * @syscap SystemCapability.Ability.Form - * @param want Indicates the detailed information for creating a {@link formBindingData#FormBindingData}. - * The {@code Want} object must include the form ID, form name, and grid style of the form. - * Such form information must be managed as persistent data for further form - * acquisition, update, and deletion. - * @return Returns the created {@link formBindingData#FormBindingData} object. - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onAddForm(want: Want): formBindingData.FormBindingData; /** * Called when the form provider is notified that a temporary form is successfully converted to a normal form. - * - * @since 9 + * @param { string } formId - Indicates the ID of the form. * @syscap SystemCapability.Ability.Form - * @param formId Indicates the ID of the form. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onCastToNormalForm(formId: string): void; /** * Called to notify the form provider to update a specified form. - * - * @since 9 + * @param { string } formId - Indicates the ID of the form to update. * @syscap SystemCapability.Ability.Form - * @param formId Indicates the ID of the form to update. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onUpdateForm(formId: string): void; /** * Called when the form provider receives form events from the system. - * - * @since 9 + * @param { { [key: string]: number } } newStatus - Indicates the form events occurred. The key in the {@code Map} + * object indicates the form ID, and the value indicates the event type, which can be either + * {@link formInfo#VisibilityType#FORM_VISIBLE} or {@link formInfo#VisibilityType#FORM_INVISIBLE}. + * {@link formInfo#VisibilityType#FORM_VISIBLE} means that the form becomes visible, and + * {@link formInfo#VisibilityType#FORM_INVISIBLE} means that the form becomes invisible. * @syscap SystemCapability.Ability.Form - * @param newStatus Indicates the form events occurred. The key in the {@code Map} object indicates the form ID, - * and the value indicates the event type, which can be either {@link formInfo#VisibilityType#FORM_VISIBLE} - * or {@link formInfo#VisibilityType#FORM_INVISIBLE}. {@link formInfo#VisibilityType#FORM_VISIBLE} - * means that the form becomes visible, and {@link formInfo#VisibilityType#FORM_INVISIBLE} - * means that the form becomes invisible. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onChangeFormVisibility(newStatus: { [key: string]: number }): void; /** * Called when a specified message event defined by the form provider is triggered. This method is valid only for * JS forms. - * - * @since 9 + * @param { string } formId - Indicates the ID of the form on which the message event is triggered, which is + * provided by the client to the form provider. + * @param { string } message - Indicates the value of the {@code params} field of the message event. This parameter + * is used to identify the specific component on which the event is triggered. * @syscap SystemCapability.Ability.Form - * @param formId Indicates the ID of the form on which the message event is triggered, which is provided by - * the client to the form provider. - * @param message Indicates the value of the {@code params} field of the message event. This parameter is - * used to identify the specific component on which the event is triggered. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onFormEvent(formId: string, message: string): void; /** * Called to notify the form provider that a specified form has been destroyed. Override this method if * you want your application, as the form provider, to be notified of form deletion. - * - * @since 9 + * @param { string } formId - Indicates the ID of the destroyed form. * @syscap SystemCapability.Ability.Form - * @param formId Indicates the ID of the destroyed form. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onRemoveForm(formId: string): void; /** * Called when the system configuration is updated. - * - * @since 9 + * @param { Configuration } config - Indicates the system configuration, such as language and color mode. * @syscap SystemCapability.Ability.Form - * @param configuration Indicates the system configuration, such as language and color mode. - * @return - - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onConfigurationUpdated(config: Configuration): void; /** * Called to return a {@link FormState} object. - * *

You must override this callback if you want this ability to return the actual form state. Otherwise, * this method returns {@link FormState#DEFAULT} by default.

- * - * @since 9 + * @param { Want } want - Indicates the description of the form for which the {@link formInfo#FormState} + * is obtained. The description covers the bundle name, ability name, module name, + * form name, and form dimensions. + * @return { formInfo.FormState } Returns the {@link formInfo#FormState} object. * @syscap SystemCapability.Ability.Form - * @param want Indicates the description of the form for which the {@link formInfo#FormState} is obtained. - * The description covers the bundle name, ability name, module name, form name, and form dimensions. - * @return Returns the {@link formInfo#FormState} object. - * @StageModelOnly + * @stagemodelonly + * @since 9 */ onAcquireFormState?(want: Want): formInfo.FormState; /** * Called when the system shares the form. - * - * @since 9 + * @param { string } formId - Indicates the ID of the form. + * @return { { [key: string]: any } } Returns the wantParams object. * @syscap SystemCapability.Ability.Form - * @param formId Indicates the ID of the form. - * @systemapi hide for inner use. - * @return Returns the wantParams object. - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ - onFormToBeShared?(formId: string): {[key: string]: any}; + onFormToBeShared?(formId: string): { [key: string]: any }; } -- Gitee From 7d6964f0c933e296bfdb55a0e818ba01d0a9271d Mon Sep 17 00:00:00 2001 From: yangzk Date: Mon, 17 Oct 2022 19:06:52 +0800 Subject: [PATCH 157/438] IssueNo: #I5RT32 Description: add ServiceExtensionAbility Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- ...s.app.ability.ServiceExtensionAbility.d.ts | 137 ++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 api/@ohos.app.ability.ServiceExtensionAbility.d.ts diff --git a/api/@ohos.app.ability.ServiceExtensionAbility.d.ts b/api/@ohos.app.ability.ServiceExtensionAbility.d.ts new file mode 100644 index 0000000000..d7d512ca8f --- /dev/null +++ b/api/@ohos.app.ability.ServiceExtensionAbility.d.ts @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import rpc from "./@ohos.rpc"; +import ServiceExtensionContext from "./application/ServiceExtensionContext"; +import Want from './@ohos.application.Want'; +import { Configuration } from './@ohos.application.Configuration'; + +/** + * class of service extension ability. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide for inner use. + * @StageModelOnly + */ +export default class ServiceExtensionAbility { + /** + * Indicates service extension ability context. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide for inner use. + * @StageModelOnly + */ + context: ServiceExtensionContext; + + /** + * Called back when a service extension is started for initialization. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the want of created service extension. + * @systemapi hide for inner use. + * @return - + * @StageModelOnly + */ + onCreate(want: Want): void; + + /** + * Called back before a service extension is destroyed. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi hide for inner use. + * @return - + * @StageModelOnly + */ + onDestroy(): void; + + /** + * Called back when a service extension is started. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the want of service extension to start. + * @param startId Indicates the number of times the service extension has been started. The {@code startId} is + * incremented by 1 every time the service extension is started. For example, if the service extension + * has been started for six times. + * @systemapi hide for inner use. + * @return - + * @StageModelOnly + */ + onRequest(want: Want, startId: number): void; + + /** + * Called back when a service extension is first connected to an ability. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates connection information about the Service ability. + * @systemapi hide for inner use. + * @return Returns the proxy of the Service ability. + * @StageModelOnly + */ + onConnect(want: Want): rpc.RemoteObject; + + /** + * Called back when all abilities connected to a service extension are disconnected. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates disconnection information about the service extension. + * @systemapi hide for inner use. + * @return - + * @StageModelOnly + */ + onDisconnect(want: Want): void; + + /** + * Called when a new client attempts to connect to a service extension after all previous client connections to it + * are disconnected. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the want of the service extension being connected. + * @systemapi hide for inner use. + * @return - + * @StageModelOnly + */ + onReconnect(want: Want): void; + + /** + * Called when the system configuration is updated. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param config Indicates the updated configuration. + * @return - + * @StageModelOnly + */ + onConfigurationUpdated(config: Configuration): void; + + /** + * Called when dump client information is required. + * It is recommended that developers don't DUMP sensitive information. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param params Indicates the params from command. + * @return The dump info array. + * @StageModelOnly + */ + onDump(params: Array): Array; +} -- Gitee From 0a0bf8691bfabe42b6e3d3a601c5fb62424c9bcf Mon Sep 17 00:00:00 2001 From: yangzk Date: Mon, 17 Oct 2022 19:11:12 +0800 Subject: [PATCH 158/438] IssueNo: #I5RT32 Description: fix jsdoc for ServiceExtensionAbility Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- ...s.app.ability.ServiceExtensionAbility.d.ts | 99 ++++++++----------- 1 file changed, 42 insertions(+), 57 deletions(-) diff --git a/api/@ohos.app.ability.ServiceExtensionAbility.d.ts b/api/@ohos.app.ability.ServiceExtensionAbility.d.ts index d7d512ca8f..3675c902d0 100644 --- a/api/@ohos.app.ability.ServiceExtensionAbility.d.ts +++ b/api/@ohos.app.ability.ServiceExtensionAbility.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -20,118 +20,103 @@ import { Configuration } from './@ohos.application.Configuration'; /** * class of service extension ability. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide for inner use. - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ export default class ServiceExtensionAbility { /** * Indicates service extension ability context. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide for inner use. - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ context: ServiceExtensionContext; /** * Called back when a service extension is started for initialization. - * - * @since 9 + * @param { Want } want - Indicates the want of created service extension. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want of created service extension. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ onCreate(want: Want): void; /** * Called back before a service extension is destroyed. - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi hide for inner use. - * @return - - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ onDestroy(): void; /** * Called back when a service extension is started. - * - * @since 9 + * @param { Want } want - Indicates the want of service extension to start. + * @param { number } startId - Indicates the number of times the service extension has been started. + * The {@code startId} is incremented by 1 every time the service extension is started. + * For example, if the service extension has been started for six times. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want of service extension to start. - * @param startId Indicates the number of times the service extension has been started. The {@code startId} is - * incremented by 1 every time the service extension is started. For example, if the service extension - * has been started for six times. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ onRequest(want: Want, startId: number): void; /** * Called back when a service extension is first connected to an ability. - * - * @since 9 + * @param { Want } want - Indicates connection information about the Service ability. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates connection information about the Service ability. - * @systemapi hide for inner use. - * @return Returns the proxy of the Service ability. - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ onConnect(want: Want): rpc.RemoteObject; /** * Called back when all abilities connected to a service extension are disconnected. - * - * @since 9 + * @param { Want } want - Indicates disconnection information about the service extension. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates disconnection information about the service extension. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ onDisconnect(want: Want): void; /** * Called when a new client attempts to connect to a service extension after all previous client connections to it * are disconnected. - * - * @since 9 + * @param { Want } want - Indicates the want of the service extension being connected. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want of the service extension being connected. - * @systemapi hide for inner use. - * @return - - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ onReconnect(want: Want): void; /** * Called when the system configuration is updated. - * - * @since 9 + * @param { Configuration } config - Indicates the updated configuration. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param config Indicates the updated configuration. - * @return - - * @StageModelOnly + * @systemapi + * @stagemodelonly + * @since 9 */ onConfigurationUpdated(config: Configuration): void; /** * Called when dump client information is required. * It is recommended that developers don't DUMP sensitive information. - * + * @param { Array } params - Indicates the params from command. + * @return { Array } The dump info array. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @param params Indicates the params from command. - * @return The dump info array. - * @StageModelOnly */ onDump(params: Array): Array; } -- Gitee From d409b61bc78007a4833497b811787fc415487d82 Mon Sep 17 00:00:00 2001 From: yangzk Date: Mon, 17 Oct 2022 19:16:54 +0800 Subject: [PATCH 159/438] IssueNo: #I5RT32 Description: add StartOptions Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- api/@ohos.app.ability.StartOptions.d.ts | 38 +++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 api/@ohos.app.ability.StartOptions.d.ts diff --git a/api/@ohos.app.ability.StartOptions.d.ts b/api/@ohos.app.ability.StartOptions.d.ts new file mode 100644 index 0000000000..2650fce27a --- /dev/null +++ b/api/@ohos.app.ability.StartOptions.d.ts @@ -0,0 +1,38 @@ +/* + * 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. + */ + +/** + * StartOptions is the basic communication component of the system. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ +export default class StartOptions { + /** + * windowMode + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + windowMode?: number; + + /** + * displayId + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + displayId?: number; +} \ No newline at end of file -- Gitee From 6fdafac6d4c5be09980cdd0a1b1f3733b57dc356 Mon Sep 17 00:00:00 2001 From: yangzk Date: Mon, 17 Oct 2022 19:30:40 +0800 Subject: [PATCH 160/438] IssueNo: #I5RT32 Description: fix import Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- api/@ohos.app.ability.Ability.d.ts | 2 +- api/@ohos.app.ability.AbilityStage.d.ts | 2 +- api/@ohos.app.ability.ExtensionAbility.d.ts | 2 +- api/@ohos.app.ability.common.d.ts | 27 + api/@ohos.app.ability.missionManager.d.ts | 2 +- api/@ohos.app.form.formHost.d.ts | 2 +- api/@ohos.app.form.formProvider.d.ts | 2 +- api/@ohos.application.Ability.d.ts | 10 +- api/@ohos.application.AbilityConstant.d.ts | 2 + ....application.AbilityLifecycleCallback.d.ts | 2 + api/@ohos.application.AbilityStage.d.ts | 2 + ...@ohos.application.EnvironmentCallback.d.ts | 2 + api/@ohos.application.ExtensionAbility.d.ts | 2 + api/@ohos.application.FormExtension.d.ts | 2 + ...s.application.ServiceExtensionAbility.d.ts | 4 +- api/@ohos.application.StartOptions.d.ts | 2 + ....application.abilityDelegatorRegistry.d.ts | 2 + api/@ohos.application.abilityManager.d.ts | 2 +- api/@ohos.application.appManager.d.ts | 2 + api/@ohos.application.context.d.ts | 2 + api/@ohos.application.errorManager.d.ts | 2 +- api/@ohos.application.missionManager.d.ts | 2 +- api/@ohos.application.quickFixManager.d.ts | 155 ----- api/@ohos.wantAgent.d.ts | 2 +- api/ability/dataAbilityHelper.d.ts | 4 - api/ability/dataAbilityUtils.d.ts | 474 -------------- api/app/context.d.ts | 6 - api/app/featureAbilityContext.d.ts | 593 ------------------ 28 files changed, 65 insertions(+), 1248 deletions(-) delete mode 100644 api/@ohos.application.quickFixManager.d.ts delete mode 100644 api/ability/dataAbilityUtils.d.ts delete mode 100644 api/app/featureAbilityContext.d.ts diff --git a/api/@ohos.app.ability.Ability.d.ts b/api/@ohos.app.ability.Ability.d.ts index 9495a9745f..ee19b722b6 100755 --- a/api/@ohos.app.ability.Ability.d.ts +++ b/api/@ohos.app.ability.Ability.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import AbilityConstant from "./@ohos.application.AbilityConstant"; +import AbilityConstant from "./@ohos.app.ability.AbilityConstant"; import AbilityContext from "./application/AbilityContext"; import Want from './@ohos.application.Want'; import window from './@ohos.window'; diff --git a/api/@ohos.app.ability.AbilityStage.d.ts b/api/@ohos.app.ability.AbilityStage.d.ts index be54070e1d..cc9634994f 100644 --- a/api/@ohos.app.ability.AbilityStage.d.ts +++ b/api/@ohos.app.ability.AbilityStage.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import AbilityConstant from "./@ohos.application.AbilityConstant"; +import AbilityConstant from "./@ohos.app.ability.AbilityConstant"; import AbilityStageContext from "./application/AbilityStageContext"; import Want from './@ohos.application.Want'; import { Configuration } from './@ohos.application.Configuration'; diff --git a/api/@ohos.app.ability.ExtensionAbility.d.ts b/api/@ohos.app.ability.ExtensionAbility.d.ts index 744d45605a..5e7d6caf0b 100644 --- a/api/@ohos.app.ability.ExtensionAbility.d.ts +++ b/api/@ohos.app.ability.ExtensionAbility.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import AbilityConstant from "./@ohos.application.AbilityConstant"; +import AbilityConstant from "./@ohos.app.ability.AbilityConstant"; import { Configuration } from './@ohos.application.Configuration'; /** diff --git a/api/@ohos.app.ability.common.d.ts b/api/@ohos.app.ability.common.d.ts index 7c2d786101..1716916ce8 100755 --- a/api/@ohos.app.ability.common.d.ts +++ b/api/@ohos.app.ability.common.d.ts @@ -22,6 +22,9 @@ import * as _ExtensionContext from './application/ExtensionContext'; import * as _FormExtensionContext from './application/FormExtensionContext'; import * as _EventHub from './application/EventHub'; import * as _PermissionRequestResult from './application/PermissionRequestResult'; +import { PacMap as _PacMap } from "./ability/dataAbilityHelper"; +import { AbilityResult as _AbilityResult } from "./ability/abilityResult"; +import { ConnectOptions as _ConnectOptions } from "./ability/connectOptions"; /** * The context of an application. It allows access to application-specific resources. @@ -120,6 +123,30 @@ declare namespace common { * @since 9 */ export type PermissionRequestResult = _PermissionRequestResult.default + + /** + * Defines a PacMap object for storing a series of values. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + export type PacMap = _PacMap + + /** + * Indicates the result of startAbility. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + export type AbilityResult = _AbilityResult + + /** + * Indicates the callback of connection + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + export type ConnectOptions = _ConnectOptions } export default common; diff --git a/api/@ohos.app.ability.missionManager.d.ts b/api/@ohos.app.ability.missionManager.d.ts index d8fee24cb5..efbed8686f 100644 --- a/api/@ohos.app.ability.missionManager.d.ts +++ b/api/@ohos.app.ability.missionManager.d.ts @@ -17,7 +17,7 @@ import { AsyncCallback } from './basic'; 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"; +import StartOptions from "./@ohos.app.ability.StartOptions"; /** * This module provides the capability to manage abilities and obtaining system task information. diff --git a/api/@ohos.app.form.formHost.d.ts b/api/@ohos.app.form.formHost.d.ts index 3f696e72a4..dbc95cd2d2 100644 --- a/api/@ohos.app.form.formHost.d.ts +++ b/api/@ohos.app.form.formHost.d.ts @@ -16,7 +16,7 @@ import { AsyncCallback } from "./basic"; import { Callback } from "./basic"; import Want from './@ohos.application.Want'; -import formInfo from './@ohos.application.formInfo' +import formInfo from './@ohos.application.formInfo'; /** * Interface of formHost. diff --git a/api/@ohos.app.form.formProvider.d.ts b/api/@ohos.app.form.formProvider.d.ts index f2a87e039e..fb7f4dc857 100644 --- a/api/@ohos.app.form.formProvider.d.ts +++ b/api/@ohos.app.form.formProvider.d.ts @@ -16,7 +16,7 @@ import { AsyncCallback } from "./basic"; import formBindingData from "./@ohos.app.form.formBindingData"; import formInfo from "./@ohos.application.formInfo"; -import Want from "./@ohos.application.Want" +import Want from "./@ohos.application.Want"; /** * Interface of formProvider. diff --git a/api/@ohos.application.Ability.d.ts b/api/@ohos.application.Ability.d.ts index 1d74c2371f..f0c54d72a5 100755 --- a/api/@ohos.application.Ability.d.ts +++ b/api/@ohos.application.Ability.d.ts @@ -30,7 +30,7 @@ import rpc from './@ohos.rpc'; * @return - * @StageModelOnly * @deprecated since 9 - * @useinstead @ohos.app.ability.Ability + * @useinstead ohos.app.ability.Ability */ export interface OnReleaseCallBack { (msg: string): void; @@ -46,7 +46,7 @@ export interface OnReleaseCallBack { * @return rpc.Sequenceable * @StageModelOnly * @deprecated since 9 - * @useinstead @ohos.app.ability.Ability + * @useinstead ohos.app.ability.Ability */ export interface CalleeCallBack { (indata: rpc.MessageParcel): rpc.Sequenceable; @@ -60,7 +60,7 @@ export interface CalleeCallBack { * @permission N/A * @StageModelOnly * @deprecated since 9 - * @useinstead @ohos.app.ability.Ability + * @useinstead ohos.app.ability.Ability */ export interface Caller { /** @@ -117,7 +117,7 @@ export interface Caller { * @permission N/A * @StageModelOnly * @deprecated since 9 - * @useinstead @ohos.app.ability.Ability + * @useinstead ohos.app.ability.Ability */ export interface Callee { @@ -153,7 +153,7 @@ export interface Callee { * @permission N/A * @StageModelOnly * @deprecated since 9 - * @useinstead @ohos.app.ability.Ability + * @useinstead ohos.app.ability.Ability */ export default class Ability { /** diff --git a/api/@ohos.application.AbilityConstant.d.ts b/api/@ohos.application.AbilityConstant.d.ts index 2847a26649..1ee74d5e78 100644 --- a/api/@ohos.application.AbilityConstant.d.ts +++ b/api/@ohos.application.AbilityConstant.d.ts @@ -20,6 +20,8 @@ * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A * @StageModelOnly + * @deprecated since 9 + * @useinstead ohos.app.ability.AbilityConstant */ declare namespace AbilityConstant { /** diff --git a/api/@ohos.application.AbilityLifecycleCallback.d.ts b/api/@ohos.application.AbilityLifecycleCallback.d.ts index 33db234da5..4e1f22ac9c 100644 --- a/api/@ohos.application.AbilityLifecycleCallback.d.ts +++ b/api/@ohos.application.AbilityLifecycleCallback.d.ts @@ -23,6 +23,8 @@ import window from './@ohos.window'; * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A + * @deprecated since 9 + * @useinstead ohos.app.ability.AbilityLifecycleCallback */ export default class AbilityLifecycleCallback { /** diff --git a/api/@ohos.application.AbilityStage.d.ts b/api/@ohos.application.AbilityStage.d.ts index a0369329ce..8d7b4cc1c8 100644 --- a/api/@ohos.application.AbilityStage.d.ts +++ b/api/@ohos.application.AbilityStage.d.ts @@ -25,6 +25,8 @@ import { Configuration } from './@ohos.application.Configuration'; * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A * @StageModelOnly + * @deprecated since 9 + * @useinstead ohos.app.ability.AbilityStage */ export default class AbilityStage { /** diff --git a/api/@ohos.application.EnvironmentCallback.d.ts b/api/@ohos.application.EnvironmentCallback.d.ts index b19bd5792e..55f6504a70 100755 --- a/api/@ohos.application.EnvironmentCallback.d.ts +++ b/api/@ohos.application.EnvironmentCallback.d.ts @@ -21,6 +21,8 @@ import { Configuration } from './@ohos.application.Configuration'; * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A + * @deprecated since 9 + * @useinstead ohos.app.ability.EnvironmentCallback */ export default class EnvironmentCallback { /** diff --git a/api/@ohos.application.ExtensionAbility.d.ts b/api/@ohos.application.ExtensionAbility.d.ts index 3cfd0d9213..eda81a8ac3 100644 --- a/api/@ohos.application.ExtensionAbility.d.ts +++ b/api/@ohos.application.ExtensionAbility.d.ts @@ -22,6 +22,8 @@ import { Configuration } from './@ohos.application.Configuration'; * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @deprecated since 9 + * @useinstead ohos.app.ability.ExtensionAbility */ export default class ExtensionAbility { /** diff --git a/api/@ohos.application.FormExtension.d.ts b/api/@ohos.application.FormExtension.d.ts index 4c52a8387e..e3bbfc7fdc 100644 --- a/api/@ohos.application.FormExtension.d.ts +++ b/api/@ohos.application.FormExtension.d.ts @@ -25,6 +25,8 @@ import { Configuration } from './@ohos.application.Configuration'; * @since 9 * @syscap SystemCapability.Ability.Form * @StageModelOnly + * @deprecated since 9 + * @useinstead ohos.app.form.FormExtensionAbility */ export default class FormExtension { /** diff --git a/api/@ohos.application.ServiceExtensionAbility.d.ts b/api/@ohos.application.ServiceExtensionAbility.d.ts index 93d3064b2e..5b850b90f6 100644 --- a/api/@ohos.application.ServiceExtensionAbility.d.ts +++ b/api/@ohos.application.ServiceExtensionAbility.d.ts @@ -25,6 +25,8 @@ import { Configuration } from './@ohos.application.Configuration'; * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi hide for inner use. * @StageModelOnly + * @deprecated since 9 + * @useinstead ohos.app.ability.ServiceExtensionAbility */ export default class ServiceExtensionAbility { /** @@ -133,6 +135,6 @@ export default class ServiceExtensionAbility { * @return The dump info array. * @StageModelOnly */ - onDump(params: Array): Array; + dump(params: Array): Array; } diff --git a/api/@ohos.application.StartOptions.d.ts b/api/@ohos.application.StartOptions.d.ts index b4cd41bbce..0fc112e6d9 100644 --- a/api/@ohos.application.StartOptions.d.ts +++ b/api/@ohos.application.StartOptions.d.ts @@ -21,6 +21,8 @@ * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A * @StageModelOnly + * @deprecated since 9 + * @useinstead ohos.app.ability.StartOptions */ export default class StartOptions { /** diff --git a/api/@ohos.application.abilityDelegatorRegistry.d.ts b/api/@ohos.application.abilityDelegatorRegistry.d.ts index ad936320c5..d8d7a51a5b 100644 --- a/api/@ohos.application.abilityDelegatorRegistry.d.ts +++ b/api/@ohos.application.abilityDelegatorRegistry.d.ts @@ -26,6 +26,8 @@ import { ShellCmdResult as _ShellCmdResult } from './application/shellCmdResult' * @syscap SystemCapability.Ability.AbilityRuntime.Core * @import import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' * @permission N/A + * @deprecated since 9 + * @useinstead ohos.app.ability.abilityDelegatorRegistry */ declare namespace abilityDelegatorRegistry { /** diff --git a/api/@ohos.application.abilityManager.d.ts b/api/@ohos.application.abilityManager.d.ts index a161cc8290..dfa26ab42b 100644 --- a/api/@ohos.application.abilityManager.d.ts +++ b/api/@ohos.application.abilityManager.d.ts @@ -27,7 +27,7 @@ import { ElementName } from './bundle/elementName'; * @systemapi Hide this for inner system use * @permission N/A * @deprecated since 9 - * @useinstead @ohos.app.ability.abilityManager + * @useinstead ohos.app.ability.abilityManager */ declare namespace abilityManager { /** diff --git a/api/@ohos.application.appManager.d.ts b/api/@ohos.application.appManager.d.ts index 834a8ef58d..3be17cb201 100644 --- a/api/@ohos.application.appManager.d.ts +++ b/api/@ohos.application.appManager.d.ts @@ -27,6 +27,8 @@ import { ProcessRunningInformation as _ProcessRunningInformation } from './appli * @syscap SystemCapability.Ability.AbilityRuntime.Core * @import import appManager from '@ohos.application.appManager' * @permission N/A + * @deprecated since 9 + * @useinstead ohos.app.ability.appManager */ declare namespace appManager { /** diff --git a/api/@ohos.application.context.d.ts b/api/@ohos.application.context.d.ts index cae84c127a..d9fc6b0c6b 100755 --- a/api/@ohos.application.context.d.ts +++ b/api/@ohos.application.context.d.ts @@ -29,6 +29,8 @@ import * as _PermissionRequestResult from './application/PermissionRequestResul * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @StageModelOnly + * @deprecated since 9 + * @useinstead ohos.app.ability.common */ declare namespace context { diff --git a/api/@ohos.application.errorManager.d.ts b/api/@ohos.application.errorManager.d.ts index 912f35efd4..1709d8e029 100644 --- a/api/@ohos.application.errorManager.d.ts +++ b/api/@ohos.application.errorManager.d.ts @@ -24,7 +24,7 @@ import * as _ErrorObserver from './application/ErrorObserver'; * @import import errorManager from '@ohos.application.errorManager' * @permission N/A * @deprecated since 9 - * @useinstead @ohos.app.ability.errorManager + * @useinstead ohos.app.ability.errorManager */ declare namespace errorManager { /** diff --git a/api/@ohos.application.missionManager.d.ts b/api/@ohos.application.missionManager.d.ts index 3398ce0a51..46062f5f42 100644 --- a/api/@ohos.application.missionManager.d.ts +++ b/api/@ohos.application.missionManager.d.ts @@ -28,7 +28,7 @@ import StartOptions from "./@ohos.application.StartOptions"; * @permission ohos.permission.MANAGE_MISSIONS * @systemapi hide for inner use. * @deprecated since 9 - * @useinstead @ohos.app.ability.missionManager + * @useinstead ohos.app.ability.missionManager */ declare namespace missionManager { /** diff --git a/api/@ohos.application.quickFixManager.d.ts b/api/@ohos.application.quickFixManager.d.ts deleted file mode 100644 index 4db4e87d7c..0000000000 --- a/api/@ohos.application.quickFixManager.d.ts +++ /dev/null @@ -1,155 +0,0 @@ -/* - * 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 { AsyncCallback } from "./basic"; - -/** - * Interface of quickFixManager. - * - * @name quickFixManager - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. - * @deprecated since 9 - * @useinstead @ohos.app.ability.quickFixManager - */ -declare namespace quickFixManager { - /** - * Quick fix info of hap module. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. - */ - export interface HapModuleQuickFixInfo { - /** - * Indicates hap module name. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. - */ - readonly moduleName: string; - - /** - * Indicates hash value of a hap. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. - */ - readonly originHapHash: string; - - /** - * Indicates installed path of quick fix file. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. - */ - readonly quickFixFilePath: string; - } - - /** - * Quick fix info of application. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. - */ - export interface ApplicationQuickFixInfo { - /** - * Bundle name. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. - */ - readonly bundleName: string; - - /** - * The version number of the bundle. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. - */ - readonly bundleVersionCode: number; - - /** - * The version name of the bundle. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. - */ - readonly bundleVersionName: string; - - /** - * The version number of the quick fix. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. - */ - readonly quickFixVersionCode: number; - - /** - * The version name of the quick fix. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. - */ - readonly quickFixVersionName: string; - - /** - * Hap module quick fix info. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @systemapi Hide this for inner system use. - */ - readonly hapModuleQuickFixInfo: Array; - } - - /** - * Apply quick fix files. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @param hapModuleQuickFixFiles Quick fix files need to apply, this value should include file path and file name. - * @systemapi Hide this for inner system use. - * @return - - * @permission ohos.permission.INSTALL_BUNDLE - */ - function applyQuickFix(hapModuleQuickFixFiles: Array, callback: AsyncCallback): void; - function applyQuickFix(hapModuleQuickFixFiles: Array): Promise; - - /** - * Get application quick fix info by bundle name. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix - * @param bundleName Bundle name wish to query. - * @systemapi Hide this for inner system use. - * @return Returns the {@link ApplicationQuickFixInfo}. - * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED - */ - function getApplicationQuickFixInfo(bundleName: string, callback: AsyncCallback): void; - function getApplicationQuickFixInfo(bundleName: string): Promise; -} - -export default quickFixManager; \ No newline at end of file diff --git a/api/@ohos.wantAgent.d.ts b/api/@ohos.wantAgent.d.ts index a6344ef34f..9863e89de4 100644 --- a/api/@ohos.wantAgent.d.ts +++ b/api/@ohos.wantAgent.d.ts @@ -28,7 +28,7 @@ import { TriggerInfo as _TriggerInfo } from './wantAgent/triggerInfo'; * @import import wantAgent from '@ohos.wantAgent'; * @permission N/A * @deprecated since 9 - * @useinstead @ohos.app.wantAgent + * @useinstead ohos.app.ability.wantAgent */ declare namespace wantAgent { /** diff --git a/api/ability/dataAbilityHelper.d.ts b/api/ability/dataAbilityHelper.d.ts index 2ffbfefded..bb5cba6122 100644 --- a/api/ability/dataAbilityHelper.d.ts +++ b/api/ability/dataAbilityHelper.d.ts @@ -26,8 +26,6 @@ import rdb from '../@ohos.data.rdb'; * * @since 7 * @FAModelOnly - * @deprecated since 9 - * @useinstead @ohos.app.ability.dataAbilityHelper */ export interface DataAbilityHelper { /** @@ -243,8 +241,6 @@ export interface DataAbilityHelper { * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @FAModelOnly - * @deprecated since 9 - * @useinstead @ohos.app.ability.dataAbilityHelper */ export interface PacMap { diff --git a/api/ability/dataAbilityUtils.d.ts b/api/ability/dataAbilityUtils.d.ts deleted file mode 100644 index 79ad8e7d7d..0000000000 --- a/api/ability/dataAbilityUtils.d.ts +++ /dev/null @@ -1,474 +0,0 @@ -/* -* 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 { AsyncCallback } from '../basic'; -import { ResultSet } from '../data/rdb/resultSet'; -import { DataAbilityOperation } from './dataAbilityOperation'; -import { DataAbilityResult } from './dataAbilityResult'; -import dataAbility from '../@ohos.data.dataAbility'; -import rdb from '../@ohos.data.rdb'; - -/** - * DataAbilityHelper - * @interface - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ -export interface DataAbilityHelper { - /** - * Opens a file in a specified remote path. - * @param { string } uri - Indicates the path of the file to open. - * @param { string } mode - Indicates the file open mode, which can be "r" for read-only access, "w" for write-only - * access (erasing whatever data is currently in the file), "wt" for write access that - * truncates any existing file, "wa" for write-only access to append to any existing data, - * "rw" for read and write access on any existing data, or "rwt" for read and write access - * that truncates any existing file. - * @param { AsyncCallback } callback - The callback is used to return the file descriptor. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - openFile(uri: string, mode: string, callback: AsyncCallback): void; - - /** - * Opens a file in a specified remote path. - * @param { string } uri - Indicates the path of the file to open. - * @param { string } mode - Indicates the file open mode, which can be "r" for read-only access, "w" for write-only - * access (erasing whatever data is currently in the file), "wt" for write access that - * truncates any existing file, "wa" for write-only access to append to any existing data, - * "rw" for read and write access on any existing data, or "rwt" for read and write access - * that truncates any existing file. - * @returns { Promise } Returns the promise of file descriptor. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - openFile(uri: string, mode: string): Promise; - - /** - * Registers an observer to observe data specified by the given uri. - * @param { string } type - dataChange. - * @param { string } uri - Indicates the path of the data to operate. - * @param { AsyncCallback } callback - The callback when dataChange. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - on(type: 'dataChange', uri: string, callback: AsyncCallback): void; - - /** - * Deregisters all observers used for monitoring data specified by the given uri. - * @param { string } type - dataChange. - * @param { string } uri - Indicates the path of the data to operate. - * @param { AsyncCallback } callback - The callback when dataChange. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - off(type: 'dataChange', uri: string, callback?: AsyncCallback): void; - - /** - * Obtains the MIME type of the date specified by the given URI. - * @param { string } uri - Indicates the path of the data to operate. - * @param { AsyncCallback } callback - The callback is used to return the MIME type. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - getType(uri: string, callback: AsyncCallback): void; - - /** - * Obtains the MIME type of the date specified by the given URI. - * @param { string } uri - Indicates the path of the data to operate. - * @returns { Promise } Returns the promise of MIME type that matches the data specified by uri. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - getType(uri: string): Promise; - - /** - * Obtains the MIME types of files supported. - * @param { string } uri - Indicates the path of the files to obtain. - * @param { string } mimeTypeFilter - Indicates the MIME types of the files to obtain. - * @param { AsyncCallback> } callback - The callback is used to return the matched MIME types Array. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - getFileTypes(uri: string, mimeTypeFilter: string, callback: AsyncCallback>): void; - - /** - * Obtains the MIME types of files supported. - * @param { string } uri - Indicates the path of the files to obtain. - * @param { string } mimeTypeFilter - Indicates the MIME types of the files to obtain. - * @returns { Promise> } Returns the promise of matched MIME types Array. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - getFileTypes(uri: string, mimeTypeFilter: string): Promise>; - - /** - * Converts the given uri that refers to the Data ability into a normalized uri. - * @param { string } uri - Indicates the uri object to normalize. - * @param { AsyncCallback } callback - The callback is used to return the normalized uri object. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - normalizeUri(uri: string, callback: AsyncCallback): void; - - /** - * Converts the given uri that refers to the Data ability into a normalized uri. - * @param { string } uri - Indicates the uri object to normalize. - * @returns { Promise } Returns the promise of normalized uri object. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - normalizeUri(uri: string): Promise; - - /** - * Converts the given normalized uri generated by normalizeUri(uri) into a denormalized one. - * @param { string } uri - Indicates the uri object to normalize. - * @param { AsyncCallback } callback - The callback is used to return the denormalized uri object. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - denormalizeUri(uri: string, callback: AsyncCallback): void; - - /** - * Converts the given normalized uri generated by normalizeUri(uri) into a denormalized one. - * @param { string } uri - Indicates the uri object to normalize. - * @returns { Promise } Returns the denormalized uri object. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - denormalizeUri(uri: string): Promise; - - /** - * Notifies the registered observers of a change to the data resource specified by uri. - * @param { string } uri - Indicates the path of the data to operate. - * @param { AsyncCallback } callback - The callback of notifyChange. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - notifyChange(uri: string, callback: AsyncCallback): void; - - /** - * Notifies the registered observers of a change to the data resource specified by uri. - * @param { string } uri - Indicates the path of the data to operate. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - notifyChange(uri: string): Promise; - - /** - * Inserts a single data record into the database. - * @param { string } uri - Indicates the path of the data to insert. - * @param { rdb.ValuesBucket } valuesBucket - Indicates the data record to insert. If this parameter is null, - * a blank row will be inserted. - * @param { AsyncCallback } callback - The callback is used to return the index of the inserted data record. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - insert(uri: string, valuesBucket: rdb.ValuesBucket, callback: AsyncCallback): void; - - /** - * Inserts a single data record into the database. - * @param { string } uri - Indicates the path of the data to insert. - * @param { rdb.ValuesBucket } valuesBucket - Indicates the data record to insert. If this parameter is null, - * a blank row will be inserted. - * @returns { Promise } Returns the index of the inserted data record. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - insert(uri: string, valuesBucket: rdb.ValuesBucket): Promise; - - /** - * Inserts multiple data records into the database. - * @param { string } uri - Indicates the path of the data to batchInsert. - * @param { Array } valuesBuckets - Indicates the data records to insert. - * @param { AsyncCallback } callback - The callback is used to return the number of data records inserted. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - batchInsert(uri: string, valuesBuckets: Array, callback: AsyncCallback): void; - - /** - * Inserts multiple data records into the database. - * @param { string } uri - Indicates the path of the data to batchInsert. - * @param { Array } valuesBuckets - Indicates the data records to insert. - * @returns { Promise } Returns the number of data records inserted. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - batchInsert(uri: string, valuesBuckets: Array): Promise; - - /** - * Deletes one or more data records from the database. - * @param { string } uri - Indicates the path of the data to delete. - * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define the - * processing logic when this parameter is null. - * @param { AsyncCallback } callback - The callback is used to return the number of data records deleted. - * @returns { Promise } Returns the number of data records deleted. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - delete(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; - - /** - * Deletes one or more data records from the database. - * @param { string } uri - Indicates the path of the data to delete. - * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define the - * processing logic when this parameter is null. - * @returns { Promise } Returns the number of data records deleted. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - delete(uri: string, predicates?: dataAbility.DataAbilityPredicates): Promise; - - /** - * Deletes one or more data records from the database. - * @param { string } uri - Indicates the path of the data to delete. - * @param { AsyncCallback } callback - The callback is used to return the number of data records deleted. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - delete(uri: string, callback: AsyncCallback): void; - - /** - * Updates data records in the database. - * @param { string } uri - Indicates the path of data to update. - * @param { rdb.ValuesBucket } valuesBucket - Indicates the data to update. - * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define - * the processing logic when this parameter is null. - * @param { AsyncCallback } callback - The callback is used to return the number of data records updated. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - update(uri: string, valuesBucket: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; - - /** - * Updates data records in the database. - * @param { string } uri - Indicates the path of data to update. - * @param { rdb.ValuesBucket } valuesBucket - Indicates the data to update. - * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define - * the processing logic when this parameter is null. - * @returns { Promise } Returns the number of data records updated. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - update(uri: string, valuesBucket: rdb.ValuesBucket, predicates?: dataAbility.DataAbilityPredicates): Promise; - - /** - * Updates data records in the database. - * @param { string } uri - Indicates the path of data to update. - * @param { rdb.ValuesBucket } valuesBucket - Indicates the data to update. - * @param { AsyncCallback } callback - The callback is used to return the number of data records updated. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - update(uri: string, valuesBucket: rdb.ValuesBucket, callback: AsyncCallback): void; - - /** - * Queries data in the database. - * @param { string } uri - Indicates the path of data to query. - * @param { Array } columns - Indicates the columns to query. If this parameter is null, all columns are queried. - * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define - * the processing logic when this parameter is null. - * @param { AsyncCallback } callback - The callback is used to return the query result {@link ResultSet}. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - query(uri: string, columns: Array, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; - - /** - * Queries data in the database. - * @param { string } uri - Indicates the path of data to query. - * @param { AsyncCallback } callback - The callback is used to return the query result {@link ResultSet}. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - query(uri: string, callback: AsyncCallback): void; - - /** - * Queries data in the database. - * @param { string } uri - Indicates the path of data to query. - * @param { Array } columns - Indicates the columns to query. If this parameter is null, all columns are queried. - * @param { AsyncCallback } callback - The callback is used to return the query result {@link ResultSet}. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - query(uri: string, columns: Array, callback: AsyncCallback): void; - - /** - * Queries data in the database. - * @param { string } uri - Indicates the path of data to query. - * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define - * the processing logic when this parameter is null. - * @param { AsyncCallback } callback - The callback is used to return the query result {@link ResultSet}. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - query(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; - - /** - * Queries data in the database. - * @param { string } uri - Indicates the path of data to query. - * @param { Array } columns - Indicates the columns to query. If this parameter is null, all columns are queried. - * @param { dataAbility.DataAbilityPredicates } predicates - Indicates filter criteria. You should define - * the processing logic when this parameter is null. - * @returns { Promise } Returns the query result {@link ResultSet}. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - query(uri: string, columns?: Array, predicates?: dataAbility.DataAbilityPredicates): Promise; - - /** - * Calls the extended API of the DataAbility. This method uses a promise to return the result. - * @param { string } uri - URI of the Data ability. Example: "dataability:///com.example.xxx.xxxx" - * @param { string } method - Indicates the method to call. - * @param { string } arg - Indicates the parameter of the String type. - * @param { PacMap } extras - Indicates the parameter of the PacMap type. - * If a custom Sequenceable object is put in the PacMap object and will be transferred across processes, - * you must call BasePacMap.setClassLoader(ClassLoader) to set a class loader for the custom object. - * If the PacMap object is to be transferred to a non-OHOS process, - * values of primitive types are supported, but not custom Sequenceable objects. - * @param { AsyncCallback } callback - The callback is used to return the query result {@link PacMap}. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - call(uri: string, method: string, arg: string, extras: PacMap, callback: AsyncCallback): void; - - /** - * Calls the extended API of the DataAbility. This method uses a promise to return the result. - * @param { string } uri - URI of the Data ability. Example: "dataability:///com.example.xxx.xxxx" - * @param { string } method - Indicates the method to call. - * @param { string } arg - Indicates the parameter of the String type. - * @param { PacMap } extras - Indicates the parameter of the PacMap type. - * If a custom Sequenceable object is put in the PacMap object and will be transferred across processes, - * you must call BasePacMap.setClassLoader(ClassLoader) to set a class loader for the custom object. - * If the PacMap object is to be transferred to a non-OHOS process, - * values of primitive types are supported, but not custom Sequenceable objects. - * @returns { Promise } Returns the query result {@link PacMap}. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - call(uri: string, method: string, arg: string, extras: PacMap): Promise; - - /** - * Queries data in the database. - * @param { string } uri - Indicates the path of data to query. - * @param { Array } operations - Indicates the data operation list, which can contain - * multiple operations on the database. - * @param { AsyncCallback> } callback - The callback is used to return the result of each - * operation, in array {@link DataAbilityResult}. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - executeBatch(uri: string, operations: Array, callback: AsyncCallback>): void; - - /** - * Queries data in the database. - * @param { string } uri - Indicates the path of data to query. - * @param { Array } operations - Indicates the data operation list, which can contain - * multiple operations on the database. - * @returns { Promise> } Returns the result of each operation, in array {@link DataAbilityResult}. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - executeBatch(uri: string, operations: Array): Promise>; -} - -/** - * Defines a PacMap object for storing a series of values. - * @typedef PacMap - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ -export interface PacMap { - /** - * Indicates the parameter of the PacMap type. - * If a custom Sequenceable object is put in the PacMap object and will be transferred across processes, - * you must call BasePacMap.setClassLoader(ClassLoader) to set a class loader for the custom object. - * If the PacMap object is to be transferred to a non-OHOS process, - * values of primitive types are supported, but not custom Sequenceable objects. - * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @famodelonly - * @since 9 - */ - [key: string]: number | string | boolean | Array | null; -} diff --git a/api/app/context.d.ts b/api/app/context.d.ts index 570a4802e0..e24a3dd24b 100644 --- a/api/app/context.d.ts +++ b/api/app/context.d.ts @@ -34,8 +34,6 @@ import bundle from '../@ohos.bundle'; * @import import abilityManager from 'app/context' * @permission N/A * @FAModelOnly - * @deprecated since 9 - * @useinstead @ohos.app.featureAbility.context */ export interface Context extends BaseContext { @@ -277,8 +275,6 @@ export interface Context extends BaseContext { * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A * @FAModelOnly - * @deprecated since 9 - * @useinstead @ohos.app.featureAbility.context */ interface PermissionRequestResult { /** @@ -312,8 +308,6 @@ interface PermissionRequestResult { * @syscap SystemCapability.Ability.AbilityRuntime.Core * @permission N/A * @FAModelOnly - * @deprecated since 9 - * @useinstead @ohos.app.featureAbility.context */ interface PermissionOptions { /** diff --git a/api/app/featureAbilityContext.d.ts b/api/app/featureAbilityContext.d.ts deleted file mode 100644 index 8d0dca6422..0000000000 --- a/api/app/featureAbilityContext.d.ts +++ /dev/null @@ -1,593 +0,0 @@ -/* -* 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 { AsyncCallback } from '../basic'; -import { ApplicationInfo } from '../bundle/applicationInfo'; -import { ProcessInfo } from './processInfo'; -import { ElementName } from '../bundle/elementName'; -import BaseContext from '../application/BaseContext'; -import { HapModuleInfo } from '../bundle/hapModuleInfo'; -import { AppVersionInfo } from './appVersionInfo'; -import { AbilityInfo } from '../bundle/abilityInfo'; -import bundle from '../@ohos.bundle'; - -/** - * 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. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ -export interface Context extends BaseContext { - /** - * Get the local root dir of an app. If it is the first call, the dir - * will be created. - * @note If in the context of the ability, return the root dir of - * the ability; if in the context of the application, return the - * root dir of the application. - * @returns { Promise } Returns the root dir. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getOrCreateLocalDir(): Promise; - - /** - * Get the local root dir of an app. If it is the first call, the dir - * will be created. - * @note If in the context of the ability, return the root dir of - * the ability; if in the context of the application, return the - * root dir of the application. - * @param { AsyncCallback } callback - The callback is used to return the root dir. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getOrCreateLocalDir(callback: AsyncCallback): void; - - /** - * Verify whether the specified permission is allowed for a particular - * pid and uid running in the system. - * @note Pid and uid are optional. If you do not pass in pid and uid, it will check your own permission. - * @param { string } permission - The name of the specified permission. - * @param { PermissionOptions } options - Indicates the permission options. - * @returns { Promise } Returns {@code 0} if the PID and UID have the permission. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - verifyPermission(permission: string, options?: PermissionOptions): Promise; - - /** - * Verify whether the specified permission is allowed for a particular - * pid and uid running in the system. - * @note Pid and uid are optional. If you do not pass in pid and uid, it will check your own permission. - * @param { string } permission - The name of the specified permission. - * @param { PermissionOptions } options - Indicates the permission options. - * @param { AsyncCallback } callback - Returns {@code 0} if the PID and UID have the permission. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - verifyPermission(permission: string, options: PermissionOptions, callback: AsyncCallback): void; - - /** - * Verify whether the specified permission is allowed for a particular - * pid and uid running in the system. - * @note Pid and uid are optional. If you do not pass in pid and uid, it will check your own permission. - * @param { string } permission - The name of the specified permission. - * @param { AsyncCallback } callback - Returns {@code 0} if the PID and UID have the permission. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - verifyPermission(permission: string, callback: AsyncCallback): void; - - /** - * Requests certain permissions from the system. - * @param { Array } permissions - Indicates the list of permissions to be requested. This parameter cannot be null. - * @param { number } requestCode - Indicates the request code to be passed to the PermissionRequestResult. - * @param { AsyncCallback } resultCallback - The callback is used to return the PermissionRequestResult. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - requestPermissionsFromUser(permissions: Array, requestCode: number, resultCallback: AsyncCallback): void; - - /** - * Requests certain permissions from the system. - * @param { Array } permissions - Indicates the list of permissions to be requested. This parameter cannot be null. - * @param { number } requestCode - Indicates the request code to be passed to the PermissionRequestResult. - * @returns { Promise } Returns the PermissionRequestResult. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - requestPermissionsFromUser(permissions: Array, requestCode: number): Promise; - - /** - * Obtains information about the current application. - * @param { AsyncCallback } callback - The callback is used to return the ApplicationInfo. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getApplicationInfo(callback: AsyncCallback): void - - /** - * Obtains information about the current application. - * @returns { Promise } Returns the ApplicationInfo. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getApplicationInfo(): Promise; - - /** - * Obtains the bundle name of the current ability. - * @param { AsyncCallback } callback - The callback is used to return the bundle name. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getBundleName(callback: AsyncCallback): void - - /** - * Obtains the bundle name of the current ability. - * @returns { Promise } Returns the bundle name. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getBundleName(): Promise; - - /** - * Obtains the current display orientation of this ability. - * @param { AsyncCallback } callback - The callback is used to return the display orientation. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getDisplayOrientation(callback: AsyncCallback): void - - /** - * Obtains the current display orientation of this ability. - * @returns { Promise } Returns the display orientation. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getDisplayOrientation(): Promise; - - /** - * Sets the display orientation of the current ability. - * @param { bundle.DisplayOrientation } orientation - Indicates the new orientation for the current ability. - * @param { AsyncCallback } callback - The callback of setDisplayOrientation. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - setDisplayOrientation(orientation: bundle.DisplayOrientation, callback: AsyncCallback): void - - /** - * Sets the display orientation of the current ability. - * @param { bundle.DisplayOrientation } orientation - Indicates the new orientation for the current ability. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - setDisplayOrientation(orientation: bundle.DisplayOrientation): Promise; - - /** - * Sets whether to show this ability on top of the lock screen whenever the lock screen is displayed, - * keeping the ability in the ACTIVE state. - * @param { boolean } show - Specifies whether to show this ability on top of the lock screen. The value true - * means to show it on the lock screen, and the value false means not. - * @param { AsyncCallback } callback - The callback of setShowOnLockScreen. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - setShowOnLockScreen(show: boolean, callback: AsyncCallback): void - - /** - * Sets whether to show this ability on top of the lock screen whenever the lock screen is displayed, - * keeping the ability in the ACTIVE state. - * @param { boolean } show - Specifies whether to show this ability on top of the lock screen. The value true - * means to show it on the lock screen, and the value false means not. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - setShowOnLockScreen(show: boolean): Promise; - - /** - * Sets whether to wake up the screen when this ability is restored. - * @param { boolean } wakeUp - Specifies whether to wake up the screen. The value true means to wake it up, - * and the value false means not. - * @param { AsyncCallback } callback - The callback of setWakeUpScreen. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - setWakeUpScreen(wakeUp: boolean, callback: AsyncCallback): void - - /** - * Sets whether to wake up the screen when this ability is restored. - * @param { boolean } wakeUp - Specifies whether to wake up the screen. The value true means to wake it up, - * and the value false means not. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - setWakeUpScreen(wakeUp: boolean): Promise; - - /** - * Obtains information about the current process, including the process ID and name. - * @param { AsyncCallback } callback - The callback is used to return the ProcessInfo. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getProcessInfo(callback: AsyncCallback): void - - /** - * Obtains information about the current process, including the process ID and name. - * @returns { Promise } Returns the ProcessInfo. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getProcessInfo(): Promise; - - /** - * Obtains the ohos.bundle.ElementName object of the current ability. This method is available only to Page abilities. - * @param { AsyncCallback } callback - The callback is used to return the ElementName. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getElementName(callback: AsyncCallback): void - - /** - * Obtains the ohos.bundle.ElementName object of the current ability. This method is available only to Page abilities. - * @returns { Promise } Returns the ElementName. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getElementName(): Promise; - - /** - * Obtains the name of the current process. - * @param { AsyncCallback } callback - The callback is used to return the process name. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getProcessName(callback: AsyncCallback): void - - /** - * Obtains the name of the current process. - * @returns { Promise } Returns the process name. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getProcessName(): Promise; - - /** - * Obtains the bundle name of the ability that called the current ability. - * @param { AsyncCallback } callback - The callback is used to return the calling bundle name. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getCallingBundle(callback: AsyncCallback): void - - /** - * Obtains the bundle name of the ability that called the current ability. - * @returns { Promise } Returns the calling bundle name. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getCallingBundle(): Promise; - - /** - * Obtains the file directory of this application on the internal storage. - * @param { AsyncCallback } callback - The callback is used to return the file directory. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getFilesDir(callback: AsyncCallback): void; - - /** - * Obtains the file directory of this application on the internal storage. - * @returns { Promise } Returns the file directory. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getFilesDir(): Promise; - - /** - * Obtains the cache directory of this application on the internal storage. - * @param { AsyncCallback } callback - The callback is used to return the cache directory. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getCacheDir(callback: AsyncCallback): void; - - /** - * Obtains the cache directory of this application on the internal storage. - * @returns { Promise } Returns the cache directory. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getCacheDir(): Promise; - - /** - * Obtains the distributed file path for storing ability or application data files. - * If the distributed file path does not exist, the system will create a path and return the created path. - * @returns { Promise } Returns the distributed file path. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getOrCreateDistributedDir(): Promise; - - /** - * Obtains the distributed file path for storing ability or application data files. - * If the distributed file path does not exist, the system will create a path and return the created path. - * @param { AsyncCallback } callback - The callback is used to return the distributed file path. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getOrCreateDistributedDir(callback: AsyncCallback): void; - - /** - * Obtains the application type. - * @param { AsyncCallback } callback - The callback is used to return the application type. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getAppType(callback: AsyncCallback): void - - /** - * Obtains the application type. - * @returns { Promise } Returns the application type. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getAppType(): Promise; - - /** - * Obtains the ModuleInfo object for this application. - * @param { AsyncCallback } callback - The callback is used to return the HapModuleInfo. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getHapModuleInfo(callback: AsyncCallback): void - - /** - * Obtains the ModuleInfo object for this application. - * @returns { Promise } Returns the HapModuleInfo. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getHapModuleInfo(): Promise; - - /** - * Obtains the application version information. - * @param { AsyncCallback } callback - The callback is used to return the application version info. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getAppVersionInfo(callback: AsyncCallback): void - - /** - * Obtains the application version information. - * @returns { Promise } Returns the application version info. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getAppVersionInfo(): Promise; - - /** - * Obtains the context of this application. - * @returns { Context } Returns the context of this application. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getApplicationContext(): Context; - - /** - * Checks the detailed information of this ability. - * @param { AsyncCallback } callback - The callback is used to return the AbilityInfo. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getAbilityInfo(callback: AsyncCallback): void - - /** - * Checks the detailed information of this ability. - * @returns { Promise } Returns the AbilityInfo. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - getAbilityInfo(): Promise; - - /** - * Checks whether the configuration of this ability is changing. - * @param { AsyncCallback } callback - Returns true if the configuration of this ability is changing and false otherwise. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - isUpdatingConfigurations(callback: AsyncCallback): void; - - /** - * Checks whether the configuration of this ability is changing. - * @returns { Promise } Returns true if the configuration of this ability is changing and false otherwise. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - isUpdatingConfigurations(): Promise; - - /** - * Informs the system of the time required for drawing this Page ability. - * @param { AsyncCallback } callback - The callback of printDrawnCompleted. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - printDrawnCompleted(callback: AsyncCallback): void; - - /** - * Informs the system of the time required for drawing this Page ability. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - printDrawnCompleted(): Promise; -} - -/** - * the result of requestPermissionsFromUser with asynchronous callback - * @typedef PermissionRequestResult - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ -interface PermissionRequestResult { - /** - * The request code passed in by the user - * @type { number } - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - requestCode: number; - - /** - * The permissions passed in by the user - * @type { Array } - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - permissions: Array; - - /** - * The results for the corresponding request permissions - * @type { Array } - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - authResults: Array; -} - -/** - * @typedef PermissionOptions - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ -interface PermissionOptions { - /** - * The process id - * @type { number } - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - pid?: number; - - /** - * The user id - * @type { number } - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @famodelonly - * @since 9 - */ - uid?: number; -} -- Gitee From 320e2dc2db9787ecad784b0382b933f51c3da9fe Mon Sep 17 00:00:00 2001 From: dboy190 Date: Tue, 18 Oct 2022 02:15:11 +0800 Subject: [PATCH 161/438] fix js doc Signed-off-by: dboy190 --- api/@ohos.data.distributedKVStore.d.ts | 809 +++++++++++++++++++++---- 1 file changed, 683 insertions(+), 126 deletions(-) diff --git a/api/@ohos.data.distributedKVStore.d.ts b/api/@ohos.data.distributedKVStore.d.ts index fe3e9d1eee..6281012593 100644 --- a/api/@ohos.data.distributedKVStore.d.ts +++ b/api/@ohos.data.distributedKVStore.d.ts @@ -535,7 +535,7 @@ declare namespace distributedKVStore { * *

Adding a child node makes this node a non-leaf node. Field value will be ignored if it has child node. * - * @param child The field node to append. + * @param {FieldNode} child - The field node to append. * @returns Returns true if the child node is successfully added to this {@code FieldNode}; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 @@ -565,7 +565,7 @@ declare namespace distributedKVStore { } /** - * Provide methods to obtain the result set of the {@code SingleKVStore} or {@code SingleKVStore} database. + * Provide methods to obtain the result set of the {@code SingleKVStore} or {@code DeviceKVStore} database. * *

The result set is created by using the {@code getResultSet} method in the {@code SingleKVStore} or * {@code DeviceKVStore} class. This interface also provides methods for moving the data read @@ -635,9 +635,9 @@ declare namespace distributedKVStore { /** * Moves the read position by a relative offset to the current position. * - * @param offset Indicates the relative offset to the current position. Anegative offset indicates moving backwards, and a - * positive offset indicates moving forewards. Forexample, if the current position is entry 1 and thisoffset is 2, - * the destination position will be entry 3; ifthe current position is entry 3 and this offset is -2, + * @param {number} offset - Indicates the relative offset to the current position. Anegative offset indicates moving + * backwards, and a positive offset indicates moving forewards. Forexample, if the current position is entry 1 and + * thisoffset is 2, the destination position will be entry 3; ifthe current position is entry 3 and this offset is -2, * the destination position will be entry 1. The valid final position after moving forwards starts with 0. If the * final position is invalid, false will be returned. * @returns Returns true if the operation succeeds; return false otherwise. @@ -649,7 +649,7 @@ declare namespace distributedKVStore { /** * Moves the read position from 0 to an absolute position. * - * @param position Indicates the absolute position. + * @param {number} position - Indicates the absolute position. * @returns Returns true if the operation succeeds; return false otherwise. * @throws {BusinessError} 401 - if parameter check failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -730,82 +730,82 @@ declare namespace distributedKVStore { /** * Constructs a {@code Query} object to query entries with the specified field whose value is equal to the specified long value. * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @param value IIndicates the long value. + * @param {string} field - Indicates the field, which must start with $. and cannot contain ^. + * @param {number|string|boolean} value - Indicates the value to be compared. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - equalTo(field: string, value: number|string|boolean): Query; + equalTo(field: string, value: number | string | boolean): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is not equal to the specified int value. * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @param value Indicates the int value. + * @param {string} field - Indicates the field, which must start with $. and cannot contain ^. + * @param {number|string|boolean} value - Indicates the value to be compared. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - notEqualTo(field: string, value: number|string|boolean): Query; + notEqualTo(field: string, value: number | string | boolean): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is greater than or equal to the * specified int value. * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @param value Indicates the int value. + * @param {string} field - Indicates the field, which must start with $. and cannot contain ^. + * @param {number|string|boolean} value - Indicates the value to be compared. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - greaterThan(field: string, value: number|string|boolean): Query; + greaterThan(field: string, value: number | string | boolean): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is less than the specified int value. * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @param value Indicates the int value. + * @param {string} field - Indicates the field, which must start with $. and cannot contain ^. + * @param {number|string} value - Indicates the value to be compared. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - lessThan(field: string, value: number|string): Query; + lessThan(field: string, value: number | string): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is greater than or * equal to the specified int value. * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @param value Indicates the int value. + * @param {string} field - Indicates the field, which must start with $. and cannot contain ^. + * @param {number|string} value - Indicates the value to be compared. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - greaterThanOrEqualTo(field: string, value: number|string): Query; + greaterThanOrEqualTo(field: string, value: number | string): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is less than or equal to the * specified int value. * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @param value Indicates the int value. + * @param {string} field - Indicates the field, which must start with $. and cannot contain ^. + * @param {number|string} value - Indicates the value to be compared. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - lessThanOrEqualTo(field: string, value: number|string): Query; + lessThanOrEqualTo(field: string, value: number | string): Query; /** * Constructs a {@code Query} object to query entries with the specified field whose value is null. * - * @param field Indicates the field, which must start with $. and cannot contain ^. + * @param {string} field - Indicates the field, which must start with $. and cannot contain ^. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @import N/A @@ -816,8 +816,8 @@ declare namespace distributedKVStore { /** * Constructs a {@code Query} object to query entries with the specified field whose value is within the specified int value list. * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @param valueList Indicates the int value list. + * @param {string} field - Indicates the field, which must start with $. and cannot contain ^. + * @param {number[]} valueList - Indicates the int value list. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @import N/A @@ -828,8 +828,8 @@ declare namespace distributedKVStore { /** * Constructs a {@code Query} object to query entries with the specified field whose value is within the specified string value list. * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @param valueList Indicates the string value list. + * @param {string} field - Indicates the field, which must start with $. and cannot contain ^. + * @param {string[]} valueList - Indicates the string value list. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @import N/A @@ -840,8 +840,8 @@ declare namespace distributedKVStore { /** * Constructs a {@code Query} object to query entries with the specified field whose value is not within the specified int value list. * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @param valueList Indicates the int value list. + * @param {string} field - Indicates the field, which must start with $. and cannot contain ^. + * @param {number[]} valueList - Indicates the int value list. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @import N/A @@ -852,8 +852,8 @@ declare namespace distributedKVStore { /** * Constructs a {@code Query} object to query entries with the specified field whose value is not within the specified string value list. * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @param valueList Indicates the string value list. + * @param {string} field - Indicates the field, which must start with $. and cannot contain ^. + * @param {string[]} valueList - Indicates the string value list. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @import N/A @@ -864,8 +864,8 @@ declare namespace distributedKVStore { /** * Constructs a {@code Query} object to query entries with the specified field whose value is similar to the specified string value. * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @param value Indicates the string value. + * @param {string} field - Indicates the field, which must start with $. and cannot contain ^. + * @param {string} value - Indicates the string value. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @import N/A @@ -876,8 +876,8 @@ declare namespace distributedKVStore { /** * Constructs a {@code Query} object to query entries with the specified field whose value is not similar to the specified string value. * - * @param field Indicates the field, which must start with $. and cannot contain ^. - * @param value Indicates the string value. + * @param {string} field - Indicates the field, which must start with $. and cannot contain ^. + * @param {string} value - Indicates the string value. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @import N/A @@ -910,7 +910,7 @@ declare namespace distributedKVStore { /** * Constructs a {@code Query} object to sort the query results in ascending order. * - * @param field Indicates the field, which must start with $. and cannot contain ^. + * @param {string} field - Indicates the field, which must start with $. and cannot contain ^. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @import N/A @@ -921,7 +921,7 @@ declare namespace distributedKVStore { /** * Constructs a {@code Query} object to sort the query results in descending order. * - * @param field Indicates the field, which must start with $. and cannot contain ^. + * @param {string} field - Indicates the field, which must start with $. and cannot contain ^. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @import N/A @@ -932,8 +932,8 @@ declare namespace distributedKVStore { /** * Constructs a {@code Query} object to specify the number of results and the start position. * - * @param total Indicates the number of results. - * @param offset Indicates the start position. + * @param {number} total - Indicates the number of results. + * @param {number} offset - Indicates the start position. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @import N/A @@ -944,7 +944,7 @@ declare namespace distributedKVStore { /** * Creates a {@code Query} condition with a specified field that is not null. * - * @param field Indicates the specified field. + * @param {string} field - Indicates the specified field. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @import N/A @@ -979,7 +979,7 @@ declare namespace distributedKVStore { /** * Creates a query condition with a specified key prefix. * - * @param prefix Indicates the specified key prefix. + * @param {string} prefix - Indicates the specified key prefix. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @import N/A @@ -990,7 +990,7 @@ declare namespace distributedKVStore { /** * Sets a specified index that will be preferentially used for query. * - * @param index Indicates the index to set. + * @param {string} index - Indicates the index to set. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @import N/A @@ -1001,7 +1001,7 @@ declare namespace distributedKVStore { /** * Add device ID key prefix.Used by {@code DeviceKVStore}. * - * @param deviceId Specify device id to query from. + * @param {string} deviceId - Specify device id to query from. * @return Returns the {@code Query} object with device ID prefix added. * @throws {BusinessError} 401 - if parameter check failed. * @import N/A @@ -1044,9 +1044,10 @@ declare namespace distributedKVStore { * *

If you do not want to synchronize this key-value pair to other devices, set the write option in the local database. * - * @param key Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. + * @param {string} key - Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. * Spaces before and after the key will be cleared. - * @param value Indicates the string value, which must be less than 4 MB as a UTF-8 byte array. + * @param {Uint8Array|string|number|boolean} value - Indicates the value to be inserted. + * @param {AsyncCallback} callback - the callback of put. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. @@ -1054,12 +1055,29 @@ declare namespace distributedKVStore { * @since 9 */ put(key: string, value: Uint8Array | string | number | boolean, callback: AsyncCallback): void; + + /** + * Writes a key-value pair of the string type into the {@code SingleKVStore} database. + * + *

If you do not want to synchronize this key-value pair to other devices, set the write option in the local database. + * + * @param {string} key - Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. + * Spaces before and after the key will be cleared. + * @param {Uint8Array|string|number|boolean} value - Indicates the value to be inserted. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ put(key: string, value: Uint8Array | string | number | boolean): Promise; /** * Inserts key-value pairs into the {@code SingleKVStore} database in batches. * - * @param entries Indicates the key-value pairs to be inserted in batches. + * @param {Entry[]} entries - Indicates the key-value pairs to be inserted in batches. + * @param {AsyncCallback} callback - the callback of putBatch. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. @@ -1067,13 +1085,25 @@ declare namespace distributedKVStore { * @since 9 */ putBatch(entries: Entry[], callback: AsyncCallback): void; + + /** + * Inserts key-value pairs into the {@code SingleKVStore} database in batches. + * + * @param {Entry[]} entries - Indicates the key-value pairs to be inserted in batches. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ putBatch(entries: Entry[]): Promise; /** - * Writes a value of the valuesbucket type into the {@code SingleKVStore} database. + * Writes a value of the ValuesBucket type into the {@code SingleKVStore} database. * - * @param value Indicates the data record to put. - * Spaces before and after the key will be cleared. + * @param {Array} value - Indicates the ValuesBucket array to be inserted. + * @param {AsyncCallback} callback - the callback of putBatch. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. @@ -1082,13 +1112,27 @@ declare namespace distributedKVStore { * @since 9 */ putBatch(value: Array, callback: AsyncCallback): void; + + /** + * Writes a value of the ValuesBucket type into the {@code SingleKVStore} database. + * + * @param {Array} value - Indicates the ValuesBucket array to be inserted. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @systemapi + * @since 9 + */ putBatch(value: Array): Promise; /** * Deletes the key-value pair based on a specified key. * - * @param key Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. + * @param {string} key - Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. * Spaces before and after the key will be cleared. + * @param {AsyncCallback} callback - the callback of delete. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100004 - if the data not exist when delete data. @@ -1097,13 +1141,27 @@ declare namespace distributedKVStore { * @since 9 */ delete(key: string, callback: AsyncCallback): void; - delete(key: string): Promise; /** * Deletes the key-value pair based on a specified key. * - * @param predicates Indicates the datasharePredicates. + * @param {string} key - Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. * Spaces before and after the key will be cleared. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the data not exist when delete data. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + delete(key: string): Promise; + + /** + * Deletes the key-value pairs based on the dataSharePredicates. + * + * @param {dataSharePredicates.DataSharePredicates} predicates - Indicates the dataSharePredicates. + * @param {AsyncCallback} callback - the callback of delete. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100004 - if the data not exist when delete data. @@ -1113,12 +1171,27 @@ declare namespace distributedKVStore { * @since 9 */ delete(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback); + + /** + * Deletes the key-value pairs based on the dataSharePredicates. + * + * @param {dataSharePredicates.DataSharePredicates} predicates - Indicates the dataSharePredicates. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the data not exist when delete data. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @systemapi + * @since 9 + */ delete(predicates: dataSharePredicates.DataSharePredicates): Promise; /** * Deletes key-value pairs in batches from the {@code SingleKVStore} database. * - * @param keys Indicates the key-value pairs to be deleted in batches. + * @param {string[]} keys - Indicates the key-value pairs to be deleted in batches. + * @param {AsyncCallback} callback - the callback of deleteBatch. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100004 - if the data not exist when delete data. @@ -1127,6 +1200,19 @@ declare namespace distributedKVStore { * @since 9 */ deleteBatch(keys: string[], callback: AsyncCallback): void; + + /** + * Deletes key-value pairs in batches from the {@code SingleKVStore} database. + * + * @param {string[]} keys - Indicates the key-value pairs to be deleted in batches. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the data not exist when delete data. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ deleteBatch(keys: string[]): Promise; /** @@ -1134,18 +1220,51 @@ declare namespace distributedKVStore { * synchronized from remote devices. This operation does not synchronize data to other databases or affect * subsequent data synchronization. * - * @param deviceId Identifies the device whose data is to be removed. The value cannot be the current device ID. + * @param {string} deviceId - Identifies the device whose data is to be removed. The value cannot be the current device ID. + * @param {AsyncCallback} callback - the callback of removeDeviceData. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100006 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ removeDeviceData(deviceId: string, callback: AsyncCallback): void; + + /** + * Removes data of a specified device from the current database. This method is used to remove only the data + * synchronized from remote devices. This operation does not synchronize data to other databases or affect + * subsequent data synchronization. + * + * @param {string} deviceId - Identifies the device whose data is to be removed. The value cannot be the current device ID. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ removeDeviceData(deviceId: string): Promise; /** - * Obtains the {@code String} value of a specified key. + * Obtains the value of a specified key. + * + * @param {string} key - Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. + * @param {AsyncCallback} callback - + * {Uint8Array|string|boolean|number}: the returned value specified by the key. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the data not exist when query data. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + get(key: string, callback: AsyncCallback): void; + + /** + * Obtains the value of a specified key. * + * @param {string} key - Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. + * @returns {Promise} + * {Uint8Array|string|boolean|number}: the returned value specified by the key. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100004 - if the data not exist when query data. @@ -1154,14 +1273,14 @@ declare namespace distributedKVStore { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - get(key: string, callback: AsyncCallback): void; - get(key: string): Promise; + get(key: string): Promise; /** * Obtains all key-value pairs that match a specified key prefix. * - * @param keyPrefix Indicates the key prefix to match. - * @returns Returns the list of all key-value pairs that match the specified key prefix. + * @param {string} keyPrefix - Indicates the key prefix to match. + \* @param {AsyncCallback} callback - {Entry[]}: the list of all key-value pairs + * that match the specified key prefix. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. @@ -1170,13 +1289,28 @@ declare namespace distributedKVStore { * @since 9 */ getEntries(keyPrefix: string, callback: AsyncCallback): void; + + /** + * Obtains all key-value pairs that match a specified key prefix. + * + * @param {string} keyPrefix - Indicates the key prefix to match. + * @returns {Promise} {Entry[]}: the list of all key-value pairs that match the + * specified key prefix. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ getEntries(keyPrefix: string): Promise; /** * Obtains the list of key-value pairs matching the specified {@code Query} object. * - * @param query Indicates the {@code Query} object. - * @returns Returns the list of key-value pairs matching the specified {@code Query} object. + * @param {Query} query - Indicates the {@code Query} object. + * @param {AsyncCallback} callback - {Entry[]}: the list of all key-value pairs + * matching the specified {@code Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100005 - if not support the operation. @@ -1186,6 +1320,21 @@ declare namespace distributedKVStore { * @since 9 */ getEntries(query: Query, callback: AsyncCallback): void; + + /** + * Obtains the list of key-value pairs matching the specified {@code Query} object. + * + * @param {Query} query - Indicates the {@code Query} object. + * @returns {Promise} {Entry[]}: the list of all key-value pairs matching the + * specified {@code Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100005 - if not support the operation. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ getEntries(query: Query): Promise; /** @@ -1195,7 +1344,9 @@ declare namespace distributedKVStore { * four objects, calling this method will return a failure. Therefore, you are advised to call the closeResultSet * method to close unnecessary {@code KVStoreResultSet} objects in a timely manner. * - * @param keyPrefix Indicates the key prefix to match. + * @param {string} keyPrefix - Indicates the key prefix to match. + * @param {AsyncCallback} callback - {KVStoreResultSet}: the {@code KVStoreResultSet} + * object matching the specified keyPrefix. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. @@ -1204,12 +1355,32 @@ declare namespace distributedKVStore { * @since 9 */ getResultSet(keyPrefix: string, callback: AsyncCallback): void; + + /** + * Obtains the result sets with a specified prefix from a {@code SingleKVStore} database. The {@code KVStoreResultSet} + * object can be used to query all key-value pairs that meet the search criteria. Each {@code SingleKVStore} + * instance can have a maximum of four {@code KVStoreResultSet} objects at the same time. If you have created + * four objects, calling this method will return a failure. Therefore, you are advised to call the closeResultSet + * method to close unnecessary {@code KVStoreResultSet} objects in a timely manner. + * + * @param {string} keyPrefix - Indicates the key prefix to match. + * @returns {Promise} {KVStoreResultSet}: the {@code KVStoreResultSet} + * object matching the specified keyPrefix. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ getResultSet(keyPrefix: string): Promise; /** * Obtains the {@code KVStoreResultSet} object matching the specified {@code Query} object. * - * @param query Indicates the {@code Query} object. + * @param {Query} query - Indicates the {@code Query} object. + * @param {AsyncCallback} callback - {KVStoreResultSet}: the {@code KVStoreResultSet} + * object matching the specified {@code Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. @@ -1218,13 +1389,28 @@ declare namespace distributedKVStore { * @since 9 */ getResultSet(query: Query, callback: AsyncCallback): void; + + /** + * Obtains the {@code KVStoreResultSet} object matching the specified {@code Query} object. + * + * @param {Query} query - Indicates the {@code Query} object. + * @returns {Promise} {KVStoreResultSet}: the {@code KVStoreResultSet} + * object matching the specified {@code Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ getResultSet(query: Query): Promise; /** * Obtains the KVStoreResultSet object matching the specified Predicate object. * - * @param predicates Indicates the datasharePredicates. - * Spaces before and after the key will be cleared. + * @param {dataSharePredicates.DataSharePredicates} predicates - Indicates the datasharePredicates. + * @param {AsyncCallback} callback - {KVStoreResultSet}: the {@code KVStoreResultSet} + * object matching the specified {@code dataSharePredicates.DataSharePredicates} object. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. @@ -1233,25 +1419,52 @@ declare namespace distributedKVStore { * @since 9 */ getResultSet(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; + + /** + * Obtains the KVStoreResultSet object matching the specified Predicate object. + * + * @param {dataSharePredicates.DataSharePredicates} predicates - Indicates the datasharePredicates. + * @returns {Promise} {KVStoreResultSet}: the {@code KVStoreResultSet} + * object matching the specified {@code dataSharePredicates.DataSharePredicates} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @systemapi + * @since 9 + */ getResultSet(predicates: dataSharePredicates.DataSharePredicates): Promise; /** * Closes a {@code KVStoreResultSet} object returned by getResultSet. * - * @param resultSet Indicates the {@code KVStoreResultSet} object to close. + * @param {KVStoreResultSet} resultSet - Indicates the {@code KVStoreResultSet} object to close. + * @param {AsyncCallback} callback - the callback of closeResultSet. * @throws {BusinessError} 401 - if parameter check failed. * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ closeResultSet(resultSet: KVStoreResultSet, callback: AsyncCallback): void; + + /** + * Closes a {@code KVStoreResultSet} object returned by getResultSet. + * + * @param {KVStoreResultSet} resultSet - Indicates the {@code KVStoreResultSet} object to close. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if parameter check failed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ closeResultSet(resultSet: KVStoreResultSet): Promise; /** * Obtains the number of results matching the specified {@code Query} object. * - * @param query Indicates the {@code Query} object. - * @returns Returns the number of results matching the specified {@code Query} object. + * @param {Query} query - Indicates the {@code Query} object. + * @param {AsyncCallback} callback - {number}: the number of results matching the + * specified {@code Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. @@ -1260,12 +1473,27 @@ declare namespace distributedKVStore { * @since 9 */ getResultSize(query: Query, callback: AsyncCallback): void; + + /** + * Obtains the number of results matching the specified {@code Query} object. + * + * @param {Query} query - Indicates the {@code Query} object. + * @returns {Promise} {number}: the number of results matching the specified + * {@code Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @import N/A + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ getResultSize(query: Query): Promise; /** * Backs up a database in a specified name. * - * @param file Indicates the name that saves the database backup. + * @param {string} file - Indicates the name that saves the database backup. + * @param {AsyncCallback} callback - the callback of backup. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100005 - if not support the operation. * @throws {BusinessError} 15100006 - if the database or result set has been closed. @@ -1273,12 +1501,25 @@ declare namespace distributedKVStore { * @since 9 */ backup(file:string, callback: AsyncCallback):void; + + /** + * Backs up a database in a specified name. + * + * @param {string} file - Indicates the name that saves the database backup. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100005 - if not support the operation. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ backup(file:string): Promise; /** * Restores a database from a specified database file. * - * @param file Indicates the name that saves the database file. + * @param {string} file - Indicates the name that saves the database file. + * @param {AsyncCallback} callback - the callback of restore. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100005 - if not support the operation. * @throws {BusinessError} 15100006 - if the database or result set has been closed. @@ -1286,17 +1527,43 @@ declare namespace distributedKVStore { * @since 9 */ restore(file:string, callback: AsyncCallback):void; + + /** + * Restores a database from a specified database file. + * + * @param {string} file - Indicates the name that saves the database file. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100005 - if not support the operation. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ restore(file:string): Promise; /** * Delete a backup files based on a specified name. * - * @param files list Indicates the name that backup file to delete. + * @param {Array} files - Indicates the backup files to be deleted. + * @param {AsyncCallback>} callback - {Array<[string, number]>}: + * the list of backup file and it's corresponding delete result which 0 means delete success + * and otherwise failed. * @throws {BusinessError} 401 - if parameter check failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ deleteBackup(files:Array, callback: AsyncCallback>):void; + + /** + * Delete a backup files based on a specified name. + * + * @param {Array} files - Indicates the backup files to be deleted. + * @returns {Promise>} {Array<[string, number]>}: the list of backup + * file and it's corresponding delete result which 0 means delete success and otherwise failed. + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ deleteBackup(files:Array): Promise>; /** @@ -1304,44 +1571,87 @@ declare namespace distributedKVStore { * *

After the database transaction is started, you can submit or roll back the operation. * + * @param {AsyncCallback} callback - the callback of startTransaction. * @throws {BusinessError} 15100006 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ startTransaction(callback: AsyncCallback): void; + + /** + * Starts a transaction operation in the {@code SingleKVStore} database. + * + *

After the database transaction is started, you can submit or roll back the operation. + * + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ startTransaction(): Promise; /** * Submits a transaction operation in the {@code SingleKVStore} database. * - * @param callback + * @param {AsyncCallback} callback - the callback of commit. * @throws {BusinessError} 15100006 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ commit(callback: AsyncCallback): void; + + /** + * Submits a transaction operation in the {@code SingleKVStore} database. + * + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ commit(): Promise; /** * Rolls back a transaction operation in the {@code SingleKVStore} database. * + * @param {AsyncCallback} callback - the callback of rollback. * @throws {BusinessError} 15100006 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ rollback(callback: AsyncCallback): void; + + /** + * Rolls back a transaction operation in the {@code SingleKVStore} database. + * + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ rollback(): Promise; /** * Sets whether to enable synchronization. * - * @param enabled Specifies whether to enable synchronization. The value true means to enable - * synchronization, and false means the opposite. + * @param {boolean} enabled - Specifies whether to enable synchronization. The value true + * means to enable synchronization, and false means the opposite. + * @param {AsyncCallback} callback - the callback of enableSync. * @throws {BusinessError} 401 - if parameter check failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ enableSync(enabled: boolean, callback: AsyncCallback): void; + + /** + * Sets whether to enable synchronization. + * + * @param {boolean} enabled - Specifies whether to enable synchronization. The value true + * means to enable synchronization, and false means the opposite. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ enableSync(enabled: boolean): Promise; /** @@ -1349,33 +1659,63 @@ declare namespace distributedKVStore { * *

The labels determine the devices with which data will be synchronized. * - * @param localLabels Indicates the synchronization labels of the local device. - * @param remoteSupportLabels Indicates the labels of the devices with which data will be synchronized. + * @param {string[]} localLabels - Indicates the synchronization labels of the local device. + * @param {string[]} remoteSupportLabels - Indicates the labels of the devices with which + * data will be synchronized. + * @param {AsyncCallback} callback - the callback of setSyncRange. * @throws {BusinessError} 401 - if parameter check failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ setSyncRange(localLabels: string[], remoteSupportLabels: string[], callback: AsyncCallback): void; + + /** + * Sets synchronization range labels. + * + *

The labels determine the devices with which data will be synchronized. + * + * @param {string[]} localLabels - Indicates the synchronization labels of the local device. + * @param {string[]} remoteSupportLabels - Indicates the labels of the devices with which + * data will be synchronized. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ setSyncRange(localLabels: string[], remoteSupportLabels: string[]): Promise; /** * Sets the default delay allowed for database synchronization * - * @param defaultAllowedDelayMs Indicates the default delay allowed for the database synchronization, in milliseconds. + * @param {number} defaultAllowedDelayMs - Indicates the default delay allowed for the + * database synchronization, in milliseconds. + * @param {AsyncCallback} callback - the callback of setSyncParam. * @throws {BusinessError} 401 - if parameter check failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback): void; + + /** + * Sets the default delay allowed for database synchronization + * + * @param {number} defaultAllowedDelayMs - Indicates the default delay allowed for the + * database synchronization, in milliseconds. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ setSyncParam(defaultAllowedDelayMs: number): Promise; /** * Synchronizes the database to the specified devices with the specified delay allowed. * * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @param deviceIds Indicates the list of devices to which to synchronize the database. - * @param mode Indicates the synchronization mode. The value can be {@code PUSH}, {@code PULL}, or {@code PUSH_PULL}. - * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. + * @param {string[]} deviceIds - Indicates the list of devices to which to synchronize the database. + * @param {SyncMode} mode - Indicates the synchronization mode. The value can be {@code PUSH}, + * {@code PULL}, or {@code PUSH_PULL}. + * @param {number} delayMs - Indicates the delay allowed for the synchronization, in milliseconds. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100004 - if the database not exist when sync data. @@ -1388,10 +1728,11 @@ declare namespace distributedKVStore { * Synchronizes the database to the specified devices with the specified delay allowed. * * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @param deviceIds Indicates the list of devices to which to synchronize the database. - * @param mode Indicates the synchronization mode. The value can be {@code PUSH}, {@code PULL}, or {@code PUSH_PULL}. - * @param delayMs Indicates the delay allowed for the synchronization, in milliseconds. - * @param query Indicates the {@code Query} object. + * @param {string[]} deviceIds - Indicates the list of devices to which to synchronize the database. + * @param {Query} query - Indicates the {@code Query} object. + * @param {SyncMode} mode - Indicates the synchronization mode. The value can be {@code PUSH}, + * {@code PULL}, or {@code PUSH_PULL}. + * @param {number} delayMs - Indicates the delay allowed for the synchronization, in milliseconds. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100004 - if the database not exist when sync data. @@ -1404,8 +1745,9 @@ declare namespace distributedKVStore { * Registers a {@code KVStoreObserver} for the database. When data in the distributed database changes, the callback in * {@code KVStoreObserver} will be invoked. * - * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. - * @param listener Indicates the observer of data change events in the distributed database. + * @param {SubscribeType} type - Indicates the subscription type, which is defined in {@code SubscribeType}. + * @param {Callback} listener - {ChangeNotification}: the {@code ChangeNotification} + * object indicates the data change events in the distributed database. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100001 - if the database has been subscribed over the max subscription time limit. * @throws {BusinessError} 15100006 - if the database or result set has been closed. @@ -1418,7 +1760,9 @@ declare namespace distributedKVStore { * Register Synchronizes SingleKVStore databases callback. *

Sync result is returned through asynchronous callback. * - * @param syncCallback Indicates the callback used to send the synchronization result to the caller. + * @param {Callback>} syncCallback - {Array<[string, number]>}: the + * deviceId and it's corresponding synchronization result which 0 means synchronization success + * and otherwise failed. * @throws {BusinessError} 401 - if parameter check failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 @@ -1428,7 +1772,8 @@ declare namespace distributedKVStore { /** * Unsubscribes from the SingleKVStore database based on the specified subscribeType and {@code KVStoreObserver}. * - * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KVStoreObserver)}. + * @param {Callback} listener - {ChangeNotification}: the {@code ChangeNotification} + * object indicates the data change events in the distributed database. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100006 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -1439,6 +1784,9 @@ declare namespace distributedKVStore { /** * UnRegister Synchronizes SingleKVStore databases callback. * + * @param {Callback>} syncCallback - {Array<[string, number]>}: the + * deviceId and it's corresponding synchronization result which 0 means synchronization success + * and otherwise failed. * @throws {BusinessError} 401 - if parameter check failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 @@ -1448,12 +1796,23 @@ declare namespace distributedKVStore { /** * Get the security level of the database. * - * @returns SecurityLevel {@code SecurityLevel} the security level of the database. + * @param {AsyncCallback} callback - {SecurityLevel}: the {@code SecurityLevel} + * object indicates the security level of the database. * @throws {BusinessError} 15100006 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ getSecurityLevel(callback: AsyncCallback): void; + + /** + * Get the security level of the database. + * + * @returns {Promise} {SecurityLevel}: the {@code SecurityLevel} object indicates + * the security level of the database. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ getSecurityLevel(): Promise; } @@ -1473,8 +1832,10 @@ declare namespace distributedKVStore { /** * Obtains the {@code String} value matching a specified device ID and key. * - * @param deviceId Indicates the device to be queried. - * @param key Indicates the key of the value to be queried. + * @param {string} deviceId - Indicates the device to be queried. + * @param {string} key - Indicates the key of the value to be queried. + * @param {AsyncCallback} callback - + * {boolean|string|number|Uint8Array}: the returned value specified by the deviceId and key. * @return Returns the value matching the given criteria. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. @@ -1483,14 +1844,32 @@ declare namespace distributedKVStore { * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ - get(deviceId: string, key: string, callback: AsyncCallback): void; - get(deviceId: string, key: string): Promise; + get(deviceId: string, key: string, callback: AsyncCallback): void; + + /** + * Obtains the {@code String} value matching a specified device ID and key. + * + * @param {string} deviceId - Indicates the device to be queried. + * @param {string} key - Indicates the key of the value to be queried. + * @returns {Promise} + * {Uint8Array|string|boolean|number}: the returned value specified by the deviceId and key. + * @return Returns the value matching the given criteria. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the data not exist when query data. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + get(deviceId: string, key: string): Promise; /** * Obtains all key-value pairs matching a specified device ID and key prefix. * - * @param deviceId Identifies the device whose data is to be queried. - * @param keyPrefix Indicates the key prefix to match. + * @param {string} deviceId - Identifies the device whose data is to be queried. + * @param {string} keyPrefix - Indicates the key prefix to match. + * @param {AsyncCallback} callback - {Entry[]}: the list of all key-value pairs + * that match the specified deviceId and key prefix. * @returns Returns the list of all key-value pairs meeting the given criteria. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. @@ -1499,14 +1878,30 @@ declare namespace distributedKVStore { * @since 9 */ getEntries(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; + + /** + * Obtains all key-value pairs matching a specified device ID and key prefix. + * + * @param {string} deviceId - Identifies the device whose data is to be queried. + * @param {string} keyPrefix - Indicates the key prefix to match. + * @returns {Promise} {Entry[]}: the list of all key-value pairs that match the + * specified deviceId and key prefix. + * @returns Returns the list of all key-value pairs meeting the given criteria. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ getEntries(deviceId: string, keyPrefix: string): Promise; /** * Obtains the list of key-value pairs matching a specified device ID and {@code Query} object. * - * @param deviceId Indicates the ID of the device to which the key-value pairs belong. - * @param query Indicates the {@code Query} object. - * @returns Returns the list of key-value pairs matching the specified {@code Query} object. + * @param {string} deviceId - Indicates the ID of the device to which the key-value pairs belong. + * @param {string} query - Indicates the {@code Query} object. + * @param {AsyncCallback} callback - {Entry[]}: the list of all key-value pairs + * matching the specified deviceId and {@code Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100005 - if not support the operation. @@ -1515,6 +1910,21 @@ declare namespace distributedKVStore { * @since 9 */ getEntries(deviceId: string, query: Query, callback: AsyncCallback): void; + + /** + * Obtains the list of key-value pairs matching a specified device ID and {@code Query} object. + * + * @param {string} deviceId - Indicates the ID of the device to which the key-value pairs belong. + * @param {string} query - Indicates the {@code Query} object. + * @returns {Promise} {Entry[]}: the list of all key-value pairs matching the + * specified deviceId and {@code Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100005 - if not support the operation. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ getEntries(deviceId: string, query: Query): Promise; /** @@ -1525,9 +1935,10 @@ declare namespace distributedKVStore { * calling this method will return a failure. Therefore, you are advised to call the closeResultSet method to close unnecessary * {@code KVStoreResultSet} objects in a timely manner. * - * @param deviceId Identifies the device whose data is to be queried. - * @param keyPrefix Indicates the key prefix to match. - * @returns Returns the {@code KVStoreResultSet} objects. + * @param {string} deviceId - Identifies the device whose data is to be queried. + * @param {string} keyPrefix - Indicates the key prefix to match. + * @param {AsyncCallback} callback - {KVStoreResultSet}: the {@code KVStoreResultSet} + * object matching the specified deviceId and keyPrefix. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. @@ -1535,14 +1946,34 @@ declare namespace distributedKVStore { * @since 9 */ getResultSet(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; + + /** + * Obtains the {@code KVStoreResultSet} object matching the specified device ID and key prefix. + * + *

The {@code KVStoreResultSet} object can be used to query all key-value pairs that meet the search criteria. Each {@code SingleKVStore} + * instance can have a maximum of four {@code KVStoreResultSet} objects at the same time. If you have created four objects, + * calling this method will return a failure. Therefore, you are advised to call the closeResultSet method to close unnecessary + * {@code KVStoreResultSet} objects in a timely manner. + * + * @param {string} deviceId - Identifies the device whose data is to be queried. + * @param {string} keyPrefix - Indicates the key prefix to match. + * @returns {Promise} {KVStoreResultSet}: the {@code KVStoreResultSet} + * object matching the specified deviceId and keyPrefix. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ getResultSet(deviceId: string, keyPrefix: string): Promise; /** * Obtains the {@code KVStoreResultSet} object matching a specified device ID and {@code Query} object. * - * @param deviceId Indicates the ID of the device to which the {@code KVStoreResultSet} object belongs. - * @param query Indicates the {@code Query} object. - * @returns Returns the {@code KVStoreResultSet} object matching the specified {@code Query} object. + * @param {string} deviceId - Indicates the ID of the device to which the {@code KVStoreResultSet} object belongs. + * @param {Query} query - Indicates the {@code Query} object. + * @param {AsyncCallback} callback - {KVStoreResultSet}: the {@code KVStoreResultSet} + * object matching the specified deviceId and {@code Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. @@ -1550,13 +1981,29 @@ declare namespace distributedKVStore { * @since 9 */ getResultSet(deviceId: string, query: Query, callback: AsyncCallback): void; + + /** + * Obtains the {@code KVStoreResultSet} object matching a specified device ID and {@code Query} object. + * + * @param {string} deviceId - Indicates the ID of the device to which the {@code KVStoreResultSet} object belongs. + * @param {Query} query - Indicates the {@code Query} object. + * @returns {Promise} {KVStoreResultSet}: the {@code KVStoreResultSet} + * object matching the specified deviceId and {@code Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ getResultSet(deviceId: string, query: Query): Promise; /** * Obtains the KVStoreResultSet object matching a specified Device ID and Predicate object. * - * @param predicates Indicates the key. * @param deviceId Indicates the ID of the device to which the results belong. + * @param {dataSharePredicates.DataSharePredicates} predicates - Indicates the dataSharePredicates. + * @param {AsyncCallback} callback - {KVStoreResultSet}: the {@code KVStoreResultSet} + * object matching the specified deviceId and {@code dataSharePredicates.DataSharePredicates} object. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. @@ -1565,14 +2012,30 @@ declare namespace distributedKVStore { * @since 9 */ getResultSet(deviceId: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; + + /** + * Obtains the KVStoreResultSet object matching a specified Device ID and Predicate object. + * + * @param deviceId Indicates the ID of the device to which the results belong. + * @param {dataSharePredicates.DataSharePredicates} predicates - Indicates the dataSharePredicates. + * @returns {Promise} {KVStoreResultSet}: the {@code KVStoreResultSet} + * object matching the specified deviceId and {@code dataSharePredicates.DataSharePredicates} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @systemapi + * @since 9 + */ getResultSet(deviceId: string, predicates: dataSharePredicates.DataSharePredicates): Promise; /** * Obtains the number of results matching a specified device ID and {@code Query} object. * - * @param deviceId Indicates the ID of the device to which the results belong. - * @param query Indicates the {@code Query} object. - * @returns Returns the number of results matching the specified {@code Query} object. + * @param {string} deviceId - Indicates the ID of the device to which the results belong. + * @param {Query} query - Indicates the {@code Query} object. + * @param {AsyncCallback} callback - {number}: the number of results matching the + * specified deviceId and {@code Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. @@ -1580,6 +2043,20 @@ declare namespace distributedKVStore { * @since 9 */ getResultSize(deviceId: string, query: Query, callback: AsyncCallback): void; + + /** + * Obtains the number of results matching a specified device ID and {@code Query} object. + * + * @param {string} deviceId - Indicates the ID of the device to which the results belong. + * @param {Query} query - Indicates the {@code Query} object. + * @returns {Promise} {number}: the number of results matching the specified + * deviceId and {@code Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ getResultSize(deviceId: string, query: Query): Promise; } @@ -1589,14 +2066,28 @@ declare namespace distributedKVStore { *

You must pass {@link KVManagerConfig} to provide configuration information * for creating the {@link KVManager} instance. * - * @param config Indicates the KVStore configuration information, + * @param {KVManagerConfig} config - Indicates the KVStore configuration information, * including the user information and package name. - * @return Returns the {@code KVManager} instance. + * @param {AsyncCallback} callback - {KVManager}: the {@code KVManager} instance. * @throws {BusinessError} 401 - if parameter check failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ function createKVManager(config: KVManagerConfig, callback: AsyncCallback): void; + + /** + * Creates a {@link KVManager} instance based on the configuration information. + * + *

You must pass {@link KVManagerConfig} to provide configuration information + * for creating the {@link KVManager} instance. + * + * @param {KVManagerConfig} config - Indicates the KVStore configuration information, + * including the user information and package name. + * @returns {Promise} {KVManager}: the {@code KVManager} instance. + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ function createKVManager(config: KVManagerConfig): Promise; /** @@ -1611,21 +2102,35 @@ declare namespace distributedKVStore { /** * Creates and obtains a KVStore database by specifying {@code Options} and {@code storeId}. * - * @param options Indicates the options used for creating and obtaining the KVStore database, - * including {@code isCreateIfMissing}, {@code isEncrypt}, and {@code KVStoreType}. - * @param storeId Identifies the KVStore database. - * The value of this parameter must be unique for the same application, - * and different applications can share the same value. - * @return Returns a {@code SingleKVStore}, or {@code DeviceKVStore}. + * @param {string} storeId - Identifies the KVStore database. The value of this parameter must be unique + * for the same application, and different applications can share the same value. + * @param {Options} options - Indicates the {@code Options} object used for creating and + * obtaining the KVStore database. + * @param {AsyncCallback} callback - {T}: the {@code SingleKVStore} or {@code DeviceKVStore} instance. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100002 - if open existed database with changed options. * @throws {BusinessError} 15100003 - if the database is corrupted. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - getKVStore(storeId: string, options: Options): Promise; getKVStore(storeId: string, options: Options, callback: AsyncCallback): void; + /** + * Creates and obtains a KVStore database by specifying {@code Options} and {@code storeId}. + * + * @param {string} storeId - Identifies the KVStore database. The value of this parameter must be unique + * for the same application, and different applications can share the same value. + * @param {Options} options - Indicates the {@code Options} object used for creating and + * obtaining the KVStore database. + * @returns {Promise} {T}: the {@code SingleKVStore} or {@code DeviceKVStore} instance. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100002 - if open existed database with changed options. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + getKVStore(storeId: string, options: Options): Promise; + /** * Closes the KVStore database. * @@ -1636,11 +2141,32 @@ declare namespace distributedKVStore { * method, release the resources created for the database, for example, {@code KVStoreResultSet} for KVStore, otherwise * closing the database will fail. If you are attempting to close a database that is already closed, an error will be returned. * + * @param {string} appId - Identifies the application that the database belong to. + * @param {string} storeId - Identifies the KVStore database to close. + * @param {AsyncCallback} callback - the callback of closeKVStore. * @throws {BusinessError} 401 - if parameter check failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ closeKVStore(appId: string, storeId: string, callback: AsyncCallback): void; + + /** + * Closes the KVStore database. + * + *

Warning: This method is not thread-safe. If you call this method to stop a KVStore database that is running, your + * thread may crash. + * + *

The KVStore database to close must be an object created by using the {@code getKVStore} method. Before using this + * method, release the resources created for the database, for example, {@code KVStoreResultSet} for KVStore, otherwise + * closing the database will fail. If you are attempting to close a database that is already closed, an error will be returned. + * + * @param {string} appId - Identifies the application that the database belong to. + * @param {string} storeId - Identifies the KVStore database to close. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ closeKVStore(appId: string, storeId: string): Promise; /** @@ -1651,41 +2177,72 @@ declare namespace distributedKVStore { *

You can use this method to delete a KVStore database not in use. After the database is deleted, all its data will be * lost. * - * @param storeId Identifies the KVStore database to delete. + * @param {string} appId - Identifies the application that the database belong to. + * @param {string} storeId - Identifies the KVStore database to delete. + * @param {AsyncCallback} callback - the callback of deleteKVStore. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100004 - if the database not exist when delete database. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ deleteKVStore(appId: string, storeId: string, callback: AsyncCallback): void; + + /** + * Deletes the KVStore database identified by storeId. + * + *

Before using this method, close all KVStore instances in use that are identified by the same storeId. + * + *

You can use this method to delete a KVStore database not in use. After the database is deleted, all its data will be + * lost. + * + * @param {string} appId - Identifies the application that the database belong to. + * @param {string} storeId - Identifies the KVStore database to delete. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100004 - if the database not exist when delete database. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ deleteKVStore(appId: string, storeId: string): Promise; /** * Obtains the storeId of all KVStore databases that are created by using the {@code getKVStore} method and not deleted by * calling the {@code deleteKVStore} method. * - * @returns Returns the storeId of all created KVStore databases. + * @param {string} appId - Identifies the application that obtains the databases. + * @param {AsyncCallback} callback - {string[]}: the storeId of all created KVStore databases. * @throws {BusinessError} 401 - if parameter check failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ getAllKVStoreId(appId: string, callback: AsyncCallback): void; - getAllKVStoreId(appId: string): Promise; /** - * register DeviceChangeCallback to get notification when device's status changed + * Obtains the storeId of all KVStore databases that are created by using the {@code getKVStore} method and not deleted by + * calling the {@code deleteKVStore} method. * - * @param deathCallback device change callback {@code DeviceChangeCallback} + * @param {string} appId - Identifies the application that obtains the databases. + * @returns {Promise} {string[]}: the storeId of all created KVStore databases. * @throws {BusinessError} 401 - if parameter check failed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + getAllKVStoreId(appId: string): Promise; + + /** + * register DeathCallback to get notification when service died. + * + * @param {Callback} deathCallback - the service died callback. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @throws {BusinessError} 401 - if parameter check failed. * @since 9 */ on(event: 'distributedDataServiceDie', deathCallback: Callback): void; /** - * unRegister DeviceChangeCallback and can not receive notification + * unRegister DeathCallback and can not receive service died notification. * - * @param deathCallback device change callback {@code DeviceChangeCallback} which has been registered. + * @param {Callback} deathCallback - the service died callback which has been registered. * @throws {BusinessError} 401 - if parameter check failed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 -- Gitee From dbc7e63a780df8718406ce55d1503141ffd92d4a Mon Sep 17 00:00:00 2001 From: wu-chengwen Date: Thu, 13 Oct 2022 16:24:28 +0800 Subject: [PATCH 162/438] feature(usb):add usb v9 api Signed-off-by: wu-chengwen --- api/@ohos.usb.d.ts | 4 + api/@ohos.usbV9.d.ts | 939 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 943 insertions(+) create mode 100644 api/@ohos.usbV9.d.ts diff --git a/api/@ohos.usb.d.ts b/api/@ohos.usb.d.ts index 00588468d5..fce6f34e61 100644 --- a/api/@ohos.usb.d.ts +++ b/api/@ohos.usb.d.ts @@ -13,6 +13,10 @@ * limitations under the License. */ +/** + * @deprecated since 9 + * @useinstead ohos.usbV9 + */ declare namespace usb { /** * Obtains the USB device list. diff --git a/api/@ohos.usbV9.d.ts b/api/@ohos.usbV9.d.ts new file mode 100644 index 0000000000..5ff0ebbe45 --- /dev/null +++ b/api/@ohos.usbV9.d.ts @@ -0,0 +1,939 @@ +/* + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * This module provides the capability of manage USB device. + * @namespace usbV9 + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ +declare namespace usbV9 { + /** + * Obtains the USB device list. + * + * @return Returns the {@link USBDevice} list. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function getDevices(): Array>; + + /** + * Connects to the USB device based on the device information returned by {@link getDevices()}. + * + * @param device USB device on the device list returned by {@link getDevices()}. + * @return Returns the {@link USBDevicePipe} object for data transfer. + * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. + * @throws {BusinessError} 14400001 - USB Device access denied. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function connectDevice(device: USBDevice): Readonly; + + /** + * Checks whether the application has the permission to access the device. + * + * @param deviceName Device name defined by {@link USBDevice.name}. + * @return Returns **true** if the user has the permission to access the device; return **false** otherwise. + * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function hasRight(deviceName: string): boolean; + + /** + * Requests the permission for a given application to access the USB device. + * + * @param deviceName Device name defined by {@link USBDevice.name}. + * @return Returns **true** if the device access permissions are granted; return **false** otherwise. + * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function requestRight(deviceName: string): Promise; + + /** + * Remove the permission for a given application to access the USB device. + * + * @param deviceName Device name defined by {@link USBDevice.name}. + * @return Returns **true** if the device access permissions are removed; return **false** otherwise. + * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function removeRight(deviceName: string): boolean; + + /** + * Add device access permission. + * + * @param bundleName refers to application that require access permissions. + * @param deviceName Device name defined by {@link USBDevice.name}. + * @return Returns the boolean value to indicate whether the permission is granted. + * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. + * @systemapi + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function addRight(bundleName: string, deviceName: string): boolean; + + /** + * Converts the string descriptor of a given USB function list to a numeric mask combination. + * + * @param funcs Descriptor of the supported function list. + * @return Returns the numeric mask combination of the function list. + * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. + * @systemapi + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function usbFunctionsFromString(funcs: string): number; + + /** + * Converts the numeric mask combination of a given USB function list to a string descriptor. + * + * @param funcs Numeric mask combination of the function list. + * @return Returns the string descriptor of the supported function list. + * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. + * @systemapi + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function usbFunctionsToString(funcs: FunctionType): string; + + /** + * Sets the current USB function list in Device mode. + * + * @param funcs Numeric mask combination of the supported function list. + * @return Returns **true** if the setting is successful; returns **false** otherwise. + * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. + * @systemapi + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function setCurrentFunctions(funcs: FunctionType): Promise; + + /** + * Obtains the numeric mask combination for the current USB function list in Device mode. + * + * @return Returns the numeric mask combination for the current USB function list in {@link FunctionType}. + * @systemapi + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function getCurrentFunctions(): FunctionType; + + /* usb port functions begin */ + /** + * Obtains the {@link USBPort} list. + * + * @return Returns the {@link USBPort} list. + * @systemapi + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function getPorts(): Array; + + /** + * Gets the mask combination for the supported mode list of the specified {@link USBPort}. + * + * @return Returns the mask combination for the supported mode list in {@link PortModeType}. + * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. + * @systemapi + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function getSupportedModes(portId: number): PortModeType; + + /** + * Sets the role types supported by the specified {@link USBPort}, which can be powerRole (for charging) and dataRole (for data transfer). + * + * @param portId Unique ID of the port. + * @param powerRole Charging role defined by {@link PowerRoleType}. + * @param dataRole Data role defined by {@link DataRoleType}. + * @return Returns the supported role type. + * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. + * @systemapi + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function setPortRoles(portId: number, powerRole: PowerRoleType, dataRole: DataRoleType): Promise; + + /* usb pipe functions begin */ + /** + * Claims a USB interface. + * + * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address. + * @param iface USB interface defined by {@link USBInterface}, which is used to determine the interface to claim. + * @param force Optional parameter that determines whether to forcibly claim the USB interface. + * @return Returns **0** if the USB interface is successfully claimed; returns an error code otherwise. + * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function claimInterface(pipe: USBDevicePipe, iface: USBInterface, force?: boolean): number; + + /** + * Releases a USB interface. + * + * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address. + * @param iface USB interface defined by {@link USBInterface}, which is used to determine the interface to release. + * @return Returns **0** if the USB interface is successfully released; returns an error code otherwise. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function releaseInterface(pipe: USBDevicePipe, iface: USBInterface): number; + + /** + * Sets the device configuration. + * + * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address. + * @param config Device configuration defined by {@link USBConfig}. + * @return Returns **0** if the device configuration is successfully set; returns an error code otherwise. + * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function setConfiguration(pipe: USBDevicePipe, config: USBConfig): number; + + /** + * Sets a USB interface. + * + * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address. + * @param iface USB interface defined by {@link USBInterface}, which is used to determine the interface to set. + * @return Returns **0** if the USB interface is successfully set; return an error code otherwise. + * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function setInterface(pipe: USBDevicePipe, iface: USBInterface): number; + + /** + * Obtains the raw USB descriptor. + * + * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address. + * @return Returns the raw descriptor data. + * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function getRawDescriptor(pipe: USBDevicePipe): Uint8Array; + + /** + * Obtains the file descriptor. + * + * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the USB device. + * @return Returns the file descriptor of the USB device. + * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function getFileDescriptor(pipe: USBDevicePipe): number; + + /** + * Performs control transfer. + * + * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the USB device. + * @param contrlparam Control transfer parameters. + * @param timeout Timeout duration. This parameter is optional. The default value is **0**, indicating no timeout. + * @return Returns the size of the transmitted or received data block if the control transfer is successful; return **-1** if an exception occurs. + * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function controlTransfer(pipe: USBDevicePipe, contrlparam: USBControlParams, timeout?: number): Promise; + + /** + * Performs bulk transfer. + * + * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the USB device. + * @param endpoint USB endpoint defined by {@link USBEndpoint}, which is used to determine the USB port for data transfer. + * @param buffer Buffer for writing or reading data. + * @param timeout Timeout duration. This parameter is optional. The default value is **0**, indicating no timeout. + * @return Returns the size of the transmitted or received data block if the control transfer is successful; return **-1** if an exception occurs. + * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function bulkTransfer(pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array, + timeout?: number): Promise; + + /** + * Closes a USB device pipe. + * + * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the USB device. + * @return Returns **0** if the USB device pipe is closed successfully; return an error code otherwise. + * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + function closePipe(pipe: USBDevicePipe): number; + + /** + * Represents the USB endpoint from which data is sent or received. You can obtain the USB endpoint through {@link USBInterface}. + * + * @typedef USBEndpoint + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + interface USBEndpoint { + /** + * Endpoint address + * + * @since 9 + */ + address: number; + + /** + * Endpoint attributes + * + * @since 9 + */ + attributes: number; + + /** + * Endpoint interval + * + * @since 9 + */ + interval: number; + + /** + * Maximum size of data packets on the endpoint + * + * @since 9 + */ + maxPacketSize: number; + + /** + * Endpoint direction + * + * @since 9 + */ + direction: USBRequestDirection; + + /** + * Endpoint number + * + * @since 9 + */ + number: number; + + /** + * Endpoint type + * + * @since 9 + */ + type: number; + + /** + * Unique ID defined by {@link USBInterface.id}, which indicates the interface to which the endpoint belongs + * + * @since 9 + */ + interfaceId: number; + } + + + /** + * Represents a USB interface. One USBconfig {@link USBConfig} can contain multiple **USBInterface** instances, each providing a specific function. + * + * @typedef USBInterface + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + interface USBInterface { + /** + * Unique ID of the USB interface + * + * @since 9 + */ + id: number; + + /** + * Interface protocol + * + * @since 9 + */ + protocol: number; + + /** + * Device type + * + * @since 9 + */ + clazz: number; + + /** + * Device subclass + * + * @since 9 + */ + subClass: number; + + /** + * Alternating between descriptors of the same USB interface + * + * @since 9 + */ + alternateSetting: number; + + /** + * Interface name + * + * @since 9 + */ + name: string; + + /** + * {@link USBEndpoint} that belongs to the USB interface + * + * @since 9 + */ + endpoints: Array; + } + + /** + * USB configuration. One {@link USBDevice} can contain multiple USBConfig instances. + * + * @typedef USBConfig + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + interface USBConfig { + /** + * Unique ID of the USB configuration + * + * @since 9 + * + * + */ + id: number; + + /** + * Configuration attributes + * + * @since 9 + */ + attributes: number; + + /** + * Maximum power consumption, in mA + * + * @since 9 + */ + maxPower: number; + + /** + * Configuration name, which can be left empty + * + * @since 9 + */ + name: string; + + /** + * Support for remote wakeup + * + * @since 9 + */ + isRemoteWakeup: boolean; + + /** + * Support for independent power supplies + * + * @since 9 + */ + isSelfPowered: boolean; + + /** + * Supported interface attributes defined by {@link USBInterface} + * + * @since 9 + */ + interfaces: Array; + } + + /** + * Represents a USB device. + * + * @typedef USBDevice + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + interface USBDevice { + /** + * Bus address + * + * @since 9 + */ + busNum: number; + /** + * Device address + * + * @since 9 + */ + devAddress: number; + /** + * Device SN + * + * @since 9 + */ + serial: string; + /** + * Device name + * + * @since 9 + */ + name: string; + /** + * Device manufacturer + * + * @since 9 + */ + manufacturerName: string; + /** + * Product information + * + * @since 9 + */ + productName: string; + /** + * Product version + * + * @since 9 + */ + version: string; + /** + * Vendor ID + * + * @since 9 + */ + vendorId: number; + /** + * Product ID + * + * @since 9 + */ + productId: number; + /** + * Device class + * + * @since 9 + */ + clazz: number; + /** + * Device subclass + * + * @since 9 + */ + subClass: number; + /** + * Device protocol code + * + * @since 9 + */ + protocol: number; + /** + * Device configuration descriptor information defined by {@link USBConfig} + * + * @since 9 + */ + configs: Array; + } + + /** + * Represents a USB device pipe, which is used to determine the USB device. + * + * @typedef USBDevicePipe + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + interface USBDevicePipe { + /** + * Bus address. + * + * @since 9 + */ + busNum: number; + /** + * Device address + * + * @since 9 + */ + devAddress: number; + } + + /** + * Enumerates power role types. + * + * @enum { number } + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + export enum PowerRoleType { + /** + * None + * + * @since 9 + */ + NONE = 0, + /** + * External power supply + * + * @since 9 + */ + SOURCE = 1, + /** + * Internal power supply + * + * @since 9 + */ + SINK = 2 + } + + /** + * Enumerates data role types. + * + * @enum { number } + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + export enum DataRoleType { + /** + * None + * + * @since 9 + */ + NONE = 0, + /** + * Host mode + * + * @since 9 + */ + HOST = 1, + /** + * Device mode + * + * @since 9 + */ + DEVICE = 2 + } + + /** + * Enumerates port mode types + * + * @enum { number } + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + export enum PortModeType { + /** + * None + * + * @since 9 + */ + NONE = 0, + /** + * Upstream facing port, which functions as the sink of power supply + * + * @since 9 + */ + UFP = 1, + /** + * Downstream facing port, which functions as the source of power supply + * + * @since 9 + */ + DFP = 2, + /** + * Dynamic reconfiguration port (DRP), which can function as the DFP (host) or UFP (device). It is not supported currently. + * + * @since 9 + */ + DRP = 3, + /** + * Not supported currently + * + * @since 9 + */ + NUM_MODES = 4 + } + + /** + * Enumerates USB device port roles. + * + * @typedef USBPortStatus + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + interface USBPortStatus { + /** + * USB mode + * + * @since 9 + */ + currentMode: number; + + /** + * Power role + * + * @since 9 + */ + currentPowerRole: number; + + /** + * Data role + * + * @since 9 + */ + currentDataRole: number; + } + + /** + * Represents a USB device port. + * + * @typedef USBPort + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + interface USBPort { + /** + * Unique ID of the USB port + * + * @since 9 + */ + id: number; + + /** + * Mask combination for the supported mode list of the USB port + * + * @since 9 + */ + supportedModes: PortModeType; + + /** + * USB port role defined by {@link USBPortStatus} + * + * @since 9 + */ + status: USBPortStatus; + } + + /** + * Represents control transfer parameters. + * + * @typedef USBControlParams + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + interface USBControlParams { + /** + * Request type + * + * @since 9 + */ + request: number; + /** + * Request target type + * + * @since 9 + */ + target: USBRequestTargetType; + /** + * Control request type + * + * @since 9 + */ + reqType: USBControlRequestType; + /** + * Request parameter value + * + * @since 9 + */ + value: number; + /** + * Index of the parameter value + * + * @since 9 + */ + index: number; + /** + * Data written to or read from the buffer + * @since 9 + */ + data: Uint8Array; + } + + /** + * Enumerates USB request target types. + * + * @enum { number } + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + export enum USBRequestTargetType { + /** + * USB device + * + * @since 9 + */ + USB_REQUEST_TARGET_DEVICE = 0, + /** + * USB interface + * + * @since 9 + */ + USB_REQUEST_TARGET_INTERFACE = 1, + /** + * Endpoint + * + * @since 9 + */ + USB_REQUEST_TARGET_ENDPOINT = 2, + /** + * Others + * + * @since 9 + */ + USB_REQUEST_TARGET_OTHER = 3 + } + + /** + * Enumerates control request types. + * + * @enum { number } + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + export enum USBControlRequestType { + /** + * Standard + * + * @since 9 + */ + USB_REQUEST_TYPE_STANDARD = 0, + /** + * Class + * + * @since 9 + */ + USB_REQUEST_TYPE_CLASS = 1, + /** + * Vendor + * + * @since 9 + */ + USB_REQUEST_TYPE_VENDOR = 2 + } + + /** + * Enumerates request directions. + * + * @enum { number } + * @syscap SystemCapability.USB.USBManager + * @since 9 + */ + export enum USBRequestDirection { + /** + * Request for writing data from the host to the device + * + * @since 9 + */ + USB_REQUEST_DIR_TO_DEVICE = 0, + /** + * Request for reading data from the device to the host + * + * @since 9 + */ + USB_REQUEST_DIR_FROM_DEVICE = 0x80 + } + + /** + * Enumerates function modes. + * + * @enum { number } + * @syscap SystemCapability.USB.USBManager + * @systemapi + * @since 9 + */ + export enum FunctionType { + /** + * None + * + * @since 9 + */ + NONE = 0, + /** + * Serial port device + * + * @since 9 + */ + ACM = 1, + /** + * Ethernet port device + * + * @since 9 + */ + ECM = 2, + /** + * HDC device + * + * @since 9 + */ + HDC = 4, + /** + * MTP device + * + * @since 9 + */ + MTP = 8, + /** + * PTP device + * + * @since 9 + */ + PTP = 16, + /** + * RNDIS device + * + * @since 9 + */ + RNDIS = 32, + /** + * MIDI device + * + * @since 9 + */ + MIDI = 64, + /** + * Audio source device + * + * @since 9 + */ + AUDIO_SOURCE = 128, + /** + * NCM device + * + * @since 9 + */ + NCM = 256 + } + +} + +export default usbV9; -- Gitee From d4b6ec3ff72bc5aedf7bbfb260ec517e0dc7792c Mon Sep 17 00:00:00 2001 From: zhaogan Date: Mon, 17 Oct 2022 14:25:42 +0800 Subject: [PATCH 163/438] =?UTF-8?q?Issue:=20#I5VJYU=20Description:=20?= =?UTF-8?q?=E5=8C=85=E7=AE=A1=E7=90=86Api=E9=94=99=E8=AF=AF=E7=A0=81?= =?UTF-8?q?=E6=95=B4=E6=94=B9=20Sig:=20SIG=5FApplicaitonFramework=20Featur?= =?UTF-8?q?e=20or=20Bugfix:=20Feature=20Binary=20Source:=20No?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhaogan --- api/@ohos.bundle.appControl.d.ts | 12 +- api/@ohos.bundle.bundleManager.d.ts | 1120 +++++++++++++++++++++-- api/@ohos.bundle.d.ts | 159 +++- api/@ohos.bundle.defaultAppManager.d.ts | 205 +++-- api/bundle/PermissionDef.d.ts | 2 + api/bundle/bundleInfo.d.ts | 2 + api/bundle/customizeData.d.ts | 6 +- api/bundleManager/bundleInfo.d.ts | 240 +++++ api/bundleManager/permissionDef.d.ts | 55 ++ 9 files changed, 1598 insertions(+), 203 deletions(-) create mode 100644 api/bundleManager/bundleInfo.d.ts create mode 100644 api/bundleManager/permissionDef.d.ts diff --git a/api/@ohos.bundle.appControl.d.ts b/api/@ohos.bundle.appControl.d.ts index 0f9de6b9fb..098b2621a1 100644 --- a/api/@ohos.bundle.appControl.d.ts +++ b/api/@ohos.bundle.appControl.d.ts @@ -32,7 +32,7 @@ declare namespace appControl { * @param { AsyncCallback } callback - The callback of setting the disposed status result. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. - * @throws { BusinessError } 801 - Capicity not supported. + * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 17700005 - The specified appId was not found. * @syscap SystemCapability.BundleManager.BundleFramework.AppControl * @systemapi @@ -48,7 +48,7 @@ declare namespace appControl { * @returns { Promise } The result of setting the disposed status of a specified bundle. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. - * @throws { BusinessError } 801 - Capicity not supported. + * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 17700005 - The specified appId was not found. * @syscap SystemCapability.BundleManager.BundleFramework.AppControl * @systemapi @@ -63,7 +63,7 @@ declare namespace appControl { * @param { AsyncCallback } callback - The callback of getting the disposed status of a specified bundle result. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. - * @throws { BusinessError } 801 - Capicity not supported. + * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 17700005 - The specified appId was not found. * @syscap SystemCapability.BundleManager.BundleFramework.AppControl * @systemapi @@ -78,7 +78,7 @@ declare namespace appControl { * @returns { Promise } Returns the disposed status of a specified bundle. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. - * @throws { BusinessError } 801 - Capicity not supported. + * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 17700005 - The specified appId was not found. * @syscap SystemCapability.BundleManager.BundleFramework.AppControl * @systemapi @@ -93,7 +93,7 @@ declare namespace appControl { * @param { AsyncCallback } callback - the callback of deleting the disposed status of a specified bundle result. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. - * @throws { BusinessError } 801 - Capicity not supported. + * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 17700005 - The specified appId was not found. * @syscap SystemCapability.BundleManager.BundleFramework.AppControl * @systemapi @@ -108,7 +108,7 @@ declare namespace appControl { * @returns { Promise } Returns the result of deleting the disposed status of a specified bundle. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. - * @throws { BusinessError } 801 - Capicity not supported. + * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 17700005 - The specified appId was not found. * @syscap SystemCapability.BundleManager.BundleFramework.AppControl * @systemapi diff --git a/api/@ohos.bundle.bundleManager.d.ts b/api/@ohos.bundle.bundleManager.d.ts index 754bb104fa..858f6aa818 100644 --- a/api/@ohos.bundle.bundleManager.d.ts +++ b/api/@ohos.bundle.bundleManager.d.ts @@ -14,109 +14,1041 @@ */ import { AsyncCallback } from './basic'; +import { ApplicationInfo as _ApplicationInfo } from './bundleManager/applicationInfo'; +import { Metadata as _Metadata } from './bundleManager/metadata'; +import { HapModuleInfo as _HapModuleInfo } from './bundleManager/hapModuleInfo'; +import { PermissionDef as _PermissionDef } from './bundleManager/permissionDef'; +import { ElementName as _ElementName } from './bundleManager/elementName'; +import Want from './@ohos.application.Want'; +import image from './@ohos.multimedia.image'; +import * as _AbilityInfo from './bundleManager/abilityInfo'; +import * as _BundleInfo from './bundleManager/bundleInfo'; +import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; /** - * Obtains the Want for starting the main ability of an application based on the - * given bundle name. The main ability of an application is the ability that has the - * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's config.json or module.json file. - * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED - * @param { string } bundleName - Indicates the bundle name of the application. - * @param { number } userId - Indicates the user ID or do not pass user ID. - * @param { AsyncCallback } callback - The callback for starting the application's main ability. - * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. - * @throws { BusinessError } 401 - Input parameters check failed. - * @throws { BusinessError } 17700001 - The specified bundleName is not existed. - * @throws { BusinessError } 17700004 - The specified userId is not existed. + * This module is used to obtain package information of various applications installed on the current device. + * @namespace bundleManager * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ -function getLaunchWantForBundle(bundleName: string, userId: number, callback: AsyncCallback): void; + declare namespace bundleManager { + /** + * Used to query the enumeration value of bundleInfo. Multiple values can be passed in the form. + * @enum { number } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + enum BundleFlag { + /** + * Used to obtain the default bundleInfo. The obtained bundleInfo does not contain information of + * signatureInfo, applicationInfo, hapModuleInfo, ability, extensionAbility and permission. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + GET_BUNDLE_INFO_DEFAULT = 0x00000000, + /** + * Used to obtain the bundleInfo containing applicationInfo. The obtained bundleInfo does not + * contain the information of signatureInfo, hapModuleInfo, ability, extensionAbility and permission. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + GET_BUNDLE_INFO_WITH_APPLICATION = 0x00000001, + /** + * Used to obtain the bundleInfo containing hapModuleInfo. The obtained bundleInfo does not + * contain the information of signatureInfo, applicationInfo, ability, extensionAbility and permission. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + GET_BUNDLE_INFO_WITH_HAP_MODULE = 0x00000002, + /** + * Used to obtain the bundleInfo containing ability. The obtained bundleInfo does not + * contain the information of signatureInfo, applicationInfo, extensionAbility and permission. + * It can't be used alone, it needs to be used with GET_BUNDLE_INFO_WITH_HAP_MODULE. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + GET_BUNDLE_INFO_WITH_ABILITY = 0x00000004, + /** + * Used to obtain the bundleInfo containing extensionAbility. The obtained bundleInfo does not + * contain the information of signatureInfo, applicationInfo, ability and permission. + * It can't be used alone, it needs to be used with GET_BUNDLE_INFO_WITH_HAP_MODULE. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY = 0x00000008, + /** + * Used to obtain the bundleInfo containing permission. The obtained bundleInfo does not + * contain the information of signatureInfo, applicationInfo, hapModuleInfo, extensionAbility and ability. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + GET_BUNDLE_INFO_WITH_REQUESTED_PERMISSION = 0x00000010, + /** + * Used to obtain the metadata contained in applicationInfo, moduleInfo and abilityInfo. + * It can't be used alone, it needs to be used with GET_BUNDLE_INFO_WITH_APPLICATION, + * GET_BUNDLE_INFO_WITH_HAP_MODULE, GET_BUNDLE_INFO_WITH_ABILITIES, GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + GET_BUNDLE_INFO_WITH_METADATA = 0x00000020, + /** + * Used to obtain the default bundleInfo containing disabled application and ability. + * The obtained bundleInfo does not contain information of signatureInfo, applicationInfo, + * hapModuleInfo, ability, extensionAbility and permission. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + GET_BUNDLE_INFO_WITH_DISABLE = 0x00000040, + /** + * Used to obtain the bundleInfo containing signatureInfo. The obtained bundleInfo does not + * contain the information of applicationInfo, hapModuleInfo, extensionAbility, ability and permission. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + GET_BUNDLE_INFO_WITH_SIGNATURE_INFO = 0x00000080, + } -/** - * Obtains the Want for starting the main ability of an application based on the - * given bundle name. The main ability of an application is the ability that has the - * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's config.json or module.json file. - * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED - * @param { string } bundleName - Indicates the bundle name of the application. - * @param { AsyncCallback } callback - The callback for starting the application's main ability. - * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. - * @throws { BusinessError } 401 - Input parameters check failed. - * @throws { BusinessError } 17700001 - The specified bundleName is not existed. - * @throws { BusinessError } 17700004 - The specified userId is not existed. - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ -function getLaunchWantForBundle(bundleName: string, callback: AsyncCallback): void; + /** + * Used to query the enumeration value of applicationInfo. Multiple values can be passed in the form. + * @enum { number } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + enum ApplicationFlag { + /** + * Used to obtain the default applicationInfo. The obtained applicationInfo does not contain the information of + * permission and metadata. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + GET_APPLICATION_INFO_DEFAULT = 0x00000000, + /** + * Used to obtain the applicationInfo containing permission. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + GET_APPLICATION_INFO_WITH_PERMISSION = 0x00000001, + /** + * Used to obtain the applicationInfo containing metadata. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + GET_APPLICATION_INFO_WITH_METADATA = 0x00000002, + /** + * Used to obtain the applicationInfo containing disabled application. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + GET_APPLICATION_INFO_WITH_DISABLE = 0x00000004, + } /** - * Obtains the Want for starting the main ability of an application based on the - * given bundle name. The main ability of an application is the ability that has the - * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's config.json or module.json file. - * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED - * @param { string } bundleName - Indicates the bundle name of the application. - * @param { number } userId - Indicates the user ID or do not pass user ID. - * @returns { Promise } the Want for starting the application's main ability. - * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. - * @throws { BusinessError } 401 - Input parameters check failed. - * @throws { BusinessError } 17700001 - The specified bundleName is not existed. - * @throws { BusinessError } 17700004 - The specified userId is not existed. - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ -function getLaunchWantForBundle(bundleName: string, userId?: number): Promise; + * Used to query the enumeration value of abilityInfo. Multiple values can be passed in the form. + * @enum { number } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + enum AbilityFlag { + /** + * Used to obtain the default abilityInfo. The obtained abilityInfo does not contain the information of + * permission, metadata and disabled abilityInfo. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + GET_ABILITY_INFO_DEFAULT = 0x00000000, + /** + * Used to obtain the abilityInfo containing disabled abilityInfo. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + GET_ABILITY_INFO_WITH_PERMISSION = 0x00000001, + /** + * Used to obtain the abilityInfo containing applicationInfo. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + GET_ABILITY_INFO_WITH_APPLICATION = 0x00000002, + /** + * Used to obtain the abilityInfo containing metadata. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + GET_ABILITY_INFO_WITH_METADATA = 0x00000004, + /** + * Used to obtain the abilityInfo containing disabled abilityInfo. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + GET_ABILITY_INFO_WITH_DISABLE = 0x00000008, + /** + * Used to obtain the abilityInfo only for system app. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + GET_ABILITY_INFO_ONLY_SYSTEM_APP = 0x00000010, + } -/** - * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. - * @param { string } moduleName - Indicates the moduleName of the application. - * @param { string } abilityName - Indicates the abilityName of the application. - * @param { string } metadataName - Indicates the name of metadata in ability. - * @param { AsyncCallback } callback - The callback of returning string in json-format of the corresponding config file. - * @throws { BusinessError } 401 - Input parameters check failed. - * @throws { BusinessError } 17700003 - The specified anilityName or moduleName is not existed. - * @throws { BusinessError } 17700024 - The specified metadataName is not existed or the profile is not json-format. - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ -function getProfileByAbility(moduleName: string, abilityName: string, metadataName: string, callback: AsyncCallback>): void; + /** + * Used to query the enumeration value of ExtensionAbilityInfo. Multiple values can be passed in the form. + * @enum { number } + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + enum ExtensionAbilityFlag { + /** + * Used to obtain the default extensionAbilityInfo. The obtained extensionAbilityInfo does not contain the information of + * permission, metadata and disabled abilityInfo. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + GET_EXTENSION_ABILITY_INFO_DEFAULT = 0x00000000, + /** + * Used to obtain the extensionAbilityInfo containing permission. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + GET_EXTENSION_ABILITY_INFO_WITH_PERMISSION = 0x00000001, + /** + * Used to obtain the extensionAbilityInfo containing applicationInfo. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + GET_EXTENSION_ABILITY_INFO_WITH_APPLICATION = 0x00000002, + /** + * Used to obtain the extensionAbilityInfo containing metadata. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + GET_EXTENSION_ABILITY_INFO_WITH_METADATA = 0x00000004, + } -/** - * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. - * @param { string } moduleName - Indicates the moduleName of the application. - * @param { string } abilityName - Indicates the abilityName of the application. - * @param { string } metadataName - Indicates the name of metadata in ability. - * @returns { Promise> } Returns string in json-format of the corresponding config file. - * @throws { BusinessError } 401 - Input parameters check failed. - * @throws { BusinessError } 17700003 - The specified anilityName or moduleName is not existed. - * @throws { BusinessError } 17700024 - The specified metadataName is not existed or the profile is not json-format. - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ -function getProfileByAbility(moduleName: string, abilityName: string, metadataName?: string): Promise>; + /** + * Obtains own bundleInfo. + * @param { number } bundleFlags - Indicates BundleFlag, the value in bundleFlag can be used in or. + * @returns { Promise } The result of getting the bundle info. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + function getBundleInfoForSelf(bundleFlags: number): Promise; -/** - * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. - * @param { string } moduleName - Indicates the moduleName of the application. - * @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application. - * @param { string } metadataName - Indicates the name of metadata in ability. - * @param { AsyncCallback } callback - The callback of returning string in json-format of the corresponding config file. - * @throws { BusinessError } 401 - Input parameters check failed. - * @throws { BusinessError } 17700003 - The specified extensionAbilityName or moduleName is not existed. - * @throws { BusinessError } 17700024 - The specified metadataName is not existed or the profile is not json-format. - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ -function getProfileByExtensionAbility(moduleName: string, extensionAbilityName: string, metadataName: string, callback: AsyncCallback>): void; + /** + * Obtains own bundleInfo. + * @param { number } bundleFlags - Indicates BundleFlag, the value in bundleFlag can be used in or. + * @param { AsyncCallback } callback - The callback of getting bundle info result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + function getBundleInfoForSelf(bundleFlags: number, callback: AsyncCallback): void; -/** - * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. - * @param { string } moduleName - Indicates the moduleName of the application. - * @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application. - * @param { string } metadataName - Indicates the name of metadata in ability. - * @returns { Promise> } Returns string in json-format of the corresponding config file. - * @throws { BusinessError } 401 - Input parameters check failed. - * @throws { BusinessError } 17700003 - The specified extensionAbilityName or moduleName is not existed. - * @throws { BusinessError } 17700024 - The specified metadataName is not existed or the profile is not json-format. - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ -function getProfileByExtensionAbility(moduleName: string, extensionAbilityName: string, metadataName?: string): Promise>; \ No newline at end of file + /** + * Obtains bundleInfo based on bundleName, bundleFlags and options. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { number } bundleFlags - Indicates BundleFlag, the value in bundleFlag can be used in or. + * @param { number } userId - Indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback - The callback of getting bundle info result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700004 - The specified userId is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function getBundleInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback): void; + function getBundleInfo(bundleName: string, bundleFlags: number, userId: number, callback: AsyncCallback): void; + + /** + * Obtains bundleInfo based on bundleName, bundleFlags and options. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { number } bundleFlags - Indicates BundleFlag, the value in bundleFlag can be used in or. + * @param { number } userId - Indicates the user ID or do not pass user ID. + * @returns { Promise } The result of getting the bundle info. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700004 - The specified userId is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function getBundleInfo(bundleName: string, bundleFlags: number, userId?: number): Promise; + + /** + * Obtains application info based on a given bundle name. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { number } appFlags - Indicates ApplicationFlag, the value in ApplicationFlag can be used in or. + * @param { number } userId - Indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback - The callback of getting application info result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700004 - The specified userId is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function getApplicationInfo(bundleName: string, appFlags: number, callback: AsyncCallback): void; + function getApplicationInfo(bundleName: string, appFlags: number, userId: number, callback: AsyncCallback): void; + + /** + * Obtains application info based on a given bundle name. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { number } appFlags - Indicates ApplicationFlag, the value in ApplicationFlag can be used in or. + * @param { number } userId - Indicates the user ID or do not pass user ID. + * @returns { Promise } The result of getting the application info. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700004 - The specified userId is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function getApplicationInfo(bundleName: string, appFlags: number, userId?: number): Promise; + + /** + * Obtains BundleInfo of all bundles available in the system. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo that will be returned. + * @param { number } userId - Indicates the user id. + * @param { AsyncCallback } callback - The callback of getting a list of BundleInfo objects. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700004 - The specified userId is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function getAllBundleInfo(bundleFlags: number, callback: AsyncCallback>): void; + function getAllBundleInfo(bundleFlags: number, userId: number, callback: AsyncCallback>): void; + + /** + * Obtains BundleInfo of all bundles available in the system. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo that will be returned. + * @param { number } userId - Indicates the user id. + * @returns { Promise> } Returns a list of BundleInfo objects. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700004 - The specified userId is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function getAllBundleInfo(bundleFlags: number, userId?: number): Promise>; + + /** + * Obtains information about all installed applications of a specified user. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. + * @param { number } userId - Indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback - The callback of getting a list of ApplicationInfo objects. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700004 - The specified userId is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function getAllApplicationInfo(appFlags: number, callback: AsyncCallback>): void; + function getAllApplicationInfo(appFlags: number, userId: number, callback: AsyncCallback>): void; + + /** + * Obtains information about all installed applications of a specified user. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. + * @param { number } userId - Indicates the user ID or do not pass user ID. + * @returns { Promise> } Returns a list of ApplicationInfo objects. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700004 - The specified userId is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function getAllApplicationInfo(appFlags: number, userId?: number): Promise>; + + /** + * Query the AbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { Want } want - Indicates the Want containing the application bundle name to be queried. + * @param { number } abilityFlags - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned. + * @param { number } userId - userId Indicates the user ID. + * @param { AsyncCallback> } callback - The callback of querying ability info result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700003 - The specified ability is not found. + * @throws { BusinessError } 17700004 - The specified userId is invalid. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @throws { BusinessError } 17700029 - The specified ability is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function queryAbilityInfo(want: Want, abilityFlags: number, callback: AsyncCallback>): void; + function queryAbilityInfo(want: Want, abilityFlags: number, userId: number, callback: AsyncCallback>): void; + + /** + * Query the AbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { Want } want - Indicates the Want containing the application bundle name to be queried. + * @param { number } abilityFlags - Indicates the flag used to specify information contained in the AbilityInfo objects that will be returned. + * @param { number } userId - userId Indicates the user ID. + * @returns { Promise> } Returns a list of AbilityInfo objects. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700003 - The specified extensionAbility is not found. + * @throws { BusinessError } 17700004 - The specified userId is invalid. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @throws { BusinessError } 17700029 - The specified ability is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function queryAbilityInfo(want: Want, abilityFlags: number, userId?: number): Promise>; + + /** + * Query extension info of by utilizing a Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { Want } want - Indicates the Want containing the application bundle name to be queried. + * @param { ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType. + * @param { number } extensionAbilityFlags - Indicates the flag used to specify information contained in the ExtensionInfo objects that will be returned. + * @param { number } userId - Indicates the user ID. + * @param { AsyncCallback> } callback - The callback of querying extension ability info result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700003 - The specified extensionAbility is not found. + * @throws { BusinessError } 17700004 - The specified userId is invalid. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function queryExtensionAbilityInfo(want: Want, extensionAbilityType: ExtensionAbilityType, extensionAbilityFlags: number, callback: AsyncCallback>): void; + function queryExtensionAbilityInfo(want: Want, extensionAbilityType: ExtensionAbilityType, extensionAbilityFlags: number, userId: number, callback: AsyncCallback>): void; + + /** + * Query the ExtensionAbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { Want } want - Indicates the Want containing the application bundle name to be queried. + * @param { ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType.. + * @param { number } extensionAbilityFlags - Indicates the flag used to specify information contained in the ExtensionAbilityInfo objects that will be returned. + * @param { number } userId - Indicates the user ID. + * @returns { Promise> } Returns a list of ExtensionAbilityInfo objects. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700003 - The specified extensionAbility is not found. + * @throws { BusinessError } 17700004 - The specified userId is invalid. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function queryExtensionAbilityInfo(want: Want, extensionAbilityType: ExtensionAbilityType, extensionAbilityFlags: number, userId?: number): Promise>; + + /** + * Obtains bundle name by the given uid. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { number } uid - Indicates the UID of an application. + * @param { AsyncCallback } callback - The callback of getting bundle name. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700021 - The uid is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function getBundleNameByUid(uid: number, callback: AsyncCallback): void + + /** + * Obtains bundle name by the given uid. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { number } uid - Indicates the UID of an application. + * @returns { Promise } Returns the bundle name. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700021 - The uid is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function getBundleNameByUid(uid: number): Promise; + + /** + * Obtains information about an application bundle contained in an ohos Ability Package (HAP). + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } hapFilePath - Indicates the path storing the HAP. The path should be the relative path to the data directory of the current application. + * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo object to be returned. + * @param { AsyncCallback } callback - The callback of getting bundle archive info result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700022 - The hapFilePath is invalid. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number, callback: AsyncCallback): void + + /** + * Obtains information about an application bundle contained in an ohos Ability Package (HAP). + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } hapFilePath - Indicates the path storing the HAP. The path should be the relative path to the data directory of the current application. + * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo object to be returned. + * @returns { Promise } Returns the BundleInfo object. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700022 - The hapFilePath is invalid. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number): Promise; + + /** + * Clears cache data of a specified application. + * @permission ohos.permission.REMOVE_CACHE_FILES + * @param { string } bundleName - Indicates the bundle name of the application whose cache data is to be cleaned. + * @param { AsyncCallback } callback - The callback of cleaning bundle cache files result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700030 - The specified bundleName does not support cleaning cache files. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function cleanBundleCacheFiles(bundleName: string, callback: AsyncCallback): void; + + /** + * Clears cache data of a specified application. + * @permission ohos.permission.REMOVE_CACHE_FILES + * @param { string } bundleName - Indicates the bundle name of the application whose cache data is to be cleaned. + * @returns { Promise } Clean bundle cache files result + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function cleanBundleCacheFiles(bundleName: string): Promise; + + /** + * Sets whether to enable a specified application. + * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. + * @param { AsyncCallback } callback - The callback of setting app enabled result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function setApplicationEnabled(bundleName: string, isEnable: boolean, callback: AsyncCallback): void; + + /** + * Sets whether to enable a specified application. + * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. + * @returns { Promise } set app enabled result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function setApplicationEnabled(bundleName: string, isEnable: boolean): Promise; + + /** + * Sets whether to enable a specified ability. + * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE + * @param { AbilityInfo } abilityInfo - Indicates information about the ability to set. + * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. + * @param { AsyncCallback } callback - The callback of setting ability enabled result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700003 - The specified abilityInfo is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function setAbilityEnabled(info: AbilityInfo, isEnable: boolean, callback: AsyncCallback): void; + + /** + * Sets whether to enable a specified ability. + * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE + * @param { AbilityInfo } abilityInfo - Indicates information about the ability to set. + * @param { boolean } isEnabled - The value true means to enable it, and the value false means to disable it. + * @returns { Promise } set ability enabled result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700003 - The specified abilityInfo is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function setAbilityEnabled(info: AbilityInfo, isEnable: boolean): Promise; + + /** + * Checks whether a specified application is enabled. + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { AsyncCallback } callback - The callback of checking application enabled result. The result is true if enabled, false otherwise. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function isApplicationEnabled(bundleName: string, callback: AsyncCallback): void; + + /** + * Checks whether a specified application is enabled. + * @param { string } bundleName - Indicates the bundle name of the application. + * @returns { Promise } Returns true if the application is enabled; returns false otherwise. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function isApplicationEnabled(bundleName: string): Promise; + + /** + * Checks whether a specified ability is enabled. + * @param { AbilityInfo } info - Indicates information about the ability to check. + * @param { AsyncCallback } callback - The callback of checking ability enabled result. The result is true if enabled, false otherwise. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700003 - The specified abilityName is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function isAbilityEnabled(info: AbilityInfo, callback: AsyncCallback): void; + + /** + * Checks whether a specified ability is enabled. + * @param { AbilityInfo } info - Indicates information about the ability to check. + * @returns { Promise } Returns true if the ability is enabled; returns false otherwise. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700003 - The specified abilityName is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function isAbilityEnabled(info: AbilityInfo): Promise; + + /** + * Obtains the Want for starting the main ability of an application based on the + * given bundle name. The main ability of an application is the ability that has the + * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's config.json or module.json file. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { number } userId - Indicates the user ID or do not pass user ID. + * @param { AsyncCallback } callback - The callback for starting the application's main ability. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. + * @throws { BusinessError } 401 - Input parameters check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700004 - The specified userId is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + function getLaunchWantForBundle(bundleName: string, userId: number, callback: AsyncCallback): void; + + /** + * Obtains the Want for starting the main ability of an application based on the + * given bundle name. The main ability of an application is the ability that has the + * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's config.json or module.json file. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { AsyncCallback } callback - The callback for starting the application's main ability. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. + * @throws { BusinessError } 401 - Input parameters check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700004 - The specified userId is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + function getLaunchWantForBundle(bundleName: string, callback: AsyncCallback): void; + + /** + * Obtains the Want for starting the main ability of an application based on the + * given bundle name. The main ability of an application is the ability that has the + * #ACTION_HOME and #ENTITY_HOME Want filters set in the application's config.json or module.json file. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { number } userId - Indicates the user ID or do not pass user ID. + * @returns { Promise } the Want for starting the application's main ability. + * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. + * @throws { BusinessError } 401 - Input parameters check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700004 - The specified userId is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + function getLaunchWantForBundle(bundleName: string, userId?: number): Promise; + + /** + * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. + * @param { string } moduleName - Indicates the moduleName of the application. + * @param { string } abilityName - Indicates the abilityName of the application. + * @param { string } metadataName - Indicates the name of metadata in ability. + * @param { AsyncCallback> } callback - The callback of returning string in json-format of the corresponding config file. + * @throws { BusinessError } 401 - Input parameters check failed. + * @throws { BusinessError } 17700002 - The specified moduleName is not existed. + * @throws { BusinessError } 17700003 - The specified anilityName is not existed. + * @throws { BusinessError } 17700024 - The specified metadataName is not existed or the profile is not json-format. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @throws { BusinessError } 17700029 - The specified ability is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + function getProfileByAbility(moduleName: string, abilityName: string, metadataName: string, callback: AsyncCallback>): void; + + /** + * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. + * @param { string } moduleName - Indicates the moduleName of the application. + * @param { string } abilityName - Indicates the abilityName of the application. + * @param { string } metadataName - Indicates the name of metadata in ability. + * @returns { Promise> } Returns string in json-format of the corresponding config file. + * @throws { BusinessError } 401 - Input parameters check failed. + * @throws { BusinessError } 17700002 - The specified moduleName is not existed. + * @throws { BusinessError } 17700003 - The specified anilityName is not existed. + * @throws { BusinessError } 17700024 - The specified metadataName is not existed or the profile is not json-format. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @throws { BusinessError } 17700029 - The specified ability is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + function getProfileByAbility(moduleName: string, abilityName: string, metadataName?: string): Promise>; + + /** + * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. + * @param { string } moduleName - Indicates the moduleName of the application. + * @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application. + * @param { string } metadataName - Indicates the name of metadata in ability. + * @param { AsyncCallback } callback - The callback of returning string in json-format of the corresponding config file. + * @throws { BusinessError } 401 - Input parameters check failed. + * @throws { BusinessError } 17700002 - The specified moduleName is not existed. + * @throws { BusinessError } 17700003 - The specified extensionAbilityName not existed. + * @throws { BusinessError } 17700024 - The specified metadataName is not existed or the profile is not json-format. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + function getProfileByExtensionAbility(moduleName: string, extensionAbilityName: string, metadataName: string, callback: AsyncCallback>): void; + + /** + * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. + * @param { string } moduleName - Indicates the moduleName of the application. + * @param { string } extensionAbilityName - Indicates the extensionAbilityName of the application. + * @param { string } metadataName - Indicates the name of metadata in ability. + * @returns { Promise> } Returns string in json-format of the corresponding config file. + * @throws { BusinessError } 401 - Input parameters check failed. + * @throws { BusinessError } 17700002 - The specified moduleName is not existed. + * @throws { BusinessError } 17700003 - The specified extensionAbilityName not existed. + * @throws { BusinessError } 17700024 - The specified metadataName is not existed or the profile is not json-format. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + function getProfileByExtensionAbility(moduleName: string, extensionAbilityName: string, metadataName?: string): Promise>; + + /** + * Get the permission details by permission name. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } permissionName - Indicates permission name. + * @param { AsyncCallback } callback - The callback of get permissionDef object result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Input parameters check failed. + * @throws { BusinessError } 17700006 - The specified permission is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function getPermissionDef(permissionName: string, callback: AsyncCallback): void; + + /** + * Get the permission details by permission name. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @param { string } permissionName - Indicates permission name. + * @returns { Promise } Returns permissionDef object. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Input parameters check failed. + * @throws { BusinessError } 17700006 - The specified permission is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function getPermissionDef(permissionName: string): Promise; + + /** + * Obtains the label of a specified ability. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. + * @param { string } moduleName - Indicates the module name. + * @param { string } abilityName - Indicates the ability name. + * @param { AsyncCallback } callback - The callback of getting ability label result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700002 - The specified moduleName is not found. + * @throws { BusinessError } 17700003 - The specified abilityName is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @throws { BusinessError } 17700029 - The specified ability is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Resource + * @systemapi + * @since 9 + */ + function getAbilityLabel(bundleName: string, moduleName: string, abilityName: string, callback: AsyncCallback): void; + + /** + * Obtains the label of a specified ability. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. + * @param { string } moduleName - Indicates the module name. + * @param { string } abilityName - Indicates the ability name. + * @returns { Promise } Returns the label representing the label of the specified ability. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700002 - The specified moduleName is not found. + * @throws { BusinessError } 17700003 - The specified abilityName is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @throws { BusinessError } 17700029 - The specified ability is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Resource + * @systemapi + * @since 9 + */ + function getAbilityLabel(bundleName: string, moduleName: string, abilityName: string): Promise; + + /** + * Obtains the icon of a specified ability. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. + * @param { string } moduleName - Indicates the module name. + * @param { string } abilityName - Indicates the ability name. + * @param { AsyncCallAsyncCallback } callback - The callback of getting ability icon result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700002 - The specified moduleName is not found. + * @throws { BusinessError } 17700003 - The specified abilityName is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @throws { BusinessError } 17700029 - The specified ability is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Resource + * @systemapi + * @since 9 + */ + function getAbilityIcon(bundleName: string, moduleName: string, abilityName: string, callback: AsyncCallback): void; + + /** + * Obtains the icon of a specified ability. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the bundle name of the application to which the ability belongs. + * @param { string } moduleName - Indicates the module name. + * @param { string } abilityName - Indicates the ability name. + * @returns { Promise } Returns the PixelMap object representing the icon of the specified ability. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700002 - The specified moduleName is not found. + * @throws { BusinessError } 17700003 - The specified abilityName is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. + * @throws { BusinessError } 17700029 - The specified ability is disabled. + * @syscap SystemCapability.BundleManager.BundleFramework.Resource + * @systemapi + * @since 9 + */ + function getAbilityIcon(bundleName: string, moduleName: string, abilityName: string): Promise; + + /** + * Obtains applicationInfo based on a given bundleName and bundleFlags. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { number } bundleFlags - Indicates the flag used to specify information contained in the ApplicationInfo object that will be returned. + * @param { number } userId - Indicates the user ID or do not pass user ID. + * @returns Returns the ApplicationInfo object. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700004 - The specified userId is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function getApplicationInfoSync(bundleName: string, bundleFlags: number, userId: number) : ApplicationInfo; + function getApplicationInfoSync(bundleName: string, bundleFlags: number) : ApplicationInfo; + + /** + * Obtains bundleInfo based on bundleName, bundleFlags and options. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @param { string } bundleName - Indicates the application bundle name to be queried. + * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo object that will be returned. + * @param { number } userId - Indicates the user ID or do not pass user ID. + * @returns Returns the BundleInfo object. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700004 - The specified userId is not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + function getBundleInfoSync(bundleName: string, bundleFlags: number, userId: number): BundleInfo; + function getBundleInfoSync(bundleName: string, bundleFlags: number): BundleInfo; + + /** + * Obtains configuration information about an application. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + export type ApplicationInfo = _ApplicationInfo; + + /** + * Indicates the Metadata. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + export type Metadata = _Metadata; + + /** + * Obtains configuration information about a bundle. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + export type BundleInfo = _BundleInfo.BundleInfo; + + /** + * The scene which is used. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + export type UsedScene = _BundleInfo.UsedScene; + + /** + * Indicates the required permissions details defined in file config.json. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + export type ReqPermissionDetail = _BundleInfo.ReqPermissionDetail; + + /** + * Indicates the PermissionGrantStatus. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + export type PermissionGrantStatus = _BundleInfo.PermissionGrantStatus; + + /** + * Indicates the SignatureInfo. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + export type SignatureInfo = _BundleInfo.SignatureInfo; + + /** + * Obtains configuration information about an module. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + export type HapModuleInfo = _HapModuleInfo; + + /** + * Obtains configuration information about an ability. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + export type AbilityInfo = _AbilityInfo.AbilityInfo; + + /** + * Contains basic Ability information, which indicates ability type. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + export type AbilityType = _AbilityInfo.AbilityType; + + /** + * Contains basic Ability information. Indicates display orientation. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + export type DisplayOrientation = _AbilityInfo.DisplayOrientation; + + /** + * Contains basic Ability information. Indicates support window mode. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + export type SupportWindowMode = _AbilityInfo.SupportWindowMode; + + /** + * Contains basic Ability information. Indicates the window size.. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + export type WindowSize = _AbilityInfo.WindowSize; + + /** + * Obtains extension information about a bundle. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + export type ExtensionAbilityInfo = _ExtensionAbilityInfo.ExtensionAbilityInfo; + + /** + * Indicates extension ability type + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + export type ExtensionAbilityType = _ExtensionAbilityInfo.ExtensionAbilityType; + + /** + * Indicates the defined permission details in file config.json. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + export type PermissionDef = _PermissionDef; + + /** + * Contains basic Ability information, which uniquely identifies an ability. + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + export type ElementName = _ElementName; +} + +export default bundleManager; diff --git a/api/@ohos.bundle.d.ts b/api/@ohos.bundle.d.ts index 8444c2188e..761db11e78 100644 --- a/api/@ohos.bundle.d.ts +++ b/api/@ohos.bundle.d.ts @@ -37,6 +37,8 @@ import * as _BundleInstaller from './bundle/bundleInstaller'; * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager */ declare namespace bundle { @@ -46,6 +48,9 @@ declare namespace bundle { * @syscap SystemCapability.BundleManager.BundleFramework * @import NA * @permission NA + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager.BundleFlag, ohos.bundle.bundleManager.ApplicationFlag or + * ohos.bundle.bundleManager.AbilityFlag */ enum BundleFlag { GET_BUNDLE_DEFAULT = 0x00000000, @@ -95,6 +100,8 @@ declare namespace bundle { * @syscap SystemCapability.BundleManager.BundleFramework * @import NA * @permission NA + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager.ExtensionAbilityFlag */ enum ExtensionFlag { GET_EXTENSION_INFO_DEFAULT = 0x00000000, @@ -109,6 +116,7 @@ declare namespace bundle { * @syscap SystemCapability.BundleManager.BundleFramework * @import NA * @permission NA + * @deprecated since 9 */ export enum ColorMode { AUTO_MODE = -1, @@ -122,6 +130,8 @@ declare namespace bundle { * @syscap SystemCapability.BundleManager.BundleFramework * @import NA * @permission NA + * @deprecated since 9 + * @useinstead bundleInfo.PermissionGrantStatus */ export enum GrantStatus { PERMISSION_DENIED = -1, @@ -134,6 +144,8 @@ declare namespace bundle { * @syscap SystemCapability.BundleManager.BundleFramework * @import NA * @permission NA + * @deprecated since 9 + * @useinstead abilityInfo.AbilityType */ export enum AbilityType { /** @@ -171,6 +183,7 @@ declare namespace bundle { * @syscap SystemCapability.BundleManager.BundleFramework * @import NA * @permission NA + * @deprecated since 9 */ export enum AbilitySubType { UNSPECIFIED = 0, @@ -183,6 +196,8 @@ declare namespace bundle { * @syscap SystemCapability.BundleManager.BundleFramework * @import NA * @permission NA + * @deprecated since 9 + * @useinstead abilityInfo.DisplayOrientation */ export enum DisplayOrientation { /** @@ -283,6 +298,8 @@ declare namespace bundle { * @syscap SystemCapability.BundleManager.BundleFramework * @import NA * @permission NA + * @deprecated since 9 + * @useinstead bundleManager/AbilityInfo.LaunchType */ export enum LaunchMode { /** @@ -306,6 +323,8 @@ declare namespace bundle { * @syscap SystemCapability.BundleManager.BundleFramework * @import NA * @permission NA + * @deprecated since 9 + * @useinstead bundleManager/ExtensionAbilityInfo.ExtensionAbilityType */ export enum ExtensionAbilityType { /** @@ -406,6 +425,7 @@ declare namespace bundle { * @syscap SystemCapability.BundleManager.BundleFramework * @import NA * @permission NA + * @deprecated since 9 */ export interface BundleOptions { /** @@ -422,6 +442,7 @@ declare namespace bundle { * @syscap SystemCapability.BundleManager.BundleFramework * @import NA * @permission NA + * @deprecated since 9 */ export enum InstallErrorCode{ SUCCESS = 0, @@ -472,6 +493,8 @@ declare namespace bundle { * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.freeInstall#UpgradeFlag */ export enum UpgradeFlag { /** @@ -500,6 +523,8 @@ declare namespace bundle { * @syscap SystemCapability.BundleManager.BundleFramework * @import NA * @permission NA + * @deprecated since 9, use @ohos.bundle.AbilityInfo.SupportWindowMode + * @useinstead bundleManager/AbilityInfo.SupportWindowMode */ export enum SupportWindowMode { /** @@ -532,6 +557,8 @@ declare namespace bundle { * @param options Indicates the bundle options object. * @return Returns the BundleInfo object. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getBundleInfo */ function getBundleInfo(bundleName: string, bundleFlags: number, options: BundleOptions, callback: AsyncCallback): void; function getBundleInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback): void; @@ -545,6 +572,8 @@ declare namespace bundle { * @return Returns the IBundleInstaller interface. * @permission ohos.permission.INSTALL_BUNDLE * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.installer#getBundleInstaller */ function getBundleInstaller(callback: AsyncCallback): void; function getBundleInstaller(): Promise; @@ -558,6 +587,8 @@ declare namespace bundle { * @param abilityName Indicates the ability name. * @return Returns the AbilityInfo object for the current ability. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#queryAbilityInfo */ function getAbilityInfo(bundleName: string, abilityName: string, callback: AsyncCallback): void; function getAbilityInfo(bundleName: string, abilityName: string): Promise; @@ -573,6 +604,8 @@ declare namespace bundle { * @param userId Indicates the user ID or do not pass user ID. * @return Returns the ApplicationInfo object. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getApplicationInfo */ function getApplicationInfo(bundleName: string, bundleFlags: number, userId: number, callback: AsyncCallback) : void; function getApplicationInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback) : void; @@ -590,6 +623,8 @@ declare namespace bundle { * @param userId Indicates the user ID. * @return Returns a list of AbilityInfo objects. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#queryAbilityInfo */ function queryAbilityByWant(want: Want, bundleFlags: number, userId: number, callback: AsyncCallback>): void; function queryAbilityByWant(want: Want, bundleFlags: number, callback: AsyncCallback>): void; @@ -605,6 +640,8 @@ declare namespace bundle { * @param userId Indicates the user id. * @return Returns a list of BundleInfo objects. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getAllBundleInfo */ function getAllBundleInfo(bundleFlag: BundleFlag, userId: number, callback: AsyncCallback>) : void; function getAllBundleInfo(bundleFlag: BundleFlag, callback: AsyncCallback>) : void; @@ -620,6 +657,8 @@ declare namespace bundle { * @param userId Indicates the user ID or do not pass user ID. * @return Returns a list of ApplicationInfo objects. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getAllApplicationInfo */ function getAllApplicationInfo(bundleFlags: number, userId: number, callback: AsyncCallback>) : void; function getAllApplicationInfo(bundleFlags: number, callback: AsyncCallback>) : void; @@ -632,6 +671,8 @@ declare namespace bundle { * @syscap SystemCapability.BundleManager.BundleFramework * @param uid Indicates the UID of an application. * @return Returns the bundle name. + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getNameForUid */ function getNameForUid(uid: number, callback: AsyncCallback) : void function getNameForUid(uid: number) : Promise; @@ -646,6 +687,8 @@ declare namespace bundle { * @param bundleFlags Indicates the flag used to specify information contained in the BundleInfo object to be * returned. * @return Returns the BundleInfo object. + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getBundleArchiveInfo */ function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number, callback: AsyncCallback) : void function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number) : Promise; @@ -677,6 +720,8 @@ declare namespace bundle { * @param callback Indicates the callback to be invoked for returning the operation result. * @permission ohos.permission.REMOVE_CACHE_FILES * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#cleanBundleCacheFiles */ function cleanBundleCacheFiles(bundleName: string, callback: AsyncCallback): void; function cleanBundleCacheFiles(bundleName: string): Promise; @@ -691,6 +736,8 @@ declare namespace bundle { * value false means to disable it. * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#setApplicationEnabled */ function setApplicationEnabled(bundleName: string, isEnable: boolean, callback: AsyncCallback): void; function setApplicationEnabled(bundleName: string, isEnable: boolean): Promise; @@ -705,6 +752,8 @@ declare namespace bundle { * value false means to disable it.. * @permission ohos.permission.CHANGE_ABILITY_ENABLED_STATE * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#setAbilityEnabled */ function setAbilityEnabled(info: AbilityInfo, isEnable: boolean, callback: AsyncCallback): void; function setAbilityEnabled(info: AbilityInfo, isEnable: boolean): Promise; @@ -720,6 +769,8 @@ declare namespace bundle { * @param userId Indicates the user ID. * @return Returns a list of ExtensionInfo objects. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#queryExtensionAbilityInfo */ function queryExtensionAbilityInfos(want: Want, extensionType: number, extensionFlags: number, userId: number, callback: AsyncCallback>): void; function queryExtensionAbilityInfos(want: Want, extensionType: number, extensionFlags: number, callback: AsyncCallback>): void; @@ -734,6 +785,8 @@ declare namespace bundle { * @return Returns permissionDef object. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @systemapi + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getPermissionDef */ function getPermissionDef(permissionName: string, callback: AsyncCallback): void; function getPermissionDef(permissionName: string): Promise; @@ -747,6 +800,8 @@ declare namespace bundle { * @param abilityName Indicates the ability name. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @return Returns the label representing the label of the specified ability. + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getAbilityLabel */ function getAbilityLabel(bundleName: string, abilityName: string, callback: AsyncCallback): void; function getAbilityLabel(bundleName: string, abilityName: string): Promise; @@ -760,6 +815,8 @@ declare namespace bundle { * @param abilityName Indicates the ability name. * @return Returns the PixelMap object representing the icon of the specified ability. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getAbilityIcon */ function getAbilityIcon(bundleName: string, abilityName: string, callback: AsyncCallback): void; function getAbilityIcon(bundleName: string, abilityName: string): Promise; @@ -771,7 +828,9 @@ declare namespace bundle { * @syscap SystemCapability.BundleManager.BundleFramework * @param info Indicates information about the ability to check. * @returns Returns true if the ability is enabled; returns false otherwise. - */ + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#isAbilityEnabled + */ function isAbilityEnabled(info: AbilityInfo, callback: AsyncCallback): void; function isAbilityEnabled(info: AbilityInfo): Promise; @@ -782,6 +841,8 @@ declare namespace bundle { * @syscap SystemCapability.BundleManager.BundleFramework * @param bundleName Indicates the bundle name of the application. * @returns Returns true if the application is enabled; returns false otherwise. + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#isApplicationEnabled */ function isApplicationEnabled(bundleName: string, callback: AsyncCallback): void; function isApplicationEnabled(bundleName: string): Promise; @@ -795,6 +856,8 @@ declare namespace bundle { * @param moduleName Indicates the module name of the application. * @param upgradeFlag Indicates upgradeFlag of the application. * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.freeInstall#setHapModuleUpgradeFlag */ function setModuleUpgradeFlag(bundleName: string, moduleName: string, upgradeFlag: UpgradeFlag, callback: AsyncCallback):void; function setModuleUpgradeFlag(bundleName: string, moduleName: string, upgradeFlag: UpgradeFlag): Promise; @@ -808,6 +871,8 @@ declare namespace bundle { * @param moduleName Indicates the module name of the application. * @returns Returns true if the module is removable; returns false otherwise. * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.freeInstall#isHapModuleRemovable */ function isModuleRemovable(bundleName: string, moduleName: string, callback: AsyncCallback): void; function isModuleRemovable(bundleName: string, moduleName: string): Promise; @@ -821,11 +886,13 @@ declare namespace bundle { * @param bundlePackFlag Indicates the application bundle pack flag to be queried. * @return Returns the BundlePackInfo object. * @systemapi hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.freeInstall#getBundlePackInfo */ function getBundlePackInfo(bundleName: string, bundlePackFlag : pack.BundlePackFlag, callback: AsyncCallback): void; function getBundlePackInfo(bundleName: string, bundlePackFlag : pack.BundlePackFlag): Promise; - /** + /** * Obtains information about the current ability. * * @since 9 @@ -835,17 +902,21 @@ declare namespace bundle { * @param abilityName Indicates the ability name. * @return Returns the AbilityInfo object for the current ability. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getAbilityInfo */ function getAbilityInfo(bundleName: string, moduleName: string, abilityName: string, callback: AsyncCallback): void; function getAbilityInfo(bundleName: string, moduleName: string, abilityName: string): Promise; - /** + /** * Obtains information about the dispatcher version. * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework * @return Returns the DispatchInfo object for the current ability. * @systemapi hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.freeInstall#getDispatchInfo */ function getDispatcherVersion(callback: AsyncCallback): void; function getDispatcherVersion(): Promise; @@ -860,6 +931,8 @@ declare namespace bundle { * @param abilityName Indicates the ability name. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @return Returns the label representing the label of the specified ability. + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getAbilityLabel */ function getAbilityLabel(bundleName: string, moduleName: string, abilityName: string, callback: AsyncCallback): void; function getAbilityLabel(bundleName: string, moduleName: string, abilityName: string): Promise; @@ -874,6 +947,8 @@ declare namespace bundle { * @param abilityName Indicates the ability name. * @return Returns the PixelMap object representing the icon of the specified ability. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getAbilityIcon */ function getAbilityIcon(bundleName: string, moduleName: string, abilityName: string, callback: AsyncCallback): void; function getAbilityIcon(bundleName: string, moduleName: string, abilityName: string): Promise; @@ -887,6 +962,8 @@ declare namespace bundle { * @param abilityName Indicates the abilityName of the application. * @param metadataName Indicates the name of metadata in ability. * @return Returns string in json-format of the corresponding config file. + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getProfileByAbility */ function getProfileByAbility(moduleName: string, abilityName: string, metadataName: string, callback: AsyncCallback>): void; function getProfileByAbility(moduleName: string, abilityName: string, metadataName?: string): Promise>; @@ -900,6 +977,8 @@ declare namespace bundle { * @param extensionAbilityName Indicates the extensionAbilityName of the application. * @param metadataName Indicates the name of metadata in ability. * @return Returns string in json-format of the corresponding config file. + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager#getProfileByExtensionAbility */ function getProfileByExtensionAbility(moduleName: string, extensionAbilityName: string, metadataName: string, callback: AsyncCallback>): void; function getProfileByExtensionAbility(moduleName: string, extensionAbilityName: string, metadataName?: string): Promise>; @@ -914,6 +993,8 @@ declare namespace bundle { * @return Returns the disposed status of a specified bundle. * @permission ohos.permission.MANAGE_DISPOSED_APP_STATUS * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.appControl#setDisposedStatus */ function setDisposedStatus(bundleName: string, status: number, callback: AsyncCallback): void; function setDisposedStatus(bundleName: string, status: number): Promise; @@ -927,6 +1008,8 @@ declare namespace bundle { * @return Returns the disposed status of a specified bundle. * @permission ohos.permission.MANAGE_DISPOSED_APP_STATUS * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.appControl#getDisposedStatus */ function getDisposedStatus(bundleName: string, callback: AsyncCallback): void; function getDisposedStatus(bundleName: string): Promise; @@ -942,6 +1025,8 @@ declare namespace bundle { * @param userId Indicates the user ID or do not pass user ID. * @return Returns the ApplicationInfo object. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @deprecated since 9 + * @useinstead ohos.bundle.appControl#getApplicationInfoSync */ function getApplicationInfoSync(bundleName: string, bundleFlags: number, userId: number) : ApplicationInfo; function getApplicationInfoSync(bundleName: string, bundleFlags: number) : ApplicationInfo; @@ -957,13 +1042,15 @@ declare namespace bundle { * @param options Indicates the bundle options object. * @return Returns the BundleInfo object. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + * @deprecated since 9 + * @useinstead ohos.bundle.appControl#getApplicationInfoSync */ function getBundleInfoSync(bundleName: string, bundleFlags: number, options: BundleOptions): BundleInfo; function getBundleInfoSync(bundleName: string, bundleFlags: number): BundleInfo; /** * Obtains configuration information about an application. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework */ @@ -971,7 +1058,7 @@ declare namespace bundle { /** * Stores module information about an application. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework */ @@ -979,7 +1066,7 @@ declare namespace bundle { /** * Indicates the custom metadata. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework */ @@ -987,7 +1074,7 @@ declare namespace bundle { /** * Indicates the Metadata. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework */ @@ -995,7 +1082,7 @@ declare namespace bundle { /** * Obtains configuration information about a bundle. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework */ @@ -1003,7 +1090,7 @@ declare namespace bundle { /** * The scene which is used. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework */ @@ -1011,7 +1098,7 @@ declare namespace bundle { /** * Indicates the required permissions details defined in file config.json. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework */ @@ -1019,7 +1106,7 @@ declare namespace bundle { /** * Obtains configuration information about an module. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework */ @@ -1027,7 +1114,7 @@ declare namespace bundle { /** * Obtains configuration information about an ability. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework */ @@ -1035,7 +1122,7 @@ declare namespace bundle { /** * Obtains extension information about a bundle. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework */ @@ -1043,43 +1130,43 @@ declare namespace bundle { /** * Offers install, upgrade, and remove bundles on the devices. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi hide this for inner system use */ - export type BundleInstaller = _BundleInstaller.BundleInstaller; + export type BundleInstaller = _BundleInstaller.BundleInstaller; /** * Provides parameters required for hashParam. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi hide this for inner system use */ - export type HashParam = _BundleInstaller.HashParam; + export type HashParam = _BundleInstaller.HashParam; /** * Provides parameters required for installing or uninstalling an application. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi hide this for inner system use */ - export type InstallParam = _BundleInstaller.InstallParam; + export type InstallParam = _BundleInstaller.InstallParam; /** * Indicates the install or uninstall status. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi hide this for inner system use */ - export type InstallStatus = _BundleInstaller.InstallStatus; + export type InstallStatus = _BundleInstaller.InstallStatus; /** * Indicates the defined permission details in file config.json. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi hide this for inner system use @@ -1088,7 +1175,7 @@ declare namespace bundle { /** * Contains basic Ability information, which uniquely identifies an ability. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework */ @@ -1096,7 +1183,7 @@ declare namespace bundle { /** * The dispatch info class. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi hide this for inner system use @@ -1105,7 +1192,7 @@ declare namespace bundle { /** * The bundle pack info class. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi hide this for inner system use @@ -1114,7 +1201,7 @@ declare namespace bundle { /** * The package info class. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi hide this for inner system use @@ -1123,7 +1210,7 @@ declare namespace bundle { /** * The package summary class. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi hide this for inner system use @@ -1132,7 +1219,7 @@ declare namespace bundle { /** * The bundle summary class. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi hide this for inner system use @@ -1141,7 +1228,7 @@ declare namespace bundle { /** * The extension ability forms class. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi hide this for inner system use @@ -1150,7 +1237,7 @@ declare namespace bundle { /** * The module summary of a bundle. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi hide this for inner system use @@ -1159,7 +1246,7 @@ declare namespace bundle { /** * The bundle info summary class. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi hide this for inner system use @@ -1168,7 +1255,7 @@ declare namespace bundle { /** * The ability info of a module. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi hide this for inner system use @@ -1177,7 +1264,7 @@ declare namespace bundle { /** * The form info of an ability. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi hide this for inner system use @@ -1186,7 +1273,7 @@ declare namespace bundle { /** * The bundle version class. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi hide this for inner system use @@ -1195,7 +1282,7 @@ declare namespace bundle { /** * The bundle Api version class. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi hide this for inner system use @@ -1204,7 +1291,7 @@ declare namespace bundle { /** * Flags which are used to indicate bundle pack. - * + * * @since 9 * @syscap SystemCapability.BundleManager.BundleFramework * @systemapi hide this for inner system use diff --git a/api/@ohos.bundle.defaultAppManager.d.ts b/api/@ohos.bundle.defaultAppManager.d.ts index d467bb1b4a..c0daf933bf 100644 --- a/api/@ohos.bundle.defaultAppManager.d.ts +++ b/api/@ohos.bundle.defaultAppManager.d.ts @@ -14,130 +14,205 @@ */ import { AsyncCallback } from './basic'; -import { BundleInfo } from './bundle/bundleInfo'; -import { ElementName } from './bundle/elementName'; +import { BundleInfo } from './bundleManager/bundleInfo'; +import { ElementName } from './bundleManager/elementName'; /** - * default application manager. - * @name defaultAppManager + * Default application manager. + * @namespace defaultAppManager + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA */ declare namespace defaultAppManager { /** - * the constant for application type. - * @name ApplicationType + * The constant for application type. + * @enum {number} + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission N/A */ export enum ApplicationType { /** - * default browser identifier. - * + * Default browser identifier. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager * @since 9 */ - BROWSER = "BROWSER", + BROWSER = "Web Browser", /** - * default image identifier. - * + * Default image identifier. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager * @since 9 */ - IMAGE = "IMAGE", + IMAGE = "Image Gallery", /** - * default audio identifier. - * + * Default audio identifier. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager * @since 9 */ - AUDIO = "AUDIO", + AUDIO = "Audio Player", /** - * default video identifier. - * + * Default video identifier. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager * @since 9 */ - VIDEO = "VIDEO", + VIDEO = "Video Player", /** - * default pdf identifier. - * + * Default PDF identifier. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager * @since 9 */ - PDF = "PDF", + PDF = "PDF Viewer", /** - * default word identifier. - * + * Default word identifier. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager * @since 9 */ - WORD = "WORD", + WORD = "Word Viewer", /** - * default excel identifier. - * + * Default excel identifier. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager * @since 9 */ - EXCEL = "EXCEL", + EXCEL = "Excel Viewer", /** - * default ppt identifier. - * + * Default PPT identifier. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager * @since 9 */ - PPT = "PPT", + PPT = "PPT Viewer", } /** - * query whether the caller is default application based on type. - * + * Query whether the caller is default application based on type. + * @param { string } type - Application type or a file type that conforms to media type format. + * @param { AsyncCallback } callback - The callback of querying default application result. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param type application type or file type. - * @return return true if caller is default application; return false otherwise. - * @permission N/A */ - function isDefaultApplication(type: string) : Promise; function isDefaultApplication(type: string, callback: AsyncCallback) : void; /** - * get default application based on type. - * + * Query whether the caller is default application based on type. + * @param { string } type - Application type or a file type that conforms to media type format. + * @returns { Promise } Return true if caller is default application; return false otherwise. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param type application type or file type. - * @param userId indicates the id for the user. - * @return return the BundleInfo object. + */ + function isDefaultApplication(type: string) : Promise; + + /** + * Get default application based on type. * @permission ohos.permission.GET_DEFAULT_APPLICATION - * @systemapi hide this for inner system use. + * @param { string } type - Application type or a file type that conforms to media type format. + * @param { number } userId - Indicates the id for the user. + * @param { AsyncCallback } callback - The callback of the BundleInfo object result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700004 - The specified user id is not found. + * @throws { BusinessError } 17700023 - The specified default app does not exist. + * @throws { BusinessError } 17700025 - The specified type is invalid. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager + * @systemapi + * @since 9 */ - function getDefaultApplication(type: string, userId?: number) : Promise; function getDefaultApplication(type: string, userId: number, callback: AsyncCallback) : void; function getDefaultApplication(type: string, callback: AsyncCallback) : void; /** - * set default application based on type. - * + * Get default application based on type. + * @permission ohos.permission.GET_DEFAULT_APPLICATION + * @param { string } type - Application type or a file type that conforms to media type format. + * @param { number } userId - Indicates the id for the user. + * @returns { Promise } Return the BundleInfo object. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700004 - The specified user id is not found. + * @throws { BusinessError } 17700023 - The specified default app does not exist. + * @throws { BusinessError } 17700025 - The specified type is invalid. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager + * @systemapi * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param type application type or file type. - * @param elementName uniquely identifies an ability or extensionAbility. - * @param userId indicates the id for the user. + */ + function getDefaultApplication(type: string, userId?: number) : Promise; + + /** + * Set default application based on type. * @permission ohos.permission.SET_DEFAULT_APPLICATION - * @systemapi hide this for inner system use. + * @param { string } type - Application type or a file type that conforms to media type format. + * @param { ElementName } elementName - Uniquely identifies an ability or extensionAbility. + * @param { number } userId - Indicates the id for the user. + * @param { AsyncCallback } callback - The callback of setting default application result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700004 - The specified user id is not found. + * @throws { BusinessError } 17700025 - The specified type is invalid. + * @throws { BusinessError } 17700028 - The specified ability and type does not match. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager.defaultAppManager + * @systemapi + * @since 9 */ - function setDefaultApplication(type: string, elementName: ElementName, userId?: number) : Promise; function setDefaultApplication(type: string, elementName: ElementName, userId: number, callback: AsyncCallback) : void; function setDefaultApplication(type: string, elementName: ElementName, callback: AsyncCallback) : void; /** - * reset default application based on type. - * + * Set default application based on type. + * @permission ohos.permission.SET_DEFAULT_APPLICATION + * @param { string } type - Application type or a file type that conforms to media type format. + * @param { ElementName } elementName - Uniquely identifies an ability or extensionAbility. + * @param { number } userId - Indicates the id for the user. + * @returns { Promise } The result of setting default application. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700004 - The specified user id is not found. + * @throws { BusinessError } 17700025 - The specified type is invalid. + * @throws { BusinessError } 17700028 - The specified ability and type does not match. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager.defaultAppManager + * @systemapi * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param type application type or file type. - * @param userId indicates the id for the user. + */ + function setDefaultApplication(type: string, elementName: ElementName, userId?: number) : Promise; + + /** + * Reset default application based on type. * @permission ohos.permission.SET_DEFAULT_APPLICATION - * @systemapi hide this for inner system use. + * @param { string } type - Application type or a file type that conforms to media type format. + * @param { number } userId - Indicates the id for the user. + * @param { AsyncCallback } callback - The callback of resetting default application result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700004 - The specified user id is not found. + * @throws { BusinessError } 17700025 - The specified type is invalid. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager.defaultAppManager + * @systemapi + * @since 9 */ - function resetDefaultApplication(type: string, userId?: number) : Promise; function resetDefaultApplication(type: string, userId: number, callback: AsyncCallback) : void; function resetDefaultApplication(type: string, callback: AsyncCallback) : void; + + /** + * Reset default application based on type. + * @permission ohos.permission.SET_DEFAULT_APPLICATION + * @param { string } type - Application type or a file type that conforms to media type format. + * @param { number } userId - Indicates the id for the user. + * @returns { Promise } The result of resetting default application. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 17700004 - The specified user id is not found. + * @throws { BusinessError } 17700025 - The specified type is invalid. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager.defaultAppManager + * @systemapi + * @since 9 + */ + function resetDefaultApplication(type: string, userId?: number) : Promise; } -export default defaultAppManager; +export default defaultAppManager; \ No newline at end of file diff --git a/api/bundle/PermissionDef.d.ts b/api/bundle/PermissionDef.d.ts index 6be050d5d9..0f5f91ba38 100644 --- a/api/bundle/PermissionDef.d.ts +++ b/api/bundle/PermissionDef.d.ts @@ -19,6 +19,8 @@ * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA * @systemapi + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager.PermissionDef */ export interface PermissionDef { /** diff --git a/api/bundle/bundleInfo.d.ts b/api/bundle/bundleInfo.d.ts index 4da8310f43..e38e1e9922 100644 --- a/api/bundle/bundleInfo.d.ts +++ b/api/bundle/bundleInfo.d.ts @@ -23,6 +23,8 @@ import { HapModuleInfo } from './hapModuleInfo'; * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager.BundleInfo * */ export interface UsedScene { diff --git a/api/bundle/customizeData.d.ts b/api/bundle/customizeData.d.ts index 4427daf061..762a082e1e 100644 --- a/api/bundle/customizeData.d.ts +++ b/api/bundle/customizeData.d.ts @@ -18,6 +18,8 @@ * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager.Metadata * */ export interface CustomizeData { @@ -27,14 +29,14 @@ * @syscap SystemCapability.BundleManager.BundleFramework */ name: string; - + /** * @default Indicates the custom metadata value * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework */ value: string; - + /** * @default Indicates the custom metadata resource * @since 8 diff --git a/api/bundleManager/bundleInfo.d.ts b/api/bundleManager/bundleInfo.d.ts new file mode 100644 index 0000000000..2fa975f423 --- /dev/null +++ b/api/bundleManager/bundleInfo.d.ts @@ -0,0 +1,240 @@ +/* + * 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 { ApplicationInfo } from './applicationInfo'; +import { HapModuleInfo } from './hapModuleInfo'; + +/** + * Obtains configuration information about a bundle + * @typedef BundleInfo + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +export interface BundleInfo { + /** + * Indicates the name of this bundle + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly name: string; + + /** + * Indicates the bundle vendor + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly vendor: string; + + /** + * Indicates the version code of the bundle + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly versionCode: number; + + /** + * Indicates the version name of the bundle + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly versionName: string; + + /** + * Indicates the **minimum ** version compatible with the bundle + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly minCompatibleVersionCode: number; + + /** + * Indicates the target version number of the bundle + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly targetVersion: number; + + /** + * Obtains configuration information about an application + * @type {ApplicationInfo} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly appInfo: ApplicationInfo; + + /** + * Obtains configuration information about an module + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly hapModulesInfo: Array; + + /** + * Indicates the required permissions details defined in file config.json + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly reqPermissionDetails: Array; + + /** + * Indicates the grant status of required permissions + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly permissionGrantStates: Array; + + /** + * Indicates the SignatureInfo of the bundle + * @type {SignatureInfo} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly signatureInfo: SignatureInfo; + + /** + * Indicates the hap install time + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly installTime: number; + + /** + * Indicates the hap update time + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly updateTime: number; +} + +/** + * Indicates the required permissions details defined in configuration file + * @typedef ReqPermissionDetail + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +export interface ReqPermissionDetail { + /** + * Indicates the name of this required permissions + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + name: string; + + /** + * Indicates the reason of this required permissions + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + reason: string; + + /** + * Indicates the reason id of this required permissions + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + reasonId: number; + + /** + * Indicates the used scene of this required permissions + * @type {UsedScene} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + usedScene: UsedScene; +} + +/** + * The scene which is used + * @typedef UsedScene + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +export interface UsedScene { + /** + * Indicates the abilities that need the permission + * @type {Array} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + abilities: Array; + + /** + * Indicates the time when the permission is used + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + when: string; +} + +/** + * PermissionGrantStatus + * @enum {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + export enum PermissionGrantStatus { + /** + * PERMISSION_DENIED + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + PERMISSION_DENIED = -1, + + /** + * PERMISSION_GRANTED + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + PERMISSION_GRANTED = 0, +} + +/** + * Indicates SignatureInfo + * @typedef SignatureInfo + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ +export interface SignatureInfo { + /** + * Indicates the ID of the application to which this bundle belongs + * The application ID uniquely identifies an application. It is determined by the bundle name and signature + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly appId: string; + + /** + * Indicates the fingerprint of the certificate + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + readonly fingerprint: string; +} \ No newline at end of file diff --git a/api/bundleManager/permissionDef.d.ts b/api/bundleManager/permissionDef.d.ts new file mode 100644 index 0000000000..2d2cc327a2 --- /dev/null +++ b/api/bundleManager/permissionDef.d.ts @@ -0,0 +1,55 @@ +/* + * 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. + */ + +/** + * Indicates the defined permission details in file config.json + * @typedef PermissionDef + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + export interface PermissionDef { + /** + * Indicates the name of this permission + * @type {string} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + permissionName: string; + + /** + * Indicates the grant mode of this permission + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + grantMode: number; + + /** + * Indicates the labelId of this permission + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + labelId: number; + + /** + * Indicates the descriptionId of this permission + * @type {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + descriptionId: number; + } \ No newline at end of file -- Gitee From 79e52d6385ab0a0f23c09032a97205b296f4b47e Mon Sep 17 00:00:00 2001 From: linhaoran Date: Thu, 13 Oct 2022 14:30:16 +0800 Subject: [PATCH 164/438] update container exception information Signed-off-by: linhaoran --- api/@ohos.util.ArrayList.d.ts | 29 +++++++++++++---------------- api/@ohos.util.Deque.d.ts | 2 +- api/@ohos.util.HashMap.d.ts | 6 +++--- api/@ohos.util.HashSet.d.ts | 8 ++++---- api/@ohos.util.LightWeightMap.d.ts | 22 +++++++++++----------- api/@ohos.util.LightWeightSet.d.ts | 14 +++++++------- api/@ohos.util.LinkedList.d.ts | 24 ++++++++++++------------ api/@ohos.util.List.d.ts | 26 ++++++++++++-------------- api/@ohos.util.PlainArray.d.ts | 28 ++++++++++++++-------------- api/@ohos.util.Queue.d.ts | 2 +- api/@ohos.util.Stack.d.ts | 2 +- api/@ohos.util.TreeMap.d.ts | 8 ++++---- api/@ohos.util.TreeSet.d.ts | 10 +++++----- api/@ohos.util.Vector.d.ts | 7 ++++++- 14 files changed, 94 insertions(+), 94 deletions(-) diff --git a/api/@ohos.util.ArrayList.d.ts b/api/@ohos.util.ArrayList.d.ts index 547343ffbb..abeeada5a6 100644 --- a/api/@ohos.util.ArrayList.d.ts +++ b/api/@ohos.util.ArrayList.d.ts @@ -42,9 +42,9 @@ declare class ArrayList { * any subsequent elements to the right (adds one to their index). * @param index index at which the specified element is to be inserted * @param element element to be inserted + * @throws { BusinessError } 10200001 - The type of parameters are out of range. * @throws { BusinessError } 10200011 - The insert method cannot be bound. - * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length]. Received value is: [index] - * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -73,9 +73,9 @@ declare class ArrayList { * delete the element, and move the index of all elements to the right of the element forward by one. * @param index the index in the arraylist * @return the T type ,returns undefined if arraylist is empty,If the index is + * @throws { BusinessError } 10200001 - The type of parameters are out of range. * @throws { BusinessError } 10200011 - The removeByIndex method cannot be bound. - * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] - * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -105,11 +105,9 @@ declare class ArrayList { * Removes from this arraylist all of the elements whose index is between fromIndex,inclusive,and toIndex ,exclusive. * @param fromIndex The starting position of the index, containing the value at that index position * @param toIndex the end of the index, excluding the value at that index + * @throws { BusinessError } 10200001 - The type of parameters are out of range. * @throws { BusinessError } 10200011 - The removeByRange method cannot be bound. - * @throws { BusinessError } 10200001 - The value of "fromIndex" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [fromIndex] - * @throws { BusinessError } 10200001 - The value of "toIndex" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [toIndex] - * @throws { BusinessError } 401 - The type of "fromIndex" must be number. Received value is: [fromIndex] - * @throws { BusinessError } 401 - The type of "toIndex" must be number. Received value is: [toIndex] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -124,7 +122,7 @@ declare class ArrayList { * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value * @throws { BusinessError } 10200011 - The replaceAllElements method cannot be bound. - * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -140,7 +138,7 @@ declare class ArrayList { * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value * @throws { BusinessError } 10200011 - The forEach method cannot be bound. - * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -156,7 +154,7 @@ declare class ArrayList { * @param secondValue (Optional) next elements * If this parameter is empty, it will default to ASCII sorting * @throws { BusinessError } 10200011 - The sort method cannot be bound. - * @throws { BusinessError } 401 - The type of "comparator" must be callable. Received value is: [comparator] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -165,11 +163,10 @@ declare class ArrayList { * Returns a view of the portion of this arraylist between the specified fromIndex,inclusize,and toIndex,exclusive * @param fromIndex The starting position of the index, containing the value at that index position * @param toIndex the end of the index, excluding the value at that index + * @throws { BusinessError } 10200001 - The type of parameters are out of range. * @throws { BusinessError } 10200011 - The subArrayList method cannot be bound. - * @throws { BusinessError } 10200001 - The value of "fromIndex" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [fromIndex] - * @throws { BusinessError } 10200001 - The value of "toIndex" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [toIndex] - * @throws { BusinessError } 401 - The type of "fromIndex" must be number. Received value is: [fromIndex] - * @throws { BusinessError } 401 - The type of "toIndex" must be number. Received value is: [toIndex] + * @throws { BusinessError } 401 - The type of parameters are invalid. + * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -218,7 +215,7 @@ declare class ArrayList { * If the newCapacity provided by the user is greater than or equal to length, * change the capacity of the arraylist to newCapacity, otherwise the capacity will not be changed * @throws { BusinessError } 10200011 - The increaseCapacityTo method cannot be bound. - * @throws { BusinessError } 401 - The type of "newCapacity" must be number. Received value is: [newCapacity] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.Deque.d.ts b/api/@ohos.util.Deque.d.ts index 3b5e4f2fe0..15c3906eab 100644 --- a/api/@ohos.util.Deque.d.ts +++ b/api/@ohos.util.Deque.d.ts @@ -92,7 +92,7 @@ declare class Deque { * @param deque (Optional) The deque object to which the current element belongs. * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value - * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @throws { BusinessError } 10200011 - The forEach method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang diff --git a/api/@ohos.util.HashMap.d.ts b/api/@ohos.util.HashMap.d.ts index d89d330946..46db82f142 100644 --- a/api/@ohos.util.HashMap.d.ts +++ b/api/@ohos.util.HashMap.d.ts @@ -66,7 +66,7 @@ declare class HashMap { * Adds all element groups in one map to another map * @param map the Map object to add members * @throws { BusinessError } 10200011 - The setAll method cannot be bound. - * @throws { BusinessError } 401 - The type of "map" must be HashMap. Received value is: [map] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -77,7 +77,7 @@ declare class HashMap { * @param value Added or updated value * @returns the map object after set * @throws { BusinessError } 10200011 - The set method cannot be bound. - * @throws { BusinessError } 401 - The type of "key" must be not null. Received value is: [key] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -126,7 +126,7 @@ declare class HashMap { * Executes the given callback function once for each real key in the map. * It does not perform functions on deleted keys * @throws { BusinessError } 10200011 - The forEach method cannot be bound. - * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.HashSet.d.ts b/api/@ohos.util.HashSet.d.ts index 8efc3a7d5b..e10b40ea0b 100644 --- a/api/@ohos.util.HashSet.d.ts +++ b/api/@ohos.util.HashSet.d.ts @@ -40,7 +40,7 @@ declare class HashSet { * @param value need to determine whether to include the element * @return the boolean type * @throws { BusinessError } 10200011 - The has method cannot be bound. - * @throws { BusinessError } 401 - The type of "value" must be not null. Received value is: [value] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -50,7 +50,7 @@ declare class HashSet { * @param value Added element * @returns the boolean type(Is there contain this element) * @throws { BusinessError } 10200011 - The add method cannot be bound. - * @throws { BusinessError } 401 - The type of "value" must be not null. Received value is: [value] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -60,7 +60,7 @@ declare class HashSet { * @param value Target to be deleted * @return the boolean type(Is there contain this element) * @throws { BusinessError } 10200011 - The remove method cannot be bound. - * @throws { BusinessError } 401 - The type of "value" must be not null. Received value is: [value] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -75,7 +75,7 @@ declare class HashSet { /** * Executes a provided function once for each value in the Set object. * @throws { BusinessError } 10200011 - The forEach method cannot be bound. - * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.LightWeightMap.d.ts b/api/@ohos.util.LightWeightMap.d.ts index 5090b2ffcf..94862c4fc1 100644 --- a/api/@ohos.util.LightWeightMap.d.ts +++ b/api/@ohos.util.LightWeightMap.d.ts @@ -31,7 +31,7 @@ declare class LightWeightMap { * Returns whether this map has all the object in a specified map * @param map the Map object to compare * @return the boolean type - * @throws { BusinessError } 401 - The type of "map" must be LightWeightMap. Received value is: [map] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @throws { BusinessError } 10200011 - The hasAll method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -60,7 +60,7 @@ declare class LightWeightMap { * and that the container has all the original objects after capacity expansion * @param minimumCapacity Minimum capacity to be reserved * @throws { BusinessError } 10200011 - The increaseCapacityTo method cannot be bound. - * @throws { BusinessError } 401 - The type of "minimumCapacity" must be number. Received value is: [minimumCapacity] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -112,8 +112,8 @@ declare class LightWeightMap { * @param index Target subscript for search * @return the key of key-value pairs * @throws { BusinessError } 10200011 - The getKeyAt method cannot be bound. - * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] - * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200001 - The type of parameters are out of range. + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -129,7 +129,7 @@ declare class LightWeightMap { * Adds all element groups in one map to another map * @param map the Map object to add members * @throws { BusinessError } 10200011 - The setAll method cannot be bound. - * @throws { BusinessError } 401 - The type of "map" must be LightWeightMap. Received value is: [map] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -158,7 +158,7 @@ declare class LightWeightMap { * @param index Target subscript for search * @return the boolean type(Is there a delete value) * @throws { BusinessError } 10200011 - The removeAt method cannot be bound. - * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -177,8 +177,8 @@ declare class LightWeightMap { * @param value Updated the target mapped value * @return the boolean type(Is there a value corresponding to the subscript) * @throws { BusinessError } 10200011 - The setValueAt method cannot be bound. - * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] - * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200001 - The type of parameters are out of range. + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -187,7 +187,7 @@ declare class LightWeightMap { * Executes the given callback function once for each real key in the map. * It does not perform functions on deleted keys * @throws { BusinessError } 10200011 - The forEach method cannot be bound. - * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -212,8 +212,8 @@ declare class LightWeightMap { * @param index Target subscript for search * @return the value of key-value pairs * @throws { BusinessError } 10200011 - The getValueAt method cannot be bound. - * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] - * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200001 - The type of parameters are out of range. + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.LightWeightSet.d.ts b/api/@ohos.util.LightWeightSet.d.ts index 1ea28f53e0..628504e614 100644 --- a/api/@ohos.util.LightWeightSet.d.ts +++ b/api/@ohos.util.LightWeightSet.d.ts @@ -41,7 +41,7 @@ declare class LightWeightSet { * @param set the Set object to provide the added element * @returns the boolean type(Is there any new data added successfully) * @throws { BusinessError } 10200011 - The addAll method cannot be bound. - * @throws { BusinessError } 401 - The type of "set" must be LightWeightSet. Received value is: [set] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -51,7 +51,7 @@ declare class LightWeightSet { * @param set the Set object to compare * @return the boolean type * @throws { BusinessError } 10200011 - The hasAll method cannot be bound. - * @throws { BusinessError } 401 - The type of "set" must be LightWeightSet. Received value is: [set] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -79,8 +79,8 @@ declare class LightWeightSet { * and that the container has all the original objects after capacity expansion * @param minimumCapacity Minimum capacity to be reserved * @throws { BusinessError } 10200011 - The increaseCapacityTo method cannot be bound. - * @throws { BusinessError } 401 - The type of "minimumCapacity" must be number. Received value is: [minimumCapacity] - * @throws { BusinessError } 10200001 - The value of "minimumCapacity" is out of range. It must be > [currentCapacity]. Received value is: [minimumCapacity] + * @throws { BusinessError } 401 - The type of parameters are invalid. + * @throws { BusinessError } 10200001 - The type of parameters are out of range. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -108,7 +108,7 @@ declare class LightWeightSet { * @param index Target subscript for search * @return the boolean type(Is there a delete value) * @throws { BusinessError } 10200011 - The removeAt method cannot be bound. - * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -125,7 +125,7 @@ declare class LightWeightSet { * Executes the given callback function once for each real key in the map. * It does not perform functions on deleted keys * @throws { BusinessError } 10200011 - The forEach method cannot be bound. - * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -156,7 +156,7 @@ declare class LightWeightSet { * @param index Target subscript for search * @return the value of key-value pairs * @throws { BusinessError } 10200011 - The getValueAt method cannot be bound. - * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.LinkedList.d.ts b/api/@ohos.util.LinkedList.d.ts index 6c6bd9df94..c46491eba3 100644 --- a/api/@ohos.util.LinkedList.d.ts +++ b/api/@ohos.util.LinkedList.d.ts @@ -41,8 +41,8 @@ declare class LinkedList { * @param index index at which the specified element is to be inserted * @param element element to be inserted * @throws { BusinessError } 10200011 - The insert method cannot be bound. - * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] - * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length]. Received value is: [index] + * @throws { BusinessError } 401 - The type of parameters are invalid. + * @throws { BusinessError } 10200001 - The type of parameters are out of range. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -53,7 +53,7 @@ declare class LinkedList { * @param index specified position * @return the T type * @throws { BusinessError } 10200011 - The get method cannot be bound. - * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -70,7 +70,7 @@ declare class LinkedList { * Retrieves and removes the head (first element) of this linkedlist. * @return the head of this list * @throws { BusinessError } 10200011 - The removeFirst method cannot be bound. - * @throws { BusinessError } 10200010 - Container is Empty. + * @throws { BusinessError } 10200010 - Container is empty. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -79,7 +79,7 @@ declare class LinkedList { * Removes and returns the last element from this linkedlist. * @return the head of this list * @throws { BusinessError } 10200011 - The removeLast method cannot be bound. - * @throws { BusinessError } 10200010 - Container is Empty. + * @throws { BusinessError } 10200010 - Container is empty. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -109,8 +109,8 @@ declare class LinkedList { * @return the T type ,returns undefined if linkedlist is empty,If the index is * out of bounds (greater than or equal to length or less than 0), throw an exception * @throws { BusinessError } 10200011 - The removeByIndex method cannot be bound. - * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] - * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] + * @throws { BusinessError } 401 - The type of parameters are invalid. + * @throws { BusinessError } 10200001 - The type of parameters are out of range. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -133,7 +133,7 @@ declare class LinkedList { * @param element element to remove * @return the boolean type ,If there is no such element, return false * @throws { BusinessError } 10200011 - The removeFirstFound method cannot be bound. - * @throws { BusinessError } 10200010 - Container is Empty. + * @throws { BusinessError } 10200010 - Container is empty. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -145,7 +145,7 @@ declare class LinkedList { * @param element element to remove * @return the boolean type ,If there is no such element, return false * @throws { BusinessError } 10200011 - The removeLastFound method cannot be bound. - * @throws { BusinessError } 10200010 - Container is Empty. + * @throws { BusinessError } 10200010 - Container is empty. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -184,8 +184,8 @@ declare class LinkedList { * @param index index to find * @return the T type ,returns undefined if linkedList is empty * @throws { BusinessError } 10200011 - The set method cannot be bound. - * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] - * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200001 - The type of parameters are out of range. + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -200,7 +200,7 @@ declare class LinkedList { * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value * @throws { BusinessError } 10200011 - The forEach method cannot be bound. - * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.List.d.ts b/api/@ohos.util.List.d.ts index ef439cb8e6..e2d80d0575 100644 --- a/api/@ohos.util.List.d.ts +++ b/api/@ohos.util.List.d.ts @@ -41,8 +41,8 @@ declare class List { * @param index index at which the specified element is to be inserted * @param element element to be inserted * @throws { BusinessError } 10200011 - The insert method cannot be bound. - * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length]. Received value is: [index] - * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200001 - The type of parameters are out of range. + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -53,7 +53,7 @@ declare class List { * @param index specified position * @return the T type * @throws { BusinessError } 10200011 - The get method cannot be bound. - * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -83,8 +83,8 @@ declare class List { * @return the T type ,returns undefined if list is empty,If the index is * out of bounds (greater than or equal to length or less than 0), throw an exception * @throws { BusinessError } 10200011 - The removeByIndex method cannot be bound. - * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] - * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200001 - The type of parameters are out of range. + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -134,8 +134,8 @@ declare class List { * @param index index to find * @return the T type * @throws { BusinessError } 10200011 - The set method cannot be bound. - * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] - * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200001 - The type of parameters are out of range. + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -160,7 +160,7 @@ declare class List { * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value * @throws { BusinessError } 10200011 - The forEach method cannot be bound. - * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -174,7 +174,7 @@ declare class List { * minus firstValue, it returns an list sorted in descending order; * @param firstValue (Optional) previous element * @param secondValue (Optional) next elements - * @throws { BusinessError } 401 - The type of "comparator" must be callable. Received value is: [comparator] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @throws { BusinessError } 10200011 - The sort method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -193,10 +193,8 @@ declare class List { * @param fromIndex The starting position of the index, containing the value at that index position * @param toIndex the end of the index, excluding the value at that index * @throws { BusinessError } 10200011 - The getSubList method cannot be bound. - * @throws { BusinessError } 10200001 - The value of "fromIndex" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [fromIndex] - * @throws { BusinessError } 10200001 - The value of "toIndex" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [toIndex] - * @throws { BusinessError } 401 - The type of "fromIndex" must be number. Received value is: [fromIndex] - * @throws { BusinessError } 401 - The type of "toIndex" must be number. Received value is: [toIndex] + * @throws { BusinessError } 10200001 - The type of parameters are out of range. + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -211,7 +209,7 @@ declare class List { * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value * @throws { BusinessError } 10200011 - The replaceAllElements method cannot be bound. - * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.PlainArray.d.ts b/api/@ohos.util.PlainArray.d.ts index bc4d455752..ef10608a24 100644 --- a/api/@ohos.util.PlainArray.d.ts +++ b/api/@ohos.util.PlainArray.d.ts @@ -32,7 +32,7 @@ declare class PlainArray { * @param key Added the key of key-value * @param value Added the value of key-value * @throws { BusinessError } 10200011 - The add method cannot be bound. - * @throws { BusinessError } 401 - The type of "key" must be number. Received value is: [key] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -56,7 +56,7 @@ declare class PlainArray { * @param key need to determine whether to include the key * @return the boolean type * @throws { BusinessError } 10200011 - The has method cannot be bound. - * @throws { BusinessError } 401 - The type of "key" must be number. Received value is: [key] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -66,7 +66,7 @@ declare class PlainArray { * @param key Looking for goals * @return the value of key-value pairs * @throws { BusinessError } 10200011 - The get method cannot be bound. - * @throws { BusinessError } 401 - The type of "key" must be number. Received value is: [key] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -76,7 +76,7 @@ declare class PlainArray { * @param key Looking for goals * @return Subscript corresponding to target * @throws { BusinessError } 10200011 - The getIndexOfKey method cannot be bound. - * @throws { BusinessError } 401 - The type of "key" must be number. Received value is: [key] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -103,7 +103,7 @@ declare class PlainArray { * @param index Target subscript for search * @return the key of key-value pairs * @throws { BusinessError } 10200011 - The getKeyAt method cannot be bound. - * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -113,7 +113,7 @@ declare class PlainArray { * @param key Target to be deleted * @return Target mapped value * @throws { BusinessError } 10200011 - The remove method cannot be bound. - * @throws { BusinessError } 401 - The type of "key" must be number. Received value is: [key] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -123,7 +123,7 @@ declare class PlainArray { * @param index Target subscript for search * @return the T type * @throws { BusinessError } 10200011 - The removeAt method cannot be bound. - * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -134,8 +134,8 @@ declare class PlainArray { * @param size Expected deletion quantity * @return Actual deleted quantity * @throws { BusinessError } 10200011 - The removeRangeFrom method cannot be bound. - * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] - * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200001 - The type of parameters are out of range. + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -145,8 +145,8 @@ declare class PlainArray { * @param index Target subscript for search * @param value Updated the target mapped value * @throws { BusinessError } 10200011 - The setValueAt method cannot be bound. - * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] - * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200001 - The type of parameters are out of range. + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -163,8 +163,8 @@ declare class PlainArray { * @param index Target subscript for search * @return the value of key-value pairs * @throws { BusinessError } 10200011 - The getValueAt method cannot be bound. - * @throws { BusinessError } 10200001 - The value of "index" is out of range. It must be >= 0 && <= [this.length - 1]. Received value is: [index] - * @throws { BusinessError } 401 - The type of "index" must be number. Received value is: [index] + * @throws { BusinessError } 10200001 - The type of parameters are out of range. + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -172,7 +172,7 @@ declare class PlainArray { /** * Executes a provided function once for each value in the PlainArray object. * @throws { BusinessError } 10200011 - The forEach method cannot be bound. - * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.Queue.d.ts b/api/@ohos.util.Queue.d.ts index a605ba12f6..20443d8d11 100644 --- a/api/@ohos.util.Queue.d.ts +++ b/api/@ohos.util.Queue.d.ts @@ -63,7 +63,7 @@ declare class Queue { * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value * @throws { BusinessError } 10200011 - The forEach method cannot be bound. - * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.Stack.d.ts b/api/@ohos.util.Stack.d.ts index 811d1e10fe..e1c4ade374 100644 --- a/api/@ohos.util.Stack.d.ts +++ b/api/@ohos.util.Stack.d.ts @@ -81,7 +81,7 @@ declare class Stack { * @param thisArg (Optional) The value passed to the function generally uses the "this" value. * If this parameter is empty, "undefined" will be passed to the "this" value * @throws { BusinessError } 10200011 - The forEach method cannot be bound. - * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.TreeMap.d.ts b/api/@ohos.util.TreeMap.d.ts index aebdd248c6..3598b07737 100644 --- a/api/@ohos.util.TreeMap.d.ts +++ b/api/@ohos.util.TreeMap.d.ts @@ -21,7 +21,7 @@ declare class TreeMap { * @param firstValue (Optional) previous element * @param secondValue (Optional) next element * @throws { BusinessError } 10200012 - The TreeMap's constructor cannot be directly invoked. - * @throws { BusinessError } 401 - The type of "comparator" must be callable. Received value is: [comparator] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -89,7 +89,7 @@ declare class TreeMap { * Adds all element groups in one map to another map * @param map the Map object to add members * @throws { BusinessError } 10200011 - The setAll method cannot be bound. - * @throws { BusinessError } 401 - The type of "map" must be TreeMap. Received value is: [map] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -100,7 +100,7 @@ declare class TreeMap { * @param value Added or updated value * @returns the map object after set * @throws { BusinessError } 10200011 - The set method cannot be bound. - * @throws { BusinessError } 401 - The type of "key" must be not null. Received value is: [key] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -169,7 +169,7 @@ declare class TreeMap { * Executes the given callback function once for each real key in the map. * It does not perform functions on deleted keys * @throws { BusinessError } 10200011 - The forEach method cannot be bound. - * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.TreeSet.d.ts b/api/@ohos.util.TreeSet.d.ts index c1c9e26a1a..77d9e5635b 100644 --- a/api/@ohos.util.TreeSet.d.ts +++ b/api/@ohos.util.TreeSet.d.ts @@ -20,7 +20,7 @@ declare class TreeSet { * @param firstValue (Optional) previous element * @param secondValue (Optional) next element * @throws { BusinessError } 10200012 - The TreeSet's constructor cannot be directly invoked. - * @throws { BusinessError } 401 - The type of "comparator" must be callable. Received value is: [comparator] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -52,7 +52,7 @@ declare class TreeSet { * If the set does not contain the element, the specified element is added * @param value Added element * @returns the boolean type(Is there contain this element) - * @throws { BusinessError } 401 - The type of "value" must be not null. Received value is: [value] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @throws { BusinessError } 10200011 - The add method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -96,7 +96,7 @@ declare class TreeSet { * @param key Objective of comparison * @return key or undefined * @throws { BusinessError } 10200011 - The getLowerValue method cannot be bound. - * @throws { BusinessError } 401 - The type of "key" must be not null. Received value is: [key] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -107,7 +107,7 @@ declare class TreeSet { * @param key Objective of comparison * @return key or undefined * @throws { BusinessError } 10200011 - The getHigherValue method cannot be bound. - * @throws { BusinessError } 401 - The type of "key" must be not null. Received value is: [key] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -131,7 +131,7 @@ declare class TreeSet { /** * Executes a provided function once for each value in the Set object. * @throws { BusinessError } 10200011 - The forEach method cannot be bound. - * @throws { BusinessError } 401 - The type of "callbackfn" must be callable. Received value is: [callbackfn] + * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 * @syscap SystemCapability.Utils.Lang */ diff --git a/api/@ohos.util.Vector.d.ts b/api/@ohos.util.Vector.d.ts index b170704ac7..8b1603b83a 100644 --- a/api/@ohos.util.Vector.d.ts +++ b/api/@ohos.util.Vector.d.ts @@ -12,7 +12,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -// @deprecated since 9 + +/** + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + */ declare class Vector { /** * A constructor used to create a Vector object. -- Gitee From 2231edb39ca2566d27fba9fe66cb06740995c5c4 Mon Sep 17 00:00:00 2001 From: dboy190 Date: Tue, 18 Oct 2022 11:00:38 +0800 Subject: [PATCH 165/438] fix datashare syscap Signed-off-by: dboy190 --- api/@ohos.data.distributedKVStore.d.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/api/@ohos.data.distributedKVStore.d.ts b/api/@ohos.data.distributedKVStore.d.ts index 6281012593..a76094f411 100644 --- a/api/@ohos.data.distributedKVStore.d.ts +++ b/api/@ohos.data.distributedKVStore.d.ts @@ -1166,7 +1166,7 @@ declare namespace distributedKVStore { * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100004 - if the data not exist when delete data. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @syscap SystemCapability.DistributedDataManager.DataShare.Provider * @systemapi * @since 9 */ @@ -1181,7 +1181,7 @@ declare namespace distributedKVStore { * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100004 - if the data not exist when delete data. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @syscap SystemCapability.DistributedDataManager.DataShare.Provider * @systemapi * @since 9 */ @@ -1414,7 +1414,7 @@ declare namespace distributedKVStore { * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @syscap SystemCapability.DistributedDataManager.DataShare.Provider * @systemapi * @since 9 */ @@ -1429,7 +1429,7 @@ declare namespace distributedKVStore { * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @syscap SystemCapability.DistributedDataManager.DataShare.Provider * @systemapi * @since 9 */ @@ -2007,7 +2007,7 @@ declare namespace distributedKVStore { * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @syscap SystemCapability.DistributedDataManager.DataShare.Provider * @systemapi * @since 9 */ @@ -2023,7 +2023,7 @@ declare namespace distributedKVStore { * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @syscap SystemCapability.DistributedDataManager.DataShare.Provider * @systemapi * @since 9 */ -- Gitee From feadfb272328bf76e1e8bcd5d2d3d49aae853ecb Mon Sep 17 00:00:00 2001 From: lutao Date: Tue, 18 Oct 2022 09:55:29 +0800 Subject: [PATCH 166/438] Modify Description Signed-off-by: lutao --- api/@ohos.hichecker.d.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/api/@ohos.hichecker.d.ts b/api/@ohos.hichecker.d.ts index a0951402b2..55293cb08c 100644 --- a/api/@ohos.hichecker.d.ts +++ b/api/@ohos.hichecker.d.ts @@ -56,6 +56,7 @@ declare namespace hichecker { * @param rule * @since 8 * @deprecated since 9 + * @useinstead ohos.hichecker/hichecker#addCheckRule * @syscap SystemCapability.HiviewDFX.HiChecker */ function addRule(rule: bigint) : void; @@ -65,6 +66,7 @@ declare namespace hichecker { * @param rule * @since 8 * @deprecated since 9 + * @useinstead ohos.hichecker/hichecker#removeCheckRule * @syscap SystemCapability.HiviewDFX.HiChecker */ function removeRule(rule: bigint) : void; @@ -83,35 +85,36 @@ declare namespace hichecker { * @return the result of whether the query rule is added. * @since 8 * @deprecated since 9 + * @useinstead ohos.hichecker/hichecker#containsCheckRule * @syscap SystemCapability.HiviewDFX.HiChecker */ function contains(rule: bigint) : boolean; /** - * add one or more rule. + * Add one or more rule. * @param rule * @since 9 * @syscap SystemCapability.HiviewDFX.HiChecker - * @throws {error} if the param is invalid + * @throws { BusinessError } 401 - the parameter check failed */ function addCheckRule(rule: bigint) : void; /** - * remove one or more rule. + * Remove one or more rule. * @param rule * @since 9 * @syscap SystemCapability.HiviewDFX.HiChecker - * @throws {error} if the param is invalid + * @throws { BusinessError } 401 - the parameter check failed */ function removeCheckRule(rule: bigint) : void; /** - * whether the query rule is added + * Whether the query rule is added * @param rule * @return the result of whether the query rule is added. * @since 9 * @syscap SystemCapability.HiviewDFX.HiChecker - * @throws {error} if the param is invalid + * @throws { BusinessError } 401 - the parameter check failed */ function containsCheckRule(rule: bigint) : boolean; } -- Gitee From e9eb8ba70a97d4aded0f7c1e143ed1044a28d021 Mon Sep 17 00:00:00 2001 From: cheng_jinsong Date: Tue, 18 Oct 2022 03:42:46 +0000 Subject: [PATCH 167/438] update api/@ohos.systemParameterV9.d.ts. Signed-off-by: cheng_jinsong Signed-off-by: cheng_jinsong --- api/@ohos.systemParameterV9.d.ts | 52 -------------------------------- 1 file changed, 52 deletions(-) diff --git a/api/@ohos.systemParameterV9.d.ts b/api/@ohos.systemParameterV9.d.ts index a32bcb4fb5..b4fee996db 100755 --- a/api/@ohos.systemParameterV9.d.ts +++ b/api/@ohos.systemParameterV9.d.ts @@ -15,58 +15,6 @@ import { AsyncCallback, BusinessError } from './basic'; -/** - * Enumerates error code. - * - * @since 9 - */ -export enum SystemParameterErrorCode { - /** - * Input parameter is missing or invalid. - * - * @since 9 - */ - SYSPARAM_INVALID_INPUT = 401, - - /** - * System parameter can not be found.
- * When getting system parameter values, if def value is specified, it will not return this error. - * - * @since 9 - */ - SYSPARAM_NOT_FOUND = 14700101, - - /** - * System parameter value is invalid.
- * -

When setting system parameters, the value length should not exceed 95 bytes.

- * -

And system parameter has three value types: string, integer and bool. - * if the value type is not matched, it will also return this error code.

- * - * @since 9 - */ - SYSPARAM_INVALID_VALUE = 14700102, - - /** - * System permission operation permission denied.
- *

System parameter are system resources, each parameter is protected by DAC and MAC rules. - *

Typical permission checking include:

- * -

systemapi: only system application can call system parameter related APIs

- * -

DAC: each system parameter has user and group owner with get, set permissions. - * Applications can only operate User/Group/Ownership matched system parameters.

- * -

MAC: each system parameter is also protected by SELinux labels.

- * - * @since 9 - */ - SYSPARAM_PERMISSION_DENIED = 14700103, - - /** - * System internal error including out of memory, deadlock etc. - * - * @since 9 - */ - SYSPARAM_SYSTEM_ERROR = 14700104, -} - /** * The interface of system parameters class. * -- Gitee From a68634557aa5cc13bef79462e1469f4cb968ce68 Mon Sep 17 00:00:00 2001 From: jiangyuan0000 Date: Fri, 9 Sep 2022 18:09:38 +0800 Subject: [PATCH 168/438] =?UTF-8?q?getServiceDump=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: jiangyuan0000 --- api/@ohos.hidebug.d.ts | 58 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 53 insertions(+), 5 deletions(-) diff --git a/api/@ohos.hidebug.d.ts b/api/@ohos.hidebug.d.ts index f5e17b220b..cd2f7bba54 100644 --- a/api/@ohos.hidebug.d.ts +++ b/api/@ohos.hidebug.d.ts @@ -89,11 +89,13 @@ declare namespace hidebug { * Start CPU Profiling. * The input parameter is a user-defined file name, excluding the file suffix. * The generated file is in the files folder under the application directory. - * such as "/data/accounts/account_0/appdata/[package name]/files/cpuprofiler-xxx.json" + * Such as "/data/accounts/account_0/appdata/[package name]/files/cpuprofiler-xxx.json" * * @param filename Indicates the user-defined file name, excluding the file suffix. * @return - * @since 8 + * @deprecated since 9 + * @useinstead ohos.hidebug/hidebug.startJsCpuProfiling * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug */ function startProfiling(filename : string) : void; @@ -105,6 +107,8 @@ declare namespace hidebug { * @param - * @return - * @since 8 + * @deprecated since 9 + * @useinstead ohos.hidebug/hidebug.stopJsCpuProfiling * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug */ function stopProfiling() : void; @@ -113,24 +117,68 @@ declare namespace hidebug { * Dump JS Virtual Machine Heap Snapshot. * The input parameter is a user-defined file name, excluding the file suffix. * The generated file is in the files folder under the application directory. - * such as "/data/accounts/account_0/appdata/[package name]/files/xxx.heapsnapshot" + * Such as "/data/accounts/account_0/appdata/[package name]/files/xxx.heapsnapshot" * * @param filename Indicates the user-defined file name, excluding the file suffix. * @return - * @since 8 + * @deprecated since 9 + * @useinstead ohos.hidebug/hidebug.dumpJsHeapData * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug */ function dumpHeapData(filename : string) : void; + /** + * Start CPU Profiling. + * The input parameter is a user-defined file name, excluding the file suffix. + * The generated file is in the files folder under the application directory. + * + * @param filename Indicates the user-defined file name, excluding the file suffix. + * @throws {BusinessError} 401 - the parameter check failed + * @return - + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug + */ + function startJsCpuProfiling(filename : string) : void; + + /** + * Stop CPU Profiling. + * It takes effect only when the CPU profiler is turned on + * + * @param - + * @return - + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug + */ + function stopJsCpuProfiling() : void; + + /** + * Dump JS Virtual Machine Heap Snapshot. + * The input parameter is a user-defined file name, excluding the file suffix. + * The generated file is in the files folder under the application directory. + * + * @param filename Indicates the user-defined file name, excluding the file suffix. + * @throws {BusinessError} 401 - the parameter check failed + * @return - + * @since 9 + * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug + */ + function dumpJsHeapData(filename : string) : void; + /** * Get a debugging dump of a system service by service id. - * Not for use by third-party applications for permission. + * It need dump permission. * * @param serviceid Indicates the id of the service ability. - * @return - sa dumped file name return. + * @param fd The file descriptor. + * @param args The args list of the system ability dump interface. + * @throws {BusinessError} 401 - the parameter check failed + * @throws {BusinessError} 11400101 - the service id is invalid + * @return - + * @permission ohos.permission.DUMP * @since 9 * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug */ - function getServiceDump(serviceid : number) : string; + function getServiceDump(serviceid : number, fd : number, args : Array) : void; } export default hidebug; -- Gitee From 39883fd1da77fcb401e92ef2f29e09a82e74ff94 Mon Sep 17 00:00:00 2001 From: li-hui-17 Date: Tue, 18 Oct 2022 11:53:34 +0800 Subject: [PATCH 169/438] new interface getRdbStoreV9 Signed-off-by: li-hui-17 --- api/@ohos.data.rdb.d.ts | 89 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index 9ae430851b..a9629cb0ac 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -43,6 +43,42 @@ declare namespace rdb { function getRdbStore(context: Context, config: StoreConfig, version: number, callback: AsyncCallback): void; function getRdbStore(context: Context, config: StoreConfig, version: number): Promise; + /** + * Obtains an RDB store. + * + * You can set parameters of the RDB store as required. In general, this method is recommended + * to obtain a rdb store. + * + * @param {Context} context - Indicates the context of application or capability. + * @param {StoreConfig} config - Indicates the {@link StoreConfig} configuration of the database related to this RDB store. + * @param {number} version - Indicates the database version for upgrade or downgrade. + * @param {AsyncCallback} callback - the RDB store {@link RdbStoreV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @throws {BusinessError} 14800010 - if failed open database by invalid database name + * @throws {BusinessError} 14800011 - if failed open database by database corrupted + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + function getRdbStoreV9(context: Context, config: StoreConfig, version: number, callback: AsyncCallback): void; + + /** + * Obtains an RDB store. + * + * You can set parameters of the RDB store as required. In general, this method is recommended + * to obtain a rdb store. + * + * @param {Context} context - Indicates the context of application or capability. + * @param {StoreConfig} config - Indicates the {@link StoreConfig} configuration of the database related to this RDB store. + * @param {number} version - Indicates the database version for upgrade or downgrade. + * @returns {Promise} the RDB store {@link RdbStoreV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @throws {BusinessError} 14800010 - if failed open database by invalid database name + * @throws {BusinessError} 14800011 - if failed open database by database corrupted + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + function getRdbStoreV9(context: Context, config: StoreConfig, version: number): Promise; + /** * Deletes the database with a specified name. * @@ -95,6 +131,59 @@ declare namespace rdb { SUBSCRIBE_TYPE_REMOTE = 0, } + /** + * Describes the {@code RdbStoreV9} type. + * + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + enum SecurityLevel { + /** + * S0: mains the db is public. + * There is no impact even if the data is leaked. + * + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + S0 = 0, + + /** + * S1: mains the db is low level security + * There are some low impact, when the data is leaked. + * + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + S1 = 1, + + /** + * S2: mains the db is middle level security + * There are some major impact, when the data is leaked. + * + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + S2 = 2, + + /** + * S3: mains the db is high level security + * There are some severity impact, when the data is leaked. + * + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + S3 = 3, + + /** + * S4: mains the db is critical level security + * There are some critical impact, when the data is leaked. + * + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + S4 = 4, + } + /** * Provides methods for managing the relational database (RDB). * -- Gitee From b97e916e25ba8a36fa238b77afdf9b2fc9c122fd Mon Sep 17 00:00:00 2001 From: yanmengzhao1 Date: Mon, 10 Oct 2022 11:35:08 +0800 Subject: [PATCH 170/438] update faultlogger js interfaces Signed-off-by: yanmengzhao1 --- api/@ohos.faultLogger.d.ts | 110 ++++++++++++++++++++++++------------- 1 file changed, 72 insertions(+), 38 deletions(-) diff --git a/api/@ohos.faultLogger.d.ts b/api/@ohos.faultLogger.d.ts index 45a78fecd3..5162e428f6 100644 --- a/api/@ohos.faultLogger.d.ts +++ b/api/@ohos.faultLogger.d.ts @@ -15,125 +15,159 @@ import { AsyncCallback } from "./basic"; - /** * This module provides the capability to query faultlog data. - * - * @since 8 + * @namespace FaultLogger * @syscap SystemCapability.HiviewDFX.Hiview.FaultLogger - * @import import sensor from '@ohos.faultlogger' + * @since 8 */ - declare namespace FaultLogger { /** * The type of fault type. - * @since 8 + * @enum { number } * @syscap SystemCapability.HiviewDFX.Hiview.FaultLogger + * @since 8 */ enum FaultType { /** * NO_SPECIFIC log type not distinguished. - * @since 8 * @syscap SystemCapability.HiviewDFX.Hiview.FaultLogger + * @since 8 */ NO_SPECIFIC = 0, /** - * CPP_CRASH CPP crash log type - * @since 8 + * CPP_CRASH CPP crash log type. * @syscap SystemCapability.HiviewDFX.Hiview.FaultLogger + * @since 8 */ CPP_CRASH = 2, /** - * JS_CRASH JS crash log type - * @since 8 + * JS_CRASH JS crash log type. * @syscap SystemCapability.HiviewDFX.Hiview.FaultLogger + * @since 8 */ JS_CRASH = 3, /** - * APP_FREEZE app feeeze log type - * @since 8 + * APP_FREEZE app feeeze log type. * @syscap SystemCapability.HiviewDFX.Hiview.FaultLogger + * @since 8 */ APP_FREEZE = 4, } /** - * Query the result of the current application FaultLog in callback Mode - * @since 8 + * Query the result of the current application FaultLog in callback Mode. + * @param faultType Fault type to query + * @param callback Faultlog information data callback function * @syscap SystemCapability.HiviewDFX.Hiview.FaultLogger - * @param faultType fault type to query - * @param callback faultlog information data callback function + * @since 8 + * @deprecated since 9 + * @useinstead ohos.faultlogger/FaultLogger#query */ function querySelfFaultLog(faultType: FaultType, callback: AsyncCallback>) : void; /** * Query the result of the current application FaultLog in return promise mode. - * @since 8 + * @param faultType Fault type to query + * @returns return faultlog information data by promise * @syscap SystemCapability.HiviewDFX.Hiview.FaultLogger - * @param faultType fault type to query - * @return return faultlog information data by promise + * @since 8 + * @deprecated since 9 + * @useinstead ohos.faultlogger/FaultLogger#query */ function querySelfFaultLog(faultType: FaultType) : Promise>; /** - * FaultLog information data structure - * @since 8 + * Query the result of the current application FaultLog in callback Mode. + * @param faultType Fault type to query + * @param callback Faultlog information data callback function + * @throws { BusinessError } 401 - the parameter check failed + * @throws { BusinessError } 801 - the specified SystemCapability name was not found + * @throws { BusinessError } 10600001 - the service is not running or broken * @syscap SystemCapability.HiviewDFX.Hiview.FaultLogger + * @since 9 + */ + function query(faultType: FaultType, callback: AsyncCallback>) : void; + + /** + * Query the result of the current application FaultLog in return promise mode. + * @param faultType Fault type to query + * @returns return faultlog information data by promise + * @throws { BusinessError } 401 - the parameter check failed + * @throws { BusinessError } 801 - the specified SystemCapability name was not found + * @throws { BusinessError } 10600001 - the service is not running or broken + * @syscap SystemCapability.HiviewDFX.Hiview.FaultLogger + * @since 9 + */ + function query(faultType: FaultType) : Promise>; + + /** + * FaultLog information data structure. + * @syscap SystemCapability.HiviewDFX.Hiview.FaultLogger + * @since 8 */ interface FaultLogInfo { /** - * pid Process id - * @since 8 + * Process id. + * @type { number } * @syscap SystemCapability.HiviewDFX.Hiview.FaultLogger + * @since 8 */ pid: number; /** - * uid user id - * @since 8 + * User id. + * @type { number } * @syscap SystemCapability.HiviewDFX.Hiview.FaultLogger + * @since 8 */ uid: number; /** - * type fault type - * @since 8 + * Fault type. + * @type { FaultType } * @syscap SystemCapability.HiviewDFX.Hiview.FaultLogger + * @since 8 */ type: FaultType; /** - * second level timestamp - * @since 8 + * Second level timestamp. + * @type { number } * @syscap SystemCapability.HiviewDFX.Hiview.FaultLogger + * @since 8 */ timestamp: number; /** - * reason fault reason - * @since 8 + * Fault reason. + * @type { string } * @syscap SystemCapability.HiviewDFX.Hiview.FaultLogger + * @since 8 */ reason: string; /** - * module fault module - * @since 8 + * Fault module. + * @type { string } * @syscap SystemCapability.HiviewDFX.Hiview.FaultLogger + * @since 8 */ module: string; /** - * summary fault summary - * @since 8 + * Fault summary. + * @type { string } * @syscap SystemCapability.HiviewDFX.Hiview.FaultLogger + * @since 8 */ summary: string; /** - * fullLog fault log - * @since 8 + * Fault log. + * @type { string } * @syscap SystemCapability.HiviewDFX.Hiview.FaultLogger + * @since 8 */ fullLog: string; } -- Gitee From 19cd4a78753bbb8acc4ee5e2620212b4fcdde7ee Mon Sep 17 00:00:00 2001 From: li-hui-17 Date: Tue, 18 Oct 2022 14:07:16 +0800 Subject: [PATCH 171/438] add StoreConfigV9 Signed-off-by: li-hui-17 --- api/@ohos.data.rdb.d.ts | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index a9629cb0ac..b433eedc03 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -478,6 +478,42 @@ declare namespace rdb { encrypt?: boolean; } + /** + * Manages relational database configurations. + * + * @import import data_rdb from '@ohos.data.rdb'; + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + interface StoreConfigV9 { + /** + * The database name. + * + * @import import data_rdb from '@ohos.data.rdb'; + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + name: string; + + /** + * Specifies whether the database is encrypted. + * + * @import import data_rdb from '@ohos.data.rdb'; + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + securityLevel: SecurityLevel; + + /** + * Specifies whether the database is encrypted. + * + * @import import data_rdb from '@ohos.data.rdb'; + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + encrypt?: boolean; + } + /** * Manages relational database configurations. * -- Gitee From 0e7010671bf22103607d7eca44198174e5ac46cb Mon Sep 17 00:00:00 2001 From: supeng Date: Tue, 18 Oct 2022 14:16:55 +0800 Subject: [PATCH 172/438] =?UTF-8?q?=E7=9B=B8=E6=9C=BA=E6=A1=86=E6=9E=B6?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=85=A8=E5=B1=80=E5=BC=80=E5=85=B3=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: supeng --- api/@ohos.multimedia.camera.d.ts | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/api/@ohos.multimedia.camera.d.ts b/api/@ohos.multimedia.camera.d.ts index fbe6c9ee52..7cc5c6278e 100644 --- a/api/@ohos.multimedia.camera.d.ts +++ b/api/@ohos.multimedia.camera.d.ts @@ -200,6 +200,32 @@ declare namespace camera { */ getSupportedOutputCapability(camera: CameraDevice): Promise; + /** + * Determine wether camera is muted. + * @return Is camera muted. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + */ + isCameraMuted(): boolean; + + /** + * Determine wether camera mute is supported. + * @return Is camera mute supported. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + */ + isCameraMuteSupported(): boolean; + + /** + * Mute camera. + * @param mute Mute camera if TRUE, otherwise unmute camera. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + */ + muteCamera(mute: boolean): void; + /** * Creates a CameraInput instance by camera. * @param camera Camera device used to create the instance. @@ -344,6 +370,16 @@ declare namespace camera { * @syscap SystemCapability.Multimedia.Camera.Core */ on(type: 'cameraStatus', callback: AsyncCallback): void; + + /** + * Subscribes camera mute change event callback. + * @param type Event type. + * @param callback Callback used to get the camera mute change. + * @since 9 + * @syscap SystemCapability.Multimedia.Camera.Core + * @systemapi + */ + on(type: 'cameraMute', callback: AsyncCallback): void; } /** -- Gitee From 60520a15bc7340fb4d2e467cca6b8b3bc3a64122 Mon Sep 17 00:00:00 2001 From: fanjiaojiao Date: Tue, 18 Oct 2022 14:41:29 +0800 Subject: [PATCH 173/438] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E8=BF=90=E8=A1=8Cfs=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fanjiaojiao --- build-tools/api_check_plugin/entry.js | 1 + 1 file changed, 1 insertion(+) diff --git a/build-tools/api_check_plugin/entry.js b/build-tools/api_check_plugin/entry.js index 849416c805..b81208d3c7 100644 --- a/build-tools/api_check_plugin/entry.js +++ b/build-tools/api_check_plugin/entry.js @@ -14,6 +14,7 @@ */ const path = require("path"); +const fs = require("fs"); const { writeResultFile } = require('./src/utils'); function checkEntry(url) { -- Gitee From 30b1877425ab8ed7113ba4f59831af4c4f011167 Mon Sep 17 00:00:00 2001 From: SoftSquirrel Date: Tue, 18 Oct 2022 15:17:48 +0800 Subject: [PATCH 174/438] Issue:#I5WBYQ Description: modify SystemCapability Sig: SIG_ApplicaitonFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: SoftSquirrel --- api/@ohos.bundle.defaultAppManager.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/@ohos.bundle.defaultAppManager.d.ts b/api/@ohos.bundle.defaultAppManager.d.ts index c0daf933bf..65a065a00c 100644 --- a/api/@ohos.bundle.defaultAppManager.d.ts +++ b/api/@ohos.bundle.defaultAppManager.d.ts @@ -153,7 +153,7 @@ declare namespace defaultAppManager { * @throws { BusinessError } 17700004 - The specified user id is not found. * @throws { BusinessError } 17700025 - The specified type is invalid. * @throws { BusinessError } 17700028 - The specified ability and type does not match. - * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager.defaultAppManager + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager * @systemapi * @since 9 */ @@ -173,7 +173,7 @@ declare namespace defaultAppManager { * @throws { BusinessError } 17700004 - The specified user id is not found. * @throws { BusinessError } 17700025 - The specified type is invalid. * @throws { BusinessError } 17700028 - The specified ability and type does not match. - * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager.defaultAppManager + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager * @systemapi * @since 9 */ @@ -190,7 +190,7 @@ declare namespace defaultAppManager { * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 17700004 - The specified user id is not found. * @throws { BusinessError } 17700025 - The specified type is invalid. - * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager.defaultAppManager + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager * @systemapi * @since 9 */ @@ -208,7 +208,7 @@ declare namespace defaultAppManager { * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 17700004 - The specified user id is not found. * @throws { BusinessError } 17700025 - The specified type is invalid. - * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager.defaultAppManager + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager * @systemapi * @since 9 */ -- Gitee From 1f1cabd23955664d3beba368fdaa6dd204b9b3ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=A4=A9=E6=80=A1?= Date: Tue, 18 Oct 2022 07:38:17 +0000 Subject: [PATCH 175/438] BUGFIX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 朱天怡 --- ...esourceschedule.backgroundTaskManager.d.ts | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts index f30c451bcb..2675ac4705 100644 --- a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts +++ b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts @@ -21,7 +21,7 @@ import Context from './application/BaseContext'; * Manages background tasks. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.TransientTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask */ declare namespace backgroundTaskManager { /** @@ -29,7 +29,7 @@ declare namespace backgroundTaskManager { * * @name DelaySuspendInfo * @since 9 - * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.TransientTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask */ interface DelaySuspendInfo { /** @@ -46,7 +46,7 @@ declare namespace backgroundTaskManager { * Cancels delayed transition to the suspended state. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.TransientTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @param requestId Indicates the identifier of the delay request. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 9800001 - Memory operation failed. @@ -62,7 +62,7 @@ declare namespace backgroundTaskManager { * Obtains the remaining time before an application enters the suspended state. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.TransientTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @param requestId Indicates the identifier of the delay request. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 9800001 - Memory operation failed. @@ -80,7 +80,7 @@ declare namespace backgroundTaskManager { * Requests delayed transition to the suspended state. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.TransientTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @param reason Indicates the reason for delayed transition to the suspended state. * @param callback The callback delay time expired. * @throws { BusinessError } 401 - Parameter error. @@ -99,7 +99,7 @@ declare namespace backgroundTaskManager { * system will publish a notification related to the this service. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @permission ohos.permission.KEEP_BACKGROUND_RUNNING * @param context app running context. * @param bgMode Indicates which background mode to request. @@ -121,7 +121,7 @@ declare namespace backgroundTaskManager { * Service ability uses this method to request stop running in background. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @param context app running context. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - Parameter error. @@ -140,7 +140,7 @@ declare namespace backgroundTaskManager { * Apply or unapply efficiency resources. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.EfficiencyResourcesApply + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 9800001 - Memory operation failed. @@ -156,7 +156,7 @@ declare namespace backgroundTaskManager { * Reset all efficiency resources apply. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.EfficiencyResourcesApply + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply * @systemapi Hide this for inner system use. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - Parameter error. @@ -172,14 +172,14 @@ declare namespace backgroundTaskManager { * Supported background mode. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask */ export enum BackgroundMode { /** * data transfer mode * * @since 9 - * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask */ DATA_TRANSFER = 1, @@ -187,7 +187,7 @@ declare namespace backgroundTaskManager { * audio playback mode * * @since 9 - * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask */ AUDIO_PLAYBACK = 2, @@ -195,7 +195,7 @@ declare namespace backgroundTaskManager { * audio recording mode * * @since 9 - * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask */ AUDIO_RECORDING = 3, @@ -203,7 +203,7 @@ declare namespace backgroundTaskManager { * location mode * * @since 9 - * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask */ LOCATION = 4, @@ -211,7 +211,7 @@ declare namespace backgroundTaskManager { * bluetooth interaction mode * * @since 9 - * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask */ BLUETOOTH_INTERACTION = 5, @@ -219,7 +219,7 @@ declare namespace backgroundTaskManager { * multi-device connection mode * * @since 9 - * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask */ MULTI_DEVICE_CONNECTION = 6, @@ -227,7 +227,7 @@ declare namespace backgroundTaskManager { * wifi interaction mode * * @since 9 - * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @systemapi Hide this for inner system use. */ WIFI_INTERACTION = 7, @@ -236,7 +236,7 @@ declare namespace backgroundTaskManager { * Voice over Internet Phone mode * * @since 9 - * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @systemapi Hide this for inner system use. */ VOIP = 8, @@ -246,7 +246,7 @@ declare namespace backgroundTaskManager { * only supported in particular device * * @since 9 - * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.ContinuousTask + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask */ TASK_KEEPING = 9, } @@ -255,7 +255,7 @@ declare namespace backgroundTaskManager { * The type of resource. * * @since 9 - * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.EfficiencyResourcesApply + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply * @systemapi Hide this for inner system use. */ export enum ResourceType { @@ -300,7 +300,7 @@ declare namespace backgroundTaskManager { * * @name EfficiencyResourcesRequest * @since 9 - * @syscap SystemCapability.ResourceSchedule.backgroundTaskManager.EfficiencyResourcesApply + * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply * @systemapi Hide this for inner system use. */ export interface EfficiencyResourcesRequest { -- Gitee From d9b0c03c295fa29500327aa3e90b7d36c873c6c7 Mon Sep 17 00:00:00 2001 From: aqxyjay Date: Wed, 12 Oct 2022 15:27:01 +0800 Subject: [PATCH 176/438] fix: update as review Signed-off-by: aqxyjay --- api/@ohos.batteryStatistics.d.ts | 14 +++++------ api/@ohos.brightness.d.ts | 4 +-- api/@ohos.power.d.ts | 38 +++++++++++++++++------------ api/@ohos.runningLock.d.ts | 42 ++++++++++++++------------------ api/@ohos.thermal.d.ts | 25 ++++++++++--------- api/@system.brightness.d.ts | 6 ++--- 6 files changed, 66 insertions(+), 63 deletions(-) diff --git a/api/@ohos.batteryStatistics.d.ts b/api/@ohos.batteryStatistics.d.ts index 78663c3eb5..a3b0b0531f 100755 --- a/api/@ohos.batteryStatistics.d.ts +++ b/api/@ohos.batteryStatistics.d.ts @@ -71,7 +71,7 @@ declare namespace batteryStats { * Obtains the power consumption information list. * * @param {AsyncCallback} callback Indicates the callback of power consumption information list. - * @throws {BusinessError} 401 If the callback is not valid. + * @throws {BusinessError} 401 - If the callback is not valid. * @systemapi * @since 8 */ @@ -82,7 +82,7 @@ declare namespace batteryStats { * * @param {number} uid Indicates the uid. * @return {number} Power consumption information(Mah). - * @throws {BusinessError} 101 If connecting to the service failed. + * @throws {BusinessError} 4600101 - If connecting to the service failed. * @systemapi * @since 8 */ @@ -93,7 +93,7 @@ declare namespace batteryStats { * * @param {number} uid Indicates the uid. * @return {number} Power consumption information(Percent). - * @throws {BusinessError} 101 If connecting to the service failed. + * @throws {BusinessError} 4600101 - If connecting to the service failed. * @systemapi * @since 8 */ @@ -104,8 +104,8 @@ declare namespace batteryStats { * * @param {ConsumptionType} type Indicates the hardware type. * @return {number} Power consumption information(Mah). - * @throws {BusinessError} 101 If connecting to the service failed. - * @throws {BusinessError} 401 If the type is not valid. + * @throws {BusinessError} 401 - If the type is not valid. + * @throws {BusinessError} 4600101 - If connecting to the service failed. * @systemapi * @since 8 */ @@ -116,8 +116,8 @@ declare namespace batteryStats { * * @param {ConsumptionType} type Indicates the hardware type. * @return {number} Power consumption information(Percent). - * @throws {BusinessError} 101 If connecting to the service failed. - * @throws {BusinessError} 401 If the type is not valid. + * @throws {BusinessError} 401 - If the type is not valid. + * @throws {BusinessError} 4600101 - If connecting to the service failed. * @systemapi * @since 8 */ diff --git a/api/@ohos.brightness.d.ts b/api/@ohos.brightness.d.ts index b667bdd844..ab8eec2b79 100644 --- a/api/@ohos.brightness.d.ts +++ b/api/@ohos.brightness.d.ts @@ -27,8 +27,8 @@ declare namespace brightness { * Sets the screen brightness. * * @param {number} value Brightness value, ranging from 0 to 255. - * @throws {BusinessError} 101 If connecting to the service failed. - * @throws {BusinessError} 401 If the value is not valid. + * @throws {BusinessError} 401 - If the value is not valid. + * @throws {BusinessError} 4700101 - If connecting to the service failed. * @systemapi * @since 7 */ diff --git a/api/@ohos.power.d.ts b/api/@ohos.power.d.ts index 28f0e03e30..11e3384bf4 100644 --- a/api/@ohos.power.d.ts +++ b/api/@ohos.power.d.ts @@ -29,8 +29,9 @@ declare namespace power { * * @permission ohos.permission.REBOOT * @param {string} reason Indicates the shutdown reason. - * @throws {BusinessError} 101 If connecting to the service failed. - * @throws {BusinessError} 201 If the permission is denied. + * @throws {BusinessError} 201 - If the permission is denied. + * @throws {BusinessError} 401 - If the reason is not valid. + * @throws {BusinessError} 4900101 - If connecting to the service failed. * @systemapi * @since 7 */ @@ -46,6 +47,7 @@ declare namespace power { * @permission ohos.permission.REBOOT * @since 7 * @deprecated since 9 + * @useinstead {@link power#reboot} */ function rebootDevice(reason: string): void; @@ -57,8 +59,9 @@ declare namespace power { * @permission ohos.permission.REBOOT * @param {string} reason Indicates the restart reason. For example, "updater" indicates entering the updater mode * after the restart. If the parameter is not specified, the system enters the normal mode after the restart. - * @throws {BusinessError} 101 If connecting to the service failed. - * @throws {BusinessError} 201 If the permission is denied. + * @throws {BusinessError} 201 - If the permission is denied. + * @throws {BusinessError} 401 - If the reason is not valid. + * @throws {BusinessError} 4900101 - If connecting to the service failed. * @systemapi * @since 9 */ @@ -70,25 +73,28 @@ declare namespace power { * @return Returns true if the screen is on; returns false otherwise. * @since 7 * @deprecated since 9 - * @useinstead {@link isScreenOn} + * @useinstead {@link power#isActive} */ function isScreenOn(callback: AsyncCallback): void; function isScreenOn(): Promise; /** - * Checks whether the screen of a device is on or off. + * Checks whether the device is active. + *

+ * The screen will be on if device is active, screen will be off otherwise. * - * @return Returns true if the screen is on; returns false otherwise. - * @throws {BusinessError} If connecting to the service failed. + * @return Returns true if the device is active; returns false otherwise. + * @throws {BusinessError} 4900101 - If connecting to the service failed. * @since 9 */ - function isScreenOn(): boolean; + function isActive(): boolean; /** * Wakes up the device to turn on the screen. * * @param {string} detail Indicates the detail information who request wakeup. - * @throws {BusinessError} 101 If connecting to the service failed. + * @throws {BusinessError} 401 - If the detail is not valid. + * @throws {BusinessError} 4900101 - If connecting to the service failed. * @systemapi * @since 9 */ @@ -97,7 +103,7 @@ declare namespace power { /** * Suspends the device to turn off the screen. * - * @throws {BusinessError} 101 If connecting to the service failed. + * @throws {BusinessError} 4900101 - If connecting to the service failed. * @systemapi * @since 9 */ @@ -108,8 +114,8 @@ declare namespace power { * * @permission ohos.permission.POWER_OPTIMIZATION * @return The power mode {@link DevicePowerMode} of current device . - * @throws {BusinessError} 101 If connecting to the service failed. - * @throws {BusinessError} 201 If the permission is denied. + * @throws {BusinessError} 201 – If the permission is denied. + * @throws {BusinessError} 4900101 - If connecting to the service failed. * @since 9 */ function getPowerMode(): DevicePowerMode; @@ -120,7 +126,8 @@ declare namespace power { * @permission ohos.permission.POWER_OPTIMIZATION * @param {DevicePowerMode} mode Indicates power mode {@link DevicePowerMode} to set. * @param {AsyncCallback} callback Indicates the callback of setting the power mode. - * @throws {BusinessError} 401 If mode or callback is not valid. + * @throws {BusinessError} 201 – If the permission is denied. + * @throws {BusinessError} 401 - If mode or callback is not valid. * @systemapi * @since 9 */ @@ -131,7 +138,8 @@ declare namespace power { * * @permission ohos.permission.POWER_OPTIMIZATION * @param {DevicePowerMode} mode Indicates power mode {@link DevicePowerMode} to set. - * @throws {BusinessError} 401 If mode is not valid. + * @throws {BusinessError} 201 – If the permission is denied. + * @throws {BusinessError} 401 - If mode or callback is not valid. * @systemapi * @since 9 */ diff --git a/api/@ohos.runningLock.d.ts b/api/@ohos.runningLock.d.ts index 98f426d4be..84a763647c 100644 --- a/api/@ohos.runningLock.d.ts +++ b/api/@ohos.runningLock.d.ts @@ -38,7 +38,7 @@ declare namespace runningLock { * released and the system hibernates if no other {@link RunningLock} is set. * @since 7 * @deprecated since 9 - * @useinstead {@link hold} + * @useinstead {@link RunningLock#hold} */ lock(timeout: number): void; @@ -49,7 +49,8 @@ declare namespace runningLock { * @permission ohos.permission.RUNNING_LOCK * @param {number} timeout Indicates the lock duration (ms). After the lock duration times out, * the lock is automatically released and the system hibernates if no other {@link RunningLock} is set. - * @throws {BusinessError} If connecting to the service failed. + * @throws {BusinessError} 401 - If the timeout is not valid. + * @throws {BusinessError} 4900101 - If connecting to the service failed. * @since 9 */ hold(timeout: number): void; @@ -60,7 +61,7 @@ declare namespace runningLock { * @return Returns true if the lock is held or in use; returns false if the lock has been released. * @since 7 * @deprecated since 9 - * @useinstead {@link isHolding} + * @useinstead {@link RunningLock#isHolding} */ isUsed(): boolean; @@ -68,7 +69,7 @@ declare namespace runningLock { * Checks whether a lock is held or in use. * * @return Returns true if the lock is held or in use; returns false if the lock has been released. - * @throws {BusinessError} If connecting to the service failed. + * @throws {BusinessError} 4900101 - If connecting to the service failed. * @since 9 */ isHolding(): boolean; @@ -80,7 +81,7 @@ declare namespace runningLock { * @permission ohos.permission.RUNNING_LOCK * @since 7 * @deprecated since 9 - * @useinstead {@link unhold} + * @useinstead {@link RunningLock#unhold} */ unlock(): void; @@ -89,7 +90,7 @@ declare namespace runningLock { * This method requires the ohos.permission.RUNNING_LOCK permission. * * @permission ohos.permission.RUNNING_LOCK - * @throws {BusinessError} If connecting to the service failed. + * @throws {BusinessError} 4900101 - If connecting to the service failed. * @since 9 */ unhold(): void; @@ -122,11 +123,13 @@ declare namespace runningLock { * Checks whether the specified {@link RunningLockType} is supported. * * @param type Indicates the specified {@link RunningLockType}. + * @param callback Indicates the callback function contains the result whether the specified + * {@link RunningLockType} is supported. * @return Returns true if the specified {@link RunningLockType} is supported; * returns false otherwise. * @since 7 * @deprecated since 9 - * @useinstead {@link iSupported} + * @useinstead {@link RunningLock#isSupported} */ function isRunningLockTypeSupported(type: RunningLockType, callback: AsyncCallback): void; function isRunningLockTypeSupported(type: RunningLockType): Promise; @@ -135,22 +138,12 @@ declare namespace runningLock { * Checks whether the specified {@link RunningLockType} is supported. * * @param {RunningLockType} type Indicates the specified {@link RunningLockType}. - * @param {AsyncCallback} callback Indicates the callback of whether the specified {@link RunningLockType} - * is supported. - * @throws {BusinessError} If the type or callback is not valid. + * @return {boolean} Whether the specified {@link RunningLockType} is supported. + * @throws {BusinessError} 401 - If the type is not valid. + * @throws {BusinessError} 4900101 - If connecting to the service failed. * @since 9 */ - function iSupported(type: RunningLockType, callback: AsyncCallback): void; - - /** - * Checks whether the specified {@link RunningLockType} is supported. - * - * @param {RunningLockType} type Indicates the specified {@link RunningLockType}. - * @return {Promise} Whether the specified {@link RunningLockType} is supported. - * @throws {BusinessError} If the type is not valid. - * @since 9 - */ - function isSupported(type: RunningLockType): Promise; + function isSupported(type: RunningLockType): boolean; /** * Creates a {@link RunningLock} object. @@ -162,11 +155,12 @@ declare namespace runningLock { * @param name Indicates the {@link RunningLock} name. A recommended name consists of the package or class name and * a suffix. * @param type Indicates the {@link RunningLockType}. + * @param callback Indicates the callback contains the {@link RunningLock} object. * @return Returns the {@link RunningLock} object. * @permission ohos.permission.RUNNING_LOCK * @since 7 * @deprecated since 9 - * @useinstead {@link create} + * @useinstead {@link RunningLock#create} */ function createRunningLock(name: string, type: RunningLockType, callback: AsyncCallback): void; function createRunningLock(name: string, type: RunningLockType): Promise; @@ -183,7 +177,7 @@ declare namespace runningLock { * class name and a suffix. * @param {RunningLockType} type Indicates the {@link RunningLockType}. * @param {AsyncCallback)} callback Indicates the callback of {@link RunningLock} object. - * @throws {BusinessError} If the name, type or callback is not valid. + * @throws {BusinessError} 401 - If the name, type or callback is not valid. * @since 9 */ function create(name: string, type: RunningLockType, callback: AsyncCallback): void; @@ -200,7 +194,7 @@ declare namespace runningLock { * class name and a suffix. * @param {RunningLockType} type Indicates the {@link RunningLockType}. * @return {Promise} The {@link RunningLock} object. - * @throws {BusinessError} If the name or type is not valid. + * @throws {BusinessError} 401 - If the name or type is not valid. * @since 9 */ function create(name: string, type: RunningLockType): Promise; diff --git a/api/@ohos.thermal.d.ts b/api/@ohos.thermal.d.ts index 3eb8282141..566c146fb3 100644 --- a/api/@ohos.thermal.d.ts +++ b/api/@ohos.thermal.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback, BusinessError} from './basic'; +import {AsyncCallback, BusinessError, Callback} from './basic'; /** * Provides thermal level-related callback and query APIs to obtain the information required for @@ -72,18 +72,19 @@ declare namespace thermal { * @return Returns the thermal level. * @since 8 * @deprecated since 9 - * @useinstead {@link registerThermalLevelCallback} + * @useinstead {@link thermal#registerThermalLevelCallback} */ function subscribeThermalLevel(callback: AsyncCallback): void; /** * Registers to callbacks of thermal level changes. * - * @param {AsyncCallback} callback Callback of thermal level changes. - * @throws {BusinessError} 401 If callback is not valid. + * @param {Callback} callback Callback of thermal level changes. + * @throws {BusinessError} 401 - If callback is not valid. + * @throws {BusinessError} 4800101 If connecting to the service failed. * @since 9 */ - function registerThermalLevelCallback(callback: AsyncCallback): void; + function registerThermalLevelCallback(callback: Callback): void; /** * Unsubscribes from the callbacks of thermal level changes. @@ -91,19 +92,19 @@ declare namespace thermal { * @param callback Callback of thermal level changes. * @since 8 * @deprecated since 9 - * @useinstead {@link unregisterThermalLevelCallback} + * @useinstead {@link thermal#unregisterThermalLevelCallback} */ function unsubscribeThermalLevel(callback?: AsyncCallback): void; /** * Unregisters from the callbacks of thermal level changes. * - * @param {AsyncCallback} callback Callback of thermal level changes. - * @throws {BusinessError} 101 If connecting to the service failed. - * @throws {BusinessError} 401 If callback is not valid. + * @param {Callback} callback Callback of thermal level changes. + * @throws {BusinessError} 401 - If callback is not valid. + * @throws {BusinessError} 4800101 If connecting to the service failed. * @since 9 */ - function unregisterThermalLevelCallback(callback?: AsyncCallback): void; + function unregisterThermalLevelCallback(callback?: Callback): void; /** * Obtains the current thermal level. @@ -111,7 +112,7 @@ declare namespace thermal { * @return Returns the thermal level. * @since 8 * @deprecated since 9 - * @useinstead {@link getLevel} + * @useinstead {@link thermal#getLevel} */ function getThermalLevel(): ThermalLevel; @@ -119,7 +120,7 @@ declare namespace thermal { * Obtains the current thermal level. * * @return {ThermalLevel} The thermal level. - * @throws {BusinessError} 101 If connecting to the service failed. + * @throws {BusinessError} 4800101 If connecting to the service failed. * @since 9 */ function getLevel(): ThermalLevel; diff --git a/api/@system.brightness.d.ts b/api/@system.brightness.d.ts index 7f758e7bec..806775ade8 100755 --- a/api/@system.brightness.d.ts +++ b/api/@system.brightness.d.ts @@ -20,7 +20,7 @@ */ export interface BrightnessResponse { /** - * Screen brightness, which ranges from 1 to 100. + * Screen brightness, which ranges from 1 to 255. * @since 3 * @deprecated since 7 */ @@ -62,9 +62,9 @@ export interface GetBrightnessOptions { */ export interface SetBrightnessOptions { /** - * Screen brightness. The value is an integer ranging from 1 to 100. + * Screen brightness. The value is an integer ranging from 1 to 255. * If the value is less than or equal to 0, value 1 will be used. - * If the value is greater than 100, value 100 will be used. + * If the value is greater than 255, value 255 will be used. * If the value contains decimals, the integral part of the value will be used. * For example, if value is 8.1 is set, value 8 will be used. * @since 3 -- Gitee From dfbf5384b5c6be27921866dd6a2f92831a9e4213 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwangxiyue=E2=80=9D?= Date: Tue, 18 Oct 2022 16:54:44 +0800 Subject: [PATCH 177/438] =?UTF-8?q?modified=20code=20Signed-off-by:=20?= =?UTF-8?q?=E2=80=9Cwangxiyue=E2=80=9D=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/@ohos.data.distributedDataObject.d.ts | 52 +++++++++++++---------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/api/@ohos.data.distributedDataObject.d.ts b/api/@ohos.data.distributedDataObject.d.ts index b1c4c834c3..6ff95356e5 100644 --- a/api/@ohos.data.distributedDataObject.d.ts +++ b/api/@ohos.data.distributedDataObject.d.ts @@ -19,7 +19,7 @@ import Context from './application/Context'; /** * Provides interfaces to sync distributed object. * - * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 8 */ declare namespace distributedDataObject { @@ -29,10 +29,10 @@ declare namespace distributedDataObject { * * @param {object} source - source Init data of distributed object. * @returns {DistributedObject} - return the distributed object. - * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 8 * @deprecated since 9 - * @useinstead create + * @useinstead ohos.distributedDataObject.create */ function createDistributedObject(source: object): DistributedObject; @@ -43,7 +43,7 @@ declare namespace distributedDataObject { * @param {object} source - source Init data of distributed object. * @returns {DistributedObjectV9} - return the distributed object. * @throws {BusinessError} 401 - the parameter check failed. - * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 9 */ function create(context: Context, source: object): DistributedObjectV9; @@ -52,13 +52,16 @@ declare namespace distributedDataObject { * Generate a random sessionId. * * @returns {string} - return generated sessionId. - * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 8 */ function genSessionId(): string; /** - * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. + * the response of save. + * Contains the parameter information of the save object. + * + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 9 */ interface SaveSuccessResponse { @@ -88,7 +91,10 @@ declare namespace distributedDataObject { } /** - * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. + * the response of revokeSave. + * Contains the sessionId of the changed object. + * + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 9 */ interface RevokeSaveSuccessResponse { @@ -104,7 +110,7 @@ declare namespace distributedDataObject { /** * Object create by {@link createDistributedObject}. * - * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 8 * @deprecated since 9 */ @@ -116,7 +122,7 @@ declare namespace distributedDataObject { * @permission ohos.permission.DISTRIBUTED_DATASYNC * @param {string} sessionId - sessionId The sessionId to be joined, if empty, leave all session. * @returns {boolean} - return a result of function. - * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 8 * @deprecated since 9 */ @@ -130,7 +136,7 @@ declare namespace distributedDataObject { * indicates the observer of object data changed. * {string} sessionId - the sessionId of the changed object. * {Array} fields - changed data. - * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 8 * @deprecated since 9 */ @@ -145,7 +151,7 @@ declare namespace distributedDataObject { * {string} sessionId - the sessionId of the changed object. * {Array} fields - changed data. * callback If not null, off the callback, if undefined, off all callbacks. - * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 8 * @deprecated since 9 */ @@ -162,7 +168,7 @@ declare namespace distributedDataObject { * {string} status * 'online' The object became online on the device and data can be synced to the device. * 'offline' The object became offline on the device and the object can not sync any data. - * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 8 * @deprecated since 9 */ @@ -181,7 +187,7 @@ declare namespace distributedDataObject { * 'online' The object became online on the device and data can be synced to the device. * 'offline' The object became offline on the device and the object can not sync any data. * callback If not null, off the callback, if undefined, off all callbacks. - * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 8 * @deprecated since 9 */ @@ -206,7 +212,7 @@ declare namespace distributedDataObject { * @throws {BusinessError} 201 - the permissions check failed. * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 15400001 - create table failed. - * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 9 */ setSessionId(sessionId: string, callback: AsyncCallback): void; @@ -221,7 +227,7 @@ declare namespace distributedDataObject { * @throws {BusinessError} 201 - the permissions check failed. * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 15400001 - create table failed. - * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 9 */ setSessionId(sessionId?: string): Promise; @@ -236,7 +242,7 @@ declare namespace distributedDataObject { * {Array} fields - changed data. * sessionId the sessionId of the changed object. * @throws {BusinessError} 401 - the parameter check failed. - * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 9 */ on(type: 'change', callback: Callback<{ sessionId: string, fields: Array }>): void; @@ -251,7 +257,7 @@ declare namespace distributedDataObject { * {Array} fields - changed data. * callback If not null, off the callback, if undefined, off all callbacks. * @throws {BusinessError} 401 - the parameter check failed. - * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 9 */ off(type: 'change', callback?: Callback<{ sessionId: string, fields: Array }>): void; @@ -269,7 +275,7 @@ declare namespace distributedDataObject { * 'offline' The object became offline on the device and the object can not sync any data. * 'restored' The object restored success. * @throws {BusinessError} 401 - the parameter check failed. - * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 9 */ on(type: 'status', @@ -288,7 +294,7 @@ declare namespace distributedDataObject { * 'offline' The object became offline on the device and the object can not sync any data. * callback If not null, off the callback, if undefined, off all callbacks. * @throws {BusinessError} 401 - the parameter check failed. - * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 9 */ off(type: 'status', @@ -309,7 +315,7 @@ declare namespace distributedDataObject { * @param {AsyncCallback} callback * {SaveSuccessResponse}: the response of save. * @throws {BusinessError} 401 - the parameter check failed. - * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 9 */ save(deviceId: string, callback: AsyncCallback): void; @@ -328,7 +334,7 @@ declare namespace distributedDataObject { * @param {string} deviceId - Indicates the device that will resume the object data. * @returns {Promise} {SaveSuccessResponse}: the response of save. * @throws {BusinessError} 401 - the parameter check failed. - * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 9 */ save(deviceId: string): Promise; @@ -341,7 +347,7 @@ declare namespace distributedDataObject { * @param {AsyncCallback} callback * {RevokeSaveSuccessResponse}: the response of revokeSave. * @throws {BusinessError} 401 - the parameter check failed. - * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 9 */ revokeSave(callback: AsyncCallback): void; @@ -353,7 +359,7 @@ declare namespace distributedDataObject { * * @returns {Promise} {RevokeSaveSuccessResponse}: the response of revokeSave. * @throws {BusinessError} 401 - the parameter check failed. - * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject. + * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 9 */ revokeSave(): Promise; -- Gitee From 5ae22523234988c7222491291af24d5587d16a02 Mon Sep 17 00:00:00 2001 From: zhutianyi Date: Tue, 18 Oct 2022 17:14:47 +0800 Subject: [PATCH 178/438] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhutianyi --- api/@ohos.backgroundTaskManager.d.ts | 111 ---------- api/@ohos.workScheduler.d.ts | 301 --------------------------- 2 files changed, 412 deletions(-) delete mode 100644 api/@ohos.workScheduler.d.ts diff --git a/api/@ohos.backgroundTaskManager.d.ts b/api/@ohos.backgroundTaskManager.d.ts index 7011676c21..7f10c8edb5 100644 --- a/api/@ohos.backgroundTaskManager.d.ts +++ b/api/@ohos.backgroundTaskManager.d.ts @@ -111,29 +111,6 @@ declare namespace backgroundTaskManager { function stopBackgroundRunning(context: Context, callback: AsyncCallback): void; function stopBackgroundRunning(context: Context): Promise; - /** - * Apply or unapply efficiency resources. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply - * @return True if efficiency resources apply success, else false. - * @systemapi Hide this for inner system use. - * @deprecated since 9 - * @useinstead ohos.resourceschedule.backgroundTaskManager.applyEfficiencyResources - */ - function applyEfficiencyResources(request: EfficiencyResourcesRequest): boolean; - - /** - * Reset all efficiency resources apply. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply - * @systemapi Hide this for inner system use. - * @deprecated since 9 - * @useinstead ohos.resourceschedule.backgroundTaskManager.resetAllEfficiencyResources - */ - function resetAllEfficiencyResources(): void; - /** * Supported background mode. * @@ -218,94 +195,6 @@ declare namespace backgroundTaskManager { */ TASK_KEEPING = 9, } - - /** - * The type of resource. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply - * @systemapi Hide this for inner system use. - * @deprecated since 9 - * @useinstead ohos.resourceschedule.backgroundTaskManager.ResourceType - */ - export enum ResourceType { - /** - * The cpu resource for not being suspended. - */ - CPU = 1, - - /** - * The resource for not being proxyed common_event. - */ - COMMON_EVENT = 1 << 1, - - /** - * The resource for not being proxyed timer. - */ - TIMER = 1 << 2, - - /** - * The resource for not being proxyed workscheduler. - */ - WORK_SCHEDULER = 1 << 3, - - /** - * The resource for not being proxyed bluetooth. - */ - BLUETOOTH = 1 << 4, - - /** - * The resource for not being proxyed gps. - */ - GPS = 1 << 5, - - /** - * The resource for not being proxyed audio. - */ - AUDIO = 1 << 6 - } - - /** - * The request of efficiency resources. - * - * @name EfficiencyResourcesRequest - * @since 9 - * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply - * @systemapi Hide this for inner system use. - * @deprecated since 9 - * @useinstead ohos.resourceschedule.backgroundTaskManager.EfficiencyResourcesRequest - */ - export interface EfficiencyResourcesRequest { - /** - * The set of resource types that app wants to apply. - */ - resourceTypes: number; - - /** - * True if the app begin to use, else false. - */ - isApply: boolean; - - /** - * The duration that the resource can be used most. - */ - timeOut: number; - - /** - * True if the apply action is persist, else false. Default value is false. - */ - isPersist?: boolean; - - /** - * True if apply action is for process, false is for package. Default value is false. - */ - isProcess?: boolean; - - /** - * The apply reason. - */ - reason: string; - } } export default backgroundTaskManager; diff --git a/api/@ohos.workScheduler.d.ts b/api/@ohos.workScheduler.d.ts deleted file mode 100644 index 65a4879961..0000000000 --- a/api/@ohos.workScheduler.d.ts +++ /dev/null @@ -1,301 +0,0 @@ -/* - * 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 {AsyncCallback} from './basic'; - -/** - * Work scheduler interface. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - * @deprecated since 9 - * @useinstead ohos.resourceschedule.workScheduler - */ -declare namespace workScheduler { - /** - * The info of work. - * - * @name WorkInfo - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - * @deprecated since 9 - * @useinstead ohos.resourceschedule.workScheduler.WorkInfo - */ - export interface WorkInfo { - /** - * The id of the current work. - */ - workId: number; - /** - * The bundle name of the current work. - */ - bundleName: string; - /** - * The ability name of the current work. - */ - abilityName: string; - /** - * Whether the current work will be saved. - */ - isPersisted?: boolean; - /** - * The network type of the current work. - */ - networkType?: NetworkType; - /** - * Whether a charging state has been set for triggering the work. - */ - isCharging?: boolean; - /** - * The charger type based on which the work is triggered. - */ - chargerType?: ChargingType; - /** - * The battery level for triggering a work. - */ - batteryLevel?: number; - /** - * The battery status for triggering a work. - */ - batteryStatus?: BatteryStatus; - /** - * Whether a storage state has been set for triggering the work. - */ - storageRequest?: StorageRequest; - /** - * The interval at which the work is repeated. - */ - repeatCycleTime?: number; - /** - * Whether the work has been set to repeat at the specified interval. - */ - isRepeat?: boolean; - /** - * The repeat of the current work. - */ - repeatCount?: number; - /** - * Whether the device deep idle state has been set for triggering the work. - */ - isDeepIdle?: boolean; - /** - * The idle wait time based on which the work is triggered. - */ - idleWaitTime?: number; - /** - * The parameters of the work. The value is only supported basic type(Number, String, Boolean). - */ - parameters?: {[key: string]: any}; - } - - /** - * Add a work to the queue. A work can be executed only when it meets the preset triggering condition - * and complies with the rules of work scheduler manager. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - * @param work The info of work. - * @return true if success, otherwise false. - * @deprecated since 9 - * @useinstead ohos.resourceschedule.workScheduler.startWork - */ - function startWork(work: WorkInfo): boolean; - - /** - * Stop a work. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - * @param work The info of work. - * @param needCancel True if need to be canceled after being stopped, otherwise false. - * @return true if success, otherwise false. - * @deprecated since 9 - * @useinstead ohos.resourceschedule.workScheduler.stopWork - */ - function stopWork(work: WorkInfo, needCancel?: boolean): boolean; - - /** - * Obtains the work info of the wordId. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - * @param workId The id of work. - * @deprecated since 9 - * @useinstead ohos.resourceschedule.workScheduler.getWorkStatus - */ - function getWorkStatus(workId: number, callback: AsyncCallback): void; - function getWorkStatus(workId: number): Promise; - - /** - * Get all works of the calling application. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - * @return the work info list. - * @deprecated since 9 - * @useinstead ohos.resourceschedule.workScheduler.obtainAllWorks - */ - function obtainAllWorks(callback: AsyncCallback): Array; - function obtainAllWorks(): Promise>; - - /** - * Stop all and clear all works of the calling application. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - * @return true if success, otherwise false. - * @deprecated since 9 - * @useinstead ohos.resourceschedule.workScheduler.stopAndClearWorks - */ - function stopAndClearWorks(): boolean; - - /** - * Check whether last work running is timeout. The interface is for repeating work. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - * @param workId The id of work. - * @return true if last work running is timeout, otherwise false. - * @deprecated since 9 - * @useinstead ohos.resourceschedule.workScheduler.isLastWorkTimeOut - */ - function isLastWorkTimeOut(workId: number, callback: AsyncCallback): boolean; - function isLastWorkTimeOut(workId: number): Promise; - - /** - * Describes network type. - * - * @name NetworkType - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - * @deprecated since 9 - * @useinstead ohos.resourceschedule.workScheduler.NetworkType - */ - export enum NetworkType { - /** - * Describes any network connection. - */ - NETWORK_TYPE_ANY = 0, - /** - * Describes a mobile network connection. - */ - NETWORK_TYPE_MOBILE, - /** - * Describes a wifi network connection. - */ - NETWORK_TYPE_WIFI, - /** - * Describes a bluetooth network connection. - */ - NETWORK_TYPE_BLUETOOTH, - /** - * Describes a wifi p2p network connection. - */ - NETWORK_TYPE_WIFI_P2P, - /** - * Describes a wifi wire network connection. - */ - NETWORK_TYPE_ETHERNET - } - - /** - * Describes charging type. - * - * @name ChargingType - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - * @deprecated since 9 - * @useinstead ohos.resourceschedule.workScheduler.ChargingType - */ - export enum ChargingType { - /** - * Describes any charger is connected. - */ - CHARGING_PLUGGED_ANY = 0, - /** - * Describes ac charger is connected. - */ - CHARGING_PLUGGED_AC, - /** - * Describes usb charger is connected. - */ - CHARGING_PLUGGED_USB, - /** - * Describes wireless charger is connected. - */ - CHARGING_PLUGGED_WIRELESS - } - - /** - * Describes the battery status. - * - * @name BatteryStatus - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - * @deprecated since 9 - * @useinstead ohos.resourceschedule.workScheduler.BatteryStatus - */ - export enum BatteryStatus { - /** - * Describes battery status is to low. - */ - BATTERY_STATUS_LOW = 0, - /** - * Describes battery status is to ok. - */ - BATTERY_STATUS_OKAY, - /** - * Describes battery status is to low or ok. - */ - BATTERY_STATUS_LOW_OR_OKAY - } - - /** - * Describes the storage request. - * - * @name StorageRequest - * @since 9 - * @syscap SystemCapability.ResourceSchedule.WorkScheduler - * @StageModelOnly - * @deprecated since 9 - * @useinstead ohos.resourceschedule.workScheduler.StorageRequest - */ - export enum StorageRequest { - /** - * Describes storage is to low. - */ - STORAGE_LEVEL_LOW = 0, - /** - * Describes storage is to ok. - */ - STORAGE_LEVEL_OKAY, - /** - * Describes storage is to low or ok. - */ - STORAGE_LEVEL_LOW_OR_OKAY - } -} -export default workScheduler; \ No newline at end of file -- Gitee From 2516602fac0a77922419fb25f753f6144ff202a9 Mon Sep 17 00:00:00 2001 From: yangzk Date: Mon, 17 Oct 2022 19:55:35 +0800 Subject: [PATCH 179/438] IssueNo: #I5RT32 Description: fix import Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- api/@ohos.ability.ability.d.ts | 5 ++ api/@ohos.app.ability.Ability.d.ts | 36 +++++++----- api/@ohos.app.ability.AbilityStage.d.ts | 4 +- api/@ohos.app.ability.ExtensionAbility.d.ts | 2 +- ...s.app.ability.ServiceExtensionAbility.d.ts | 4 +- ....app.ability.abilityDelegatorRegistry.d.ts | 2 +- api/@ohos.app.ability.abilityManager.d.ts | 2 +- api/@ohos.app.form.FormExtensionAbility.d.ts | 6 +- api/application/AbilityContext.d.ts | 48 ++++++++++++++- api/application/AbilityRunningInfo.d.ts | 2 +- api/application/ApplicationContext.d.ts | 58 ++++++++++++++++++- api/application/ServiceExtensionContext.d.ts | 57 +++++++++++++++++- api/application/abilityDelegator.d.ts | 2 +- api/application/abilityMonitor.d.ts | 4 +- 14 files changed, 201 insertions(+), 31 deletions(-) diff --git a/api/@ohos.ability.ability.d.ts b/api/@ohos.ability.ability.d.ts index d710852e0a..dde2908026 100755 --- a/api/@ohos.ability.ability.d.ts +++ b/api/@ohos.ability.ability.d.ts @@ -50,6 +50,7 @@ declare namespace ability { /** * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @FAModelOnly */ export type DataAbilityOperation = _DataAbilityOperation @@ -57,24 +58,28 @@ declare namespace ability { * @name DataAbilityResult * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @FAModelOnly */ export type DataAbilityResult = _DataAbilityResult /** * @since 9 * @syscap SystemCapability.Ability.AbilityBase + * @FAModelOnly */ export type AbilityResult = _AbilityResult /** * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @FAModelOnly */ export type ConnectOptions = _ConnectOptions /** * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel + * @FAModelOnly */ export type StartAbilityParameter = _StartAbilityParameter } diff --git a/api/@ohos.app.ability.Ability.d.ts b/api/@ohos.app.ability.Ability.d.ts index ee19b722b6..7ed043a155 100755 --- a/api/@ohos.app.ability.Ability.d.ts +++ b/api/@ohos.app.ability.Ability.d.ts @@ -15,30 +15,30 @@ import AbilityConstant from "./@ohos.app.ability.AbilityConstant"; import AbilityContext from "./application/AbilityContext"; +import rpc from './@ohos.rpc'; import Want from './@ohos.application.Want'; import window from './@ohos.window'; import { Configuration } from './@ohos.application.Configuration'; -import rpc from './@ohos.rpc'; /** * The prototype of the listener function interface registered by the Caller. - * @typedef OnReleaseCallBack + * @typedef OnReleaseCallback * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @stagemodelonly * @since 9 */ -export interface OnReleaseCallBack { +export interface OnReleaseCallback { (msg: string): void; } /** * The prototype of the message listener function interface registered by the Callee. - * @typedef CalleeCallBack + * @typedef CalleeCallback * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @stagemodelonly * @since 9 */ -export interface CalleeCallBack { +export interface CalleeCallback { (indata: rpc.MessageParcel): rpc.Sequenceable; } @@ -82,27 +82,37 @@ export interface Caller { */ release(): void; + /** + * Register death listener notification callback. + * @param { OnReleaseCallback } callback - Register a callback function for listening for notifications. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ + onRelease(callback: OnReleaseCallback): void; + /** * Register death listener notification callback. * @param { string } type - release. - * @param { OnReleaseCallBack } callback - Register a callback function for listening for notifications. + * @param { OnReleaseCallback } callback - Register a callback function for listening for notifications. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @stagemodelonly * @since 9 */ - on(type: "release", callback: OnReleaseCallBack): void; + on(type: "release", callback: OnReleaseCallback): void; /** * Unregister death listener notification callback. * @param { string } type - release. - * @param { OnReleaseCallBack } callback - Unregister a callback function for listening for notifications. + * @param { OnReleaseCallback } callback - Unregister a callback function for listening for notifications. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @stagemodelonly * @since 9 */ - off(type: "release", callback: OnReleaseCallBack): void; + off(type: "release", callback: OnReleaseCallback): void; /** * Unregister all death listener notification callback. @@ -126,13 +136,13 @@ export interface Callee { /** * Register data listener callback. * @param { string } method - A string registered to listen for notification events. - * @param { CalleeCallBack } callback - Register a callback function that listens for notification events. + * @param { CalleeCallback } callback - Register a callback function that listens for notification events. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @stagemodelonly * @since 9 */ - on(method: string, callback: CalleeCallBack): void; + on(method: string, callback: CalleeCallback): void; /** * Unregister data listener callback. @@ -271,12 +281,12 @@ export default class Ability { /** * Called when the system configuration is updated. - * @param { Configuration } config - Indicates the updated configuration. + * @param { Configuration } newConfig - Indicates the updated configuration. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore * @stagemodelonly * @since 9 */ - onConfigurationUpdated(config: Configuration): void; + onConfigurationUpdate(newConfig: Configuration): void; /** * Called when dump client information is required. diff --git a/api/@ohos.app.ability.AbilityStage.d.ts b/api/@ohos.app.ability.AbilityStage.d.ts index cc9634994f..3078c51ca6 100644 --- a/api/@ohos.app.ability.AbilityStage.d.ts +++ b/api/@ohos.app.ability.AbilityStage.d.ts @@ -56,12 +56,12 @@ export default class AbilityStage { /** * Called when the system configuration is updated. - * @param { Configuration } config - Indicates the updated configuration. + * @param { Configuration } newConfig - Indicates the updated configuration. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @stagemodelonly * @since 9 */ - onConfigurationUpdated(config: Configuration): void; + onConfigurationUpdate(newConfig: Configuration): void; /** * Called when the system has determined to trim the memory, for example, when the ability is running in the diff --git a/api/@ohos.app.ability.ExtensionAbility.d.ts b/api/@ohos.app.ability.ExtensionAbility.d.ts index 5e7d6caf0b..e63914c35b 100644 --- a/api/@ohos.app.ability.ExtensionAbility.d.ts +++ b/api/@ohos.app.ability.ExtensionAbility.d.ts @@ -30,7 +30,7 @@ export default class ExtensionAbility { * @stagemodelonly * @since 9 */ - onConfigurationUpdated(newConfig: Configuration): void; + onConfigurationUpdate(newConfig: Configuration): void; /** * Called when the system has determined to trim the memory, for example, when the ability is running in the diff --git a/api/@ohos.app.ability.ServiceExtensionAbility.d.ts b/api/@ohos.app.ability.ServiceExtensionAbility.d.ts index 3675c902d0..575bca4ddb 100644 --- a/api/@ohos.app.ability.ServiceExtensionAbility.d.ts +++ b/api/@ohos.app.ability.ServiceExtensionAbility.d.ts @@ -100,13 +100,13 @@ export default class ServiceExtensionAbility { /** * Called when the system configuration is updated. - * @param { Configuration } config - Indicates the updated configuration. + * @param { Configuration } newConfig - Indicates the updated configuration. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi * @stagemodelonly * @since 9 */ - onConfigurationUpdated(config: Configuration): void; + onConfigurationUpdate(newConfig: Configuration): void; /** * Called when dump client information is required. diff --git a/api/@ohos.app.ability.abilityDelegatorRegistry.d.ts b/api/@ohos.app.ability.abilityDelegatorRegistry.d.ts index 5d4d9147aa..a3177d986c 100644 --- a/api/@ohos.app.ability.abilityDelegatorRegistry.d.ts +++ b/api/@ohos.app.ability.abilityDelegatorRegistry.d.ts @@ -35,7 +35,7 @@ declare namespace abilityDelegatorRegistry { function getAbilityDelegator(): AbilityDelegator; /** - * Get unit test parameters stored in the AbilityDelegatorArgs object. + * Get unit test arguments stored in the AbilityDelegatorArgs object. * @returns { AbilityDelegator } Return the previously registered AbilityDelegatorArgs object. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 diff --git a/api/@ohos.app.ability.abilityManager.d.ts b/api/@ohos.app.ability.abilityManager.d.ts index a904da0cb8..60c76db94d 100644 --- a/api/@ohos.app.ability.abilityManager.d.ts +++ b/api/@ohos.app.ability.abilityManager.d.ts @@ -78,7 +78,7 @@ declare namespace abilityManager { function getAbilityRunningInfos(): Promise>; /** - * Get information about running abilities + * Get information about the running ability * @permission ohos.permission.GET_RUNNING_INFO * @param { AsyncCallback> } callback - The callback is used to return the array of AbilityRunningInfo. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. diff --git a/api/@ohos.app.form.FormExtensionAbility.d.ts b/api/@ohos.app.form.FormExtensionAbility.d.ts index a3d519049a..b32f18cb29 100644 --- a/api/@ohos.app.form.FormExtensionAbility.d.ts +++ b/api/@ohos.app.form.FormExtensionAbility.d.ts @@ -104,12 +104,12 @@ export default class FormExtensionAbility { /** * Called when the system configuration is updated. - * @param { Configuration } config - Indicates the system configuration, such as language and color mode. + * @param { Configuration } newConfig - Indicates the system configuration, such as language and color mode. * @syscap SystemCapability.Ability.Form * @stagemodelonly * @since 9 */ - onConfigurationUpdated(config: Configuration): void; + onConfigurationUpdate(newConfig: Configuration): void; /** * Called to return a {@link FormState} object. @@ -134,5 +134,5 @@ export default class FormExtensionAbility { * @stagemodelonly * @since 9 */ - onFormToBeShared?(formId: string): { [key: string]: any }; + onShareForm?(formId: string): { [key: string]: any }; } diff --git a/api/application/AbilityContext.d.ts b/api/application/AbilityContext.d.ts index 5174f3e58d..ffa23b2ef0 100755 --- a/api/application/AbilityContext.d.ts +++ b/api/application/AbilityContext.d.ts @@ -22,7 +22,7 @@ import { ConnectOptions } from "../ability/connectOptions"; import { HapModuleInfo } from "../bundle/hapModuleInfo"; import Context from "./Context"; import Want from "../@ohos.application.Want"; -import StartOptions from "../@ohos.application.StartOptions"; +import StartOptions from "../@ohos.app.ability.StartOptions"; import PermissionRequestResult from "./PermissionRequestResult"; import { Configuration } from '../@ohos.application.Configuration'; import { Caller } from '../@ohos.app.ability.Ability'; @@ -381,6 +381,52 @@ export default class AbilityContext extends Context { */ terminateSelfWithResult(parameter: AbilityResult): Promise; + /** + * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want The element name of the service ability + * @param options The remote object instance + * @systemapi Hide this for inner system use. + * @return Returns the number code of the ability connected + * @StageModelOnly + * @deprecated since 9 + * @useinstead connectServiceExtensionAbility + */ + connectAbility(want: Want, options: ConnectOptions): number; + + /** + * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template with account. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want The element name of the service ability + * @param accountId The account to connect + * @param options The remote object instance + * @systemapi hide for inner use. + * @return Returns the number code of the ability connected + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @StageModelOnly + * @deprecated since 9 + * @useinstead connectServiceExtensionAbilityWithAccount + */ + connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; + + /** + * The callback interface was connect successfully. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param connection The number code of the ability connected + * @systemapi Hide this for inner system use. + * @StageModelOnly + * @deprecated since 9 + * @useinstead disconnectServiceExtensionAbility + */ + disconnectAbility(connection: number, callback:AsyncCallback): void; + disconnectAbility(connection: number): Promise; + /** * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template. * @param { Want } want - The element name of the service ability diff --git a/api/application/AbilityRunningInfo.d.ts b/api/application/AbilityRunningInfo.d.ts index 864465c87b..63b82692d4 100644 --- a/api/application/AbilityRunningInfo.d.ts +++ b/api/application/AbilityRunningInfo.d.ts @@ -14,7 +14,7 @@ */ import { ElementName } from '../bundle/elementName'; -import abilityManager from '../@ohos.application.abilityManager'; +import abilityManager from '../@ohos.app.ability.abilityManager'; /** * The class of an ability running information. diff --git a/api/application/ApplicationContext.d.ts b/api/application/ApplicationContext.d.ts index 54ef9d985f..8fc1e3b46f 100755 --- a/api/application/ApplicationContext.d.ts +++ b/api/application/ApplicationContext.d.ts @@ -15,8 +15,8 @@ import { AsyncCallback } from "../basic"; import Context from "./Context"; -import AbilityLifecycleCallback from "../@ohos.application.AbilityLifecycleCallback"; -import EnvironmentCallback from "../@ohos.application.EnvironmentCallback"; +import AbilityLifecycleCallback from "../@ohos.app.ability.AbilityLifecycleCallback"; +import EnvironmentCallback from "../@ohos.app.ability.EnvironmentCallback"; import { ProcessRunningInformation } from "./ProcessRunningInformation"; /** @@ -26,6 +26,60 @@ import { ProcessRunningInformation } from "./ProcessRunningInformation"; * @since 9 */ export default class ApplicationContext extends Context { + /** + * Register ability lifecycle callback. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param callback The ability lifecycle callback. + * @return Returns the number code of the callback. + * @StageModelOnly + * @deprecated since 9 + * @useinstead on + */ + registerAbilityLifecycleCallback(callback: AbilityLifecycleCallback): number; + + /** + * Unregister ability lifecycle callback. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param callbackId Indicates the number code of the callback. + * @return - + * @StageModelOnly + * @deprecated since 9 + * @useinstead off + */ + unregisterAbilityLifecycleCallback(callbackId: number, callback: AsyncCallback): void; + unregisterAbilityLifecycleCallback(callbackId: number): Promise; + + /** + * Register environment callback. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param callback The environment callback. + * @return Returns the number code of the callback. + * @StageModelOnly + * @deprecated since 9 + * @useinstead on + */ + registerEnvironmentCallback(callback: EnvironmentCallback): number; + + /** + * Unregister environment callback. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param callbackId Indicates the number code of the callback. + * @return - + * @StageModelOnly + * @deprecated since 9 + * @useinstead off + */ + unregisterEnvironmentCallback(callbackId: number, callback: AsyncCallback): void; + unregisterEnvironmentCallback(callbackId: number): Promise; + /** * Register ability lifecycle callback. * @param { string } type - abilityLifecycle. diff --git a/api/application/ServiceExtensionContext.d.ts b/api/application/ServiceExtensionContext.d.ts index 414f3d38f1..e6326f414e 100644 --- a/api/application/ServiceExtensionContext.d.ts +++ b/api/application/ServiceExtensionContext.d.ts @@ -18,7 +18,7 @@ import { ConnectOptions } from "../ability/connectOptions"; import { Caller } from '../@ohos.app.ability.Ability'; import ExtensionContext from "./ExtensionContext"; import Want from "../@ohos.application.Want"; -import StartOptions from "../@ohos.application.StartOptions"; +import StartOptions from "../@ohos.app.ability.StartOptions"; /** * The context of service extension. It allows access to @@ -234,6 +234,61 @@ export default class ServiceExtensionContext extends ExtensionContext { */ terminateSelf(): Promise; + /** + * Connects an ability to a Service extension. + * + *

This method can be called by an ability or service extension, but the destination of the connection must be a + * service extension. You must implement the {@link ConnectOptions} interface to obtain the proxy of the target + * service extension when the Service extension is connected.

+ * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the service extension to connect. + * @param options Indicates the callback of connection. + * @systemapi hide for inner use. + * @return connection id, int value. + * @StageModelOnly + * @deprecated since 9 + * @useinstead connectServiceExtensionAbility + */ + connectAbility(want: Want, options: ConnectOptions): number; + + /** + * Connects an ability to a Service extension with account. + * + *

This method can be called by an ability or service extension, but the destination of the connection must be a + * service extension. You must implement the {@link ConnectOptions} interface to obtain the proxy of the target + * service extension when the Service extension is connected.

+ * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want Indicates the service extension to connect. + * @param accountId Indicates the account to connect. + * @param options Indicates the callback of connection. + * @systemapi hide for inner use. + * @return connection id, int value. + * @StageModelOnly + * @deprecated since 9 + * @useinstead connectServiceExtensionAbilityWithAccount + */ + connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; + + /** + * Disconnects an ability to a service extension, in contrast to + * {@link connectAbility}. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param connection the connection id returned from connectAbility api. + * @systemapi hide for inner use. + * @return - + * @StageModelOnly + * @deprecated since 9 + * @useinstead disconnectServiceExtensionAbility + */ + disconnectAbility(connection: number, callback:AsyncCallback): void; + disconnectAbility(connection: number): Promise; + /** * Connects an ability to a Service extension. *

This method can be called by an ability or service extension, but the destination of the connection must be a diff --git a/api/application/abilityDelegator.d.ts b/api/application/abilityDelegator.d.ts index 520bd8ce43..72ac4c9d98 100644 --- a/api/application/abilityDelegator.d.ts +++ b/api/application/abilityDelegator.d.ts @@ -15,7 +15,7 @@ import { AsyncCallback } from '../basic'; import Ability from '../@ohos.app.ability.Ability'; -import AbilityStage from '../@ohos.application.AbilityStage'; +import AbilityStage from '../@ohos.app.ability.AbilityStage'; import { AbilityMonitor } from './abilityMonitor'; import { AbilityStageMonitor } from './abilityStageMonitor'; import Context from './Context'; diff --git a/api/application/abilityMonitor.d.ts b/api/application/abilityMonitor.d.ts index 8dec39ad4f..dd0a1989f1 100644 --- a/api/application/abilityMonitor.d.ts +++ b/api/application/abilityMonitor.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import Ability from '../@ohos.application.Ability'; +import Ability from '../@ohos.app.ability.Ability'; /** * Provide methods for matching monitored Ability objects that meet specified conditions. @@ -39,7 +39,7 @@ export interface AbilityMonitor { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core */ - moduleName: string; + moduleName?: string; /** * Called back when the ability is started for initialization. -- Gitee From e35fae8439c620b0ca07e87f2837946cf11a54ae Mon Sep 17 00:00:00 2001 From: yangzk Date: Tue, 18 Oct 2022 17:28:50 +0800 Subject: [PATCH 180/438] IssueNo: #I5RT32 Description: add wantConstant Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- api/@ohos.app.ability.wantConstant.d.ts | 439 ++++++++++++++++++++++++ 1 file changed, 439 insertions(+) create mode 100644 api/@ohos.app.ability.wantConstant.d.ts diff --git a/api/@ohos.app.ability.wantConstant.d.ts b/api/@ohos.app.ability.wantConstant.d.ts new file mode 100644 index 0000000000..05e563cd9f --- /dev/null +++ b/api/@ohos.app.ability.wantConstant.d.ts @@ -0,0 +1,439 @@ +/* + * 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. + */ + +/** + * the constant for action and entity in the want + * @namespace wantConstant + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ +declare namespace wantConstant { + /** + * the constant for action of the want + * @enum { string } + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + export enum Action { + /** + * Indicates the action of backing home. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ACTION_HOME = "ohos.want.action.home", + + /** + * Indicates the action of starting a Page ability that displays a keypad. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ACTION_DIAL = "ohos.want.action.dial", + + /** + * Indicates the action of starting a Page ability for search. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ACTION_SEARCH = "ohos.want.action.search", + + /** + * Indicates the action of starting a Page ability that provides wireless network settings, for example, + * Wi-Fi options. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ACTION_WIRELESS_SETTINGS = "ohos.settings.wireless", + + /** + * Indicates the action of starting a Page ability that manages installed applications. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ACTION_MANAGE_APPLICATIONS_SETTINGS = "ohos.settings.manage.applications", + + /** + * Indicates the action of starting a Page ability that displays details of a specified application. + * + *

You must specify the application bundle name in the {@code package} attribute of the {@code Intent} + * containing this action. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ACTION_APPLICATION_DETAILS_SETTINGS = "ohos.settings.application.details", + + /** + * Indicates the action of starting a Page ability for setting an alarm clock. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ACTION_SET_ALARM = "ohos.want.action.setAlarm", + + /** + * Indicates the action of starting a Page ability that displays all alarm + * clocks. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ACTION_SHOW_ALARMS = "ohos.want.action.showAlarms", + + /** + * Indicates the action of starting a Page ability for snoozing an alarm clock. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ACTION_SNOOZE_ALARM = "ohos.want.action.snoozeAlarm", + + /** + * Indicates the action of starting a Page ability for deleting an alarm clock. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ACTION_DISMISS_ALARM = "ohos.want.action.dismissAlarm", + + /** + * Indicates the action of starting a Page ability for dismissing a timer. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ACTION_DISMISS_TIMER = "ohos.want.action.dismissTimer", + + /** + * Indicates the action of starting a Page ability for sending a sms. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ACTION_SEND_SMS = "ohos.want.action.sendSms", + + /** + * Indicates the action of starting a Page ability for opening contacts or pictures. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ACTION_CHOOSE = "ohos.want.action.choose", + + /** + * Indicates the action of starting a Page ability for take a picture. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ACTION_IMAGE_CAPTURE = "ohos.want.action.imageCapture", + + /** + * Indicates the action of starting a Page ability for Take a video. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ACTION_VIDEO_CAPTURE = "ohos.want.action.videoCapture", + + /** + * Indicates the action of showing the application selection dialog box. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ACTION_SELECT = "ohos.want.action.select", + + /** + * Indicates the action of sending a single data record. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ACTION_SEND_DATA = "ohos.want.action.sendData", + + /** + * Indicates the action of sending multiple data records. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ACTION_SEND_MULTIPLE_DATA = "ohos.want.action.sendMultipleData", + + /** + * Indicates the action of requesting the media scanner to scan files and adding the files to the media library. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ACTION_SCAN_MEDIA_FILE = "ohos.want.action.scanMediaFile", + + /** + * Indicates the action of viewing data. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ACTION_VIEW_DATA = "ohos.want.action.viewData", + + /** + * Indicates the action of editing data. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ACTION_EDIT_DATA = "ohos.want.action.editData", + + /** + * Indicates the choices you will show with {@link #ACTION_PICKER}. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + INTENT_PARAMS_INTENT = "ability.want.params.INTENT", + + /** + * Indicates the CharSequence dialog title when used with a {@link #ACTION_PICKER}. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + INTENT_PARAMS_TITLE = "ability.want.params.TITLE", + + /** + * Indicates the action of select file. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ACTION_FILE_SELECT = "ohos.action.fileSelect", + + /** + * Indicates the URI holding a stream of data associated with the Intent when used with a {@link #ACTION_SEND_DATA}. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + PARAMS_STREAM = "ability.params.stream", + + /** + * Indicates the action of providing auth service. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ACTION_APP_ACCOUNT_AUTH = "account.appAccount.action.auth", + + /** + * Indicates the action of an application downloaded from the application market. + * @syscap SystemCapability.Ability.AbilityBase + * @systemapi + * @since 9 + */ + ACTION_MARKET_DOWNLOAD = "ohos.want.action.marketDownload", + + /** + * Indicates the action of an application crowdtested from the application market. + * @syscap SystemCapability.Ability.AbilityBase + * @systemapi + * @since 9 + */ + ACTION_MARKET_CROWDTEST = "ohos.want.action.marketCrowdTest", + + /** + * Indicates the param of sandbox flag. + * @syscap SystemCapability.Ability.AbilityBase + * @systemapi + * @since 9 + */ + DLP_PARAMS_SANDBOX = "ohos.dlp.params.sandbox", + + /** + * Indicates the param of dlp bundle name. + * @syscap SystemCapability.Ability.AbilityBase + * @systemapi + * @since 9 + */ + DLP_PARAMS_BUNDLE_NAME = "ohos.dlp.params.bundleName", + + /** + * Indicates the param of dlp module name. + * @syscap SystemCapability.Ability.AbilityBase + * @systemapi + * @since 9 + */ + DLP_PARAMS_MODULE_NAME = "ohos.dlp.params.moduleName", + + /** + * Indicates the param of dlp ability name. + * @syscap SystemCapability.Ability.AbilityBase + * @systemapi + * @since 9 + */ + DLP_PARAMS_ABILITY_NAME = "ohos.dlp.params.abilityName", + + /** + * Indicates the param of dlp bundle index. + * @syscap SystemCapability.Ability.AbilityBase + * @systemapi + * @since 9 + */ + DLP_PARAMS_INDEX = "ohos.dlp.params.index" + } + + /** + * the constant for Entity of the want + * @enum { string } + * @name Entity + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + export enum Entity { + /** + * Indicates the default entity, which is used if the entity is not specified. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ENTITY_DEFAULT = "entity.system.default", + + /** + * Indicates the home screen entity. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ENTITY_HOME = "entity.system.home", + + /** + * Indicates the voice interaction entity. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ENTITY_VOICE = "entity.system.voice", + + /** + * Indicates the browser category. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ENTITY_BROWSABLE = "entity.system.browsable", + + /** + * Indicates the video category. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + ENTITY_VIDEO = "entity.system.video" + } + + export enum Flags { + /** + * Indicates the grant to perform read operations on the URI. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + FLAG_AUTH_READ_URI_PERMISSION = 0x00000001, + + /** + * Indicates the grant to perform write operations on the URI. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + FLAG_AUTH_WRITE_URI_PERMISSION = 0x00000002, + + /** + * Returns the result to the source ability. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + FLAG_ABILITY_FORWARD_RESULT = 0x00000004, + + /** + * Determines whether an ability on the local device can be migrated to a remote device. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + FLAG_ABILITY_CONTINUATION = 0x00000008, + + /** + * Specifies whether a component does not belong to OHOS. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + FLAG_NOT_OHOS_COMPONENT = 0x00000010, + + /** + * Specifies whether an ability is started. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + FLAG_ABILITY_FORM_ENABLED = 0x00000020, + + /** + * Indicates the grant for possible persisting on the URI. + * @syscap SystemCapability.Ability.AbilityBase + * @systemapi + * @since 9 + */ + FLAG_AUTH_PERSISTABLE_URI_PERMISSION = 0x00000040, + + /** + * Returns the result to the source ability slice. + * @syscap SystemCapability.Ability.AbilityBase + * @systemapi + * @since 9 + */ + FLAG_AUTH_PREFIX_URI_PERMISSION = 0x00000080, + + /** + * Supports multi-device startup in the distributed scheduling system. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + FLAG_ABILITYSLICE_MULTI_DEVICE = 0x00000100, + + /** + * Indicates that an ability using the Service template is started regardless of whether the host application has + * been started. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + FLAG_START_FOREGROUND_ABILITY = 0x00000200, + + /** + * Indicates the continuation is reversible. + * @syscap SystemCapability.Ability.AbilityBase + * @systemapi + * @since 9 + */ + FLAG_ABILITY_CONTINUATION_REVERSIBLE = 0x00000400, + + /** + * Install the specified ability if it's not installed. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + FLAG_INSTALL_ON_DEMAND = 0x00000800, + + /** + * Install the specifiedi ability with background mode if it's not installed. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + FLAG_INSTALL_WITH_BACKGROUND_MODE = 0x80000000, + + /** + * Indicates the operation of clearing other missions. This flag can be set for the {@code Intent} passed to + * {@link ohos.app.Context#startAbility} and must be used together with {@link FLAG_ABILITY_NEW_MISSION}. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + FLAG_ABILITY_CLEAR_MISSION = 0x00008000, + + /** + * Indicates the operation of creating a task on the historical mission stack. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + FLAG_ABILITY_NEW_MISSION = 0x10000000, + + /** + * Indicates that the existing instance of the ability to start will be reused if it is already at the top of + * the mission stack. Otherwise, a new ability instance will be created. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + FLAG_ABILITY_MISSION_TOP = 0x20000000 + } +} + +export default wantConstant; -- Gitee From e3190f942a2940e61e0170823cde2d951f08e2d0 Mon Sep 17 00:00:00 2001 From: openharmony_ci <120357966@qq.com> Date: Tue, 18 Oct 2022 09:49:52 +0000 Subject: [PATCH 181/438] =?UTF-8?q?=E5=9B=9E=E9=80=80=20'Pull=20Request=20?= =?UTF-8?q?!3013=20:=20=E6=97=A0=E9=9A=9C=E7=A2=8D=E5=A2=9E=E5=BC=BA?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=94=AF=E6=8C=81=E5=BC=82=E5=B8=B8=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=A0=81'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/@ohos.accessibility.config.d.ts | 24 ++---- api/@ohos.accessibility.d.ts | 73 +++++-------------- .../AccessibilityExtensionContext.d.ts | 19 +---- 3 files changed, 29 insertions(+), 87 deletions(-) diff --git a/api/@ohos.accessibility.config.d.ts b/api/@ohos.accessibility.config.d.ts index 690c702cff..2dfac6d56a 100644 --- a/api/@ohos.accessibility.config.d.ts +++ b/api/@ohos.accessibility.config.d.ts @@ -77,10 +77,6 @@ declare namespace config { * Enable the accessibility extension ability. * @param name Indicates the accessibility extension name, in "bundleName/abilityName" format. * @param capability Indicates the ability. - * @throws { BusinessError } 201 - Permission denied. - * @throws { BusinessError } 401 - Input parameter error. - * @throws { BusinessError } 9300001 - Invalid bundle name or ability name. - * @throws { BusinessError } 9300002 - Target ability already enabled. */ function enableAbility(name: string, capability: Array): Promise; function enableAbility(name: string, capability: Array, callback: AsyncCallback): void; @@ -88,28 +84,23 @@ declare namespace config { /** * Disable the accessibility extension ability. * @param name Indicates the accessibility extension name, in "bundleName/abilityName" format. - * @throws { BusinessError } 201 - Permission denied. - * @throws { BusinessError } 401 - Input parameter error. - * @throws { BusinessError } 9300001 - Invalid bundle name or ability name. */ function disableAbility(name: string): Promise; function disableAbility(name: string, callback: AsyncCallback): void; /** * Register the listener that watches for changes in the enabled status of accessibility extensions. - * @param type Indicates the type of event. + * @param type Indicates the enableAbilityListsStateChanged type. * @param callback Indicates the listener. - * @throws { BusinessError } 401 - Input parameter error. */ - function on(type: 'enabledAccessibilityExtensionListChange', callback: Callback): void; + function on(type: 'enableAbilityListsStateChanged', callback: Callback): void; /** - * Unregister listener that watches for changes in the enabled status of accessibility extensions. - * @param type Indicates the type of event. + * Deregister listener that watches for changes in the enabled status of accessibility extensions. + * @param type Indicates the enableAbilityListsStateChanged type. * @param callback Indicates the listener. - * @throws { BusinessError } 401 - Input parameter error. */ - function off(type: 'enabledAccessibilityExtensionListChange', callback?: Callback): void; + function off(type: 'enableAbilityListsStateChanged', callback?: Callback): void; /** * Indicates setting, getting, and listening to changes in configuration. @@ -118,8 +109,6 @@ declare namespace config { /** * Setting configuration value. * @param value Indicates the value. - * @throws { BusinessError } 201 - Permission denied. - * @throws { BusinessError } 401 - Input parameter error. */ set(value: T): Promise; set(value: T, callback: AsyncCallback): void; @@ -133,12 +122,11 @@ declare namespace config { /** * Register the listener to listen for configuration changes. * @param callback Indicates the listener. - * @throws { BusinessError } 401 - Input parameter error. */ on(callback: Callback): void; /** - * Unregister the listener to listen for configuration changes. + * Deregister the listener to listen for configuration changes. * @param callback Indicates the listener. */ off(callback?: Callback): void; diff --git a/api/@ohos.accessibility.d.ts b/api/@ohos.accessibility.d.ts index 8b5b372e0a..50f45c0251 100644 --- a/api/@ohos.accessibility.d.ts +++ b/api/@ohos.accessibility.d.ts @@ -24,19 +24,13 @@ import { Callback } from './basic'; * @import basic,abilityInfo */ declare namespace accessibility { + /** * The type of the Ability app. - * @type { 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual' } * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ - /** - * The type of the Ability app. - * @type { 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual' | 'all' } - * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @since 9 - */ - type AbilityType = 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual' | 'all'; + type AbilityType = 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual'; /** * The action that the ability can execute. @@ -104,7 +98,7 @@ declare namespace accessibility { * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns {@code true} if the accessibility is enabled; returns {@code false} otherwise. - */ + */ function isOpenAccessibility(callback: AsyncCallback): void; function isOpenAccessibility(): Promise; @@ -114,7 +108,7 @@ declare namespace accessibility { * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Vision * @return Returns {@code true} if the touch browser is enabled; returns {@code false} otherwise. - */ + */ function isOpenTouchGuide(callback: AsyncCallback): void; function isOpenTouchGuide(): Promise; @@ -125,26 +119,24 @@ declare namespace accessibility { * @param stateType The state of the accessibility ability. {@code AbilityState} eg.installed * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns the list of abilityInfos. - * @deprecated since 9 - * @useinstead ohos.accessibility#getAccessibilityExtensionList - */ + */ function getAbilityLists(abilityType: AbilityType, stateType: AbilityState, callback: AsyncCallback>): void; function getAbilityLists(abilityType: AbilityType, stateType: AbilityState): Promise>; - /** * Queries the list of accessibility abilities. * @since 9 - * @param abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken + * @param abilityType The all type of the accessibility ability. * @param stateType The state of the accessibility ability. {@code AbilityState} eg.installed * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns the list of abilityInfos. - * @throws { BusinessError } 401 - Input parameter error. - */ - function getAccessibilityExtensionList(abilityType: AbilityType, stateType: AbilityState): Promise>; - function getAccessibilityExtensionList(abilityType: AbilityType, stateType: AbilityState, callback: AsyncCallback>): void; + */ + function getAbilityLists(abilityType: 'all', stateType: AbilityState, + callback: AsyncCallback>): void; + function getAbilityLists(abilityType: 'all', + stateType: AbilityState): Promise>; /** * Send accessibility Event. @@ -153,64 +145,46 @@ declare namespace accessibility { * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns {@code true} if success ; returns {@code false} otherwise. - * @deprecated since 9 - * @useinstead ohos.accessibility#sendAccessibilityEvent */ function sendEvent(event: EventInfo, callback: AsyncCallback): void; function sendEvent(event: EventInfo): Promise; /** - * Send accessibility event. - * @since 9 - * @param event The object of the accessibility {@code EventInfo} . - * @param callback Asynchronous callback interface. - * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @return Returns {@code true} if success ; returns {@code false} otherwise. - * @throws { BusinessError } 401 - Input parameter error. - */ - function sendAccessibilityEvent(event: EventInfo, callback: AsyncCallback): void; - function sendAccessibilityEvent(event: EventInfo): Promise; - - /** - * Register the observer of the accessibility state changed. + * Register the observe of the accessibility state changed. * @since 7 * @param type state event type. * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns {@code true} if the register is success ; returns {@code false} otherwise. - * @throws { BusinessError } 401 - Input parameter error. */ function on(type: 'accessibilityStateChange', callback: Callback): void; /** - * Register the observer of the touchGuide state changed. + * Register the observe of the touchGuide state changed. * @since 7 * @param type state event type. * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Vision * @return Returns {@code true} if the register is success ; returns {@code false} otherwise. - * @throws { BusinessError } 401 - Input parameter error. */ function on(type: 'touchGuideStateChange', callback: Callback): void; /** - * Unregister the observer of the accessibility state changed. + * Deregister the observe of the accessibility state changed. * @since 7 * @param type state event type * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @return Returns {@code true} if the Unregister is success ; returns {@code false} otherwise. - * @throws { BusinessError } 401 - Input parameter error. + * @return Returns {@code true} if the deregister is success ; returns {@code false} otherwise. */ function off(type: 'accessibilityStateChange', callback?: Callback): void; /** - * Unregister the observer of the touchGuide state changed. + * Deregister the observe of the touchGuide state changed. * @since 7 * @param type state event type * @param callback Asynchronous callback interface. - * @return Returns {@code true} if the Unregister is success ; returns {@code false} otherwise. - * @throws { BusinessError } 401 - Input parameter error. + * @return Returns {@code true} if the deregister is success ; returns {@code false} otherwise. */ function off(type: 'touchGuideStateChange', callback?: Callback): void; @@ -238,26 +212,19 @@ declare namespace accessibility { style: CaptionsStyle; /** - * Register the observer of the enable state. - * @throws { BusinessError } 401 - Input parameter error. + * Register the observe of the enable state. */ on(type: 'enableChange', callback: Callback): void; - /** * Register the observer of the style. - * @throws { BusinessError } 401 - Input parameter error. */ on(type: 'styleChange', callback: Callback): void; - /** - * Unregister the observer of the enable state. - * @throws { BusinessError } 401 - Input parameter error. + * Deregister the observe of the enable state. */ off(type: 'enableChange', callback?: Callback): void; - /** - * Unregister the observer of the style. - * @throws { BusinessError } 401 - Input parameter error. + * Deregister the observer of the style. */ off(type: 'styleChange', callback?: Callback): void; } diff --git a/api/application/AccessibilityExtensionContext.d.ts b/api/application/AccessibilityExtensionContext.d.ts index d3c38cddde..76ee1b0e0b 100644 --- a/api/application/AccessibilityExtensionContext.d.ts +++ b/api/application/AccessibilityExtensionContext.d.ts @@ -28,7 +28,6 @@ export default class AccessibilityExtensionContext extends ExtensionContext { /** * Set the name of the bundle name that is interested in sending the event. * @param targetNames - * @throws { BusinessError } 401 - Input parameter error. */ setTargetBundleName(targetNames: Array): Promise; setTargetBundleName(targetNames: Array, callback: AsyncCallback): void; @@ -36,7 +35,6 @@ export default class AccessibilityExtensionContext extends ExtensionContext { /** * Get focus element. * @param isAccessibilityFocus Indicates whether the acquired element has an accessibility focus. - * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. */ getFocusElement(isAccessibilityFocus?: boolean): Promise; getFocusElement(callback: AsyncCallback): void; @@ -45,7 +43,6 @@ export default class AccessibilityExtensionContext extends ExtensionContext { /** * Get window root element. * @param windowId Indicates the window ID. - * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. */ getWindowRootElement(windowId?: number): Promise; getWindowRootElement(callback: AsyncCallback): void; @@ -54,7 +51,6 @@ export default class AccessibilityExtensionContext extends ExtensionContext { /** * Get window list. * @param displayId Indicates the display ID. - * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. */ getWindows(displayId?: number): Promise>; getWindows(callback: AsyncCallback>): void; @@ -63,8 +59,6 @@ export default class AccessibilityExtensionContext extends ExtensionContext { /** * Inject gesture path events. * @param gesturePath Indicates the gesture path. - * @throws { BusinessError } 401 - Input parameter error. - * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. */ injectGesture(gesturePath: GesturePath): Promise; injectGesture(gesturePath: GesturePath, callback: AsyncCallback): void; @@ -87,8 +81,6 @@ declare interface AccessibilityElement { /** * Get the value of an attribute. * @param attributeName Indicates the attribute name. - * @throws { BusinessError } 401 - Input parameter error. - * @throws { BusinessError } 9300004 - This property does not exist. */ attributeValue(attributeName: T): Promise; attributeValue(attributeName: T, @@ -104,18 +96,15 @@ declare interface AccessibilityElement { * Perform the specified action. * @param actionName Indicates the action name. * @param parameters Indicates the parameters needed to execute the action. - * @throws { BusinessError } 401 - Input parameter error. - * @throws { BusinessError } 9300005 - This action is not supported. */ - performAction(actionName: string, parameters?: object): Promise; - performAction(actionName: string, callback: AsyncCallback): void; - performAction(actionName: string, parameters: object, callback: AsyncCallback): void; + performAction(actionName: string, parameters?: object): Promise; + performAction(actionName: string, callback: AsyncCallback): void; + performAction(actionName: string, parameters: object, callback: AsyncCallback): void; /** * Find elements that match the condition. * @param type The type of query condition is content. * @param condition Indicates the specific content to be queried. - * @throws { BusinessError } 401 - Input parameter error. */ findElement(type: 'content', condition: string): Promise>; findElement(type: 'content', condition: string, callback: AsyncCallback>): void @@ -124,7 +113,6 @@ declare interface AccessibilityElement { * Find elements that match the condition. * @param type The type of query condition is focus type. * @param condition Indicates the type of focus to query. - * @throws { BusinessError } 401 - Input parameter error. */ findElement(type: 'focusType', condition: FocusType): Promise; findElement(type: 'focusType', condition: FocusType, callback: AsyncCallback): void @@ -133,7 +121,6 @@ declare interface AccessibilityElement { * Find elements that match the condition. * @param type The type of query condition is focus direction. * @param condition Indicates the direction of search focus to query. - * @throws { BusinessError } 401 - Input parameter error. */ findElement(type: 'focusDirection', condition: FocusDirection): Promise; findElement(type: 'focusDirection', condition: FocusDirection, callback: AsyncCallback): void -- Gitee From abcfe06b0e114ca8d3344a3bd36b4f0231ade9e6 Mon Sep 17 00:00:00 2001 From: huangjie Date: Thu, 13 Oct 2022 17:33:52 +0800 Subject: [PATCH 182/438] =?UTF-8?q?=E8=B5=84=E6=BA=90=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E7=9A=84AsyncCallback=E6=8B=93=E5=B1=95code=E6=88=90?= =?UTF-8?q?=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huangjie --- api/@ohos.resourceManager.d.ts | 51 ++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/api/@ohos.resourceManager.d.ts b/api/@ohos.resourceManager.d.ts index b4f2afb22a..6b43f6b7df 100644 --- a/api/@ohos.resourceManager.d.ts +++ b/api/@ohos.resourceManager.d.ts @@ -15,7 +15,7 @@ import { RawFileDescriptor as _RawFileDescriptor } from './global/rawFileDescriptor'; import { Resource as _Resource } from './global/resource'; -import { AsyncCallback } from './basic'; +import { AsyncCallback as _AsyncCallback } from './basic'; /** * Provides resource related APIs. @@ -185,6 +185,15 @@ export class DeviceCapability { deviceType: DeviceType } +/** + * The ResourceManager callback. + * @since 6 + * @deprecated since 9 + */ + export interface AsyncCallback { + (err: Error, data: T): void; +} + /** * Obtains the ResourceManager object of the current application. * @@ -262,7 +271,7 @@ export interface ResourceManager { * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ - getStringValue(resource: Resource, callback: AsyncCallback): void; + getStringValue(resource: Resource, callback: _AsyncCallback): void; /** * Obtains string resources associated with a specified resource object in Promise mode. @@ -310,7 +319,7 @@ export interface ResourceManager { * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ - getStringArrayValue(resource: Resource, callback: AsyncCallback>): void; + getStringArrayValue(resource: Resource, callback: _AsyncCallback>): void; /** * Obtains the array of character strings corresponding to a specified resource object in Promise mode. @@ -357,7 +366,7 @@ export interface ResourceManager { * @throws { BusinessError } 9001002 - If the resource not found by module resId. * @since 9 */ - getMediaContent(resource: Resource, callback: AsyncCallback): void; + getMediaContent(resource: Resource, callback: _AsyncCallback): void; /** * Obtains the content of the media file corresponding to a specified resource object in Promise mode. @@ -405,7 +414,7 @@ export interface ResourceManager { * @throws { BusinessError } 9001002 - If the resource not found by module resId. * @since 9 */ - getMediaContentBase64(resource: Resource, callback: AsyncCallback): void; + getMediaContentBase64(resource: Resource, callback: _AsyncCallback): void; /** * Obtains the Base64 code of the image resource corresponding to the specified resource object in Promise mode. @@ -425,7 +434,7 @@ export interface ResourceManager { * @param callback Indicates the asynchronous callback used to return the obtained device capability. * @since 6 */ - getDeviceCapability(callback: AsyncCallback): void; + getDeviceCapability(callback: _AsyncCallback): void; /** * Obtains the device capability in Promise mode. @@ -442,7 +451,7 @@ export interface ResourceManager { * configuration. * @since 6 */ - getConfiguration(callback: AsyncCallback): void; + getConfiguration(callback: _AsyncCallback): void; /** * Obtains the device configuration in Promise mode. @@ -494,7 +503,7 @@ export interface ResourceManager { * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ - getPluralStringValue(resource: Resource, num: number, callback: AsyncCallback): void; + getPluralStringValue(resource: Resource, num: number, callback: _AsyncCallback): void; /** * Obtains the singular-plural character string represented by the resource object string corresponding to @@ -589,7 +598,7 @@ export interface ResourceManager { * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ - getStringByName(resName: string, callback: AsyncCallback): void; + getStringByName(resName: string, callback: _AsyncCallback): void; /** * Obtains string resources associated with a specified resource name in Promise mode. @@ -615,7 +624,7 @@ export interface ResourceManager { * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ - getStringArrayByName(resName: string, callback: AsyncCallback>): void; + getStringArrayByName(resName: string, callback: _AsyncCallback>): void; /** * Obtains the array of character strings corresponding to a specified resource name in Promise mode. @@ -640,7 +649,7 @@ export interface ResourceManager { * @throws { BusinessError } 9001004 - If the resource not found by resName. * @since 9 */ - getMediaByName(resName: string, callback: AsyncCallback): void; + getMediaByName(resName: string, callback: _AsyncCallback): void; /** * Obtains the content of the media file corresponding to a specified resource name in Promise mode. @@ -665,7 +674,7 @@ export interface ResourceManager { * @throws { BusinessError } 9001004 - If the resource not found by resName. * @since 9 */ - getMediaBase64ByName(resName: string, callback: AsyncCallback): void; + getMediaBase64ByName(resName: string, callback: _AsyncCallback): void; /** * Obtains the Base64 code of the image resource corresponding to the specified resource name in Promise mode. @@ -693,7 +702,7 @@ export interface ResourceManager { * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ - getPluralStringByName(resName: string, num: number, callback: AsyncCallback): void; + getPluralStringByName(resName: string, num: number, callback: _AsyncCallback): void; /** * Obtains the singular-plural character string represented by the name string corresponding to @@ -846,7 +855,7 @@ export interface ResourceManager { * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ - getStringValue(resId: number, callback: AsyncCallback): void; + getStringValue(resId: number, callback: _AsyncCallback): void; /** * Obtains string resources associated with a specified resource ID in Promise mode. @@ -872,7 +881,7 @@ export interface ResourceManager { * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ - getStringArrayValue(resId: number, callback: AsyncCallback>): void; + getStringArrayValue(resId: number, callback: _AsyncCallback>): void; /** * Obtains the array of character strings corresponding to a specified resource ID in Promise mode. @@ -901,7 +910,7 @@ export interface ResourceManager { * @throws { BusinessError } 9001006 - If the resource re-ref too much. * @since 9 */ - getPluralStringValue(resId: number, num: number, callback: AsyncCallback): void; + getPluralStringValue(resId: number, num: number, callback: _AsyncCallback): void; /** * Obtains the singular-plural character string represented by the ID string corresponding to @@ -929,7 +938,7 @@ export interface ResourceManager { * @throws { BusinessError } 9001002 - If the resource not found by resId. * @since 9 */ - getMediaContent(resId: number, callback: AsyncCallback): void; + getMediaContent(resId: number, callback: _AsyncCallback): void; /** * Obtains the content of the media file corresponding to a specified resource ID in Promise mode. @@ -954,7 +963,7 @@ export interface ResourceManager { * @throws { BusinessError } 9001002 - If the resource not found by resId. * @since 9 */ - getMediaContentBase64(resId: number, callback: AsyncCallback): void; + getMediaContentBase64(resId: number, callback: _AsyncCallback): void; /** * Obtains the Base64 code of the image resource corresponding to the specified resource ID in Promise mode. @@ -977,7 +986,7 @@ export interface ResourceManager { * @throws { BusinessError } 9001005 - If the resource not found by path. * @since 9 */ - getRawFileContent(path: string, callback: AsyncCallback): void; + getRawFileContent(path: string, callback: _AsyncCallback): void; /** * Obtains the raw file resource corresponding to the specified resource path in Promise mode. @@ -999,7 +1008,7 @@ export interface ResourceManager { * @throws { BusinessError } 9001005 - If the resource not found by path. * @since 9 */ - getRawFd(path: string, callback: AsyncCallback): void; + getRawFd(path: string, callback: _AsyncCallback): void; /** * Obtains the raw file resource descriptor corresponding to the specified resource path in Promise mode. @@ -1021,7 +1030,7 @@ export interface ResourceManager { * @throws { BusinessError } 9001005 - If the resource not found by path. * @since 9 */ - closeRawFd(path: string, callback: AsyncCallback): void; + closeRawFd(path: string, callback: _AsyncCallback): void; /** * Obtains close raw file resource descriptor corresponding to the specified resource path in Promise mode. -- Gitee From 06d7bf1cb55bbb44672d99e0d61c32f66d7e6f25 Mon Sep 17 00:00:00 2001 From: ltdong Date: Tue, 18 Oct 2022 10:01:02 +0000 Subject: [PATCH 183/438] update api/@ohos.data.rdb.d.ts. Signed-off-by: ltdong --- api/@ohos.data.rdb.d.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index aac8d61487..1b0bd3d1d7 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -36,10 +36,7 @@ declare namespace rdb { * @param {Context} context - Indicates the context of application or capability. * @param {StoreConfig} config - Indicates the {@link StoreConfig} configuration of the database related to this RDB store. * @param {number} version - Indicates the database version for upgrade or downgrade. - * @param {AsyncCallback} callback - the RDB store {@link RdbStoreV9}. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @throws {BusinessError} 14800010 - if failed open database by invalid database name - * @throws {BusinessError} 14800011 - if failed open database by database corrupted + * @param {AsyncCallback} callback - the RDB store {@link RdbStore}. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 @@ -55,10 +52,7 @@ declare namespace rdb { * @param {Context} context - Indicates the context of application or capability. * @param {StoreConfig} config - Indicates the {@link StoreConfig} configuration of the database related to this RDB store. * @param {number} version - Indicates the database version for upgrade or downgrade. - * @returns {Promise} the RDB store {@link RdbStoreV9}. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @throws {BusinessError} 14800010 - if failed open database by invalid database name - * @throws {BusinessError} 14800011 - if failed open database by database corrupted + * @returns {Promise} the RDB store {@link RdbStore}. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 -- Gitee From 2dd37027ba26133ab420bab189194134ae219db8 Mon Sep 17 00:00:00 2001 From: supeng Date: Tue, 18 Oct 2022 18:27:56 +0800 Subject: [PATCH 184/438] modify interface description Signed-off-by: supeng --- api/@ohos.multimedia.camera.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.multimedia.camera.d.ts b/api/@ohos.multimedia.camera.d.ts index 7cc5c6278e..596e921301 100644 --- a/api/@ohos.multimedia.camera.d.ts +++ b/api/@ohos.multimedia.camera.d.ts @@ -201,7 +201,7 @@ declare namespace camera { getSupportedOutputCapability(camera: CameraDevice): Promise; /** - * Determine wether camera is muted. + * Determine whether camera is muted. * @return Is camera muted. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core @@ -209,7 +209,7 @@ declare namespace camera { isCameraMuted(): boolean; /** - * Determine wether camera mute is supported. + * Determine whether camera mute is supported. * @return Is camera mute supported. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core -- Gitee From 6bf3df295616184ece9ebe2e5ba46950de550157 Mon Sep 17 00:00:00 2001 From: yangzk Date: Tue, 18 Oct 2022 19:26:35 +0800 Subject: [PATCH 185/438] IssueNo: #I5RT32 Description: add Configuration Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- api/@ohos.ability.wantConstant.d.ts | 2 + api/@ohos.app.ability.Configuration.d.ts | 72 ++++++++++++++++++++++++ api/@ohos.application.Configuration.d.ts | 2 + 3 files changed, 76 insertions(+) create mode 100644 api/@ohos.app.ability.Configuration.d.ts diff --git a/api/@ohos.ability.wantConstant.d.ts b/api/@ohos.ability.wantConstant.d.ts index 15ce6b7a38..9ad6e2e43a 100644 --- a/api/@ohos.ability.wantConstant.d.ts +++ b/api/@ohos.ability.wantConstant.d.ts @@ -19,6 +19,8 @@ * @since 6 * @syscap SystemCapability.Ability.AbilityBase * @permission N/A + * @deprecated since 9 + * @useinstead ohos.app.ability.wantConstant */ declare namespace wantConstant { /** diff --git a/api/@ohos.app.ability.Configuration.d.ts b/api/@ohos.app.ability.Configuration.d.ts new file mode 100644 index 0000000000..32194943c4 --- /dev/null +++ b/api/@ohos.app.ability.Configuration.d.ts @@ -0,0 +1,72 @@ +/* + * 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 ConfigurationConstant from "./@ohos.application.ConfigurationConstant"; + +/** + * configuration item. + * @typedef Configuration + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ +export interface Configuration { + /** + * Indicates the current language of the application. + * @type { string } + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + language?: string; + + /** + * Indicates the current colorMode of the application. + * @type { ConfigurationConstant.ColorMode } + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + colorMode?: ConfigurationConstant.ColorMode; + + /** + * Indicates the screen direction of the current device. + * @type { ConfigurationConstant.Direction } + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + direction?: ConfigurationConstant.Direction; + + /** + * Indicates the screen density of the current device. + * @type { ConfigurationConstant.ScreenDensity } + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + screenDensity?: ConfigurationConstant.ScreenDensity; + + /** + * Indicates the displayId of the current device. + * @type { number } + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + displayId?: number; + + /** + * Indicates whether a pointer type device has connected. + * @type { boolean } + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + hasPointerDevice?: boolean; +} diff --git a/api/@ohos.application.Configuration.d.ts b/api/@ohos.application.Configuration.d.ts index b1c3861169..2d339a3940 100644 --- a/api/@ohos.application.Configuration.d.ts +++ b/api/@ohos.application.Configuration.d.ts @@ -22,6 +22,8 @@ import ConfigurationConstant from "./@ohos.application.ConfigurationConstant"; * @since 8 * @syscap SystemCapability.Ability.AbilityBase * @permission N/A + * @deprecated since 9 + * @useinstead ohos.app.ability.Configuration */ export interface Configuration { /** -- Gitee From cb04a3bebc4284191dfadb0b0f0bc217ec154c52 Mon Sep 17 00:00:00 2001 From: yangzk Date: Tue, 18 Oct 2022 19:30:11 +0800 Subject: [PATCH 186/438] IssueNo: #I5RT32 Description: add ConfigurationConstant Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- ...hos.app.ability.ConfigurationConstant.d.ts | 65 +++++++++++++++++++ ...hos.application.ConfigurationConstant.d.ts | 2 + 2 files changed, 67 insertions(+) create mode 100644 api/@ohos.app.ability.ConfigurationConstant.d.ts diff --git a/api/@ohos.app.ability.ConfigurationConstant.d.ts b/api/@ohos.app.ability.ConfigurationConstant.d.ts new file mode 100644 index 0000000000..303647c93b --- /dev/null +++ b/api/@ohos.app.ability.ConfigurationConstant.d.ts @@ -0,0 +1,65 @@ +/* + * 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. + */ + +/** + * The definition of ConfigurationConstant. + * @namespace ConfigurationConstant + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + declare namespace ConfigurationConstant { + /** + * ColorMode + * @enum { number } + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + export enum ColorMode { + COLOR_MODE_NOT_SET = -1, + COLOR_MODE_DARK = 0, + COLOR_MODE_LIGHT = 1, + } + + /** + * Direction + * @enum { number } + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + export enum Direction { + DIRECTION_NOT_SET = -1, + DIRECTION_VERTICAL = 0, + DIRECTION_HORIZONTAL = 1, + } + + /** + * ScreenDensity + * @name ScreenDensity + * @enum { number } + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + export enum ScreenDensity { + SCREEN_DENSITY_NOT_SET = 0, + SCREEN_DENSITY_SDPI = 120, + SCREEN_DENSITY_MDPI = 160, + SCREEN_DENSITY_LDPI = 240, + SCREEN_DENSITY_XLDPI = 320, + SCREEN_DENSITY_XXLDPI = 480, + SCREEN_DENSITY_XXXLDPI = 640, + } +} + +export default ConfigurationConstant diff --git a/api/@ohos.application.ConfigurationConstant.d.ts b/api/@ohos.application.ConfigurationConstant.d.ts index cdf3b32724..7e3853aa5d 100644 --- a/api/@ohos.application.ConfigurationConstant.d.ts +++ b/api/@ohos.application.ConfigurationConstant.d.ts @@ -19,6 +19,8 @@ * @since 8 * @syscap SystemCapability.Ability.AbilityBase * @permission N/A + * @deprecated since 9 + * @useinstead ohos.app.ability.ConfigurationConstant */ declare namespace ConfigurationConstant { /** -- Gitee From 6d1f799da2d62f6a3c1c0a757c7fc91df4f86fca Mon Sep 17 00:00:00 2001 From: laiguizhong Date: Tue, 18 Oct 2022 20:02:05 +0800 Subject: [PATCH 187/438] =?UTF-8?q?Revert=20"!3040=20=E5=9B=9E=E9=80=80=20?= =?UTF-8?q?'Pull=20Request=20!3013=20:=20=E6=97=A0=E9=9A=9C=E7=A2=8D?= =?UTF-8?q?=E5=A2=9E=E5=BC=BA=E6=8E=A5=E5=8F=A3=E6=94=AF=E6=8C=81=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E9=94=99=E8=AF=AF=E7=A0=81'"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 82e61d0de23b7dbc1edbf38094b79ac2348c87d0, reversing changes made to 5e281f7b65ead4e452bd564193c6169decdae0dc. Signed-off-by: laiguizhong --- api/@ohos.accessibility.config.d.ts | 24 ++++-- api/@ohos.accessibility.d.ts | 73 ++++++++++++++----- .../AccessibilityExtensionContext.d.ts | 19 ++++- 3 files changed, 87 insertions(+), 29 deletions(-) diff --git a/api/@ohos.accessibility.config.d.ts b/api/@ohos.accessibility.config.d.ts index 2dfac6d56a..690c702cff 100644 --- a/api/@ohos.accessibility.config.d.ts +++ b/api/@ohos.accessibility.config.d.ts @@ -77,6 +77,10 @@ declare namespace config { * Enable the accessibility extension ability. * @param name Indicates the accessibility extension name, in "bundleName/abilityName" format. * @param capability Indicates the ability. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300001 - Invalid bundle name or ability name. + * @throws { BusinessError } 9300002 - Target ability already enabled. */ function enableAbility(name: string, capability: Array): Promise; function enableAbility(name: string, capability: Array, callback: AsyncCallback): void; @@ -84,23 +88,28 @@ declare namespace config { /** * Disable the accessibility extension ability. * @param name Indicates the accessibility extension name, in "bundleName/abilityName" format. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300001 - Invalid bundle name or ability name. */ function disableAbility(name: string): Promise; function disableAbility(name: string, callback: AsyncCallback): void; /** * Register the listener that watches for changes in the enabled status of accessibility extensions. - * @param type Indicates the enableAbilityListsStateChanged type. + * @param type Indicates the type of event. * @param callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. */ - function on(type: 'enableAbilityListsStateChanged', callback: Callback): void; + function on(type: 'enabledAccessibilityExtensionListChange', callback: Callback): void; /** - * Deregister listener that watches for changes in the enabled status of accessibility extensions. - * @param type Indicates the enableAbilityListsStateChanged type. + * Unregister listener that watches for changes in the enabled status of accessibility extensions. + * @param type Indicates the type of event. * @param callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. */ - function off(type: 'enableAbilityListsStateChanged', callback?: Callback): void; + function off(type: 'enabledAccessibilityExtensionListChange', callback?: Callback): void; /** * Indicates setting, getting, and listening to changes in configuration. @@ -109,6 +118,8 @@ declare namespace config { /** * Setting configuration value. * @param value Indicates the value. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Input parameter error. */ set(value: T): Promise; set(value: T, callback: AsyncCallback): void; @@ -122,11 +133,12 @@ declare namespace config { /** * Register the listener to listen for configuration changes. * @param callback Indicates the listener. + * @throws { BusinessError } 401 - Input parameter error. */ on(callback: Callback): void; /** - * Deregister the listener to listen for configuration changes. + * Unregister the listener to listen for configuration changes. * @param callback Indicates the listener. */ off(callback?: Callback): void; diff --git a/api/@ohos.accessibility.d.ts b/api/@ohos.accessibility.d.ts index 50f45c0251..8b5b372e0a 100644 --- a/api/@ohos.accessibility.d.ts +++ b/api/@ohos.accessibility.d.ts @@ -24,13 +24,19 @@ import { Callback } from './basic'; * @import basic,abilityInfo */ declare namespace accessibility { - /** * The type of the Ability app. + * @type { 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual' } * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ - type AbilityType = 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual'; + /** + * The type of the Ability app. + * @type { 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual' | 'all' } + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @since 9 + */ + type AbilityType = 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual' | 'all'; /** * The action that the ability can execute. @@ -98,7 +104,7 @@ declare namespace accessibility { * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns {@code true} if the accessibility is enabled; returns {@code false} otherwise. - */ + */ function isOpenAccessibility(callback: AsyncCallback): void; function isOpenAccessibility(): Promise; @@ -108,7 +114,7 @@ declare namespace accessibility { * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Vision * @return Returns {@code true} if the touch browser is enabled; returns {@code false} otherwise. - */ + */ function isOpenTouchGuide(callback: AsyncCallback): void; function isOpenTouchGuide(): Promise; @@ -119,24 +125,26 @@ declare namespace accessibility { * @param stateType The state of the accessibility ability. {@code AbilityState} eg.installed * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns the list of abilityInfos. - */ + * @deprecated since 9 + * @useinstead ohos.accessibility#getAccessibilityExtensionList + */ function getAbilityLists(abilityType: AbilityType, stateType: AbilityState, callback: AsyncCallback>): void; function getAbilityLists(abilityType: AbilityType, stateType: AbilityState): Promise>; + /** * Queries the list of accessibility abilities. * @since 9 - * @param abilityType The all type of the accessibility ability. + * @param abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken * @param stateType The state of the accessibility ability. {@code AbilityState} eg.installed * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns the list of abilityInfos. - */ - function getAbilityLists(abilityType: 'all', stateType: AbilityState, - callback: AsyncCallback>): void; - function getAbilityLists(abilityType: 'all', - stateType: AbilityState): Promise>; + * @throws { BusinessError } 401 - Input parameter error. + */ + function getAccessibilityExtensionList(abilityType: AbilityType, stateType: AbilityState): Promise>; + function getAccessibilityExtensionList(abilityType: AbilityType, stateType: AbilityState, callback: AsyncCallback>): void; /** * Send accessibility Event. @@ -145,46 +153,64 @@ declare namespace accessibility { * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns {@code true} if success ; returns {@code false} otherwise. + * @deprecated since 9 + * @useinstead ohos.accessibility#sendAccessibilityEvent */ function sendEvent(event: EventInfo, callback: AsyncCallback): void; function sendEvent(event: EventInfo): Promise; /** - * Register the observe of the accessibility state changed. + * Send accessibility event. + * @since 9 + * @param event The object of the accessibility {@code EventInfo} . + * @param callback Asynchronous callback interface. + * @syscap SystemCapability.BarrierFree.Accessibility.Core + * @return Returns {@code true} if success ; returns {@code false} otherwise. + * @throws { BusinessError } 401 - Input parameter error. + */ + function sendAccessibilityEvent(event: EventInfo, callback: AsyncCallback): void; + function sendAccessibilityEvent(event: EventInfo): Promise; + + /** + * Register the observer of the accessibility state changed. * @since 7 * @param type state event type. * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Core * @return Returns {@code true} if the register is success ; returns {@code false} otherwise. + * @throws { BusinessError } 401 - Input parameter error. */ function on(type: 'accessibilityStateChange', callback: Callback): void; /** - * Register the observe of the touchGuide state changed. + * Register the observer of the touchGuide state changed. * @since 7 * @param type state event type. * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Vision * @return Returns {@code true} if the register is success ; returns {@code false} otherwise. + * @throws { BusinessError } 401 - Input parameter error. */ function on(type: 'touchGuideStateChange', callback: Callback): void; /** - * Deregister the observe of the accessibility state changed. + * Unregister the observer of the accessibility state changed. * @since 7 * @param type state event type * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @return Returns {@code true} if the deregister is success ; returns {@code false} otherwise. + * @return Returns {@code true} if the Unregister is success ; returns {@code false} otherwise. + * @throws { BusinessError } 401 - Input parameter error. */ function off(type: 'accessibilityStateChange', callback?: Callback): void; /** - * Deregister the observe of the touchGuide state changed. + * Unregister the observer of the touchGuide state changed. * @since 7 * @param type state event type * @param callback Asynchronous callback interface. - * @return Returns {@code true} if the deregister is success ; returns {@code false} otherwise. + * @return Returns {@code true} if the Unregister is success ; returns {@code false} otherwise. + * @throws { BusinessError } 401 - Input parameter error. */ function off(type: 'touchGuideStateChange', callback?: Callback): void; @@ -212,19 +238,26 @@ declare namespace accessibility { style: CaptionsStyle; /** - * Register the observe of the enable state. + * Register the observer of the enable state. + * @throws { BusinessError } 401 - Input parameter error. */ on(type: 'enableChange', callback: Callback): void; + /** * Register the observer of the style. + * @throws { BusinessError } 401 - Input parameter error. */ on(type: 'styleChange', callback: Callback): void; + /** - * Deregister the observe of the enable state. + * Unregister the observer of the enable state. + * @throws { BusinessError } 401 - Input parameter error. */ off(type: 'enableChange', callback?: Callback): void; + /** - * Deregister the observer of the style. + * Unregister the observer of the style. + * @throws { BusinessError } 401 - Input parameter error. */ off(type: 'styleChange', callback?: Callback): void; } diff --git a/api/application/AccessibilityExtensionContext.d.ts b/api/application/AccessibilityExtensionContext.d.ts index 76ee1b0e0b..d3c38cddde 100644 --- a/api/application/AccessibilityExtensionContext.d.ts +++ b/api/application/AccessibilityExtensionContext.d.ts @@ -28,6 +28,7 @@ export default class AccessibilityExtensionContext extends ExtensionContext { /** * Set the name of the bundle name that is interested in sending the event. * @param targetNames + * @throws { BusinessError } 401 - Input parameter error. */ setTargetBundleName(targetNames: Array): Promise; setTargetBundleName(targetNames: Array, callback: AsyncCallback): void; @@ -35,6 +36,7 @@ export default class AccessibilityExtensionContext extends ExtensionContext { /** * Get focus element. * @param isAccessibilityFocus Indicates whether the acquired element has an accessibility focus. + * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. */ getFocusElement(isAccessibilityFocus?: boolean): Promise; getFocusElement(callback: AsyncCallback): void; @@ -43,6 +45,7 @@ export default class AccessibilityExtensionContext extends ExtensionContext { /** * Get window root element. * @param windowId Indicates the window ID. + * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. */ getWindowRootElement(windowId?: number): Promise; getWindowRootElement(callback: AsyncCallback): void; @@ -51,6 +54,7 @@ export default class AccessibilityExtensionContext extends ExtensionContext { /** * Get window list. * @param displayId Indicates the display ID. + * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. */ getWindows(displayId?: number): Promise>; getWindows(callback: AsyncCallback>): void; @@ -59,6 +63,8 @@ export default class AccessibilityExtensionContext extends ExtensionContext { /** * Inject gesture path events. * @param gesturePath Indicates the gesture path. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300003 - Do not have accessibility right for this operation. */ injectGesture(gesturePath: GesturePath): Promise; injectGesture(gesturePath: GesturePath, callback: AsyncCallback): void; @@ -81,6 +87,8 @@ declare interface AccessibilityElement { /** * Get the value of an attribute. * @param attributeName Indicates the attribute name. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300004 - This property does not exist. */ attributeValue(attributeName: T): Promise; attributeValue(attributeName: T, @@ -96,15 +104,18 @@ declare interface AccessibilityElement { * Perform the specified action. * @param actionName Indicates the action name. * @param parameters Indicates the parameters needed to execute the action. + * @throws { BusinessError } 401 - Input parameter error. + * @throws { BusinessError } 9300005 - This action is not supported. */ - performAction(actionName: string, parameters?: object): Promise; - performAction(actionName: string, callback: AsyncCallback): void; - performAction(actionName: string, parameters: object, callback: AsyncCallback): void; + performAction(actionName: string, parameters?: object): Promise; + performAction(actionName: string, callback: AsyncCallback): void; + performAction(actionName: string, parameters: object, callback: AsyncCallback): void; /** * Find elements that match the condition. * @param type The type of query condition is content. * @param condition Indicates the specific content to be queried. + * @throws { BusinessError } 401 - Input parameter error. */ findElement(type: 'content', condition: string): Promise>; findElement(type: 'content', condition: string, callback: AsyncCallback>): void @@ -113,6 +124,7 @@ declare interface AccessibilityElement { * Find elements that match the condition. * @param type The type of query condition is focus type. * @param condition Indicates the type of focus to query. + * @throws { BusinessError } 401 - Input parameter error. */ findElement(type: 'focusType', condition: FocusType): Promise; findElement(type: 'focusType', condition: FocusType, callback: AsyncCallback): void @@ -121,6 +133,7 @@ declare interface AccessibilityElement { * Find elements that match the condition. * @param type The type of query condition is focus direction. * @param condition Indicates the direction of search focus to query. + * @throws { BusinessError } 401 - Input parameter error. */ findElement(type: 'focusDirection', condition: FocusDirection): Promise; findElement(type: 'focusDirection', condition: FocusDirection, callback: AsyncCallback): void -- Gitee From 2f6ea39194cf3aade2c02a4bc5029f647b429361 Mon Sep 17 00:00:00 2001 From: yangzk Date: Tue, 18 Oct 2022 19:39:48 +0800 Subject: [PATCH 188/438] IssueNo: #I5RT32 Description: add formInfo Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- api/@ohos.app.form.formInfo.d.ts | 498 ++++++++++++++++++++++++++++ api/@ohos.application.formInfo.d.ts | 2 + 2 files changed, 500 insertions(+) create mode 100644 api/@ohos.app.form.formInfo.d.ts diff --git a/api/@ohos.app.form.formInfo.d.ts b/api/@ohos.app.form.formInfo.d.ts new file mode 100644 index 0000000000..f991fc2672 --- /dev/null +++ b/api/@ohos.app.form.formInfo.d.ts @@ -0,0 +1,498 @@ +/* + * 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 Want from './@ohos.application.Want'; + +/** + * interface of formInfo. + * @namespace formInfo + * @syscap SystemCapability.Ability.Form + * @since 9 + */ +declare namespace formInfo { + /** + * Provides information about a form. + * @typedef FormInfo + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + interface FormInfo { + /** + * Obtains the bundle name of the application to which this form belongs. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + bundleName: string; + + /** + * Obtains the name of the application module to which this form belongs. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + moduleName: string; + + /** + * Obtains the class name of the ability to which this form belongs. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + abilityName: string; + + /** + * Obtains the name of this form. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + name: string; + + /** + * Obtains the name of this form. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + description: string; + + /** + * Obtains the type of this form. Currently, JS forms are supported. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + type: FormType; + + /** + * Obtains the JS component name of this JS form. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + jsComponentName: string; + + /** + * Obtains the color mode of this form. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + colorMode: ColorMode; + + /** + * Checks whether this form is a default form. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + isDefault: boolean; + + /** + * Obtains the updateEnabled. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + updateEnabled: boolean; + + /** + * Obtains whether notify visible of this form. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + formVisibleNotify: boolean; + + /** + * Obtains the bundle relatedBundleName of the application to which this form belongs. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + relatedBundleName: string; + + /** + * Obtains the scheduledUpdateTime. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + scheduledUpdateTime: string; + + /** + * Obtains the form config ability about this form. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + formConfigAbility: string; + + /** + * Obtains the updateDuration. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + updateDuration: number; + + /** + * Obtains the default grid style of this form. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + defaultDimension: number; + + /** + * Obtains the grid styles supported by this form. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + supportDimensions: Array; + + /** + * Obtains the custom data defined in this form. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + customizeData: {[key: string]: [value: string]}; + } + + /** + * Type of form. + * @enum { number } + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + enum FormType { + /** + * JS form. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + JS = 1, + + /** + * eTS form. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + eTS = 2 + } + + /** + * Color mode. + * @enum { number } + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + enum ColorMode { + /** + * Automatic mode. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + MODE_AUTO = -1, + + /** + * Dark mode. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + MODE_DARK = 0, + + /** + * Light mode. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + MODE_LIGHT = 1 + } + + /** + * Provides state information about a form. + * @typedef FormStateInfo + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + interface FormStateInfo { + /** + * Obtains the form state. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + formState: FormState; + + /** + * Obtains the want form . + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + want: Want; + } + + /** + * Provides state about a form. + * @enum { number } + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + enum FormState { + /** + * Indicates that the form status is unknown due to an internal error. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + UNKNOWN = -1, + + /** + * Indicates that the form is in the default state. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + DEFAULT = 0, + + /** + * Indicates that the form is ready. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + READY = 1, + } + + /** + * Parameter of form. + * @enum { string } + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + enum FormParam { + /** + * Indicates the key specifying the ID of the form to be obtained, which is represented as + * want: { + * "parameters": { + * IDENTITY_KEY: 1L + * } + * }. + * + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + /** + * Indicates the key specifying the ID of the form to be obtained, which is represented as + * want: { + * "parameters": { + * IDENTITY_KEY: "119476135" + * } + * }. + * + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + IDENTITY_KEY = "ohos.extra.param.key.form_identity", + + /** + * Indicates the key specifying the grid style of the form to be obtained, which is represented as + * want: { + * "parameters": { + * DIMENSION_KEY: FormDimension.Dimension_1_2 + * } + * }. + * + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + DIMENSION_KEY = "ohos.extra.param.key.form_dimension", + + /** + * Indicates the key specifying the name of the form to be obtained, which is represented as + * want: { + * "parameters": { + * NAME_KEY: "formName" + * } + * }. + * + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + NAME_KEY = "ohos.extra.param.key.form_name", + + /** + * Indicates the key specifying the name of the module to which the form to be obtained belongs, which is + * represented as + * want: { + * "parameters": { + * MODULE_NAME_KEY: "formEntry" + * } + * } + * This constant is mandatory. + * + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + MODULE_NAME_KEY = "ohos.extra.param.key.module_name", + + /** + * Indicates the key specifying the width of the form to be obtained, which is represented as + * want: { + * "parameters": { + * WIDTH_KEY: 800 + * } + * } + * + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + WIDTH_KEY = "ohos.extra.param.key.form_width", + + /** + * Indicates the key specifying the height of the form to be obtained, which is represented as + * want: { + * "parameters": { + * HEIGHT_KEY: 400 + * } + * } + * + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + HEIGHT_KEY = "ohos.extra.param.key.form_height", + + /** + * Indicates the key specifying whether a form is temporary, which is represented as + * want: { + * "parameters": { + * TEMPORARY_KEY: true + * } + * } + * + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + TEMPORARY_KEY = "ohos.extra.param.key.form_temporary", + + /** + * Indicates the key specifying the name of the bundle to be obtained, which is represented as + * want: { + * "parameters": { + * BUNDLE_NAME_KEY: "bundleName" + * } + * } + * + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + BUNDLE_NAME_KEY = "ohos.extra.param.key.bundle_name", + + /** + * Indicates the key specifying the name of the ability to be obtained, which is represented as + * want: { + * "parameters": { + * ABILITY_NAME_KEY: "abilityName" + * } + * } + * + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + ABILITY_NAME_KEY = "ohos.extra.param.key.ability_name", + + /** + * Indicates the key specifying the the device ID, which is represented as + * want: { + * "parameters": { + * DEVICE_ID_KEY : "EFC11C0C53628D8CC2F8CB5052477E130D075917034613B9884C55CD22B3DEF2" + * } + * } + * + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 9 + */ + DEVICE_ID_KEY = "ohos.extra.param.key.device_id" + } + + /** + * The optional options used as filters to ask + * getFormsInfo to return formInfos from only forms that match the options. + * @typedef FormInfoFilter + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + interface FormInfoFilter { + /** + * optional moduleName that used to ask getFormsInfo to return + * form infos with the same moduleName. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + moduleName?: string; + } + + /** + * Defines the FormDimension enum. + * @enum { number } + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + enum FormDimension { + /** + * 1 x 2 form + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + Dimension_1_2 = 1, + + /** + * 2 x 2 form + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + Dimension_2_2, + + /** + * 2 x 4 form + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + Dimension_2_4, + + /** + * 4 x 4 form + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + Dimension_4_4, + + /** + * 2 x 1 form + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + Dimension_2_1, + } + /** + * The visibility of a form. + * @enum { number } + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + enum VisibilityType { + /** + * Indicates the type of the form is visible. + * Often used as a condition variable in function OnVisibilityChange to specify actions only on forms that are + * changing to visible. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + FORM_VISIBLE = 1, + /** + * Indicates the type of the form is invisible. + * Often used as a condition variable in function OnVisibilityChange to specify actions only on forms that are + * changing to invisible. + * @syscap SystemCapability.Ability.Form + * @since 9 + */ + FORM_INVISIBLE, + } +} +export default formInfo; \ No newline at end of file diff --git a/api/@ohos.application.formInfo.d.ts b/api/@ohos.application.formInfo.d.ts index 774eb4d383..49b86ecead 100644 --- a/api/@ohos.application.formInfo.d.ts +++ b/api/@ohos.application.formInfo.d.ts @@ -21,6 +21,8 @@ import Want from './@ohos.application.Want'; * @name formInfo * @since 8 * @syscap SystemCapability.Ability.Form + * @deprecated since 9 + * @useinstead ohos.app.form.formInfo */ declare namespace formInfo { /** -- Gitee From f11633a0a40506c5baec334fb6186f6275ae73c8 Mon Sep 17 00:00:00 2001 From: yangzk Date: Tue, 18 Oct 2022 20:06:01 +0800 Subject: [PATCH 189/438] IssueNo: #I5RT32 Description: add Want Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- api/@ohos.app.ability.Want.d.ts | 91 +++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 api/@ohos.app.ability.Want.d.ts diff --git a/api/@ohos.app.ability.Want.d.ts b/api/@ohos.app.ability.Want.d.ts new file mode 100644 index 0000000000..39f02017e5 --- /dev/null +++ b/api/@ohos.app.ability.Want.d.ts @@ -0,0 +1,91 @@ +/* + * 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. + */ + +/** + * Want is the basic communication component of the system. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ +export default class Want { + /** + * device id + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + deviceId?: string; + + /** + * bundle name + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + bundleName?: string; + + /** + * ability name + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + abilityName?: string; + + /** + * The description of a URI in a Want. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + uri?: string; + + /** + * The description of the type in this Want. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + type?: string; + + /** + * The options of the flags in this Want. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + flags?: number; + + /** + * The description of an action in an want. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + action?: string; + + /** + * The description of the WantParams object in an Want + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + parameters?: {[key: string]: any}; + + /** + * The description of a entities in a Want. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + entities?: Array; + + /** + * The description of an module name in an want. + * @syscap SystemCapability.Ability.AbilityBase + * @since 9 + */ + moduleName?: string; +} -- Gitee From f4917de7f4dd1cfda5a01c0f9a44e9dee9cb0662 Mon Sep 17 00:00:00 2001 From: yangzk Date: Tue, 18 Oct 2022 20:14:04 +0800 Subject: [PATCH 190/438] IssueNo: #I5RT32 Description: fix import Sig: SIG_ApplicationFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: yangzk Change-Id: Ia3092286b30f36e05eba91bc756e84cb48a55b14 --- api/@ohos.app.ability.Ability.d.ts | 4 ++-- api/@ohos.app.ability.AbilityStage.d.ts | 4 ++-- api/@ohos.app.ability.Configuration.d.ts | 2 +- api/@ohos.app.ability.EnvironmentCallback.d.ts | 2 +- api/@ohos.app.ability.ExtensionAbility.d.ts | 2 +- api/@ohos.app.ability.ServiceExtensionAbility.d.ts | 4 ++-- api/@ohos.app.ability.abilityManager.d.ts | 2 +- api/@ohos.app.ability.wantAgent.d.ts | 2 +- api/@ohos.app.form.FormExtensionAbility.d.ts | 6 +++--- api/@ohos.app.form.formHost.d.ts | 4 ++-- api/@ohos.app.form.formInfo.d.ts | 2 +- api/@ohos.app.form.formProvider.d.ts | 4 ++-- api/@ohos.application.Want.d.ts | 2 ++ 13 files changed, 21 insertions(+), 19 deletions(-) diff --git a/api/@ohos.app.ability.Ability.d.ts b/api/@ohos.app.ability.Ability.d.ts index 7ed043a155..b41d046740 100755 --- a/api/@ohos.app.ability.Ability.d.ts +++ b/api/@ohos.app.ability.Ability.d.ts @@ -16,9 +16,9 @@ import AbilityConstant from "./@ohos.app.ability.AbilityConstant"; import AbilityContext from "./application/AbilityContext"; import rpc from './@ohos.rpc'; -import Want from './@ohos.application.Want'; +import Want from './@ohos.app.ability.Want'; import window from './@ohos.window'; -import { Configuration } from './@ohos.application.Configuration'; +import { Configuration } from './@ohos.app.ability.Configuration'; /** * The prototype of the listener function interface registered by the Caller. diff --git a/api/@ohos.app.ability.AbilityStage.d.ts b/api/@ohos.app.ability.AbilityStage.d.ts index 3078c51ca6..8aa0201a3f 100644 --- a/api/@ohos.app.ability.AbilityStage.d.ts +++ b/api/@ohos.app.ability.AbilityStage.d.ts @@ -15,8 +15,8 @@ import AbilityConstant from "./@ohos.app.ability.AbilityConstant"; import AbilityStageContext from "./application/AbilityStageContext"; -import Want from './@ohos.application.Want'; -import { Configuration } from './@ohos.application.Configuration'; +import Want from './@ohos.app.ability.Want'; +import { Configuration } from './@ohos.app.ability.Configuration'; /** * The class of an ability stage. diff --git a/api/@ohos.app.ability.Configuration.d.ts b/api/@ohos.app.ability.Configuration.d.ts index 32194943c4..b5f11c28d2 100644 --- a/api/@ohos.app.ability.Configuration.d.ts +++ b/api/@ohos.app.ability.Configuration.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import ConfigurationConstant from "./@ohos.application.ConfigurationConstant"; +import ConfigurationConstant from "./@ohos.app.ability.ConfigurationConstant"; /** * configuration item. diff --git a/api/@ohos.app.ability.EnvironmentCallback.d.ts b/api/@ohos.app.ability.EnvironmentCallback.d.ts index 1e1a9419ad..03ccc013c3 100755 --- a/api/@ohos.app.ability.EnvironmentCallback.d.ts +++ b/api/@ohos.app.ability.EnvironmentCallback.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { Configuration } from './@ohos.application.Configuration'; +import { Configuration } from './@ohos.app.ability.Configuration'; /** * The environment callback. diff --git a/api/@ohos.app.ability.ExtensionAbility.d.ts b/api/@ohos.app.ability.ExtensionAbility.d.ts index e63914c35b..6f27489e3f 100644 --- a/api/@ohos.app.ability.ExtensionAbility.d.ts +++ b/api/@ohos.app.ability.ExtensionAbility.d.ts @@ -14,7 +14,7 @@ */ import AbilityConstant from "./@ohos.app.ability.AbilityConstant"; -import { Configuration } from './@ohos.application.Configuration'; +import { Configuration } from './@ohos.app.ability.Configuration'; /** * class of extension. diff --git a/api/@ohos.app.ability.ServiceExtensionAbility.d.ts b/api/@ohos.app.ability.ServiceExtensionAbility.d.ts index 575bca4ddb..d4eaab2f12 100644 --- a/api/@ohos.app.ability.ServiceExtensionAbility.d.ts +++ b/api/@ohos.app.ability.ServiceExtensionAbility.d.ts @@ -15,8 +15,8 @@ import rpc from "./@ohos.rpc"; import ServiceExtensionContext from "./application/ServiceExtensionContext"; -import Want from './@ohos.application.Want'; -import { Configuration } from './@ohos.application.Configuration'; +import Want from './@ohos.app.ability.Want'; +import { Configuration } from './@ohos.app.ability.Configuration'; /** * class of service extension ability. diff --git a/api/@ohos.app.ability.abilityManager.d.ts b/api/@ohos.app.ability.abilityManager.d.ts index 60c76db94d..fcf61cb6b2 100644 --- a/api/@ohos.app.ability.abilityManager.d.ts +++ b/api/@ohos.app.ability.abilityManager.d.ts @@ -14,7 +14,7 @@ */ import { AsyncCallback } from './basic'; -import { Configuration } from './@ohos.application.Configuration'; +import { Configuration } from './@ohos.app.ability.Configuration'; import { AbilityRunningInfo as _AbilityRunningInfo } from './application/AbilityRunningInfo'; import { ExtensionRunningInfo as _ExtensionRunningInfo } from './application/ExtensionRunningInfo'; import { ElementName } from './bundle/elementName'; diff --git a/api/@ohos.app.ability.wantAgent.d.ts b/api/@ohos.app.ability.wantAgent.d.ts index 0dd77890e8..ace81f0b44 100644 --- a/api/@ohos.app.ability.wantAgent.d.ts +++ b/api/@ohos.app.ability.wantAgent.d.ts @@ -14,7 +14,7 @@ */ import { AsyncCallback , Callback} from './basic'; -import Want from './@ohos.application.Want'; +import Want from './@ohos.app.ability.Want'; import { WantAgentInfo as _WantAgentInfo } from './wantAgent/wantAgentInfo'; import { TriggerInfo as _TriggerInfo } from './wantAgent/triggerInfo'; diff --git a/api/@ohos.app.form.FormExtensionAbility.d.ts b/api/@ohos.app.form.FormExtensionAbility.d.ts index b32f18cb29..aeed2002d1 100644 --- a/api/@ohos.app.form.FormExtensionAbility.d.ts +++ b/api/@ohos.app.form.FormExtensionAbility.d.ts @@ -14,10 +14,10 @@ */ import formBindingData from './@ohos.app.form.formBindingData'; -import formInfo from "./@ohos.application.formInfo"; +import formInfo from "./@ohos.app.form.formInfo"; import FormExtensionContext from "./application/FormExtensionContext"; -import Want from './@ohos.application.Want'; -import { Configuration } from './@ohos.application.Configuration'; +import Want from './@ohos.app.ability.Want'; +import { Configuration } from './@ohos.app.ability.Configuration'; /** * class of form extension. diff --git a/api/@ohos.app.form.formHost.d.ts b/api/@ohos.app.form.formHost.d.ts index dbc95cd2d2..96d204f779 100644 --- a/api/@ohos.app.form.formHost.d.ts +++ b/api/@ohos.app.form.formHost.d.ts @@ -15,8 +15,8 @@ import { AsyncCallback } from "./basic"; import { Callback } from "./basic"; -import Want from './@ohos.application.Want'; -import formInfo from './@ohos.application.formInfo'; +import Want from './@ohos.app.ability.Want'; +import formInfo from './@ohos.app.form.formInfo'; /** * Interface of formHost. diff --git a/api/@ohos.app.form.formInfo.d.ts b/api/@ohos.app.form.formInfo.d.ts index f991fc2672..ee5c9648fe 100644 --- a/api/@ohos.app.form.formInfo.d.ts +++ b/api/@ohos.app.form.formInfo.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import Want from './@ohos.application.Want'; +import Want from './@ohos.app.ability.Want'; /** * interface of formInfo. diff --git a/api/@ohos.app.form.formProvider.d.ts b/api/@ohos.app.form.formProvider.d.ts index fb7f4dc857..31b048c783 100644 --- a/api/@ohos.app.form.formProvider.d.ts +++ b/api/@ohos.app.form.formProvider.d.ts @@ -15,8 +15,8 @@ import { AsyncCallback } from "./basic"; import formBindingData from "./@ohos.app.form.formBindingData"; -import formInfo from "./@ohos.application.formInfo"; -import Want from "./@ohos.application.Want"; +import formInfo from "./@ohos.app.form.formInfo"; +import Want from "./@ohos.app.ability.Want"; /** * Interface of formProvider. diff --git a/api/@ohos.application.Want.d.ts b/api/@ohos.application.Want.d.ts index 1a54ebefd9..b417aba928 100644 --- a/api/@ohos.application.Want.d.ts +++ b/api/@ohos.application.Want.d.ts @@ -20,6 +20,8 @@ * @since 8 * @syscap SystemCapability.Ability.AbilityBase * @permission N/A + * @deprecated since 9 + * @useinstead ohos.app.ability.Want */ export default class Want { /** -- Gitee From c8be6cfe4a28469c62e1aa87e8110293f864f252 Mon Sep 17 00:00:00 2001 From: SoftSquirrel Date: Tue, 18 Oct 2022 20:23:00 +0800 Subject: [PATCH 191/438] Issue:#I5WBYQ Description: modify SystemCapability Sig: SIG_ApplicaitonFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: SoftSquirrel --- api/bundle/bundleInfo.d.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/api/bundle/bundleInfo.d.ts b/api/bundle/bundleInfo.d.ts index e38e1e9922..9f614035ee 100644 --- a/api/bundle/bundleInfo.d.ts +++ b/api/bundle/bundleInfo.d.ts @@ -24,7 +24,7 @@ import { HapModuleInfo } from './hapModuleInfo'; * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA * @deprecated since 9 - * @useinstead ohos.bundle.bundleManager.BundleInfo + * @useinstead ohos.bundle.bundleManager.UsedScene * */ export interface UsedScene { @@ -48,7 +48,8 @@ export interface UsedScene { * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA - * + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager.ReqPermissionDetail */ export interface ReqPermissionDetail { /** @@ -85,7 +86,8 @@ export interface ReqPermissionDetail { * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA - * + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager.BundleInfo */ export interface BundleInfo { /** -- Gitee From 37c37fb507f1cd8b9a16ea392bd7eb6ae72751e0 Mon Sep 17 00:00:00 2001 From: dboy190 Date: Tue, 18 Oct 2022 21:06:26 +0800 Subject: [PATCH 192/438] delete import Signed-off-by: dboy190 --- api/@ohos.data.distributedData.d.ts | 103 ------------------------- api/@ohos.data.distributedKVStore.d.ts | 100 ------------------------ 2 files changed, 203 deletions(-) diff --git a/api/@ohos.data.distributedData.d.ts b/api/@ohos.data.distributedData.d.ts index 33cca8bc0d..9231cbc643 100644 --- a/api/@ohos.data.distributedData.d.ts +++ b/api/@ohos.data.distributedData.d.ts @@ -18,7 +18,6 @@ import { AsyncCallback, Callback } from './basic'; /** * Providers interfaces to creat a {@link KVManager} istances. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore @@ -28,7 +27,6 @@ declare namespace distributedData { * Provides configuration information for {@link KVManager} instances, * including the caller's package name and distributed network type. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.KVManagerConfig @@ -37,7 +35,6 @@ declare namespace distributedData { /** * Indicates the user information * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 */ @@ -46,7 +43,6 @@ declare namespace distributedData { /** * Indicates the bundleName * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.KVManagerConfig#bundleName @@ -61,7 +57,6 @@ declare namespace distributedData { * and checking whether two users are the same. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 */ @@ -69,7 +64,6 @@ declare namespace distributedData { /** * Indicates the user ID to set * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 */ @@ -78,7 +72,6 @@ declare namespace distributedData { /** * Indicates the user type to set * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 */ @@ -89,7 +82,6 @@ declare namespace distributedData { * Enumerates user types. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 */ @@ -97,7 +89,6 @@ declare namespace distributedData { /** * Indicates a user that logs in to different devices using the same account. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 */ @@ -108,7 +99,6 @@ declare namespace distributedData { * KVStore constants * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Constants @@ -117,7 +107,6 @@ declare namespace distributedData { /** * max key length. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Constants#MAX_KEY_LENGTH @@ -127,7 +116,6 @@ declare namespace distributedData { /** * max value length. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Constants#MAX_VALUE_LENGTH @@ -137,7 +125,6 @@ declare namespace distributedData { /** * max device coordinate key length. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Constants#MAX_KEY_LENGTH_DEVICEs @@ -147,7 +134,6 @@ declare namespace distributedData { /** * max store id length. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Constants#MAX_STORE_ID_LENGTH @@ -157,7 +143,6 @@ declare namespace distributedData { /** * max query length. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Constants#MAX_QUERY_LENGTH @@ -167,7 +152,6 @@ declare namespace distributedData { /** * max batch operation size. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Constants#MAX_BATCH_SIZE @@ -181,7 +165,6 @@ declare namespace distributedData { *

{@code ValueType} is obtained based on the value. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.ValueType @@ -190,7 +173,6 @@ declare namespace distributedData { /** * Indicates that the value type is string. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.ValueType#STRING @@ -200,7 +182,6 @@ declare namespace distributedData { /** * Indicates that the value type is int. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.ValueType#INTEGER @@ -210,7 +191,6 @@ declare namespace distributedData { /** * Indicates that the value type is float. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.ValueType#FLOAT @@ -220,7 +200,6 @@ declare namespace distributedData { /** * Indicates that the value type is byte array. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.ValueTypeB#YTE_ARRAY @@ -230,7 +209,6 @@ declare namespace distributedData { /** * Indicates that the value type is boolean. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.ValueType#BOOLEAN @@ -240,7 +218,6 @@ declare namespace distributedData { /** * Indicates that the value type is double. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.ValueType#DOUBLE @@ -252,7 +229,6 @@ declare namespace distributedData { * Obtains {@code Value} objects stored in a {@link KVStore} database. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Value @@ -261,7 +237,6 @@ declare namespace distributedData { /** * Indicates value type * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @see ValueType * @type {number} * @memberof Value @@ -273,7 +248,6 @@ declare namespace distributedData { /** * Indicates value * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Value#value @@ -285,7 +259,6 @@ declare namespace distributedData { * Provides key-value pairs stored in the distributed database. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Entry @@ -294,7 +267,6 @@ declare namespace distributedData { /** * Indicates key * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Entry#key @@ -303,7 +275,6 @@ declare namespace distributedData { /** * Indicates value * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Entry#value @@ -318,7 +289,6 @@ declare namespace distributedData { * from the parameters in callback methods upon data insertion, update, or deletion. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.ChangeNotification @@ -327,7 +297,6 @@ declare namespace distributedData { /** * Indicates data addition records. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.ChangeNotification#insertEntries @@ -336,7 +305,6 @@ declare namespace distributedData { /** * Indicates data update records. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.ChangeNotification#updateEntries @@ -345,7 +313,6 @@ declare namespace distributedData { /** * Indicates data deletion records. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.ChangeNotification#deleteEntries @@ -354,7 +321,6 @@ declare namespace distributedData { /** * Indicates from device id. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.ChangeNotification#deviceId @@ -366,7 +332,6 @@ declare namespace distributedData { * Indicates the database synchronization mode. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SyncMode @@ -375,7 +340,6 @@ declare namespace distributedData { /** * Indicates that data is only pulled from the remote end. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SyncMode#PULL_ONLY @@ -384,7 +348,6 @@ declare namespace distributedData { /** * Indicates that data is only pushed from the local end. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SyncMode#PUSH_ONLY @@ -393,7 +356,6 @@ declare namespace distributedData { /** * Indicates that data is pushed from the local end, and then pulled from the remote end. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SyncMode#PUSH_PULL @@ -405,7 +367,6 @@ declare namespace distributedData { * Describes the subscription type. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SubscribeType @@ -414,7 +375,6 @@ declare namespace distributedData { /** * Subscription to local data changes * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SubscribeType#SUBSCRIBE_TYPE_LOCAL @@ -424,7 +384,6 @@ declare namespace distributedData { /** * Subscription to remote data changes * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SubscribeType#SUBSCRIBE_TYPE_REMOTE @@ -434,7 +393,6 @@ declare namespace distributedData { /** * Subscription to both local and remote data changes * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SubscribeType#SUBSCRIBE_TYPE_ALL @@ -446,7 +404,6 @@ declare namespace distributedData { * Describes the {@code KVStore} type. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.KVStoreType @@ -455,7 +412,6 @@ declare namespace distributedData { /** * Device-collaborated database, as specified by {@code DeviceKVStore} * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.KVStoreType#DEVICE_COLLABORATION @@ -465,7 +421,6 @@ declare namespace distributedData { /** * Single-version database, as specified by {@code SingleKVStore} * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.KVStoreType#SINGLE_VERSION @@ -475,7 +430,6 @@ declare namespace distributedData { /** * Multi-version database, as specified by {@code MultiKVStore} * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @import N/A * @since 7 * @deprecated since 9 */ @@ -486,7 +440,6 @@ declare namespace distributedData { * Describes the {@code KVStore} type. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SecurityLevel @@ -496,7 +449,6 @@ declare namespace distributedData { * NO_LEVEL: mains not set the security level. * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @import N/A * @since 7 * @deprecated since 9 */ @@ -507,7 +459,6 @@ declare namespace distributedData { * There is no impact even if the data is leaked. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 */ @@ -518,7 +469,6 @@ declare namespace distributedData { * There are some low impact, when the data is leaked. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SecurityLevel#S1 @@ -530,7 +480,6 @@ declare namespace distributedData { * There are some major impact, when the data is leaked. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SecurityLevel#S2 @@ -542,7 +491,6 @@ declare namespace distributedData { * There are some severity impact, when the data is leaked. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SecurityLevel#S3 @@ -554,7 +502,6 @@ declare namespace distributedData { * There are some critical impact, when the data is leaked. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SecurityLevel#S4 @@ -569,7 +516,6 @@ declare namespace distributedData { * whether to encrypt the database, and the database type. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Options @@ -578,7 +524,6 @@ declare namespace distributedData { /** * Indicates whether to createa database when the database file does not exist * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Options#createIfMissing @@ -587,7 +532,6 @@ declare namespace distributedData { /** * Indicates setting whether database files are encrypted * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Options#encrypt @@ -596,7 +540,6 @@ declare namespace distributedData { /** * Indicates setting whether to back up database files * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Options#backup @@ -606,7 +549,6 @@ declare namespace distributedData { * Indicates setting whether database files are automatically synchronized * @permission ohos.permission.DISTRIBUTED_DATASYNC * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Options#autoSync @@ -615,7 +557,6 @@ declare namespace distributedData { /** * Indicates setting the databse type * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Options#kvStoreType @@ -624,7 +565,6 @@ declare namespace distributedData { /** * Indicates setting the database security level * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Options#securityLevel @@ -633,7 +573,6 @@ declare namespace distributedData { /** * Indicates schema object * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @import N/A * @since 8 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Options#schema @@ -647,7 +586,6 @@ declare namespace distributedData { * You can create Schema objects and put them in Options when creating or opening the database. * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @import N/A * @since 8 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Schema @@ -710,7 +648,6 @@ declare namespace distributedData { *

The leaf node must have a value; the non-leaf node must have a child {@code FieldNode}. * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @import N/A * @since 8 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.FieldNode @@ -775,7 +712,6 @@ declare namespace distributedData { * methods for moving the data read position in the result set. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.KVStoreResultSet @@ -935,7 +871,6 @@ declare namespace distributedData { * *

This class also provides methods for adding predicates to the {@code Query} instance. * - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -955,7 +890,6 @@ declare namespace distributedData { * Resets this {@code Query} object. * * @returns Returns the reset {@code Query} object. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -969,7 +903,6 @@ declare namespace distributedData { * @param value IIndicates the long value. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -983,7 +916,6 @@ declare namespace distributedData { * @param value Indicates the int value. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -998,7 +930,6 @@ declare namespace distributedData { * @param value Indicates the int value. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1012,7 +943,6 @@ declare namespace distributedData { * @param value Indicates the int value. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1027,7 +957,6 @@ declare namespace distributedData { * @param value Indicates the int value. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1042,7 +971,6 @@ declare namespace distributedData { * @param value Indicates the int value. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1055,7 +983,6 @@ declare namespace distributedData { * @param field Indicates the field, which must start with $. and cannot contain ^. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1069,7 +996,6 @@ declare namespace distributedData { * @param valueList Indicates the int value list. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1083,7 +1009,6 @@ declare namespace distributedData { * @param valueList Indicates the string value list. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1097,7 +1022,6 @@ declare namespace distributedData { * @param valueList Indicates the int value list. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1111,7 +1035,6 @@ declare namespace distributedData { * @param valueList Indicates the string value list. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1125,7 +1048,6 @@ declare namespace distributedData { * @param value Indicates the string value. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1139,7 +1061,6 @@ declare namespace distributedData { * @param value Indicates the string value. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1152,7 +1073,6 @@ declare namespace distributedData { *

Multiple predicates should be connected using the and or or condition. * * @returns Returns the {@coed Query} object. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1165,7 +1085,6 @@ declare namespace distributedData { *

Multiple predicates should be connected using the and or or condition. * * @returns Returns the {@coed Query} object. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1178,7 +1097,6 @@ declare namespace distributedData { * @param field Indicates the field, which must start with $. and cannot contain ^. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1191,7 +1109,6 @@ declare namespace distributedData { * @param field Indicates the field, which must start with $. and cannot contain ^. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1204,7 +1121,6 @@ declare namespace distributedData { * @param total Indicates the number of results. * @param offset Indicates the start position. * @returns Returns the {@coed Query} object. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1217,7 +1133,6 @@ declare namespace distributedData { * @param field Indicates the specified field. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1231,7 +1146,6 @@ declare namespace distributedData { * whole to combine with other query conditions. * * @returns Returns the {@coed Query} object. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1245,7 +1159,6 @@ declare namespace distributedData { * whole to combine with other query conditions. * * @returns Returns the {@coed Query} object. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1258,7 +1171,6 @@ declare namespace distributedData { * @param prefix Indicates the specified key prefix. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1271,7 +1183,6 @@ declare namespace distributedData { * @param index Indicates the index to set. * @returns Returns the {@coed Query} object. * @throws Throws this exception if input is invalid. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1284,7 +1195,6 @@ declare namespace distributedData { * @param deviceId Specify device id to query from. * @return Returns the {@code Query} object with device ID prefix added. * @throw Throws this exception if input is invalid. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1298,7 +1208,6 @@ declare namespace distributedData { * The String length should be no longer than 500kb. * * @return String representing this {@code Query}. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1316,7 +1225,6 @@ declare namespace distributedData { * including {@code SingleKVStore}. * * - * @import N/A * @version 1 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 @@ -1507,7 +1415,6 @@ declare namespace distributedData { * The {@code SingleKVStore} database does not support * synchronous transactions, or data search using snapshots. * - * @import N/A * @version 1 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 @@ -1521,7 +1428,6 @@ declare namespace distributedData { * @param key Indicates the key of the boolean value to be queried. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}, and {@code KEY_NOT_FOUND}. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -1537,7 +1443,6 @@ declare namespace distributedData { * @returns Returns the list of all key-value pairs that match the specified key prefix. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1553,7 +1458,6 @@ declare namespace distributedData { * @returns Returns the list of key-value pairs matching the specified {@code Query} object. * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1572,7 +1476,6 @@ declare namespace distributedData { * @param keyPrefix Indicates the key prefix to match. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1587,7 +1490,6 @@ declare namespace distributedData { * @param query Indicates the {@code Query} object. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1602,7 +1504,6 @@ declare namespace distributedData { * @param resultSet Indicates the {@code KvStoreResultSet} object to close. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1618,7 +1519,6 @@ declare namespace distributedData { * @returns Returns the number of results matching the specified {@code Query} object. * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1630,7 +1530,6 @@ declare namespace distributedData { /** * void removeDeviceData​({@link String} deviceId) throws {@link KvStoreException} * - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1717,7 +1616,6 @@ declare namespace distributedData { * data by device, and cannot modify data synchronized from remote devices. When an application writes a key-value pair entry * into the database, the system automatically adds the ID of the device running the application to the key. * - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 * @deprecated since 9 @@ -1960,7 +1858,6 @@ declare namespace distributedData { /** * Provides interfaces to manage a {@code KVStore} database, including obtaining, closing, and deleting the {@code KVStore}. * - * @import N/A * @version 1 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 diff --git a/api/@ohos.data.distributedKVStore.d.ts b/api/@ohos.data.distributedKVStore.d.ts index a76094f411..30514b2525 100644 --- a/api/@ohos.data.distributedKVStore.d.ts +++ b/api/@ohos.data.distributedKVStore.d.ts @@ -21,7 +21,6 @@ import Context from './application/Context'; /** * Providers interfaces to create a {@link KVManager} istances. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @import N/A * @since 9 */ declare namespace distributedKVStore { @@ -29,14 +28,12 @@ declare namespace distributedKVStore { * Provides configuration information for {@link KVManager} instances, * including the caller's package name and distributed network type. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ interface KVManagerConfig { /** * Indicates the bundleName * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ bundleName: string; @@ -44,7 +41,6 @@ declare namespace distributedKVStore { /** * Indicates the ability or hap context * @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 * @since 9 */ @@ -55,14 +51,12 @@ declare namespace distributedKVStore { * KVStore constants * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ namespace Constants { /** * max key length. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ const MAX_KEY_LENGTH = 1024; @@ -70,7 +64,6 @@ declare namespace distributedKVStore { /** * max value length. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ const MAX_VALUE_LENGTH = 4194303; @@ -78,7 +71,6 @@ declare namespace distributedKVStore { /** * max device coordinate key length. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ const MAX_KEY_LENGTH_DEVICE = 896; @@ -86,7 +78,6 @@ declare namespace distributedKVStore { /** * max store id length. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ const MAX_STORE_ID_LENGTH = 128; @@ -94,7 +85,6 @@ declare namespace distributedKVStore { /** * max query length. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ const MAX_QUERY_LENGTH = 512000; @@ -102,7 +92,6 @@ declare namespace distributedKVStore { /** * max batch operation size. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ const MAX_BATCH_SIZE = 128; @@ -114,14 +103,12 @@ declare namespace distributedKVStore { *

{@code ValueType} is obtained based on the value. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ enum ValueType { /** * Indicates that the value type is string. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ STRING, @@ -129,7 +116,6 @@ declare namespace distributedKVStore { /** * Indicates that the value type is int. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ INTEGER, @@ -137,7 +123,6 @@ declare namespace distributedKVStore { /** * Indicates that the value type is float. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ FLOAT, @@ -145,7 +130,6 @@ declare namespace distributedKVStore { /** * Indicates that the value type is byte array. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 * */ BYTE_ARRAY, @@ -153,7 +137,6 @@ declare namespace distributedKVStore { /** * Indicates that the value type is boolean. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 * */ BOOLEAN, @@ -161,7 +144,6 @@ declare namespace distributedKVStore { /** * Indicates that the value type is double. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ DOUBLE, @@ -171,14 +153,12 @@ declare namespace distributedKVStore { * Obtains {@code Value} objects stored in a {@link SingleKVStore} or {@link DeviceKVStore} database. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ interface Value { /** * Indicates value type * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @see ValueType * @type {number} * @memberof Value @@ -188,7 +168,6 @@ declare namespace distributedKVStore { /** * Indicates value * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ value: Uint8Array | string | number | boolean; @@ -198,21 +177,18 @@ declare namespace distributedKVStore { * Provides key-value pairs stored in the distributed database. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ interface Entry { /** * Indicates key * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ key: string; /** * Indicates value * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ value: Value; @@ -226,35 +202,30 @@ declare namespace distributedKVStore { * upon data insertion, update, or deletion. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ interface ChangeNotification { /** * Indicates data addition records. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ insertEntries: Entry[]; /** * Indicates data update records. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ updateEntries: Entry[]; /** * Indicates data deletion records. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ deleteEntries: Entry[]; /** * Indicates from device id. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ deviceId: string; @@ -264,28 +235,24 @@ declare namespace distributedKVStore { * Indicates the database synchronization mode. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ enum SyncMode { /** * Indicates that data is only pulled from the remote end. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ PULL_ONLY, /** * Indicates that data is only pushed from the local end. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ PUSH_ONLY, /** * Indicates that data is pushed from the local end, and then pulled from the remote end. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ PUSH_PULL, @@ -295,14 +262,12 @@ declare namespace distributedKVStore { * Describes the subscription type. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ enum SubscribeType { /** * Subscription to local data changes * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ SUBSCRIBE_TYPE_LOCAL, @@ -310,7 +275,6 @@ declare namespace distributedKVStore { /** * Subscription to remote data changes * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ SUBSCRIBE_TYPE_REMOTE, @@ -318,7 +282,6 @@ declare namespace distributedKVStore { /** * Subscription to both local and remote data changes * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ SUBSCRIBE_TYPE_ALL, @@ -328,14 +291,12 @@ declare namespace distributedKVStore { * Describes the KVStore type. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ enum KVStoreType { /** * Device-collaborated database, as specified by {@code DeviceKVStore} * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @import N/A * @since 9 */ DEVICE_COLLABORATION, @@ -343,7 +304,6 @@ declare namespace distributedKVStore { /** * Single-version database, as specified by {@code SingleKVStore} * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ SINGLE_VERSION, @@ -353,7 +313,6 @@ declare namespace distributedKVStore { * Describes the KVStore security level. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ enum SecurityLevel { @@ -362,7 +321,6 @@ declare namespace distributedKVStore { * There are some low impact, when the data is leaked. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ S1, @@ -372,7 +330,6 @@ declare namespace distributedKVStore { * There are some major impact, when the data is leaked. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ S2, @@ -382,7 +339,6 @@ declare namespace distributedKVStore { * There are some severity impact, when the data is leaked. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ S3, @@ -392,7 +348,6 @@ declare namespace distributedKVStore { * There are some critical impact, when the data is leaked. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ S4, @@ -405,28 +360,24 @@ declare namespace distributedKVStore { * whether to encrypt the database, and the database type. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ interface Options { /** * Indicates whether to createa database when the database file does not exist * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ createIfMissing?: boolean; /** * Indicates setting whether database files are encrypted * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ encrypt?: boolean; /** * Indicates setting whether to back up database files * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ backup?: boolean; @@ -434,28 +385,24 @@ declare namespace distributedKVStore { * Indicates setting whether database files are automatically synchronized * @permission ohos.permission.DISTRIBUTED_DATASYNC * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ autoSync?: boolean; /** * Indicates setting the databse type * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ kvStoreType?: KVStoreType; /** * Indicates setting the database security level * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ securityLevel: SecurityLevel; /** * Indicates schema object * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @import N/A * @since 9 */ schema?: Schema; @@ -467,7 +414,6 @@ declare namespace distributedKVStore { * You can create Schema objects and put them in Options when creating or opening the database. * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @import N/A * @since 9 */ class Schema { @@ -518,7 +464,6 @@ declare namespace distributedKVStore { *

The leaf node must have a value; the non-leaf node must have a child {@code FieldNode}. * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @import N/A * @since 9 */ class FieldNode { @@ -572,7 +517,6 @@ declare namespace distributedKVStore { * position in the result set. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @import N/A * @since 9 */ interface KVStoreResultSet { @@ -706,7 +650,6 @@ declare namespace distributedKVStore { * *

This class also provides methods for adding predicates to the {@code Query} instance. * - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -722,7 +665,6 @@ declare namespace distributedKVStore { * Resets this {@code Query} object. * * @returns Returns the reset {@code Query} object. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -734,7 +676,6 @@ declare namespace distributedKVStore { * @param {number|string|boolean} value - Indicates the value to be compared. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -746,7 +687,6 @@ declare namespace distributedKVStore { * @param {number|string|boolean} value - Indicates the value to be compared. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -759,7 +699,6 @@ declare namespace distributedKVStore { * @param {number|string|boolean} value - Indicates the value to be compared. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -771,7 +710,6 @@ declare namespace distributedKVStore { * @param {number|string} value - Indicates the value to be compared. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -784,7 +722,6 @@ declare namespace distributedKVStore { * @param {number|string} value - Indicates the value to be compared. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -797,7 +734,6 @@ declare namespace distributedKVStore { * @param {number|string} value - Indicates the value to be compared. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -808,7 +744,6 @@ declare namespace distributedKVStore { * @param {string} field - Indicates the field, which must start with $. and cannot contain ^. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -820,7 +755,6 @@ declare namespace distributedKVStore { * @param {number[]} valueList - Indicates the int value list. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -832,7 +766,6 @@ declare namespace distributedKVStore { * @param {string[]} valueList - Indicates the string value list. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -844,7 +777,6 @@ declare namespace distributedKVStore { * @param {number[]} valueList - Indicates the int value list. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -856,7 +788,6 @@ declare namespace distributedKVStore { * @param {string[]} valueList - Indicates the string value list. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -868,7 +799,6 @@ declare namespace distributedKVStore { * @param {string} value - Indicates the string value. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -880,7 +810,6 @@ declare namespace distributedKVStore { * @param {string} value - Indicates the string value. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -891,7 +820,6 @@ declare namespace distributedKVStore { *

Multiple predicates should be connected using the and or or condition. * * @returns Returns the {@coed Query} object. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -902,7 +830,6 @@ declare namespace distributedKVStore { *

Multiple predicates should be connected using the and or or condition. * * @returns Returns the {@coed Query} object. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -913,7 +840,6 @@ declare namespace distributedKVStore { * @param {string} field - Indicates the field, which must start with $. and cannot contain ^. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -924,7 +850,6 @@ declare namespace distributedKVStore { * @param {string} field - Indicates the field, which must start with $. and cannot contain ^. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -936,7 +861,6 @@ declare namespace distributedKVStore { * @param {number} offset - Indicates the start position. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -947,7 +871,6 @@ declare namespace distributedKVStore { * @param {string} field - Indicates the specified field. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -959,7 +882,6 @@ declare namespace distributedKVStore { * whole to combine with other query conditions. * * @returns Returns the {@coed Query} object. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -971,7 +893,6 @@ declare namespace distributedKVStore { * whole to combine with other query conditions. * * @returns Returns the {@coed Query} object. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -982,7 +903,6 @@ declare namespace distributedKVStore { * @param {string} prefix - Indicates the specified key prefix. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -993,7 +913,6 @@ declare namespace distributedKVStore { * @param {string} index - Indicates the index to set. * @returns Returns the {@coed Query} object. * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1004,7 +923,6 @@ declare namespace distributedKVStore { * @param {string} deviceId - Specify device id to query from. * @return Returns the {@code Query} object with device ID prefix added. * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1016,7 +934,6 @@ declare namespace distributedKVStore { * The String length should be no longer than 500kb. * * @return String representing this {@code Query}. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1033,7 +950,6 @@ declare namespace distributedKVStore { * The {@code SingleKVStore} database does not support * synchronous transactions, or data search using snapshots. * - * @import N/A * @version 1 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 @@ -1253,7 +1169,6 @@ declare namespace distributedKVStore { * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100004 - if the data not exist when query data. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1269,7 +1184,6 @@ declare namespace distributedKVStore { * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100004 - if the data not exist when query data. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1284,7 +1198,6 @@ declare namespace distributedKVStore { * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1299,7 +1212,6 @@ declare namespace distributedKVStore { * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1315,7 +1227,6 @@ declare namespace distributedKVStore { * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100005 - if not support the operation. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1331,7 +1242,6 @@ declare namespace distributedKVStore { * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100005 - if not support the operation. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1350,7 +1260,6 @@ declare namespace distributedKVStore { * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1369,7 +1278,6 @@ declare namespace distributedKVStore { * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1384,7 +1292,6 @@ declare namespace distributedKVStore { * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1399,7 +1306,6 @@ declare namespace distributedKVStore { * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1441,7 +1347,6 @@ declare namespace distributedKVStore { * @param {KVStoreResultSet} resultSet - Indicates the {@code KVStoreResultSet} object to close. * @param {AsyncCallback} callback - the callback of closeResultSet. * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1453,7 +1358,6 @@ declare namespace distributedKVStore { * @param {KVStoreResultSet} resultSet - Indicates the {@code KVStoreResultSet} object to close. * @returns {Promise} the promise returned by the function. * @throws {BusinessError} 401 - if parameter check failed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1468,7 +1372,6 @@ declare namespace distributedKVStore { * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1483,7 +1386,6 @@ declare namespace distributedKVStore { * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100006 - if the database or result set has been closed. - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1824,7 +1726,6 @@ declare namespace distributedKVStore { * data by device, and cannot modify data synchronized from remote devices. When an application writes a key-value pair entry * into the database, the system automatically adds the ID of the device running the application to the key. * - * @import N/A * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ @@ -2093,7 +1994,6 @@ declare namespace distributedKVStore { /** * Provides interfaces to manage a {@code SingleKVStore} database, including obtaining, closing, and deleting the {@code SingleKVStore}. * - * @import N/A * @version 1 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 -- Gitee From e9a2a54e9b1bf4dfc7b5a133a0d1dc9f475c386b Mon Sep 17 00:00:00 2001 From: wangqing Date: Tue, 18 Oct 2022 21:16:00 +0800 Subject: [PATCH 193/438] fix api_check Signed-off-by: wangqing --- build-tools/api_check_plugin/entry.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-tools/api_check_plugin/entry.js b/build-tools/api_check_plugin/entry.js index b81208d3c7..f07cfa6646 100644 --- a/build-tools/api_check_plugin/entry.js +++ b/build-tools/api_check_plugin/entry.js @@ -25,7 +25,7 @@ function checkEntry(url) { execSync("cd interface/sdk-js/build-tools/api_check_plugin && npm install"); const { scanEntry } = require(path.resolve(__dirname, "./src/api_check_plugin")); result = scanEntry(url); - const content = fs.readFileSync(path.resolve(__dirname, "./Result.txt"), "utf-8"); + const content = fs.readFileSync(url, "utf-8"); result += `mdFilePath = ${url}, content = ${content}` const { removeDir } = require(path.resolve(__dirname, "./src/utils")); removeDir(path.resolve(__dirname, "node_modules")); -- Gitee From 77ec0fd3e17c89facd57b900f0be5497c1cb4da8 Mon Sep 17 00:00:00 2001 From: liwuli Date: Wed, 19 Oct 2022 13:54:01 +0800 Subject: [PATCH 194/438] complemented setEnterpriseInfo permission Signed-off-by: liwuli --- api/@ohos.enterpriseDeviceManager.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/api/@ohos.enterpriseDeviceManager.d.ts b/api/@ohos.enterpriseDeviceManager.d.ts index 612d2d7d12..08f6c2cb53 100644 --- a/api/@ohos.enterpriseDeviceManager.d.ts +++ b/api/@ohos.enterpriseDeviceManager.d.ts @@ -280,6 +280,7 @@ declare namespace enterpriseDeviceManager { /** * Set the information of the administrator's enterprise. * Only the administrator app can call this method. + * @permission ohos.permission.SET_ENTERPRISE_INFO * @param { Want } admin - admin indicates the administrator ability information. * @param { EnterpriseInfo } enterpriseInfo - enterpriseInfo indicates the enterprise information of the calling application. * @param { AsyncCallback } callback - the callback of setEnterpriseInfo. -- Gitee From cb68541ad8728d6f3906eaa2b3f3d4a04d4b4a23 Mon Sep 17 00:00:00 2001 From: zhufenghao Date: Tue, 18 Oct 2022 11:54:54 +0800 Subject: [PATCH 195/438] =?UTF-8?q?=E5=88=A0=E9=99=A4webview.d.ts=E4=B8=AD?= =?UTF-8?q?saveCookieSync=E6=8E=A5=E5=8F=A3=EF=BC=8C=E4=BF=AE=E6=94=B9thir?= =?UTF-8?q?dparty=E9=BB=98=E8=AE=A4=E5=80=BC=E4=B8=BAfalse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhufenghao --- api/@ohos.web.webview.d.ts | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/api/@ohos.web.webview.d.ts b/api/@ohos.web.webview.d.ts index 1ef2d8ad7c..1a839be4e6 100644 --- a/api/@ohos.web.webview.d.ts +++ b/api/@ohos.web.webview.d.ts @@ -371,28 +371,17 @@ declare namespace webview { */ static setCookie(url: string, value: string): void; - /** - * Save the cookies Synchronously. - * - * @since 9 - */ - static saveCookieSync(): void; - /** * Save the cookies Asynchronously. * - * @param { AsyncCallback } callback - Called after the cookies have been saved. - * The parameter will either be true if the cookies - * have been successfully saved, or false if failed. + * @param { AsyncCallback } callback - Called after the cookies have been saved. * @throws { BusinessError } 401 - Invaild input parameter. - * @return { Promise } A promise resolved after the cookies have been saved. - * The parameter will either be true if the cookies have - * been successfully saved, or false if failed. + * @return { Promise } A promise resolved after the cookies have been saved. * * @since 9 */ - static saveCookieAsync(): Promise; - static saveCookieAsync(callback: AsyncCallback): void; + static saveCookieAsync(): Promise; + static saveCookieAsync(callback: AsyncCallback): void; /** * Get whether the instance can send and accept cookies. @@ -425,7 +414,7 @@ declare namespace webview { /** * Set whether the instance should send and accept thirdparty cookies. - * By default this is set to be true. + * By default this is set to be false. * * @param { boolean } accept - Whether the instance should send and accept thirdparty cookies. * @throws { BusinessError } 401 - Invaild input parameter. @@ -809,7 +798,7 @@ declare namespace webview { * * @since 9 */ - stop(); + stop(): void; /** * Registers the JavaScript object and method list. -- Gitee From 1f79a1b09577e5fab5f5b4e9376525cef379a4bd Mon Sep 17 00:00:00 2001 From: wangzezhen Date: Wed, 19 Oct 2022 09:51:55 +0800 Subject: [PATCH 196/438] fix navigation Signed-off-by: wangzezhen Change-Id: Id5fe3f63cc3f3e34a3ebeb061d097f6cde705ecb --- api/@internal/component/ets/nav_destination.d.ts | 4 ++-- api/@internal/component/ets/nav_router.d.ts | 2 +- api/@internal/component/ets/navigation.d.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/@internal/component/ets/nav_destination.d.ts b/api/@internal/component/ets/nav_destination.d.ts index 3868d8de29..ff5b52d3a3 100644 --- a/api/@internal/component/ets/nav_destination.d.ts +++ b/api/@internal/component/ets/nav_destination.d.ts @@ -40,7 +40,7 @@ declare interface NavDestinationCustomTitle { * Sets the custom title builder. * @since 9 */ - builder: string; + builder: CustomBuilder; /** * Sets the custom title height. @@ -55,7 +55,7 @@ declare interface NavDestinationCustomTitle { */ declare interface NavDestinationInterface { /** - * constructor. + * Constructor. * @since 9 */ (): NavDestinationAttribute; diff --git a/api/@internal/component/ets/nav_router.d.ts b/api/@internal/component/ets/nav_router.d.ts index f6d6718aa1..44ea2af9b8 100644 --- a/api/@internal/component/ets/nav_router.d.ts +++ b/api/@internal/component/ets/nav_router.d.ts @@ -19,7 +19,7 @@ */ declare interface NavRouterInterface { /** - * constructor. + * Constructor. * @since 9 */ (): NavRouterAttribute; diff --git a/api/@internal/component/ets/navigation.d.ts b/api/@internal/component/ets/navigation.d.ts index 74d0480687..3cec4a169d 100644 --- a/api/@internal/component/ets/navigation.d.ts +++ b/api/@internal/component/ets/navigation.d.ts @@ -40,7 +40,7 @@ declare interface NavigationCustomTitle { * Sets the custom title builder. * @since 9 */ - builder: string; + builder: CustomBuilder; /** * Sets the custom title height. -- Gitee From 529709166e6bd6fff84eb7be1f184c09cf8da260 Mon Sep 17 00:00:00 2001 From: dboy190 Date: Wed, 19 Oct 2022 15:44:27 +0800 Subject: [PATCH 197/438] fix js doc language error Signed-off-by: dboy190 --- api/@ohos.data.distributedKVStore.d.ts | 175 ++++++++++++------------- 1 file changed, 84 insertions(+), 91 deletions(-) diff --git a/api/@ohos.data.distributedKVStore.d.ts b/api/@ohos.data.distributedKVStore.d.ts index 30514b2525..cc55042a39 100644 --- a/api/@ohos.data.distributedKVStore.d.ts +++ b/api/@ohos.data.distributedKVStore.d.ts @@ -19,14 +19,14 @@ import dataSharePredicates from './@ohos.data.dataSharePredicates'; import Context from './application/Context'; /** - * Providers interfaces to create a {@link KVManager} istances. + * Provider interfaces to create a {@link KVManager} istances. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ declare namespace distributedKVStore { /** - * Provides configuration information for {@link KVManager} instances, - * including the caller's package name and distributed network type. + * Provides configuration information to create a {@link KVManager} instance, + * which includes the caller's package name and ability or hap context. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -55,42 +55,42 @@ declare namespace distributedKVStore { */ namespace Constants { /** - * max key length. + * Max key length. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ const MAX_KEY_LENGTH = 1024; /** - * max value length. + * Max value length. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ const MAX_VALUE_LENGTH = 4194303; /** - * max device coordinate key length. + * Max device coordinate key length. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ const MAX_KEY_LENGTH_DEVICE = 896; /** - * max store id length. + * Max store id length. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ const MAX_STORE_ID_LENGTH = 128; /** - * max query length. + * Max query length. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ const MAX_QUERY_LENGTH = 512000; /** - * max batch operation size. + * Max batch operation size. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -157,16 +157,14 @@ declare namespace distributedKVStore { */ interface Value { /** - * Indicates value type + * Indicates the value type * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @see ValueType - * @type {number} - * @memberof Value * @since 9 */ type: ValueType; /** - * Indicates value + * Indicates the value * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -174,20 +172,20 @@ declare namespace distributedKVStore { } /** - * Provides key-value pairs stored in the distributed database. + * Provides key-value pairs stored in the distributedKVStore. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ interface Entry { /** - * Indicates key + * Indicates the key * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ key: string; /** - * Indicates value + * Indicates the value * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -195,18 +193,18 @@ declare namespace distributedKVStore { } /** - * Receives notifications of all data changes, including data insertion, update, and deletion. + * Receive notifications of all data changes, including data insertion, update, and deletion. * *

If you have subscribed to {@code SingleKVStore} or {@code DeviceKVStore}, you will receive * data change notifications and obtain the changed data from the parameters in callback methods - * upon data insertion, update, or deletion. + * upon data insertion, update or deletion. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ interface ChangeNotification { /** - * Indicates data addition records. + * Indicates data insertion records. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -224,7 +222,7 @@ declare namespace distributedKVStore { */ deleteEntries: Entry[]; /** - * Indicates from device id. + * Indicates the device id which brings the data change. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -317,8 +315,8 @@ declare namespace distributedKVStore { */ enum SecurityLevel { /** - * S1: mains the db is low level security - * There are some low impact, when the data is leaked. + * S1: means the db is in the low security level + * There are some low impact when the data is leaked. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 @@ -326,8 +324,8 @@ declare namespace distributedKVStore { S1, /** - * S2: mains the db is middle level security - * There are some major impact, when the data is leaked. + * S2: means the db is in the middle security level + * There are some major impact when the data is leaked. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 @@ -335,8 +333,8 @@ declare namespace distributedKVStore { S2, /** - * S3: mains the db is high level security - * There are some severity impact, when the data is leaked. + * S3: means the db is in the high security level + * There are some severity impact when the data is leaked. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 @@ -344,8 +342,8 @@ declare namespace distributedKVStore { S3, /** - * S4: mains the db is critical level security - * There are some critical impact, when the data is leaked. + * S4: means the db is in the critical security level + * There are some critical impact when the data is leaked. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 @@ -354,54 +352,51 @@ declare namespace distributedKVStore { } /** - * Provides configuration options for creating a {@code SingleKVStore} or {@code DeviceKVStore}. - * - *

You can determine whether to create another database if a KVStore database is missing, - * whether to encrypt the database, and the database type. + * Provides configuration options to create a {@code SingleKVStore} or {@code DeviceKVStore}. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ interface Options { /** - * Indicates whether to createa database when the database file does not exist + * Indicates whether to create a database when the database file does not exist * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ createIfMissing?: boolean; /** - * Indicates setting whether database files are encrypted + * Indicates whether database files to be encrypted * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ encrypt?: boolean; /** - * Indicates setting whether to back up database files + * Indicates whether to back up database files * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ backup?: boolean; /** - * Indicates setting whether database files are automatically synchronized + * Indicates whether database files are automatically synchronized * @permission ohos.permission.DISTRIBUTED_DATASYNC * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ autoSync?: boolean; /** - * Indicates setting the databse type + * Indicates the database type * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ kvStoreType?: KVStoreType; /** - * Indicates setting the database security level + * Indicates the database security level * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ securityLevel: SecurityLevel; /** - * Indicates schema object + * Indicates the database schema * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ @@ -411,7 +406,7 @@ declare namespace distributedKVStore { /** * Represents the database schema. * - * You can create Schema objects and put them in Options when creating or opening the database. + * You can set the schema object in options when create or open the database. * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 @@ -446,7 +441,7 @@ declare namespace distributedKVStore { */ mode: number; /** - * Indicates the skipsize of schema. + * Indicates the skip size of schema. * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 @@ -457,7 +452,7 @@ declare namespace distributedKVStore { /** * Represents a node of a {@link Schema} instance. * - *

Through the {@link Schema} instance, you can define the fields contained in the values stored in a database. + *

With a {@link Schema} instance, you can define the value fields which stored in the database. * *

A FieldNode of the {@link Schema} instance is either a leaf or a non-leaf node. * @@ -478,16 +473,16 @@ declare namespace distributedKVStore { /** * Adds a child node to this {@code FieldNode}. * - *

Adding a child node makes this node a non-leaf node. Field value will be ignored if it has child node. + *

Add a child node to makes this node a non-leaf node and field value will be ignored if it has a child node. * * @param {FieldNode} child - The field node to append. - * @returns Returns true if the child node is successfully added to this {@code FieldNode}; returns false otherwise. + * @returns Returns true if the child node is successfully added to this {@code FieldNode} and false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ appendChild(child: FieldNode): boolean; /** - * Indicates the default value of fieldnode. + * Indicates the default value of field node. * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 @@ -510,10 +505,10 @@ declare namespace distributedKVStore { } /** - * Provide methods to obtain the result set of the {@code SingleKVStore} or {@code DeviceKVStore} database. + * Provides methods to operate the result set of the {@code SingleKVStore} or {@code DeviceKVStore} database. * *

The result set is created by using the {@code getResultSet} method in the {@code SingleKVStore} or - * {@code DeviceKVStore} class. This interface also provides methods for moving the data read + * {@code DeviceKVStore} class. This interface also provides methods to move the data read * position in the result set. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -643,12 +638,12 @@ declare namespace distributedKVStore { } /** - * Represents a database query using a predicate. + * Represents a database query using predicates. * *

This class provides a constructor used to create a {@code Query} instance, which is used to query data * matching specified conditions in the database. * - *

This class also provides methods for adding predicates to the {@code Query} instance. + *

This class also provides methods to add predicates to the {@code Query} instance. * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 @@ -950,7 +945,6 @@ declare namespace distributedKVStore { * The {@code SingleKVStore} database does not support * synchronous transactions, or data search using snapshots. * - * @version 1 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -960,7 +954,7 @@ declare namespace distributedKVStore { * *

If you do not want to synchronize this key-value pair to other devices, set the write option in the local database. * - * @param {string} key - Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. + * @param {string} key - Indicates the key. Length must be less than {@code MAX_KEY_LENGTH}. * Spaces before and after the key will be cleared. * @param {Uint8Array|string|number|boolean} value - Indicates the value to be inserted. * @param {AsyncCallback} callback - the callback of put. @@ -977,7 +971,7 @@ declare namespace distributedKVStore { * *

If you do not want to synchronize this key-value pair to other devices, set the write option in the local database. * - * @param {string} key - Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. + * @param {string} key - Indicates the key. Length must be less than {@code MAX_KEY_LENGTH}. * Spaces before and after the key will be cleared. * @param {Uint8Array|string|number|boolean} value - Indicates the value to be inserted. * @returns {Promise} the promise returned by the function. @@ -1016,7 +1010,7 @@ declare namespace distributedKVStore { putBatch(entries: Entry[]): Promise; /** - * Writes a value of the ValuesBucket type into the {@code SingleKVStore} database. + * Writes values of ValuesBucket type into the {@code SingleKVStore} database. * * @param {Array} value - Indicates the ValuesBucket array to be inserted. * @param {AsyncCallback} callback - the callback of putBatch. @@ -1030,7 +1024,7 @@ declare namespace distributedKVStore { putBatch(value: Array, callback: AsyncCallback): void; /** - * Writes a value of the ValuesBucket type into the {@code SingleKVStore} database. + * Writes values of ValuesBucket type into the {@code SingleKVStore} database. * * @param {Array} value - Indicates the ValuesBucket array to be inserted. * @returns {Promise} the promise returned by the function. @@ -1046,7 +1040,7 @@ declare namespace distributedKVStore { /** * Deletes the key-value pair based on a specified key. * - * @param {string} key - Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. + * @param {string} key - Indicates the key. Length must be less than {@code MAX_KEY_LENGTH}. * Spaces before and after the key will be cleared. * @param {AsyncCallback} callback - the callback of delete. * @throws {BusinessError} 401 - if parameter check failed. @@ -1061,7 +1055,7 @@ declare namespace distributedKVStore { /** * Deletes the key-value pair based on a specified key. * - * @param {string} key - Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. + * @param {string} key - Indicates the key. Length must be less than {@code MAX_KEY_LENGTH}. * Spaces before and after the key will be cleared. * @returns {Promise} the promise returned by the function. * @throws {BusinessError} 401 - if parameter check failed. @@ -1132,11 +1126,11 @@ declare namespace distributedKVStore { deleteBatch(keys: string[]): Promise; /** - * Removes data of a specified device from the current database. This method is used to remove only the data + * Removes data of the specified device from current database. This method is used to remove only the data * synchronized from remote devices. This operation does not synchronize data to other databases or affect * subsequent data synchronization. * - * @param {string} deviceId - Identifies the device whose data is to be removed. The value cannot be the current device ID. + * @param {string} deviceId - Identifies the device whose data is to be removed and the value cannot be the current device ID. * @param {AsyncCallback} callback - the callback of removeDeviceData. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100006 - if the database or result set has been closed. @@ -1146,11 +1140,11 @@ declare namespace distributedKVStore { removeDeviceData(deviceId: string, callback: AsyncCallback): void; /** - * Removes data of a specified device from the current database. This method is used to remove only the data + * Removes data of the specified device from current database. This method is used to remove only the data * synchronized from remote devices. This operation does not synchronize data to other databases or affect * subsequent data synchronization. * - * @param {string} deviceId - Identifies the device whose data is to be removed. The value cannot be the current device ID. + * @param {string} deviceId - Identifies the device whose data is to be removed and the value cannot be the current device ID. * @returns {Promise} the promise returned by the function. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100006 - if the database or result set has been closed. @@ -1248,7 +1242,7 @@ declare namespace distributedKVStore { getEntries(query: Query): Promise; /** - * Obtains the result sets with a specified prefix from a {@code SingleKVStore} database. The {@code KVStoreResultSet} + * Obtains the result set with a specified prefix from a {@code SingleKVStore} database. The {@code KVStoreResultSet} * object can be used to query all key-value pairs that meet the search criteria. Each {@code SingleKVStore} * instance can have a maximum of four {@code KVStoreResultSet} objects at the same time. If you have created * four objects, calling this method will return a failure. Therefore, you are advised to call the closeResultSet @@ -1266,7 +1260,7 @@ declare namespace distributedKVStore { getResultSet(keyPrefix: string, callback: AsyncCallback): void; /** - * Obtains the result sets with a specified prefix from a {@code SingleKVStore} database. The {@code KVStoreResultSet} + * Obtains the result set with a specified prefix from a {@code SingleKVStore} database. The {@code KVStoreResultSet} * object can be used to query all key-value pairs that meet the search criteria. Each {@code SingleKVStore} * instance can have a maximum of four {@code KVStoreResultSet} objects at the same time. If you have created * four objects, calling this method will return a failure. Therefore, you are advised to call the closeResultSet @@ -1312,7 +1306,7 @@ declare namespace distributedKVStore { getResultSet(query: Query): Promise; /** - * Obtains the KVStoreResultSet object matching the specified Predicate object. + * Obtains the KVStoreResultSet object matching the specified predicate object. * * @param {dataSharePredicates.DataSharePredicates} predicates - Indicates the datasharePredicates. * @param {AsyncCallback} callback - {KVStoreResultSet}: the {@code KVStoreResultSet} @@ -1327,7 +1321,7 @@ declare namespace distributedKVStore { getResultSet(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; /** - * Obtains the KVStoreResultSet object matching the specified Predicate object. + * Obtains the KVStoreResultSet object matching the specified predicate object. * * @param {dataSharePredicates.DataSharePredicates} predicates - Indicates the datasharePredicates. * @returns {Promise} {KVStoreResultSet}: the {@code KVStoreResultSet} @@ -1342,7 +1336,7 @@ declare namespace distributedKVStore { getResultSet(predicates: dataSharePredicates.DataSharePredicates): Promise; /** - * Closes a {@code KVStoreResultSet} object returned by getResultSet. + * Closes a {@code KVStoreResultSet} object returned by getResultSet method. * * @param {KVStoreResultSet} resultSet - Indicates the {@code KVStoreResultSet} object to close. * @param {AsyncCallback} callback - the callback of closeResultSet. @@ -1353,7 +1347,7 @@ declare namespace distributedKVStore { closeResultSet(resultSet: KVStoreResultSet, callback: AsyncCallback): void; /** - * Closes a {@code KVStoreResultSet} object returned by getResultSet. + * Closes a {@code KVStoreResultSet} object returned by getResultSet method. * * @param {KVStoreResultSet} resultSet - Indicates the {@code KVStoreResultSet} object to close. * @returns {Promise} the promise returned by the function. @@ -1392,9 +1386,9 @@ declare namespace distributedKVStore { getResultSize(query: Query): Promise; /** - * Backs up a database in a specified name. + * Backs up a database in the specified filename. * - * @param {string} file - Indicates the name that saves the database backup. + * @param {string} file - Indicates the database backup filename. * @param {AsyncCallback} callback - the callback of backup. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100005 - if not support the operation. @@ -1405,9 +1399,9 @@ declare namespace distributedKVStore { backup(file:string, callback: AsyncCallback):void; /** - * Backs up a database in a specified name. + * Backs up a database in the specified filename. * - * @param {string} file - Indicates the name that saves the database backup. + * @param {string} file - Indicates the database backup filename. * @returns {Promise} the promise returned by the function. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100005 - if not support the operation. @@ -1420,7 +1414,7 @@ declare namespace distributedKVStore { /** * Restores a database from a specified database file. * - * @param {string} file - Indicates the name that saves the database file. + * @param {string} file - Indicates the database backup filename. * @param {AsyncCallback} callback - the callback of restore. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100005 - if not support the operation. @@ -1433,7 +1427,7 @@ declare namespace distributedKVStore { /** * Restores a database from a specified database file. * - * @param {string} file - Indicates the name that saves the database file. + * @param {string} file - Indicates the database backup filename. * @returns {Promise} the promise returned by the function. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100005 - if not support the operation. @@ -1444,9 +1438,9 @@ declare namespace distributedKVStore { restore(file:string): Promise; /** - * Delete a backup files based on a specified name. + * Delete database backup files based on the specified filenames. * - * @param {Array} files - Indicates the backup files to be deleted. + * @param {Array} files - Indicates the backup filenames to be deleted. * @param {AsyncCallback>} callback - {Array<[string, number]>}: * the list of backup file and it's corresponding delete result which 0 means delete success * and otherwise failed. @@ -1457,9 +1451,9 @@ declare namespace distributedKVStore { deleteBackup(files:Array, callback: AsyncCallback>):void; /** - * Delete a backup files based on a specified name. + * Delete database backup files based on the specified filenames. * - * @param {Array} files - Indicates the backup files to be deleted. + * @param {Array} files - Indicates the backup filenames to be deleted. * @returns {Promise>} {Array<[string, number]>}: the list of backup * file and it's corresponding delete result which 0 means delete success and otherwise failed. * @throws {BusinessError} 401 - if parameter check failed. @@ -1644,8 +1638,8 @@ declare namespace distributedKVStore { sync(deviceIds: string[], query: Query, mode: SyncMode, delayMs?: number): void; /** - * Registers a {@code KVStoreObserver} for the database. When data in the distributed database changes, the callback in - * {@code KVStoreObserver} will be invoked. + * Register a callback to the database and when data in the distributed database has changed, + * the callback will be invoked. * * @param {SubscribeType} type - Indicates the subscription type, which is defined in {@code SubscribeType}. * @param {Callback} listener - {ChangeNotification}: the {@code ChangeNotification} @@ -1659,7 +1653,7 @@ declare namespace distributedKVStore { on(event: 'dataChange', type: SubscribeType, listener: Callback): void; /** - * Register Synchronizes SingleKVStore databases callback. + * Register a databases synchronization callback to the database. *

Sync result is returned through asynchronous callback. * * @param {Callback>} syncCallback - {Array<[string, number]>}: the @@ -1672,7 +1666,7 @@ declare namespace distributedKVStore { on(event: 'syncComplete', syncCallback: Callback>): void; /** - * Unsubscribes from the SingleKVStore database based on the specified subscribeType and {@code KVStoreObserver}. + * Unsubscribe from the SingleKVStore database based on the specified subscribeType and listener. * * @param {Callback} listener - {ChangeNotification}: the {@code ChangeNotification} * object indicates the data change events in the distributed database. @@ -1684,7 +1678,7 @@ declare namespace distributedKVStore { off(event:'dataChange', listener?: Callback): void; /** - * UnRegister Synchronizes SingleKVStore databases callback. + * Unregister the database synchronization callback. * * @param {Callback>} syncCallback - {Array<[string, number]>}: the * deviceId and it's corresponding synchronization result which 0 means synchronization success @@ -1719,7 +1713,7 @@ declare namespace distributedKVStore { } /** - * Manages distributed data by device in a distributed system. + * Provides methods related to device-collaboration distributed databases. * *

To create a {@code DeviceKVStore} database, you can use the {@link data.distributed.common.KVManager.getKVStore(Options, String)} * method with {@code KVStoreType} set to {@code DEVICE_COLLABORATION} for the input parameter Options. This database manages distributed @@ -1965,10 +1959,10 @@ declare namespace distributedKVStore { * Creates a {@link KVManager} instance based on the configuration information. * *

You must pass {@link KVManagerConfig} to provide configuration information - * for creating the {@link KVManager} instance. + * to create a {@link KVManager} instance. * * @param {KVManagerConfig} config - Indicates the KVStore configuration information, - * including the user information and package name. + * including the package name and context. * @param {AsyncCallback} callback - {KVManager}: the {@code KVManager} instance. * @throws {BusinessError} 401 - if parameter check failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -1980,10 +1974,10 @@ declare namespace distributedKVStore { * Creates a {@link KVManager} instance based on the configuration information. * *

You must pass {@link KVManagerConfig} to provide configuration information - * for creating the {@link KVManager} instance. + * to create a {@link KVManager} instance. * * @param {KVManagerConfig} config - Indicates the KVStore configuration information, - * including the user information and package name. + * including the package name and context. * @returns {Promise} {KVManager}: the {@code KVManager} instance. * @throws {BusinessError} 401 - if parameter check failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -1994,7 +1988,6 @@ declare namespace distributedKVStore { /** * Provides interfaces to manage a {@code SingleKVStore} database, including obtaining, closing, and deleting the {@code SingleKVStore}. * - * @version 1 * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -2039,7 +2032,7 @@ declare namespace distributedKVStore { * *

The KVStore database to close must be an object created by using the {@code getKVStore} method. Before using this * method, release the resources created for the database, for example, {@code KVStoreResultSet} for KVStore, otherwise - * closing the database will fail. If you are attempting to close a database that is already closed, an error will be returned. + * closing the database will fail. * * @param {string} appId - Identifies the application that the database belong to. * @param {string} storeId - Identifies the KVStore database to close. @@ -2058,7 +2051,7 @@ declare namespace distributedKVStore { * *

The KVStore database to close must be an object created by using the {@code getKVStore} method. Before using this * method, release the resources created for the database, for example, {@code KVStoreResultSet} for KVStore, otherwise - * closing the database will fail. If you are attempting to close a database that is already closed, an error will be returned. + * closing the database will fail. * * @param {string} appId - Identifies the application that the database belong to. * @param {string} storeId - Identifies the KVStore database to close. @@ -2130,7 +2123,7 @@ declare namespace distributedKVStore { getAllKVStoreId(appId: string): Promise; /** - * register DeathCallback to get notification when service died. + * Register a death callback to get notification when service died. * * @param {Callback} deathCallback - the service died callback. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore @@ -2140,7 +2133,7 @@ declare namespace distributedKVStore { on(event: 'distributedDataServiceDie', deathCallback: Callback): void; /** - * unRegister DeathCallback and can not receive service died notification. + * Unregister the death callback and can not receive service died notification any more. * * @param {Callback} deathCallback - the service died callback which has been registered. * @throws {BusinessError} 401 - if parameter check failed. -- Gitee From bcfa84636d669cdee20af8cca40364d90bd7af11 Mon Sep 17 00:00:00 2001 From: wangqing Date: Wed, 19 Oct 2022 15:51:24 +0800 Subject: [PATCH 198/438] fix api_check Signed-off-by: wangqing --- build-tools/api_check_plugin/entry.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build-tools/api_check_plugin/entry.js b/build-tools/api_check_plugin/entry.js index f07cfa6646..2bc25c700f 100644 --- a/build-tools/api_check_plugin/entry.js +++ b/build-tools/api_check_plugin/entry.js @@ -19,6 +19,7 @@ const { writeResultFile } = require('./src/utils'); function checkEntry(url) { let result = "API CHECK FAILED!"; + const sourceDirname = __dirname; __dirname = "interface/sdk-js/build-tools/api_check_plugin"; try { const execSync = require("child_process").execSync; @@ -26,12 +27,12 @@ function checkEntry(url) { const { scanEntry } = require(path.resolve(__dirname, "./src/api_check_plugin")); result = scanEntry(url); const content = fs.readFileSync(url, "utf-8"); - result += `mdFilePath = ${url}, content = ${content}` + result += `mdFilePath = ${url}, content = ${content}, __dirname = ${__dirname}, sourceDirname = ${sourceDirname}`; const { removeDir } = require(path.resolve(__dirname, "./src/utils")); removeDir(path.resolve(__dirname, "node_modules")); } catch (error) { // catch error - result = `CATCHERROR : ${error}`; + result = `CATCHERROR : ${error}, mdFilePath = ${url}, __dirname = ${__dirname}, sourceDirname = ${sourceDirname}`; } writeResultFile(result, path.resolve(__dirname, "./Result.txt"), {}); } -- Gitee From b201a4ae0649cdbf4b19f49278ac046513c90e80 Mon Sep 17 00:00:00 2001 From: wangtiantian Date: Wed, 19 Oct 2022 08:08:13 +0000 Subject: [PATCH 199/438] IssueNo: #I5WKT8 Description: add errcode Sig:SIG_ApplicaitonFramework Feature or Bugfix:Bugfix Binary Source:No Signed-off-by: wangtiantian --- api/@ohos.bundle.bundleManager.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/api/@ohos.bundle.bundleManager.d.ts b/api/@ohos.bundle.bundleManager.d.ts index 858f6aa818..d5b1014290 100644 --- a/api/@ohos.bundle.bundleManager.d.ts +++ b/api/@ohos.bundle.bundleManager.d.ts @@ -546,6 +546,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700030 - The specified bundleName does not support cleaning cache files. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi * @since 9 -- Gitee From b342177cd4ff6e77b02b013bc0af0faa0c4a894a Mon Sep 17 00:00:00 2001 From: zhaogan Date: Wed, 19 Oct 2022 11:55:26 +0800 Subject: [PATCH 200/438] Issue: #I5WIDP Description: rename BundleManager.BundleInfo.PermissionGrantState Sig: SIG_ApplicaitonFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: zhaogan --- api/@ohos.bundle.bundleManager.d.ts | 26 ++++++++++++-------------- api/bundleManager/bundleInfo.d.ts | 10 +++++----- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/api/@ohos.bundle.bundleManager.d.ts b/api/@ohos.bundle.bundleManager.d.ts index 858f6aa818..913d650989 100644 --- a/api/@ohos.bundle.bundleManager.d.ts +++ b/api/@ohos.bundle.bundleManager.d.ts @@ -227,9 +227,8 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; /** * Obtains own bundleInfo. - * @param { number } bundleFlags - Indicates BundleFlag, the value in bundleFlag can be used in or. + * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. * @returns { Promise } The result of getting the bundle info. - * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 @@ -238,9 +237,8 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; /** * Obtains own bundleInfo. - * @param { number } bundleFlags - Indicates BundleFlag, the value in bundleFlag can be used in or. + * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. * @param { AsyncCallback } callback - The callback of getting bundle info result. - * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 @@ -251,7 +249,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * Obtains bundleInfo based on bundleName, bundleFlags and options. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @param { string } bundleName - Indicates the application bundle name to be queried. - * @param { number } bundleFlags - Indicates BundleFlag, the value in bundleFlag can be used in or. + * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. * @param { number } userId - Indicates the user ID or do not pass user ID. * @param { AsyncCallback } callback - The callback of getting bundle info result. * @throws { BusinessError } 201 - Permission denied. @@ -270,7 +268,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * Obtains bundleInfo based on bundleName, bundleFlags and options. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @param { string } bundleName - Indicates the application bundle name to be queried. - * @param { number } bundleFlags - Indicates BundleFlag, the value in bundleFlag can be used in or. + * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. * @param { number } userId - Indicates the user ID or do not pass user ID. * @returns { Promise } The result of getting the bundle info. * @throws { BusinessError } 201 - Permission denied. @@ -288,7 +286,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * Obtains application info based on a given bundle name. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @param { string } bundleName - Indicates the application bundle name to be queried. - * @param { number } appFlags - Indicates ApplicationFlag, the value in ApplicationFlag can be used in or. + * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. * @param { number } userId - Indicates the user ID or do not pass user ID. * @param { AsyncCallback } callback - The callback of getting application info result. * @throws { BusinessError } 201 - Permission denied. @@ -307,7 +305,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * Obtains application info based on a given bundle name. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @param { string } bundleName - Indicates the application bundle name to be queried. - * @param { number } appFlags - Indicates ApplicationFlag, the value in ApplicationFlag can be used in or. + * @param { number } appFlags - Indicates the flag used to specify information contained in the ApplicationInfo objects that will be returned. * @param { number } userId - Indicates the user ID or do not pass user ID. * @returns { Promise } The result of getting the application info. * @throws { BusinessError } 201 - Permission denied. @@ -429,7 +427,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @param { Want } want - Indicates the Want containing the application bundle name to be queried. * @param { ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType. - * @param { number } extensionAbilityFlags - Indicates the flag used to specify information contained in the ExtensionInfo objects that will be returned. + * @param { number } extensionAbilityFlags - Indicates the flag used to specify information contained in the ExtensionAbilityInfo objects that will be returned. * @param { number } userId - Indicates the user ID. * @param { AsyncCallback> } callback - The callback of querying extension ability info result. * @throws { BusinessError } 201 - Permission denied. @@ -898,7 +896,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * Obtains applicationInfo based on a given bundleName and bundleFlags. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @param { string } bundleName - Indicates the application bundle name to be queried. - * @param { number } bundleFlags - Indicates the flag used to specify information contained in the ApplicationInfo object that will be returned. + * @param { number } applicationFlags - Indicates the flag used to specify information contained in the ApplicationInfo object that will be returned. * @param { number } userId - Indicates the user ID or do not pass user ID. * @returns Returns the ApplicationInfo object. * @throws { BusinessError } 201 - Permission denied. @@ -909,8 +907,8 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @systemapi * @since 9 */ - function getApplicationInfoSync(bundleName: string, bundleFlags: number, userId: number) : ApplicationInfo; - function getApplicationInfoSync(bundleName: string, bundleFlags: number) : ApplicationInfo; + function getApplicationInfoSync(bundleName: string, applicationFlags: number, userId: number) : ApplicationInfo; + function getApplicationInfoSync(bundleName: string, applicationFlags: number) : ApplicationInfo; /** * Obtains bundleInfo based on bundleName, bundleFlags and options. @@ -966,11 +964,11 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; export type ReqPermissionDetail = _BundleInfo.ReqPermissionDetail; /** - * Indicates the PermissionGrantStatus. + * Indicates the PermissionGrantState. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ - export type PermissionGrantStatus = _BundleInfo.PermissionGrantStatus; + export type PermissionGrantState = _BundleInfo.PermissionGrantState; /** * Indicates the SignatureInfo. diff --git a/api/bundleManager/bundleInfo.d.ts b/api/bundleManager/bundleInfo.d.ts index 2fa975f423..55a81553c5 100644 --- a/api/bundleManager/bundleInfo.d.ts +++ b/api/bundleManager/bundleInfo.d.ts @@ -96,12 +96,12 @@ export interface BundleInfo { readonly reqPermissionDetails: Array; /** - * Indicates the grant status of required permissions - * @type {Array} + * Indicates the grant state of required permissions + * @type {Array} * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ - readonly permissionGrantStates: Array; + readonly permissionGrantStates: Array; /** * Indicates the SignatureInfo of the bundle @@ -193,12 +193,12 @@ export interface UsedScene { } /** - * PermissionGrantStatus + * PermissionGrantState * @enum {number} * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ - export enum PermissionGrantStatus { + export enum PermissionGrantState { /** * PERMISSION_DENIED * @syscap SystemCapability.BundleManager.BundleFramework.Core -- Gitee From 58d4d229e9a0e27639db5678ebe1e2bf96c66f59 Mon Sep 17 00:00:00 2001 From: li-hui-17 Date: Wed, 19 Oct 2022 17:00:03 +0800 Subject: [PATCH 201/438] add RdbStoreV9 Signed-off-by: li-hui-17 --- api/@ohos.data.rdb.d.ts | 455 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 453 insertions(+), 2 deletions(-) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index b433eedc03..0e15ef27b8 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -59,7 +59,7 @@ declare namespace rdb { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ - function getRdbStoreV9(context: Context, config: StoreConfig, version: number, callback: AsyncCallback): void; + function getRdbStoreV9(context: Context, config: StoreConfigV9, version: number, callback: AsyncCallback): void; /** * Obtains an RDB store. @@ -77,7 +77,7 @@ declare namespace rdb { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ - function getRdbStoreV9(context: Context, config: StoreConfig, version: number): Promise; + function getRdbStoreV9(context: Context, config: StoreConfigV9, version: number): Promise; /** * Deletes the database with a specified name. @@ -438,6 +438,457 @@ declare namespace rdb { off(event:'dataChange', type: SubscribeType, observer: Callback>): void; } + /** + * Provides methods for managing the relational database (RDB). + * + * This class provides methods for creating, querying, updating, and deleting RDBs. + * + * @import import data_rdb from '@ohos.data.rdb'; + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + interface RdbStoreV9 { + /** + * Inserts a row of data into the target table. + * + * @param {string} table - Indicates the row of data to be inserted into the table. + * @param {ValuesBucket} values - Indicates the row of data {@link ValuesBucket} to be inserted into the table. + * @param {AsyncCallback} callback - the row ID if the operation is successful. returns -1 otherwise. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + insert(table: string, values: ValuesBucket, callback: AsyncCallback): void; + + /** + * Inserts a row of data into the target table. + * + * @param {string} table - Indicates the row of data to be inserted into the table. + * @param {ValuesBucket} values - Indicates the row of data {@link ValuesBucket} to be inserted into the table. + * @returns {Promise} return the row ID if the operation is successful. return -1 otherwise. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + insert(table: string, values: ValuesBucket): Promise; + + /** + * Inserts a batch of data into the target table. + * + * @param {string} table - Indicates the target table. + * @param {Array} values - Indicates the rows of data {@link ValuesBucket} to be inserted into the table. + * @param {AsyncCallback} callback - the number of values that were inserted if the operation is successful. returns -1 otherwise. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + batchInsert(table: string, values: Array, callback: AsyncCallback): void; + + /** + * Inserts a batch of data into the target table. + * + * @param {string} table - Indicates the target table. + * @param {Array} values - Indicates the rows of data {@link ValuesBucket} to be inserted into the table. + * @returns {Promise} return the number of values that were inserted if the operation is successful. returns -1 otherwise. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + batchInsert(table: string, values: Array): Promise; + + /** + * Updates data in the database based on a a specified instance object of RdbPredicatesV9. + * + * @param {ValuesBucket} values - Indicates Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. + * @param {RdbPredicatesV9} predicates - Indicates the specified update condition by the instance object of {@link RdbPredicatesV9}. + * @param {AsyncCallback} callback - the number of affected rows. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + update(values: ValuesBucket, predicates: RdbPredicatesV9, callback: AsyncCallback): void; + + /** + * Updates data in the database based on a a specified instance object of RdbPredicatesV9. + * + * @param {ValuesBucket} values - Indicates Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. + * @param {RdbPredicatesV9} predicates - Indicates the specified update condition by the instance object of {@link RdbPredicatesV9}. + * @returns {Promise} return the number of affected rows. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + update(values: ValuesBucket, predicates: RdbPredicatesV9): Promise; + + /** + * Updates data in the database based on a a specified instance object of RdbPredicatesV9. + * + * @param {string} table - Indicates the target table. + * @param {ValuesBucket} values - Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. + * @param {DataSharePredicates} predicates - Indicates the specified update condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. + * @param {AsyncCallback} callback - the number of affected rows. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + update(table: string, values: ValuesBucket, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; + + /** + * Updates data in the database based on a a specified instance object of RdbPredicatesV9. + * + * @param {string} table - Indicates the target table. + * @param {ValuesBucket} values - Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. + * @param {DataSharePredicates} predicates - Indicates the specified update condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. + * @returns {Promise} return the number of affected rows. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + update(table: string, values: ValuesBucket, predicates: dataSharePredicates.DataSharePredicates): Promise; + + /** + * Deletes data from the database based on a specified instance object of RdbPredicatesV9. + * + * @param {RdbPredicatesV9} predicates - the specified delete condition by the instance object of {@link RdbPredicatesV9}. + * @param {AsyncCallback} callback - the number of affected rows. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + delete(predicates: RdbPredicatesV9, callback: AsyncCallback): void; + + /** + * Deletes data from the database based on a specified instance object of RdbPredicatesV9. + * + * @param {RdbPredicatesV9} predicates - the specified delete condition by the instance object of {@link RdbPredicatesV9}. + * @returns {Promise} return the number of affected rows. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + delete(predicates: RdbPredicatesV9): Promise; + + /** + * Deletes data from the database based on a specified instance object of RdbPredicatesV9. + * + * @param {string} table - Indicates the target table. + * @param {DataSharePredicates} predicates - the specified delete condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. + * @param {AsyncCallback} callback - the number of affected rows. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + delete(table: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; + + /** + * Deletes data from the database based on a specified instance object of RdbPredicatesV9. + * + * @param {string} table - Indicates the target table. + * @param {DataSharePredicates} predicates - the specified delete condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. + * @param {AsyncCallback} callback - the number of affected rows. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + delete(table: string, predicates: dataSharePredicates.DataSharePredicates): Promise; + + /** + * Queries data in the database based on specified conditions. + * + * @param {RdbPredicatesV9} predicates - the specified query condition by the instance object of {@link RdbPredicatesV9}. + * @param {Array} columns - the columns to query. If the value is empty array, the query applies to all columns. + * @param {AsyncCallback} callback - the {@link ResultSetV9} object if the operation is successful. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + query(predicates: RdbPredicatesV9, columns: Array, callback: AsyncCallback): void; + + /** + * Queries data in the database based on specified conditions. + * + * @param {RdbPredicatesV9} predicates - the specified query condition by the instance object of {@link RdbPredicatesV9}. + * @param {Array} columns - the columns to query. If the value is null, the query applies to all columns. + * @returns {Promise} return the {@link ResultSetV9} object if the operation is successful. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + query(predicates: RdbPredicatesV9, columns?: Array): Promise; + + /** + * Queries data in the database based on specified conditions. + * + * @param {string} table - Indicates the target table. + * @param {dataSharePredicates.DataSharePredicates} predicates - the specified query condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. + * @param {Array} columns - the columns to query. If the value is empty array, the query applies to all columns. + * @param {AsyncCallback} callback - the {@link ResultSetV9} object if the operation is successful. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + query(table: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array, callback: AsyncCallback): void; + + /** + * Queries data in the database based on specified conditions. + * + * @param {string} table - Indicates the target table. + * @param {dataSharePredicates.DataSharePredicates} predicates - the specified query condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. + * @param {Array} columns - the columns to query. If the value is null, the query applies to all columns. + * @returns {Promise} return the {@link ResultSetV9} object if the operation is successful. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + query(table: string, predicates: dataSharePredicates.DataSharePredicates, columns?: Array): Promise; + + /** + * Queries remote data in the database based on specified conditions before Synchronizing Data. + * + * @param {string} device - Indicates specified remote device. + * @param {string} table - Indicates the target table. + * @param {RdbPredicatesV9} predicates - the specified remote remote query condition by the instance object of {@link RdbPredicatesV9}. + * @param {Array} columns - the columns to remote query. If the value is empty array, the remote query applies to all columns. + * @param {AsyncCallback} callback - the {@link ResultSetV9} object if the operation is successful. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + remoteQuery(device: string, table: string, predicates: RdbPredicatesV9, columns: Array, callback: AsyncCallback): void; + + /** + * Queries remote data in the database based on specified conditions before Synchronizing Data. + * + * @param {string} device - Indicates specified remote device. + * @param {string} table - Indicates the target table. + * @param {RdbPredicatesV9} predicates - the specified remote remote query condition by the instance object of {@link RdbPredicatesV9}. + * @param {Array} columns - the columns to remote query. If the value is empty array, the remote query applies to all columns. + * @returns {Promise} return the {@link ResultSetV9} object if the operation is successful. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + remoteQuery(device: string, table: string, predicates: RdbPredicatesV9, columns: Array): Promise; + + /** + * Queries data in the database based on SQL statement. + * + * @param {string} sql - Indicates the SQL statement to execute. + * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. + * @param {AsyncCallback} callback - the {@link ResultSetV9} object if the operation is successful. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + querySql(sql: string, bindArgs: Array, callback: AsyncCallback): void; + + /** + * Deletes data from the database based on a specified instance object of RdbPredicatesV9. + * + * @param {string} sql - Indicates the SQL statement to execute. + * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. + * @returns {Promise} return the {@link ResultSetV9} object if the operation is successful. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + querySql(sql: string, bindArgs?: Array): Promise; + + /** + * Executes an SQL statement that contains specified parameters but returns no value. + * + * @param {string} sql - Indicates the SQL statement to execute. + * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. + * @param {AsyncCallback} callback - the callback of executeSql. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + executeSql(sql: string, bindArgs: Array, callback: AsyncCallback): void; + + /** + * Executes an SQL statement that contains specified parameters but returns no value. + * + * @param {string} sql - Indicates the SQL statement to execute. + * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + executeSql(sql: string, bindArgs?: Array): Promise; + + /** + * beginTransaction before excute your sql. + * + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + beginTransaction():void; + + /** + * commit the the sql you have excuted. + * + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + commit():void; + + /** + * roll back the sql you have already excuted. + * + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + rollBack():void; + + /** + * Backs up a database in a specified name. + * + * @param {string} destName - Indicates the name that saves the database backup. + * @param {AsyncCallback} callback - the callback of backup. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + backup(destName:string, callback: AsyncCallback):void; + + /** + * Backs up a database in a specified name. + * + * @param {string} destName - Indicates the name that saves the database backup. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + backup(destName:string): Promise; + + /** + * Restores a database from a specified database file. + * + * @param {string} srcName - Indicates the name that saves the database file. + * @param {AsyncCallback} callback - the callback of restore. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + restore(srcName:string, callback: AsyncCallback):void; + + /** + * Restores a database from a specified database file. + * + * @param {string} srcName - Indicates the name that saves the database file. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + restore(srcName:string): Promise; + + /** + * Set table to be distributed table. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param {Array} tables - Indicates the tables name you want to set. + * @param {AsyncCallback} callback - the callback of setDistributedTables. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + setDistributedTables(tables: Array, callback: AsyncCallback): void; + + /** + * Set table to be distributed table. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param {Array} tables - Indicates the tables name you want to set. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + setDistributedTables(tables: Array): Promise; + + /** + * Obtain distributed table name of specified remote device according to local table name. + * When query remote device database, distributed table name is needed. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param {string} device - Indicates the remote device. + * @param {AsyncCallback} callback - {string}: the distributed table name. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + obtainDistributedTableName(device: string, table: string, callback: AsyncCallback): void; + + /** + * Obtain distributed table name of specified remote device according to local table name. + * When query remote device database, distributed table name is needed. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param {string} device - Indicates the remote device. + * @returns {Promise} {string}: the distributed table name. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + obtainDistributedTableName(device: string, table: string): Promise; + + /** + * Sync data between devices. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param {string} device - Indicates the remote device. + * @param {AsyncCallback>} callback - {Array<[string, number]>}: devices sync status array, {string}: device id, {number}: device sync status. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + sync(mode: SyncMode, predicates: RdbPredicatesV9, callback: AsyncCallback>): void; + + /** + * Sync data between devices. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param {string} device - Indicates the remote device. + * @returns {Promise>} {Array<[string, number]>}: devices sync status array, {string}: device id, {number}: device sync status. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + sync(mode: SyncMode, predicates: RdbPredicatesV9): Promise>; + + /** + * Registers an observer for the database. When data in the distributed database changes, + * the callback will be invoked. + * + * @param {string} event - Indicates the event must be string 'dataChange'. + * @param {SubscribeType} type - Indicates the subscription type, which is defined in {@link SubscribeType}. + * @param {AsyncCallback>} observer - {Array}: the observer of data change events in the distributed database. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + on(event: 'dataChange', type: SubscribeType, observer: Callback>): void; + + /** + * Remove specified observer of specified type from the database. + * + * @param {string} event - Indicates the event must be string 'dataChange'. + * @param {SubscribeType} type - Indicates the subscription type, which is defined in {@link SubscribeType}. + * @param {AsyncCallback>} observer - {Array}: the data change observer already registered. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + off(event:'dataChange', type: SubscribeType, observer: Callback>): void; + } + /** * Indicates possible value types * -- Gitee From 3964aa91a77d68ff5b74d6d29ed55c90b4b52566 Mon Sep 17 00:00:00 2001 From: zhancaijin Date: Wed, 12 Oct 2022 11:08:08 +0800 Subject: [PATCH 202/438] add dfx recovery api Signed-off-by: zhancaijin --- api/@ohos.application.Ability.d.ts | 12 ++ api/@ohos.application.AbilityConstant.d.ts | 29 +++++ api/@ohos.application.appRecovery.d.ts | 124 +++++++++++++++++++++ 3 files changed, 165 insertions(+) mode change 100755 => 100644 api/@ohos.application.Ability.d.ts create mode 100644 api/@ohos.application.appRecovery.d.ts diff --git a/api/@ohos.application.Ability.d.ts b/api/@ohos.application.Ability.d.ts old mode 100755 new mode 100644 index 99cfd35561..5654c5a7df --- a/api/@ohos.application.Ability.d.ts +++ b/api/@ohos.application.Ability.d.ts @@ -314,4 +314,16 @@ export default class Ability { * @StageModelOnly */ onMemoryLevel(level: AbilityConstant.MemoryLevel): void; + + /** + * Called back when an ability prepares to save. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @param reason state type when save. + * @param wantParam Indicates the want parameter. + * @return 0 if ability agrees to save data successfully, otherwise errcode. + * @StageModelOnly + */ + onSaveState(reason: AbilityConstant.StateType, wantParam : {[key: string]: any}): AbilityConstant.OnSaveResult; } diff --git a/api/@ohos.application.AbilityConstant.d.ts b/api/@ohos.application.AbilityConstant.d.ts index 2847a26649..425f2241fd 100644 --- a/api/@ohos.application.AbilityConstant.d.ts +++ b/api/@ohos.application.AbilityConstant.d.ts @@ -61,6 +61,7 @@ declare namespace AbilityConstant { START_ABILITY = 1, CALL = 2, CONTINUATION = 3, + APP_RECOVERY = 4, } /** @@ -116,6 +117,34 @@ declare namespace AbilityConstant { WINDOW_MODE_SPLIT_SECONDARY = 101, WINDOW_MODE_FLOATING = 102, } + + /** + * Type of onSave result. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + export enum OnSaveResult { + ALL_AGREE = 0, + CONTINUATION_REJECT = 1, + CONTINUATION_MISMATCH = 2, + RECOVERY_AGREE = 3, + RECOVERY_REJECT = 4, + ALL_REJECT, + } + + /** + * Type of save state. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + export enum StateType { + CONTINUATION = 0, + APP_RECOVERY = 1, + } } export default AbilityConstant diff --git a/api/@ohos.application.appRecovery.d.ts b/api/@ohos.application.appRecovery.d.ts new file mode 100644 index 0000000000..f5361534d1 --- /dev/null +++ b/api/@ohos.application.appRecovery.d.ts @@ -0,0 +1,124 @@ +/* + * 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. + */ + +/** + * This module provides the capability to app receovery. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AppReceovery + * @import appReceovery from '@ohos.appReceovery' + */ +declare namespace appReceovery { + /** + * The type of no restart mode. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AppReceovery + */ + enum RestartFlag { + /** + * NONE: no restart restrictions + */ + ALWAYS_RESTART = 0, + + /** + * CPP_CRASH_NO_RESTART: Do not restart if process terminates due to cpp exception + */ + CPP_CRASH_NO_RESTART = 0x0001, + + /** + * JS_CRASH_NO_RESTART: Do not restart if process terminates due to js/ts/ets exception + */ + JS_CRASH_NO_RESTART = 0x0002, + + /** + * APP_FREEZE_NO_RESTART: Do not restart if process terminates due to appliction not respondong + */ + APP_FREEZE_NO_RESTART = 0x0004, + + /** + * NO_RESTART: Do not restart + */ + NO_RESTART = 0xFFFF, + } + + /** + * The type of when to save. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AppReceovery + */ + enum SaveOccasionFlag { + /** + * SAVE_WHEN_ERROR is saving when an error occurs. + */ + SAVE_WHEN_ERROR = 0x0001, + + /** + * SAVE_WHEN_CREATE is saving on background. + */ + SAVE_WHEN_BACKGROUND = 0x0002, + } + + /** + * The type of where to save. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AppReceovery + */ + enum SaveModeFlag { + /** + * SAVE_WITH_FILE is saving to file. + */ + SAVE_WITH_FILE = 0x0001, + + /** + * SAVE_WITH_SHARED_MEMORY is saving to shared memory. + */ + SAVE_WITH_SHARED_MEMORY = 0x0002, + } + + /** + * Enable appRecovery and app supports save and restore + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AppReceovery + * @param restart no restart mode + * @param saveOccasion The type of When to save + * @param saveMode The type of where to save + * @StageModelOnly + */ + function enableAppRecovery(restart?: RestartFlag, saveOccasion?: SaveOccasionFlag, saveMode?: SaveModeFlag) : void; + + /** + * Restart App when called + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AppReceovery + */ + function restartApp(): void; + + /** + * Save App state data when called + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.AppReceovery + * @return true if save data successfully, otherwise false + * @StageModelOnly + */ + function saveAppState(): boolean; +} + +export default appReceovery; \ No newline at end of file -- Gitee From f1882983718ef7c7b4fdddcfaef7ad67c23309b4 Mon Sep 17 00:00:00 2001 From: wangqing Date: Thu, 20 Oct 2022 09:27:37 +0800 Subject: [PATCH 203/438] fix api check Signed-off-by: wangqing --- build-tools/api_check_plugin/entry.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/build-tools/api_check_plugin/entry.js b/build-tools/api_check_plugin/entry.js index 2bc25c700f..cc37411cf7 100644 --- a/build-tools/api_check_plugin/entry.js +++ b/build-tools/api_check_plugin/entry.js @@ -18,14 +18,23 @@ const fs = require("fs"); const { writeResultFile } = require('./src/utils'); function checkEntry(url) { - let result = "API CHECK FAILED!"; + let result = ""; + fs.access(url, fs.constants.R_OK | fs.constants.W_OK, (err) => { + const checkResult1 = err ? 'no access!' : 'can read/write'; + result += `checkResult1 = ${checkResult1} ||| ${url} ||| \n`; + }); const sourceDirname = __dirname; __dirname = "interface/sdk-js/build-tools/api_check_plugin"; try { const execSync = require("child_process").execSync; execSync("cd interface/sdk-js/build-tools/api_check_plugin && npm install"); + const path2 = path2 = path.resolve(sourceDirname, '../../../../', "ci_tool/ci_build/readme_file.txt"); + fs.access(path2, fs.constants.R_OK | fs.constants.W_OK, (err) => { + const checkResult2 = err ? 'no access!' : 'can read/write'; + result += `checkResult2 = ${checkResult2} ||| ${path2} ||| \n`; + }); const { scanEntry } = require(path.resolve(__dirname, "./src/api_check_plugin")); - result = scanEntry(url); + result += scanEntry(url); const content = fs.readFileSync(url, "utf-8"); result += `mdFilePath = ${url}, content = ${content}, __dirname = ${__dirname}, sourceDirname = ${sourceDirname}`; const { removeDir } = require(path.resolve(__dirname, "./src/utils")); -- Gitee From 123e0a5d438a50f9c0354f95078252e8d372e65b Mon Sep 17 00:00:00 2001 From: jiangkai43 Date: Tue, 6 Sep 2022 09:56:17 +0800 Subject: [PATCH 204/438] Add interface exception information https://gitee.com/openharmony/interface_sdk-js/issues/I5PR3T Signed-off-by: jiangkai43 --- api/@ohos.convertxml.d.ts | 22 +- api/@ohos.process.d.ts | 172 +++++-- api/@ohos.uri.d.ts | 26 +- api/@ohos.url.d.ts | 227 +++------ api/@ohos.util.d.ts | 978 +++++++++++++++++++++++++++++++++----- api/@ohos.xml.d.ts | 40 +- 6 files changed, 1132 insertions(+), 333 deletions(-) diff --git a/api/@ohos.convertxml.d.ts b/api/@ohos.convertxml.d.ts index c4f7dfc141..bf0cbe1192 100644 --- a/api/@ohos.convertxml.d.ts +++ b/api/@ohos.convertxml.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -138,16 +138,36 @@ declare namespace xml { elementsKey: string; } + /** + * ConvertXML representation refers to extensible markup language. + * @name ConvertXML + * @since 8 + * @syscap SystemCapability.Utils.Lang + */ class ConvertXML { /** * To convert XML text to JavaScript object. * @since 8 + * @deprecated since 9 + * @useinstead ohos.convertxml.ConvertXML.convertToJSObject * @syscap SystemCapability.Utils.Lang * @param xml The xml text to be converted. * @param option Option Inputted by user to set. * @return Returns a JavaScript object converting from XML text. */ convert(xml: string, options?: ConvertOptions) : Object; + + /** + * To convert XML text to JavaScript object. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param xml The xml text to be converted. + * @param option Option Inputted by user to set. + * @return Returns a JavaScript object converting from XML text. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200002 - Invalid xml string. + */ + convertToJSObject(xml: string, options?: ConvertOptions) : Object; } } export default xml; \ No newline at end of file diff --git a/api/@ohos.process.d.ts b/api/@ohos.process.d.ts index 39f8897d6e..875e6dd2c1 100644 --- a/api/@ohos.process.d.ts +++ b/api/@ohos.process.d.ts @@ -1,5 +1,5 @@ /* -* Copyright (c) 2021 Huawei Device Co., Ltd. +* Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -30,69 +30,70 @@ declare namespace process { */ export interface ChildProcess { /** - * return pid is the pid of the current process + * Return pid is the pid of the current process * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use - * @return return the pid of the current process. + * @return Return the pid of the current process. */ readonly pid: number; + /** - * return ppid is the pid of the current child process + * Return ppid is the pid of the current child process * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use - * @return return the pid of the current child process. + * @return Return the pid of the current child process. */ readonly ppid: number; /** - * return exitCode is the exit code of the current child process + * Return exitCode is the exit code of the current child process * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use - * @return return the exit code of the current child process. + * @return Return the exit code of the current child process. */ readonly exitCode: number; /** - * return boolean is whether the current process signal is sent successfully + * Return boolean is whether the current process signal is sent successfully * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use - * @return return whether the current process signal is sent successfully. + * @return Return whether the current process signal is sent successfully. */ readonly killed: boolean; /** - * return 'number' is the target process exit code + * Return 'number' is the target process exit code * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use - * @return return the target process exit code. + * @return Return the target process exit code. */ wait(): Promise; /** - * return it as 'Uint8Array' of the stdout until EOF + * Return it as 'Uint8Array' of the stdout until EOF * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use - * @return return subprocess standard outpute. + * @return Return subprocess standard outpute. */ getOutput(): Promise; /** - * return it as 'Uint8Array of the stderr until EOF + * Return it as 'Uint8Array of the stderr until EOF * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use - * @return return subprocess standard error output. + * @return Return subprocess standard error output. */ getErrorOutput(): Promise; /** - * close the target process + * Close the target process * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use @@ -100,73 +101,152 @@ declare namespace process { close(): void; /** - * send a signal to process + * Send a signal to process * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use - * @param signal number or string represents the signal sent. + * @param signal Number or string represents the signal sent. */ kill(signal: number | string): void; } /** - * returns the numeric valid group ID of the process + * Process is mainly used to obtain the relevant ID of the process, obtain and modify the + * working directory of the process, exit and close the process. + * @name ProcessManager + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + export class ProcessManager { + /** + * Returns a boolean whether the specified uid belongs to a particular application. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param v An id. + * @return Return a boolean whether the specified uid belongs to a particular application. + * @throws {BusinessError} 401 - The type of v must be number. + */ + isAppUid(v: number): boolean; + + /** + * Returns the uid based on the specified user name. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param v Process name. + * @return Return the uid based on the specified user name. + * @throws {BusinessError} 401 - The type of v must be string. + */ + getUidForName(v: string): number; + + /** + * Returns the thread priority based on the specified tid. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param v The tid of the process. + * @return Return the thread priority based on the specified tid. + * @throws {BusinessError} 401 - The type of v must be number. + */ + getThreadPriority(v: number): number; + + /** + * Returns the system configuration at runtime. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param name Parameters defined by the system configuration. + * @return Return the system configuration at runtime. + * @throws {BusinessError} 401 - The type of name must be number. + */ + getSystemConfig(name: number): number; + + /** + * Returns the system value for environment variables. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param name Parameters defined by the system environment variables. + * @Returns the system value for environment variables. + * @throws {BusinessError} 401 - The type of name must be string. + */ + getEnvironmentVar(name: string): string; + + /** + * Process exit + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param code Process exit code. + * @throws {BusinessError} 401 - The type of code must be number. + */ + exit(code: number): void; + + /** + * Return whether the signal was sent successfully + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param signal Signal sent. + * @param pid Send signal to target pid. + * @return Return the result of the signal. + * @throws {BusinessError} 401 - if the input parameters are invalid. + */ + kill(signal: number, pid: number): boolean; + } + + /** + * Returns the numeric valid group ID of the process * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use - * @return return the numeric valid group ID of the process. + * @return Return the numeric valid group ID of the process. */ const egid: number; /** - * return the numeric valid user identity of the process + * Return the numeric valid user identity of the process * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use - * @return return the numeric valid user identity of the process. + * @return Return the numeric valid user identity of the process. */ const euid: number; /** - * returns the numeric group id of the process + * Returns the numeric group id of the process * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use - * @return return the numeric group if of the process. + * @return Return the numeric group if of the process. */ const gid: number /** - * returns the digital user id of the process + * Returns the digital user id of the process * @since 7 * @syscap SystemCapability.Utils.Lang - * @return return the digital user id of the process. + * @return Return the digital user id of the process. */ const uid: number; /** - * return an array with supplementary group id + * Return an array with supplementary group id * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use - * @return return an array with supplementary group id. + * @return Return an array with supplementary group id. */ const groups: number[]; /** - * return pid is The pid of the current process + * Return pid is The pid of the current process * @since 7 * @syscap SystemCapability.Utils.Lang - * @return return The pid of the current process. + * @return Return The pid of the current process. */ const pid: number; /** - * return ppid is The pid of the current child process + * Return ppid is The pid of the current child process * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use - * @return return The pid of the current child process. + * @return Return The pid of the current child process. */ const ppid: number; @@ -174,7 +254,7 @@ declare namespace process { * Returns the tid of the current thread. * @since 8 * @syscap SystemCapability.Utils.Lang - * @return return the tid of the current thread. + * @return Return the tid of the current thread. */ const tid: number; @@ -182,16 +262,18 @@ declare namespace process { * Returns a boolean whether the process is isolated. * @since 8 * @syscap SystemCapability.Utils.Lang - * @return return boolean whether the process is isolated. + * @return Return boolean whether the process is isolated. */ function isIsolatedProcess(): boolean; /** * Returns a boolean whether the specified uid belongs to a particular application. * @since 8 + * @deprecated since 9 + * @useinstead ohos.process.ProcessManager.isAppUid * @syscap SystemCapability.Utils.Lang * @param v An id. - * @return return a boolean whether the specified uid belongs to a particular application. + * @return Return a boolean whether the specified uid belongs to a particular application. */ function isAppUid(v: number): boolean; @@ -199,22 +281,26 @@ declare namespace process { * Returns a boolean whether the process is running in a 64-bit environment. * @since 8 * @syscap SystemCapability.Utils.Lang - * @return return a boolean whether the process is running in a 64-bit environment. + * @return Return a boolean whether the process is running in a 64-bit environment. */ function is64Bit(): boolean; /** * Returns the uid based on the specified user name. * @since 8 + * @deprecated since 9 + * @useinstead ohos.process.ProcessManager.getUidForName * @syscap SystemCapability.Utils.Lang * @param v Process name. - * @return return the uid based on the specified user name. + * @return Return the uid based on the specified user name. */ function getUidForName(v: string): number; /** * Returns the thread priority based on the specified tid. * @since 8 + * @deprecated since 9 + * @useinstead ohos.process.ProcessManager.getThreadPriority * @syscap SystemCapability.Utils.Lang * @param v The tid of the process. * @return Return the thread priority based on the specified tid. @@ -240,6 +326,8 @@ declare namespace process { /** * Returns the system configuration at runtime. * @since 8 + * @deprecated since 9 + * @useinstead ohos.process.ProcessManager.getSystemConfig * @syscap SystemCapability.Utils.Lang * @param name Parameters defined by the system configuration. * @return Return the system configuration at runtime. @@ -249,6 +337,8 @@ declare namespace process { /** * Returns the system value for environment variables. * @since 8 + * @deprecated since 9 + * @useinstead ohos.process.ProcessManager.getEnvironmentVar * @syscap SystemCapability.Utils.Lang * @param name Parameters defined by the system environment variables. * @Returns the system value for environment variables. @@ -260,7 +350,7 @@ declare namespace process { * Return a child process object and spawns a new ChildProcess to run the command * @since 7 * @syscap SystemCapability.Utils.Lang - * @param command string of the shell commands executed by the child process. + * @param command String of the shell commands executed by the child process. * @param options This is an object. The object contains three parameters. Timeout is the running time of the child * process, killSignal is the signal sent when the child process reaches timeout, and maxBuffer is the size of the * maximum buffer area for standard input and output. @@ -300,6 +390,8 @@ declare namespace process { /** * Process exit * @since 7 + * @deprecated since 9 + * @useinstead ohos.process.ProcessManager.exit * @syscap SystemCapability.Utils.Lang * @param code Process exit code. */ @@ -315,7 +407,7 @@ declare namespace process { function cwd(): string; /** - * Change current directory + * Change current directory * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use @@ -334,6 +426,8 @@ declare namespace process { /** * Return whether the signal was sent successfully * @since 7 + * @deprecated since 9 + * @useinstead ohos.process.ProcessManager.kill * @syscap SystemCapability.Utils.Lang * @param signal Signal sent. * @param pid Send signal to target pid. diff --git a/api/@ohos.uri.d.ts b/api/@ohos.uri.d.ts index 12b6b22306..7778407067 100644 --- a/api/@ohos.uri.d.ts +++ b/api/@ohos.uri.d.ts @@ -1,5 +1,5 @@ /* -* Copyright (c) 2021 Huawei Device Co., Ltd. +* Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -21,10 +21,18 @@ * @permission N/A */ declare namespace uri { + + /** + * URI Represents a Uniform Resource Identifier (URI) reference. + * @name URI + * @since 8 + * @syscap SystemCapability.Utils.Lang + */ class URI { /** * URI constructor, which is used to instantiate a URI object. * uri: Constructs a URI by parsing a given string. + * @throws {BusinessError} 401 - if the input parameters are invalid. */ constructor(uri: string); @@ -34,17 +42,29 @@ declare namespace uri { * @syscap SystemCapability.Utils.Lang * @return Returns the serialized URI as a string. */ - toString(): string + toString(): string; /** - * Tests whether this URI is equivalent to other URI objects. + * Check whether this URI is equivalent to other URI objects. * @since 8 + * @deprecated since 9 + * @useinstead ohos.uri.URI.equalsTo * @syscap SystemCapability.Utils.Lang * @param other URI object to be compared * @return boolean Tests whether this URI is equivalent to other URI objects. */ equals(other: URI): boolean; + /** + * Check whether this URI is equivalent to other URI objects. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param other URI object to be compared + * @return boolean Tests whether this URI is equivalent to other URI objects. + * @throws {BusinessError} 10200002 - The type of other must be URI. + */ + equalsTo(other: URI): boolean; + /** * Indicates whether this URI is an absolute URI. * @since 8 diff --git a/api/@ohos.url.d.ts b/api/@ohos.url.d.ts index 3fb05fe8aa..80d25e6c6d 100644 --- a/api/@ohos.url.d.ts +++ b/api/@ohos.url.d.ts @@ -15,14 +15,20 @@ /** * The url module provides utilities for URL resolution and parsing. - * @since 9 + * @since 7 * @syscap SystemCapability.Utils.Lang * @import import url from '@ohos.url'; * @permission N/A */ - -declare namespace util.url { - // @deprecated since 9 +declare namespace url { + /** + * The URLSearchParams interface defines some practical methods to process URL query strings. + * @name URLSearchParams + * @since 7 + * @deprecated since 9 + * @useinstead ohos.url.URLParams + * @syscap SystemCapability.Utils.Lang + */ class URLSearchParams { /** * A parameterized constructor used to create an URLSearchParams instance. @@ -32,6 +38,7 @@ declare namespace util.url { * The input parameter is a character string. * The input parameter is the URLSearchParams object. * @deprecated since 9 + * @useinstead ohos.url.URLParams.constructor */ constructor(init?: string[][] | Record | string | URLSearchParams); @@ -39,6 +46,7 @@ declare namespace util.url { * Appends a specified key/value pair as a new search parameter. * @since 7 * @deprecated since 9 + * @useinstead ohos.url.URLParams.append * @syscap SystemCapability.Utils.Lang * @param name Key name of the search parameter to be inserted. * @param value Values of search parameters to be inserted. @@ -49,8 +57,9 @@ declare namespace util.url { * Deletes the given search parameter and its associated value,from the list of all search parameters. * @since 7 * @deprecated since 9 + * @useinstead ohos.url.URLParams.delete * @syscap SystemCapability.Utils.Lang - * @param Name of the key-value pair to be deleted. + * @param name Name of the key-value pair to be deleted. */ delete(name: string): void; @@ -58,8 +67,9 @@ declare namespace util.url { * Returns all key-value pairs associated with a given search parameter as an array. * @since 7 * @deprecated since 9 + * @useinstead ohos.url.URLParams.getAll * @syscap SystemCapability.Utils.Lang - * @param Name Specifies the name of a key value. + * @param name Specifies the name of a key value. * @return string[] Returns all key-value pairs with the specified name. */ getAll(name: string): string[]; @@ -69,15 +79,17 @@ declare namespace util.url { * The first item of Array is name, and the second item of Array is value. * @since 7 * @deprecated since 9 + * @useinstead ohos.url.URLParams.entries * @syscap SystemCapability.Utils.Lang * @return Returns an iterator for ES6. */ - entries(): IterableIterator<[string, string]>; + entries(): IterableIterator<[string, string]>; /** * Callback functions are used to traverse key-value pairs on the URLSearchParams instance object. * @since 7 * @deprecated since 9 + * @useinstead ohos.url.URLParams.forEach * @syscap SystemCapability.Utils.Lang * @param value Current traversal key value. * @param key Indicates the name of the key that is traversed. @@ -90,6 +102,7 @@ declare namespace util.url { * Returns the first value associated to the given search parameter. * @since 7 * @deprecated since 9 + * @useinstead ohos.url.URLParams.get * @syscap SystemCapability.Utils.Lang * @param name Specifies the name of a key-value pair. * @return Returns the first value found by name. If no value is found, null is returned. @@ -100,6 +113,7 @@ declare namespace util.url { * Returns a Boolean that indicates whether a parameter with the specified name exists. * @since 7 * @deprecated since 9 + * @useinstead ohos.url.URLParams.has * @syscap SystemCapability.Utils.Lang * @param name Specifies the name of a key-value pair. * @return Returns a Boolean value that indicates whether a found @@ -113,6 +127,7 @@ declare namespace util.url { * method creates it. * @since 7 * @deprecated since 9 + * @useinstead ohos.url.URLParams.set * @syscap SystemCapability.Utils.Lang * @param name Key name of the parameter to be set. * @param value Indicates the parameter value to be set. @@ -123,6 +138,7 @@ declare namespace util.url { * Sort all key/value pairs contained in this object in place and return undefined. * @since 7 * @deprecated since 9 + * @useinstead ohos.url.URLParams.sort * @syscap SystemCapability.Utils.Lang */ sort(): void; @@ -131,6 +147,7 @@ declare namespace util.url { * Returns an iterator allowing to go through all keys contained in this object. * @since 7 * @deprecated since 9 + * @useinstead ohos.url.URLParams.keys * @syscap SystemCapability.Utils.Lang * @return Returns an ES6 Iterator over the names of each name-value pair. */ @@ -140,6 +157,7 @@ declare namespace util.url { * Returns an iterator allowing to go through all values contained in this object. * @since 7 * @deprecated since 9 + * @useinstead ohos.url.URLParams.values * @syscap SystemCapability.Utils.Lang * @return Returns an ES6 Iterator over the values of each name-value pair. */ @@ -150,6 +168,7 @@ declare namespace util.url { * pairs contained in this object. * @since 7 * @deprecated since 9 + * @useinstead ohos.url.URLParams.[Symbol.iterator] * @syscap SystemCapability.Utils.Lang * @return Returns an ES6 iterator. Each item of the iterator is a JavaScript Array. * The first item of Array is name, and the second item of Array is value. @@ -160,13 +179,20 @@ declare namespace util.url { * Returns a query string suitable for use in a URL. * @since 7 * @deprecated since 9 + * @useinstead ohos.url.URLParams.toString * @syscap SystemCapability.Utils.Lang * @return Returns a search parameter serialized as a string, percent-encoded if necessary. */ toString(): string; } - class URLSearchParamsV9 { + /** + * The URLParams interface defines some practical methods to process URL query strings. + * @name URLParams + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + class URLParams { /** * A parameterized constructor used to create an URLSearchParams instance. * As the input parameter of the constructor function, init supports four types. @@ -175,7 +201,8 @@ declare namespace util.url { * The input parameter is a character string. * The input parameter is the URLSearchParams object. * @since 9 - * @throws {TypedError} Parameter check failed. + * @throws {BusinessError} 401 - The type of init must be string two-dimensional array or object list + * or string or URLSearchParams object. */ constructor(init?: string[][] | Record | string | URLSearchParams); @@ -185,7 +212,7 @@ declare namespace util.url { * @syscap SystemCapability.Utils.Lang * @param name Key name of the search parameter to be inserted. * @param value Values of search parameters to be inserted. - * @throws {TypedError} Parameter check failed. + * @throws {BusinessError} 401 - if the input parameters are invalid. */ append(name: string, value: string): void; @@ -193,8 +220,8 @@ declare namespace util.url { * Deletes the given search parameter and its associated value,from the list of all search parameters. * @since 9 * @syscap SystemCapability.Utils.Lang - * @param Name of the key-value pair to be deleted. - * @throws {TypedError} Parameter check failed. + * @param name Name of the key-value pair to be deleted. + * @throws {BusinessError} 401 - The type of name must be string. */ delete(name: string): void; @@ -202,9 +229,9 @@ declare namespace util.url { * Returns all key-value pairs associated with a given search parameter as an array. * @since 9 * @syscap SystemCapability.Utils.Lang - * @param Name Specifies the name of a key value. + * @param name Specifies the name of a key value. * @return string[] Returns all key-value pairs with the specified name. - * @throws {TypedError} Parameter check failed. + * @throws {BusinessError} 401 - The type of name must be string. */ getAll(name: string): string[]; @@ -215,7 +242,7 @@ declare namespace util.url { * @syscap SystemCapability.Utils.Lang * @return Returns an iterator for ES6. */ - entries(): IterableIterator<[string, string]>; + entries(): IterableIterator<[string, string]>; /** * Callback functions are used to traverse key-value pairs on the URLSearchParams instance object. @@ -225,7 +252,7 @@ declare namespace util.url { * @param key Indicates the name of the key that is traversed. * @param searchParams The instance object that is currently calling the forEach method. * @param thisArg to be used as this value for when callbackfn is called - * @throws {TypedError} Parameter check failed. + * @throws {BusinessError} 401 - if the input parameters are invalid. */ forEach(callbackfn: (value: string, key: string, searchParams: this) => void, thisArg?: Object): void; @@ -235,7 +262,7 @@ declare namespace util.url { * @syscap SystemCapability.Utils.Lang * @param name Specifies the name of a key-value pair. * @return Returns the first value found by name. If no value is found, null is returned. - * @throws {TypedError} Parameter check failed. + * @throws {BusinessError} 401 - The type of name must be string. */ get(name: string): string | null; @@ -245,7 +272,7 @@ declare namespace util.url { * @syscap SystemCapability.Utils.Lang * @param name Specifies the name of a key-value pair. * @return Returns a Boolean value that indicates whether a found - * @throws {TypedError} Parameter check failed. + * @throws {BusinessError} 401 - The type of name must be string. */ has(name: string): boolean; @@ -258,7 +285,7 @@ declare namespace util.url { * @syscap SystemCapability.Utils.Lang * @param name Key name of the parameter to be set. * @param value Indicates the parameter value to be set. - * @throws {TypedError} Parameter check failed. + * @throws {BusinessError} 401 - if the input parameters are invalid. */ set(name: string, value: string): void; @@ -303,22 +330,44 @@ declare namespace util.url { */ toString(): string; } - - // @deprecated since 9 + + /** + * The interface of URL is used to parse, construct, normalize, and encode URLs. + * @name URL + * @since 7 + * @syscap SystemCapability.Utils.Lang + */ class URL { - /** + /** * URL constructor, which is used to instantiate a URL object. * url: Absolute or relative input URL to resolve. Base is required if input is relative. * If input is an absolute value, base ignores the value. * base: Base URL to parse if input is not absolute. + * @since 7 * @deprecated since 9 + * @useinstead ohos.URL.constructor */ constructor(url: string, base?: string | URL); + /** + * URL constructor, which is used to instantiate a URL object. + * @since 9 + */ + constructor(); + + /** + * Check the validity of parameters + * url: Absolute or relative input URL to resolve. Base is required if input is relative. + * If input is an absolute value, base ignores the value. + * base: Base URL to parse if input is not absolute. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200002 - Invalid url string. + */ + static parseURL(url: string, base?: string | URL): URL; + /** * Returns the serialized URL as a string. * @since 7 - * @deprecated since 9 * @syscap SystemCapability.Utils.Lang * @return Returns the serialized URL as a string. */ @@ -327,7 +376,6 @@ declare namespace util.url { /** * Returns the serialized URL as a string. * @since 7 - * @deprecated since 9 * @syscap SystemCapability.Utils.Lang * @return Returns the serialized URL as a string. */ @@ -336,7 +384,6 @@ declare namespace util.url { /** * Gets and sets the fragment portion of the URL. * @since 7 - * @deprecated since 9 * @syscap SystemCapability.Utils.Lang */ hash: string; @@ -344,7 +391,6 @@ declare namespace util.url { /** * Gets and sets the host portion of the URL. * @since 7 - * @deprecated since 9 * @syscap SystemCapability.Utils.Lang */ host: string; @@ -352,7 +398,6 @@ declare namespace util.url { /** * Gets and sets the host name portion of the URL,not include the port. * @since 7 - * @deprecated since 9 * @syscap SystemCapability.Utils.Lang */ hostname: string; @@ -360,7 +405,6 @@ declare namespace util.url { /** * Gets and sets the serialized URL. * @since 7 - * @deprecated since 9 * @syscap SystemCapability.Utils.Lang */ href: string; @@ -368,7 +412,6 @@ declare namespace util.url { /** * Gets the read-only serialization of the URL's origin. * @since 7 - * @deprecated since 9 * @syscap SystemCapability.Utils.Lang */ readonly origin: string; @@ -376,7 +419,6 @@ declare namespace util.url { /** * Gets and sets the password portion of the URL. * @since 7 - * @deprecated since 9 * @syscap SystemCapability.Utils.Lang */ password: string; @@ -384,7 +426,6 @@ declare namespace util.url { /** * Gets and sets the path portion of the URL. * @since 7 - * @deprecated since 9 * @syscap SystemCapability.Utils.Lang */ pathname: string; @@ -392,7 +433,6 @@ declare namespace util.url { /** * Gets and sets the port portion of the URL. * @since 7 - * @deprecated since 9 * @syscap SystemCapability.Utils.Lang */ port: string; @@ -400,7 +440,6 @@ declare namespace util.url { /** * Gets and sets the protocol portion of the URL. * @since 7 - * @deprecated since 9 * @syscap SystemCapability.Utils.Lang */ protocol: string; @@ -408,7 +447,6 @@ declare namespace util.url { /** * Gets and sets the serialized query portion of the URL. * @since 7 - * @deprecated since 9 * @syscap SystemCapability.Utils.Lang */ search: string; @@ -422,134 +460,15 @@ declare namespace util.url { * @note Be careful when modifying with .searchParams, because the URLSearchParams * object uses different rules to determine which characters to * percent-encode according to the WHATWG specification. - * @deprecated since 9 */ readonly searchParams: URLSearchParams; /** * Gets and sets the username portion of the URL. * @since 7 - * @deprecated since 9 - * @syscap SystemCapability.Utils.Lang - */ - username: string; - } - - class URLV9 { - /** - * URL constructor, which is used to instantiate a URL object. - * url: Absolute or relative input URL to resolve. Base is required if input is relative. - * If input is an absolute value, base ignores the value. - * base: Base URL to parse if input is not absolute. - * @since 9 - * @throws {TypedError} Parameter check failed. - */ - constructor(url: string, base?: string | URL); - - /** - * Returns the serialized URL as a string. - * @since 9 - * @syscap SystemCapability.Utils.Lang - * @return Returns the serialized URL as a string. - */ - toString(): string; - - /** - * Returns the serialized URL as a string. - * @since 9 - * @syscap SystemCapability.Utils.Lang - * @return Returns the serialized URL as a string. - */ - toJSON(): string; - - /** - * Gets and sets the fragment portion of the URL. - * @since 9 - * @syscap SystemCapability.Utils.Lang - */ - hash: string; - - /** - * Gets and sets the host portion of the URL. - * @since 9 - * @syscap SystemCapability.Utils.Lang - */ - host: string; - - /** - * Gets and sets the host name portion of the URL,not include the port. - * @since 9 - * @syscap SystemCapability.Utils.Lang - */ - hostname: string; - - /** - * Gets and sets the serialized URL. - * @since 9 - * @syscap SystemCapability.Utils.Lang - */ - href: string; - - /** - * Gets the read-only serialization of the URL's origin. - * @since 9 - * @syscap SystemCapability.Utils.Lang - */ - readonly origin: string; - - /** - * Gets and sets the password portion of the URL. - * @since 9 - * @syscap SystemCapability.Utils.Lang - */ - password: string; - - /** - * Gets and sets the path portion of the URL. - * @since 9 - * @syscap SystemCapability.Utils.Lang - */ - pathname: string; - - /** - * Gets and sets the port portion of the URL. - * @since 9 - * @syscap SystemCapability.Utils.Lang - */ - port: string; - - /** - * Gets and sets the protocol portion of the URL. - * @since 9 - * @syscap SystemCapability.Utils.Lang - */ - protocol: string; - - /** - * Gets and sets the serialized query portion of the URL. - * @since 9 - * @syscap SystemCapability.Utils.Lang - */ - search: string; - - /** - * Gets the URLSearchParams object that represents the URL query parameter. - * This property is read-only, but URLSearchParams provides an object that can be used to change - * the URL instance. To replace the entire query parameter for a URL, use url.searchsetter. - * @since 9 - * @syscap SystemCapability.Utils.Lang - * @note Be careful when modifying with .searchParams, because the URLSearchParams - * object uses different rules to determine which characters to - * percent-encode according to the WHATWG specification. - */ - readonly searchParams: URLSearchParams; - - /** - * Gets and sets the username portion of the URL. - * @since 9 * @syscap SystemCapability.Utils.Lang */ username: string; } } -export default util.url; \ No newline at end of file +export default url; \ No newline at end of file diff --git a/api/@ohos.util.d.ts b/api/@ohos.util.d.ts index f4202b0e73..71a15492b2 100644 --- a/api/@ohos.util.d.ts +++ b/api/@ohos.util.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -39,28 +39,69 @@ declare namespace util { * %c: CSS. This specifier is ignored and will skip any CSS passed in. * %%: single percent sign ('%'). This does not consume an argument.Returns: The formatted string. * @since 7 + * @deprecated since 9 + * @useinstead ohos.util.format * @syscap SystemCapability.Utils.Lang - * @param format styled string - * @param args data to be formatted + * @param format Styled string + * @param args Data to be formatted * @return Return the character string formatted in a specific format */ function printf(format: string, ...args: Object[]): string; + /** + * %s: String will be used to convert all values except BigInt, Object and -0. BigInt values will be represented + * with an n and Objects that have no user defined toString function are inspected using util.inspect() with + * options { depth: 0, colors: false, compact: 3 }. + * %d: Number will be used to convert all values except BigInt and Symbol. + * %i: parseInt(value, 10) is used for all values except BigInt and Symbol. + * %f: parseFloat(value) is used for all values except Bigint and Symbol. + * %j: JSON. Replaced with the string '[Circular]' if the argument contains circular references. + * %o: Object. A string representation of an object with generic JavaScript object formatting.Similar to + * util.inspect() with options { showHidden: true, showProxy: true}. This will show the full object including + * non-enumerable properties and proxies. + * %O: Object. A string representation of an object with generic JavaScript object formatting. + * %O: Object. A string representation of an object with generic JavaScript object formatting.Similar to + * util.inspect() without options. This will show the full object not including non-enumerable properties and + * proxies. + * %c: CSS. This specifier is ignored and will skip any CSS passed in. + * %%: single percent sign ('%'). This does not consume an argument.Returns: The formatted string. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param format Styled string + * @param args Data to be formatted + * @return Return the character string formatted in a specific format + * @throws {BusinessError} 401 - if the input parameters are invalid. + */ + function format(format: string, ...args: Object[]): string; + /** * Get the string name of the system errno. * @since 7 + * @deprecated since 9 + * @useinstead ohos.util.errnoToString * @syscap SystemCapability.Utils.Lang - * @param errno the error code generated by an error in the system - * @return return the string name of a system errno + * @param errno The error code generated by an error in the system + * @return Return the string name of a system errno */ function getErrorString(errno: number): string; + /** + * Get the string name of the system errno. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param errno The error code generated by an error in the system + * @return Return the string name of a system errno + * @throws {BusinessError} 401 - The type of errno must be number. + */ + function errnoToString(errno: number): string; + /** * Takes an async function (or a function that returns a Promise) and returns a function following the * error-first callback style. * @since 7 * @syscap SystemCapability.Utils.Lang - * @param original asynchronous function + * @param original Asynchronous function + * @throws {BusinessError} 401 - The type of original must be Function. */ function callbackWrapper(original: Function): (err: Object, value: Object) => void; @@ -69,52 +110,63 @@ declare namespace util { * callback as the last argument, and return a function that returns promises. * @since 9 * @syscap SystemCapability.Utils.Lang - * @param original asynchronous function - * @return return a function that returns promises + * @param original Asynchronous function + * @return Return a function that returns promises + * @throws {BusinessError} 401 - The type of original must be Function. */ - function promisify(original: (err: Object, value: Object) => void): Function; + function promisify(original: (err: Object, value: Object) => void): Function; /** * Takes a function following the common error-first callback style, i.e taking an (err, value) => * callback as the last argument, and return a version that returns promises. * @since 7 * @deprecated since 9 + * @useinstead ohos.util.promisify * @syscap SystemCapability.Utils.Lang - * @param original asynchronous function - * @return return a version that returns promises + * @param original Asynchronous function + * @return Return a version that returns promises */ function promiseWrapper(original: (err: Object, value: Object) => void): Object; - + /** - * Generate a random RFC 4122 version 4 UUID using a cryptographically secure random number generator. - * @since 9 - * @syscap SystemCapability.Utils.Lang - * @param entropyCache whether to generate the UUID with using the cache. Default: true. - * @return return a string representing this UUID. - */ + * Generate a random RFC 4122 version 4 UUID using a cryptographically secure random number generator. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param entropyCache Whether to generate the UUID with using the cache. Default: true. + * @return Return a string representing this UUID. + * @throws {BusinessError} 401 - The type of entropyCache must be boolean. + */ function randomUUID(entropyCache?: boolean): string; /** - * Generate a random RFC 4122 version 4 UUID using a cryptographically secure random number generator. - * @since 9 - * @syscap SystemCapability.Utils.Lang - * @param entropyCache whether to generate the UUID with using the cache. Default: true. - * @return return a Uint8Array representing this UUID. - */ + * Generate a random RFC 4122 version 4 UUID using a cryptographically secure random number generator. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param entropyCache Whether to generate the UUID with using the cache. Default: true. + * @return Return a Uint8Array representing this UUID. + * @throws {BusinessError} 401 - The type of entropyCache must be boolean. + */ function randomBinaryUUID(entropyCache?: boolean): Uint8Array; /** - * Parse a UUID from the string standard representation as described in the RFC 4122 version 4. - * @since 9 - * @syscap SystemCapability.Utils.Lang - * @param uuid string that specifies a UUID - * @return return a Uint8Array representing this UUID. Throw SyntaxError if parsing fails. - */ + * Parse a UUID from the string standard representation as described in the RFC 4122 version 4. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param uuid String that specifies a UUID + * @return Return a Uint8Array representing this UUID. Throw SyntaxError if parsing fails. + * @throws {BusinessError} 401 - The type of uuid must be string. + */ function parseUUID(uuid: string): Uint8Array; + /** + * The TextEncoder represents a text encoder that accepts a string as input, + * encodes it in UTF-8 format, and outputs UTF-8 byte stream. + * @syscap SystemCapability.Utils.Lang + * @since 7 + */ class TextDecoder { /** - * the source encoding's name, lowercased. + * The source encoding's name, lowercased. * @since 7 * @syscap SystemCapability.Utils.Lang */ @@ -135,22 +187,45 @@ declare namespace util { readonly ignoreBOM = false; /** - * the textEncoder constructor. - * @param 7 + * The textEncoder constructor. + * @since 7 + * @deprecated since 9 + * @useinstead ohos.util.constructor * @syscap SystemCapability.Utils.Lang - * @param encoding decoding format + * @param encoding Decoding format */ constructor( encoding?: string, options?: { fatal?: boolean; ignoreBOM?: boolean }, ); + /** + * The textEncoder constructor. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + constructor(); + + /** + * Check the validity of parameters. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param encoding Decoding format + * @throws {BusinessError} 401 - if the input parameters are invalid. + */ + static create( + encoding?: string, + options?: { fatal?: boolean; ignoreBOM?: boolean }, + ): TextDecoder; + /** * Returns the result of running encoding's decoder. * @since 7 + * @deprecated since 9 + * @useinstead ohos.util.decodeWithStream * @syscap SystemCapability.Utils.Lang - * @param input decoded numbers in accordance with the format - * @return return decoded text + * @param input Decoded numbers in accordance with the format + * @return Return decoded text */ decode(input: Uint8Array, options?: { stream?: false }): string; @@ -158,12 +233,19 @@ declare namespace util { * Returns the result of running encoding's decoder. * @since 9 * @syscap SystemCapability.Utils.Lang - * @param input decoded numbers in accordance with the format - * @return return decoded text + * @param input Decoded numbers in accordance with the format + * @return Return decoded text + * @throws {BusinessError} 401 - if the input parameters are invalid. */ - decodeWithStream(input: Uint8Array, options?: { stream?: boolean }): string; + decodeWithStream(input: Uint8Array, options?: { stream?: boolean }): string; } + /** + * The TextDecoder interface represents a text decoder. + * The decoder takes the byte stream as the input and outputs the String string. + * @syscap SystemCapability.Utils.Lang + * @since 7 + */ class TextEncoder { /** * Encoding format. @@ -173,36 +255,51 @@ declare namespace util { readonly encoding = "utf-8"; /** - * the textEncoder constructor. + * The textEncoder constructor. * @since 7 * @syscap SystemCapability.Utils.Lang */ constructor(); /** - * the textEncoder constructor. + * The textEncoder constructor. * @since 9 * @syscap SystemCapability.Utils.Lang * @param encoding The string for encoding format. + * @throws {BusinessError} 401 - The type of encoding must be string. */ constructor(encoding?: string); /** * Returns the result of encoder. * @since 7 + * @deprecated since 9 + * @useinstead ohos.util.encodeInto * @syscap SystemCapability.Utils.Lang - * @param The string to be encoded. - * @return returns the encoded text. + * @param input The string to be encoded. + * @return Returns the encoded text. */ encode(input?: string): Uint8Array; /** - * encode string, write the result to dest array. + * Returns the result of encoder. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param input The string to be encoded. + * @return Returns the encoded text. + * @throws {BusinessError} 401 - The type of input must be string. + */ + encodeInto(input?: string): Uint8Array; + + /** + * Encode string, write the result to dest array. * @since 7 + * @deprecated since 9 + * @useinstead ohos.util.encodeIntoUint8Array * @syscap SystemCapability.Utils.Lang * @param input The string to be encoded. - * @param dest decoded numbers in accordance with the format - * @return returns Returns the object, where read represents + * @param dest Decoded numbers in accordance with the format + * @return Returns Returns the object, where read represents * the number of characters that have been encoded, and written * represents the number of bytes occupied by the encoded characters. */ @@ -210,41 +307,98 @@ declare namespace util { input: string, dest: Uint8Array, ): { read: number; written: number }; - } + /** + * Encode string, write the result to dest array. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param input The string to be encoded. + * @param dest Decoded numbers in accordance with the format + * @return Returns Returns the object, where read represents + * the number of characters that have been encoded, and written + * represents the number of bytes occupied by the encoded characters. + * @throws {BusinessError} 401 - if the input parameters are invalid. + */ + encodeIntoUint8Array( + input: string, + dest: Uint8Array, + ): { read: number; written: number }; + } + + /** + * The rational number is mainly to compare rational numbers and obtain the numerator and denominator. + * @syscap SystemCapability.Utils.Lang + * @since 8 + */ class RationalNumber { /** * A constructor used to create a RationalNumber instance with a given numerator and denominator. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.constructor * @syscap SystemCapability.Utils.Lang * @param numerator An integer number * @param denominator An integer number */ constructor(numerator: number, denominator: number); + + /** + * A constructor used to create a RationalNumber instance with a given numerator and denominator. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + constructor(); + + /** + * Check the validity of parameters. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param numerator An integer number + * @param denominator An integer number + * @throws {BusinessError} 401 - if the input parameters are invalid. + */ + static parseRationalNumber(numerator: number, denominator: number): RationalNumber; + /** * Creates a RationalNumber object based on a given string. * @since 8 * @syscap SystemCapability.Utils.Lang - * @param String Expression of Rational Numbers + * @param rationalString String Expression of Rational Numbers * @return Returns a RationalNumber object generated based on the given string. + * @throws {BusinessError} 401 - The type of rationalString must be string. */ static createRationalFromString(rationalString: string): RationalNumber​; + /** * Compares the current RationalNumber object to the given object. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.compare * @syscap SystemCapability.Utils.Lang - * @param An object of other rational numbers + * @param another An object of other rational numbers * @return Returns 0 or 1, or -1, depending on the comparison. */ compareTo(another :RationalNumber): number; + + /** + * Compares the current RationalNumber object to the given object. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param another An object of other rational numbers + * @return Returns 0 or 1, or -1, depending on the comparison. + * @throws {BusinessError} 401 - The type of another must be RationalNumber. + */ + compare(another :RationalNumber): number; + /** * Compares two objects for equality. * @since 8 * @syscap SystemCapability.Utils.Lang - * @param An object + * @param obj An object * @return Returns true if the given object is the same as the current object; Otherwise, false is returned. */ equals(obj: Object): boolean; + /** * Gets integer and floating-point values of a rational number object. * @since 8 @@ -252,15 +406,30 @@ declare namespace util { * @return Returns the integer and floating-point values of a rational number object. */ valueOf(): number; + /** * Get the greatest common divisor of two integers. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.getCommonFactor * @syscap SystemCapability.Utils.Lang - * @param number1 is an integer. - * @param number2 is an integer. + * @param number1 Is an integer. + * @param number2 Is an integer. * @return Returns the greatest common divisor of two integers, integer type. */ static getCommonDivisor(number1: number, number2: number): number; + + /** + * Get the greatest common divisor of two integers. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param number1 Is an integer. + * @param number2 Is an integer. + * @return Returns the greatest common divisor of two integers, integer type. + * @throws {BusinessError} 401 - if the input parameters are invalid. + */ + static getCommonFactor(number1: number, number2: number): number; + /** * Gets the denominator of the current object. * @since 8 @@ -268,6 +437,7 @@ declare namespace util { * @return Returns the denominator of the current object. */ getDenominator(): number; + /** * Gets the numerator​ of the current object. * @since 8 @@ -275,13 +445,15 @@ declare namespace util { * @return Returns the numerator​ of the current object. */ getNumerator(): number; + /** * Checks whether the current RationalNumber object represents an infinite value. * @since 8 * @syscap SystemCapability.Utils.Lang * @return If the denominator is not 0, true is returned. Otherwise, false is returned. */ - isFinite() : boolean; + isFinite(): boolean; + /** * Checks whether the current RationalNumber object represents a Not-a-Number (NaN) value. * @since 8 @@ -289,6 +461,7 @@ declare namespace util { * @return If both the denominator and numerator are 0, true is returned. Otherwise, false is returned. */ isNaN(): boolean; + /** * Checks whether the current RationalNumber object represents the value 0. * @since 8 @@ -296,6 +469,7 @@ declare namespace util { * @return If the value represented by the current object is 0, true is returned. Otherwise, false is returned. */ isZero(): boolean; + /** * Obtains a string representation of the current RationalNumber object. * @since 8 @@ -305,132 +479,192 @@ declare namespace util { toString(): string; } + /** + * The LruBuffer algorithm replaces the least used data with new data when the buffer space is insufficient. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache + */ class LruBuffer { /** * Default constructor used to create a new LruBuffer instance with the default capacity of 64. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.constructor * @syscap SystemCapability.Utils.Lang * @param capacity Indicates the capacity to customize for the buffer. */ - constructor(capacity?:number); + constructor(capacity?: number); + /** * Updates the buffer capacity to a specified capacity. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.updateCapacity * @syscap SystemCapability.Utils.Lang * @param newCapacity Indicates the new capacity to set. */ updateCapacity(newCapacity: number):void + /** - *Returns a string representation of the object. + * Returns a string representation of the object. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.toString * @syscap SystemCapability.Utils.Lang * @return Returns the string representation of the object and outputs the string representation of the object. */ - toString():string + toString(): string + /** * Obtains a list of all values in the current buffer. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.length * @syscap SystemCapability.Utils.Lang * @return Returns the total number of values in the current buffer. */ - length:number + length: number + /** * Obtains the capacity of the current buffer. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.getCapacity * @syscap SystemCapability.Utils.Lang * @return Returns the capacity of the current buffer. */ getCapacity(): number; + /** * Clears key-value pairs from the current buffer. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.clear * @syscap SystemCapability.Utils.Lang */ clear(): void; + /** * Obtains the number of times createDefault(Object) returned a value. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.getCreateCount * @syscap SystemCapability.Utils.Lang * @return Returns the number of times createDefault(java.lang.Object) returned a value. */ getCreateCount(): number; + /** * Obtains the number of times that the queried values are not matched. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.getMissCount * @syscap SystemCapability.Utils.Lang * @return Returns the number of times that the queried values are not matched. */ getMissCount(): number; + /** * Obtains the number of times that values are evicted from the buffer. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.getRemovalCount * @syscap SystemCapability.Utils.Lang * @return Returns the number of times that values are evicted from the buffer. */ getRemovalCount(): number; + /** * Obtains the number of times that the queried values are successfully matched. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.getMatchCount * @syscap SystemCapability.Utils.Lang * @return Returns the number of times that the queried values are successfully matched. */ getMatchCount(): number; + /** * Obtains the number of times that values are added to the buffer. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.getPutCount * @syscap SystemCapability.Utils.Lang * @return Returns the number of times that values are added to the buffer. */ getPutCount(): number; + /** * Checks whether the current buffer is empty. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.isEmpty * @syscap SystemCapability.Utils.Lang * @return Returns true if the current buffer contains no value. */ isEmpty(): boolean; + /** * Obtains the value associated with a specified key. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.get * @syscap SystemCapability.Utils.Lang * @param key Indicates the key to query. * @return Returns the value associated with the key if the specified key is present in the buffer; returns null otherwise. */ get(key: K): V | undefined; + /** * Adds a key-value pair to the buffer. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.put * @syscap SystemCapability.Utils.Lang * @param key Indicates the key to add. * @param value Indicates the value associated with the key to add. * @return Returns the value associated with the added key; returns the original value if the key to add already exists. */ put(key: K, value: V): V; + /** * Obtains a list of all values in the current buffer. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.values * @syscap SystemCapability.Utils.Lang * @return Returns the list of all values in the current buffer in ascending order, from the most recently accessed to least recently accessed. */ values(): V[]; + /** * Obtains a list of keys for the values in the current buffer. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.keys * @syscap SystemCapability.Utils.Lang * @return Returns a list of keys sorted from most recently accessed to least recently accessed. */ keys(): K[]; + /** * Deletes a specified key and its associated value from the current buffer. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.remove * @syscap SystemCapability.Utils.Lang * @param key Indicates the key to delete. * @return Returns an Optional object containing the deleted key-value pair; returns an empty Optional object if the key does not exist. */ remove(key: K): V | undefined; + /** * Executes subsequent operations after a value is deleted. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.afterRemoval * @syscap SystemCapability.Utils.Lang * @param isEvict The parameter value is true if this method is called due to insufficient capacity, and the parameter value is false in other cases. * @param key Indicates the deleted key. @@ -438,144 +672,398 @@ declare namespace util { * @param newValue The parameter value is the new value associated if the put(java.lang.Object,java.lang.Object) method is called and the key to add already exists. The parameter value is null in other cases. */ afterRemoval(isEvict: boolean, key: K, value: V, newValue: V): void; + /** * Checks whether the current buffer contains a specified key. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.contains * @syscap SystemCapability.Utils.Lang * @param key Indicates the key to check. * @return Returns true if the buffer contains the specified key. */ contains(key: K): boolean; + /** * Executes subsequent operations if miss to compute a value for the specific key. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.createDefault * @syscap SystemCapability.Utils.Lang * @param key Indicates the missed key. * @return Returns the value associated with the key. */ createDefault(key: K): V; + /** * Returns an array of key-value pairs of enumeratable properties of a given object. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.entries * @syscap SystemCapability.Utils.Lang * @return Returns an array of key-value pairs for the enumeratable properties of the given object itself. */ entries(): IterableIterator<[K, V]>; + /** * Specifies the default iterator for an object. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.LRUCache.[Symbol.iterator] * @syscap SystemCapability.Utils.Lang * @return Returns a two - dimensional array in the form of key - value pairs. */ [Symbol.iterator](): IterableIterator<[K, V]>; } - interface ScopeComparable { - /** - * The comparison function is used by the scope. - * @since 8 - * @syscap SystemCapability.Utils.Lang - * @return Returns whether the current object is greater than or equal to the input object. - */ - compareTo(other: ScopeComparable): boolean; - } + /** - * A type used to denote ScopeComparable or number. - * @since 8 + * The LRUCache algorithm replaces the least used data with new data when the buffer space is insufficient. * @syscap SystemCapability.Utils.Lang + * @since 9 */ - type ScopeType = ScopeComparable | number; - - class Scope{ + class LRUCache { /** - * A constructor used to create a Scope instance with the lower and upper bounds specified. - * @since 8 + * Default constructor used to create a new LruBuffer instance with the default capacity of 64. + * @since 9 * @syscap SystemCapability.Utils.Lang - * @param lowerObj A ScopeType value - * @param upperObj A ScopeType value + * @param capacity Indicates the capacity to customize for the buffer. */ - constructor(lowerObj: ScopeType, upperObj: ScopeType); + constructor(capacity?: number); + /** - * Obtains a string representation of the current range. - * @since 8 + * Updates the buffer capacity to a specified capacity. + * @since 9 * @syscap SystemCapability.Utils.Lang - * @return Returns a string representation of the current range object. + * @param newCapacity Indicates the new capacity to set. + * @throws {BusinessError} 401 - The type of newCapacity must be number. */ - toString(): string; + updateCapacity(newCapacity: number):void + /** - * Returns the intersection of a given range and the current range. - * @since 8 + * Returns a string representation of the object. + * @since 9 * @syscap SystemCapability.Utils.Lang - * @param range A Scope range object - * @return Returns the intersection of a given range and the current range. + * @return Returns the string representation of the object and outputs the string representation of the object. */ - intersect(range: Scope): Scope; + toString(): string + /** - * Returns the intersection of the current range and the range specified by the given lower and upper bounds. - * @since 8 + * Obtains a list of all values in the current buffer. + * @since 9 * @syscap SystemCapability.Utils.Lang - * @param lowerObj A ScopeType value - * @param upperObj A ScopeType value - * @return Returns the intersection of the current range and the range specified by the given lower and upper bounds. + * @return Returns the total number of values in the current buffer. */ - intersect(lowerObj: ScopeType, upperObj: ScopeType): Scope; + length: number + /** - * Obtains the upper bound of the current range. - * @since 8 + * Obtains the capacity of the current buffer. + * @since 9 * @syscap SystemCapability.Utils.Lang - * @return Returns the upper bound of the current range. + * @return Returns the capacity of the current buffer. */ - getUpper(): ScopeType; + getCapacity(): number; + /** - * Obtains the lower bound of the current range. - * @since 8 + * Clears key-value pairs from the current buffer. + * @since 9 * @syscap SystemCapability.Utils.Lang - * @return Returns the lower bound of the current range. */ - getLower(): ScopeType; + clear(): void; + /** - * Creates the smallest range that includes the current range and the given lower and upper bounds. - * @since 8 + * Obtains the number of times createDefault(Object) returned a value. + * @since 9 * @syscap SystemCapability.Utils.Lang - * @param lowerObj A ScopeType value - * @param upperObj A ScopeType value - * @return Returns the smallest range that includes the current range and the given lower and upper bounds. + * @return Returns the number of times createDefault(java.lang.Object) returned a value. */ - expand(lowerObj: ScopeType, upperObj: ScopeType): Scope; + getCreateCount(): number; + /** - * Creates the smallest range that includes the current range and a given range. - * @since 8 + * Obtains the number of times that the queried values are not matched. + * @since 9 * @syscap SystemCapability.Utils.Lang - * @param range A Scope range object - * @return Returns the smallest range that includes the current range and a given range. + * @return Returns the number of times that the queried values are not matched. */ - expand(range: Scope): Scope; + getMissCount(): number; + /** - * Creates the smallest range that includes the current range and a given value. - * @since 8 + * Obtains the number of times that values are evicted from the buffer. + * @since 9 * @syscap SystemCapability.Utils.Lang - * @param value A ScopeType value - * @return Returns the smallest range that includes the current range and a given value. + * @return Returns the number of times that values are evicted from the buffer. */ - expand(value: ScopeType): Scope; + getRemovalCount(): number; + /** - * Checks whether a given value is within the current range. - * @since 8 + * Obtains the number of times that the queried values are successfully matched. + * @since 9 * @syscap SystemCapability.Utils.Lang - * @param range A ScopeType range - * @return If the value is within the current range return true,otherwise return false. + * @return Returns the number of times that the queried values are successfully matched. + */ + getMatchCount(): number; + + /** + * Obtains the number of times that values are added to the buffer. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @return Returns the number of times that values are added to the buffer. + */ + getPutCount(): number; + + /** + * Checks whether the current buffer is empty. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @return Returns true if the current buffer contains no value. + */ + isEmpty(): boolean; + + /** + * Obtains the value associated with a specified key. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param key Indicates the key to query. + * @return Returns the value associated with the key if the specified key is present in the buffer; returns null otherwise. + * @throws {BusinessError} 401 - The type of key must be object. + */ + get(key: K): V | undefined; + + /** + * Adds a key-value pair to the buffer. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param key Indicates the key to add. + * @param value Indicates the value associated with the key to add. + * @return Returns the value associated with the added key; returns the original value if the key to add already exists. + * @throws {BusinessError} 401 - if the input parameters are invalid. + */ + put(key: K, value: V): V; + + /** + * Obtains a list of all values in the current buffer. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @return Returns the list of all values in the current buffer in ascending order, from the most recently accessed to least recently accessed. + */ + values(): V[]; + + /** + * Obtains a list of keys for the values in the current buffer. + * since 9 + * @syscap SystemCapability.Utils.Lang + * @return Returns a list of keys sorted from most recently accessed to least recently accessed. + */ + keys(): K[]; + + /** + * Deletes a specified key and its associated value from the current buffer. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param key Indicates the key to delete. + * @return Returns an Optional object containing the deleted key-value pair; returns an empty Optional object if the key does not exist. + * @throws {BusinessError} 401 - The type of key must be object. + */ + remove(key: K): V | undefined; + + /** + * Executes subsequent operations after a value is deleted. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param isEvict The parameter value is true if this method is called due to insufficient capacity, and the parameter value is false in other cases. + * @param key Indicates the deleted key. + * @param value Indicates the deleted value. + * @param newValue The parameter value is the new value associated if the put(java.lang.Object,java.lang.Object) method is called and the key to add already exists. The parameter value is null in other cases. + * @throws {BusinessError} 401 - if the input parameters are invalid. + */ + afterRemoval(isEvict: boolean, key: K, value: V, newValue: V): void; + + /** + * Checks whether the current buffer contains a specified key. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param key Indicates the key to check. + * @return Returns true if the buffer contains the specified key. + * @throws {BusinessError} 401 - The type of key must be object. + */ + contains(key: object): boolean; + + /** + * Executes subsequent operations if miss to compute a value for the specific key. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param key Indicates the missed key. + * @return Returns the value associated with the key. + * @throws {BusinessError} 401 - The type of key must be object. + */ + createDefault(key: K): V; + + /** + * Returns an array of key-value pairs of enumeratable properties of a given object. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @return Returns an array of key-value pairs for the enumeratable properties of the given object itself. + */ + entries(): IterableIterator<[K, V]>; + + /** + * Specifies the default iterator for an object. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @return Returns a two - dimensional array in the form of key - value pairs. + */ + [Symbol.iterator](): IterableIterator<[K, V]>; + } + + interface ScopeComparable { + /** + * The comparison function is used by the scope. + * @since 8 + * @syscap SystemCapability.Utils.Lang + * @return Returns whether the current object is greater than or equal to the input object. + */ + compareTo(other: ScopeComparable): boolean; + } + + /** + * A type used to denote ScopeComparable or number. + * @since 8 + * @syscap SystemCapability.Utils.Lang + */ + type ScopeType = ScopeComparable | number; + + /** + * The Scope interface is used to describe the valid range of a field. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.ScopeHelper + */ + class Scope { + /** + * A constructor used to create a Scope instance with the lower and upper bounds specified. + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.ScopeHelper.constructor + * @syscap SystemCapability.Utils.Lang + * @param lowerObj A ScopeType value + * @param upperObj A ScopeType value + */ + constructor(lowerObj: ScopeType, upperObj: ScopeType); + + /** + * Obtains a string representation of the current range. + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.ScopeHelper.toString + * @syscap SystemCapability.Utils.Lang + * @return Returns a string representation of the current range object. + */ + toString(): string; + + /** + * Returns the intersection of a given range and the current range. + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.ScopeHelper.intersect + * @syscap SystemCapability.Utils.Lang + * @param range A Scope range object + * @return Returns the intersection of a given range and the current range. + */ + intersect(range: Scope): Scope; + + /** + * Returns the intersection of the current range and the range specified by the given lower and upper bounds. + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.ScopeHelper.intersect + * @syscap SystemCapability.Utils.Lang + * @param lowerObj A ScopeType value + * @param upperObj A ScopeType value + * @return Returns the intersection of the current range and the range specified by the given lower and upper bounds. + */ + intersect(lowerObj: ScopeType, upperObj: ScopeType): Scope; + + /** + * Obtains the upper bound of the current range. + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.ScopeHelper.getUpper + * @syscap SystemCapability.Utils.Lang + * @return Returns the upper bound of the current range. + */ + getUpper(): ScopeType; + + /** + * Obtains the lower bound of the current range. + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.ScopeHelper.getLower + * @syscap SystemCapability.Utils.Lang + * @return Returns the lower bound of the current range. + */ + getLower(): ScopeType; + + /** + * Creates the smallest range that includes the current range and the given lower and upper bounds. + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.ScopeHelper.expand + * @syscap SystemCapability.Utils.Lang + * @param lowerObj A ScopeType value + * @param upperObj A ScopeType value + * @return Returns the smallest range that includes the current range and the given lower and upper bounds. + */ + expand(lowerObj: ScopeType, upperObj: ScopeType): Scope; + + /** + * Creates the smallest range that includes the current range and a given range. + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.ScopeHelper.expand + * @syscap SystemCapability.Utils.Lang + * @param range A Scope range object + * @return Returns the smallest range that includes the current range and a given range. + */ + expand(range: Scope): Scope; + + /** + * Creates the smallest range that includes the current range and a given value. + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.ScopeHelper.expand + * @syscap SystemCapability.Utils.Lang + * @param value A ScopeType value + * @return Returns the smallest range that includes the current range and a given value. + */ + expand(value: ScopeType): Scope; + + /** + * Checks whether a given value is within the current range. + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.ScopeHelper.contains + * @syscap SystemCapability.Utils.Lang + * @param value A ScopeType value + * @return If the value is within the current range return true,otherwise return false. */ contains(value: ScopeType): boolean; + /** * Checks whether a given range is within the current range. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.ScopeHelper.contains * @syscap SystemCapability.Utils.Lang - * @param value A Scope value + * @param range A Scope range * @return If the current range is within the given range return true,otherwise return false. */ contains(range: Scope): boolean; + /** * Clamps a given value to the current range. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.ScopeHelper.clamp * @syscap SystemCapability.Utils.Lang * @param value A ScopeType value * @return Returns a ScopeType object that a given value is clamped to the current range.. @@ -583,65 +1071,299 @@ declare namespace util { clamp(value: ScopeType): ScopeType; } - class Base64{ + /** + * The ScopeHelper interface is used to describe the valid range of a field. + * @syscap SystemCapability.Utils.Lang + * @since 9 + */ + class ScopeHelper { + /** + * A constructor used to create a Scope instance with the lower and upper bounds specified. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param lowerObj A ScopeType value + * @param upperObj A ScopeType value + * @throws {BusinessError} 401 - if the input parameters are invalid. + */ + constructor(lowerObj: ScopeType, upperObj: ScopeType); + + /** + * Obtains a string representation of the current range. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @return Returns a string representation of the current range object. + */ + toString(): string; + + /** + * Returns the intersection of a given range and the current range. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param range A Scope range object + * @return Returns the intersection of a given range and the current range. + * @throws {BusinessError} 401 - The type of range must be ScopeHelper. + */ + intersect(range: ScopeHelper): ScopeHelper; + + /** + * Returns the intersection of the current range and the range specified by the given lower and upper bounds. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param lowerObj A ScopeType value + * @param upperObj A ScopeType value + * @return Returns the intersection of the current range and the range specified by the given lower and upper bounds. + * @throws {BusinessError} 401 - if the input parameters are invalid. + */ + intersect(lowerObj: ScopeType, upperObj: ScopeType): ScopeHelper; + + /** + * Obtains the upper bound of the current range. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @return Returns the upper bound of the current range. + */ + getUpper(): ScopeType; + + /** + * Obtains the lower bound of the current range. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @return Returns the lower bound of the current range. + */ + getLower(): ScopeType; + + /** + * Creates the smallest range that includes the current range and the given lower and upper bounds. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param lowerObj A ScopeType value + * @param upperObj A ScopeType value + * @return Returns the smallest range that includes the current range and the given lower and upper bounds. + * @throws {BusinessError} 401 - if the input parameters are invalid. + */ + expand(lowerObj: ScopeType, upperObj: ScopeType): ScopeHelper; + + /** + * Creates the smallest range that includes the current range and a given range. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param range A Scope range object + * @return Returns the smallest range that includes the current range and a given range. + * @throws {BusinessError} 401 - The type of range must be ScopeHelper. + */ + expand(range: ScopeHelper): ScopeHelper; + + /** + * Creates the smallest range that includes the current range and a given value. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param value A ScopeType value + * @return Returns the smallest range that includes the current range and a given value. + * @throws {BusinessError} 401 - The type of value must be object. + */ + expand(value: ScopeType): ScopeHelper; + + /** + * Checks whether a given value is within the current range. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param value A ScopeType value + * @return If the value is within the current range return true,otherwise return false. + * @throws {BusinessError} 401 - The type of value must be object. + */ + contains(value: ScopeType): boolean; + + /** + * Checks whether a given range is within the current range. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param range A Scope range + * @return If the current range is within the given range return true,otherwise return false. + * @throws {BusinessError} 401 - The type of range must be ScopeHelper. + */ + contains(range: ScopeHelper): boolean; + + /** + * Clamps a given value to the current range. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param value A ScopeType value + * @return Returns a ScopeType object that a given value is clamped to the current range. + * @throws {BusinessError} 401 - The type of value must be object. + */ + clamp(value: ScopeType): ScopeType; + } + + /** + * Decodes a Base64 encoded String or input u8 array into a newly-allocated + * u8 array using the Base64 encoding scheme. + * @syscap SystemCapability.Utils.Lang + * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.Base64Helper + */ + class Base64 { /** * Constructor for creating base64 encoding and decoding * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.Base64Helper.constructor * @syscap SystemCapability.Utils.Lang * @param No input parameter is required. * @return No return value. */ constructor(); + /** * Encodes all bytes from the specified u8 array into a newly-allocated u8 array using the Base64 encoding scheme. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.Base64Helper.encodeSync * @syscap SystemCapability.Utils.Lang - * @param value A Uint8Array value + * @param src A Uint8Array value * @return Return the encoded new Uint8Array. */ encodeSync(src: Uint8Array): Uint8Array; + /** * Encodes the specified byte array into a String using the Base64 encoding scheme. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.Base64Helper.encodeToStringSync * @syscap SystemCapability.Utils.Lang - * @param value A Uint8Array value + * @param src A Uint8Array value * @return Return the encoded string. */ encodeToStringSync(src: Uint8Array): string; + /** * Decodes a Base64 encoded String or input u8 array into a newly-allocated u8 array using the Base64 encoding scheme. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.Base64Helper.decodeSync * @syscap SystemCapability.Utils.Lang - * @param value A Uint8Array value or value A string value + * @param src A Uint8Array value or value A string value * @return Return the decoded Uint8Array. */ decodeSync(src: Uint8Array | string): Uint8Array; + /** * Asynchronously encodes all bytes in the specified u8 array into the newly allocated u8 array using the Base64 encoding scheme. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.Base64Helper.encode * @syscap SystemCapability.Utils.Lang - * @param value A Uint8Array value + * @param src A Uint8Array value * @return Return the encodes asynchronous new Uint8Array. */ encode(src: Uint8Array): Promise; + /** * Asynchronously encodes the specified byte array into a String using the Base64 encoding scheme. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.Base64Helper.encodeToString * @syscap SystemCapability.Utils.Lang - * @param value A Uint8Array value + * @param src A Uint8Array value * @return Returns the encoded asynchronous string. */ - encodeToString(src: Uint8Array): Promise; + encodeToString(src: Uint8Array): Promise; + /** * Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or input u8 array into a newly allocated u8 array. * @since 8 + * @deprecated since 9 + * @useinstead ohos.util.Base64Helper.decode * @syscap SystemCapability.Utils.Lang - * @param value A Uint8Array value or value A string value + * @param src A Uint8Array value or value A string value * @return Return the decoded asynchronous Uint8Array. */ decode(src: Uint8Array | string): Promise; } + /** + * Decodes a Base64 encoded String or input u8 array into a newly-allocated + * u8 array using the Base64 encoding scheme. + * @syscap SystemCapability.Utils.Lang + * @since 9 + */ + class Base64Helper { + /** + * Constructor for creating base64 encoding and decoding + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param No input parameter is required. + * @return No return value. + */ + constructor(); + + /** + * Encodes all bytes from the specified u8 array into a newly-allocated u8 array using the Base64 encoding scheme. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param src A Uint8Array value + * @return Return the encoded new Uint8Array. + * @throws {BusinessError} 401 - The type of src must be Uint8Array. + */ + encodeSync(src: Uint8Array): Uint8Array; + + /** + * Encodes the specified byte array into a String using the Base64 encoding scheme. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param src A Uint8Array value + * @return Return the encoded string. + * @throws {BusinessError} 401 - The type of src must be Uint8Array. + */ + encodeToStringSync(src: Uint8Array): string; + + /** + * Decodes a Base64 encoded String or input u8 array into a newly-allocated u8 array using the Base64 encoding scheme. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param src A Uint8Array value or value A string value + * @return Return the decoded Uint8Array. + * @throws {BusinessError} 401 - The type of src must be Uint8Array or string. + */ + decodeSync(src: Uint8Array | string): Uint8Array; + + /** + * Asynchronously encodes all bytes in the specified u8 array into the newly allocated u8 array using the Base64 encoding scheme. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param src A Uint8Array value + * @return Return the encodes asynchronous new Uint8Array. + * @throws {BusinessError} 401 - The type of src must be Uint8Array. + */ + encode(src: Uint8Array): Promise; + + /** + * Asynchronously encodes the specified byte array into a String using the Base64 encoding scheme. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param src A Uint8Array value + * @return Returns the encoded asynchronous string. + * @throws {BusinessError} 401 - The type of src must be Uint8Array. + */ + encodeToString(src: Uint8Array): Promise; + + /** + * Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or + * input u8 array into a newly allocated u8 array. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param src A Uint8Array value or value A string value + * @return Return the decoded asynchronous Uint8Array. + * @throws {BusinessError} 401 - The type of src must be Uint8Array or string. + */ + decode(src: Uint8Array | string): Promise; + } + + /** + * Check the type of parameter. + * @syscap SystemCapability.Utils.Lang + * @since 8 + */ class types{ /** * The types constructor diff --git a/api/@ohos.xml.d.ts b/api/@ohos.xml.d.ts index 6aed19cbd9..49916703c6 100644 --- a/api/@ohos.xml.d.ts +++ b/api/@ohos.xml.d.ts @@ -21,6 +21,13 @@ * @permission N/A */ declare namespace xml { + + /** + * The XmlSerializer interface is used to generate an xml file. + * @name XmlSerializer + * @since 8 + * @syscap SystemCapability.Utils.Lang + */ class XmlSerializer { /** * A parameterized constructor used to create a new XmlSerializer instance. @@ -28,6 +35,7 @@ declare namespace xml { * The input parameter is an Arrarybuff. * The input parameter is a DataView. * The input parameter is an encoding format of string type. + * @throws {BusinessError} 401 - if the input parameters are invalid. */ constructor(buffer: ArrayBuffer | DataView, encoding?: string); @@ -37,6 +45,7 @@ declare namespace xml { * @syscap SystemCapability.Utils.Lang * @param name Key name of the attribute. * @param value Values of attribute. + * @throws {BusinessError} 401 - if the input parameters are invalid. */ setAttributes(name: string, value: string): void; @@ -46,6 +55,7 @@ declare namespace xml { * @syscap SystemCapability.Utils.Lang * @param name Key name of the attribute. * @param value Values of element. + * @throws {BusinessError} 401 - The type of name must be string. */ addEmptyElement(name: string): void; @@ -60,7 +70,8 @@ declare namespace xml { * Writes a elemnet start tag with the given name. * @since 8 * @syscap SystemCapability.Utils.Lang - * @param name name of the element. + * @param name Name of the element. + * @throws {BusinessError} 401 - The type of name must be string. */ startElement(name: string): void; @@ -77,6 +88,7 @@ declare namespace xml { * @syscap SystemCapability.Utils.Lang * @param prefix Values name of the prefix. * @param namespace Values of namespace. + * @throws {BusinessError} 401 - if the input parameters are invalid. */ setNamespace(prefix: string, namespace: string): void; @@ -85,6 +97,7 @@ declare namespace xml { * @since 8 * @syscap SystemCapability.Utils.Lang * @param text Values of comment. + * @throws {BusinessError} 401 - The type of text must be string. */ setComment(text: string): void; @@ -93,6 +106,7 @@ declare namespace xml { * @since 8 * @syscap SystemCapability.Utils.Lang * @param text Values of CDATA. + * @throws {BusinessError} 401 - The type of text must be string. */ setCDATA(text: string): void; @@ -101,6 +115,7 @@ declare namespace xml { * @since 8 * @syscap SystemCapability.Utils.Lang * @param text Values of text. + * @throws {BusinessError} 401 - The type of text must be string. */ setText(text: string): void; @@ -109,6 +124,7 @@ declare namespace xml { * @since 8 * @syscap SystemCapability.Utils.Lang * @param text Values of docType. + * @throws {BusinessError} 401 - The type of text must be string. */ setDocType(text: string): void; } @@ -175,7 +191,7 @@ declare namespace xml { */ ENTITY_REFERENCE, /** - * a whitespace. + * A whitespace. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -246,7 +262,7 @@ declare namespace xml { getAttributeCount(): number; } - /** parse options for XmlPullParser. */ + /** Parse options for XmlPullParser. */ interface ParseOptions { /** @@ -264,7 +280,7 @@ declare namespace xml { ignoreNameSpace?: boolean; /** - * tag value callback function. + * Tag value callback function. * @since 8 * @syscap SystemCapability.Utils.Lang * @param name The current tag name. @@ -274,7 +290,7 @@ declare namespace xml { tagValueCallbackFunction?: (name: string, value: string) => boolean; /** - * attribute value callback function. + * Attribute value callback function. * @since 8 * @syscap SystemCapability.Utils.Lang * @param name The current attribute name. @@ -284,7 +300,7 @@ declare namespace xml { attributeValueCallbackFunction?: (name: string, value: string) => boolean; /** - * token value callback function. + * Token value callback function. * @since 8 * @syscap SystemCapability.Utils.Lang * @param eventType The current token eventtype. @@ -294,10 +310,17 @@ declare namespace xml { tokenValueCallbackFunction?: (eventType: EventType, value: ParseInfo) => boolean; } + /** + * The XmlPullParser interface is used to parse the existing xml file. + * @name XmlPullParser + * @since 8 + * @syscap SystemCapability.Utils.Lang + */ class XmlPullParser { /** - * A constructor used to create a new XmlPullParser instance. - */ + * A constructor used to create a new XmlPullParser instance. + * @throws {BusinessError} 401 - if the input parameters are invalid. + */ constructor(buffer: ArrayBuffer | DataView, encoding?: string); /** @@ -305,6 +328,7 @@ declare namespace xml { * @since 8 * @syscap SystemCapability.Utils.Lang * @param option parse options for XmlPullParser, the interface including two Boolean variables and three callback functions. + * @throws {BusinessError} 401 - The type of option must be ParseOptions. */ parse(option: ParseOptions): void; } -- Gitee From aeea68f8ef84c01bc61650298f261eacdd0e2b0d Mon Sep 17 00:00:00 2001 From: zhancaijin Date: Thu, 20 Oct 2022 14:41:07 +0800 Subject: [PATCH 205/438] modify dfx Recovery SystemCapability Properties Signed-off-by: zhancaijin --- api/@ohos.application.appRecovery.d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/api/@ohos.application.appRecovery.d.ts b/api/@ohos.application.appRecovery.d.ts index f5361534d1..d98ff25612 100644 --- a/api/@ohos.application.appRecovery.d.ts +++ b/api/@ohos.application.appRecovery.d.ts @@ -17,15 +17,15 @@ * This module provides the capability to app receovery. * * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.AppReceovery - * @import appReceovery from '@ohos.appReceovery' + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @import appReceovery from '@ohos.application.appRecovery' */ declare namespace appReceovery { /** * The type of no restart mode. * * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.AppReceovery + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ enum RestartFlag { /** @@ -58,7 +58,7 @@ declare namespace appReceovery { * The type of when to save. * * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.AppReceovery + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ enum SaveOccasionFlag { /** @@ -76,7 +76,7 @@ declare namespace appReceovery { * The type of where to save. * * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.AppReceovery + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ enum SaveModeFlag { /** @@ -94,7 +94,7 @@ declare namespace appReceovery { * Enable appRecovery and app supports save and restore * * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.AppReceovery + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param restart no restart mode * @param saveOccasion The type of When to save * @param saveMode The type of where to save @@ -106,7 +106,7 @@ declare namespace appReceovery { * Restart App when called * * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.AppReceovery + * @syscap SystemCapability.Ability.AbilityRuntime.Core */ function restartApp(): void; @@ -114,7 +114,7 @@ declare namespace appReceovery { * Save App state data when called * * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.AppReceovery + * @syscap SystemCapability.Ability.AbilityRuntime.Core * @return true if save data successfully, otherwise false * @StageModelOnly */ -- Gitee From 421d1061a4aad76bb1c4f7826921d8e1eec8d92b Mon Sep 17 00:00:00 2001 From: qianlf Date: Thu, 20 Oct 2022 08:52:39 +0000 Subject: [PATCH 206/438] modify window stage event type Signed-off-by: qianlf Change-Id: I862cf41f543ef66654b2ae21413fcfb791c63dee --- api/@ohos.window.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index 842d868fc1..e3c9026060 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -2148,10 +2148,10 @@ declare namespace window { * @StageModelOnly */ enum WindowStageEventType { - FOREGROUND = 1, + SHOWN = 1, ACTIVE, INACTIVE, - BACKGROUND, + HIDDEN, } /** * WindowStage -- Gitee From 15c2fa1e1e5e479e2f2f69ce9d8658886b5048e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwangxiyue=E2=80=9D?= Date: Thu, 20 Oct 2022 17:22:28 +0800 Subject: [PATCH 207/438] modified code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: “wangxiyue” --- api/@ohos.data.distributedDataObject.d.ts | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/api/@ohos.data.distributedDataObject.d.ts b/api/@ohos.data.distributedDataObject.d.ts index 6ff95356e5..c42521376c 100644 --- a/api/@ohos.data.distributedDataObject.d.ts +++ b/api/@ohos.data.distributedDataObject.d.ts @@ -58,7 +58,7 @@ declare namespace distributedDataObject { function genSessionId(): string; /** - * the response of save. + * The response of save. * Contains the parameter information of the save object. * * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject @@ -91,7 +91,7 @@ declare namespace distributedDataObject { } /** - * the response of revokeSave. + * The response of revokeSave. * Contains the sessionId of the changed object. * * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject @@ -100,7 +100,7 @@ declare namespace distributedDataObject { interface RevokeSaveSuccessResponse { /** - * the sessionId of the changed object. + * The sessionId of the changed object. * * @since 9 */ @@ -113,10 +113,11 @@ declare namespace distributedDataObject { * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 8 * @deprecated since 9 + * @useinstead ohos.distributedDataObject.DistributedObjectV9 */ interface DistributedObject { - /* + /** * Change object session * * @permission ohos.permission.DISTRIBUTED_DATASYNC @@ -125,6 +126,7 @@ declare namespace distributedDataObject { * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 8 * @deprecated since 9 + * @useinstead ohos.distributedDataObject.DistributedObjectV9.setSessionId */ setSessionId(sessionId?: string): boolean; @@ -139,6 +141,7 @@ declare namespace distributedDataObject { * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 8 * @deprecated since 9 + * @useinstead ohos.distributedDataObject.DistributedObjectV9.on */ on(type: 'change', callback: Callback<{ sessionId: string, fields: Array }>): void; @@ -154,6 +157,7 @@ declare namespace distributedDataObject { * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 8 * @deprecated since 9 + * @useinstead ohos.distributedDataObject.DistributedObjectV9.off */ off(type: 'change', callback?: Callback<{ sessionId: string, fields: Array }>): void; @@ -171,6 +175,7 @@ declare namespace distributedDataObject { * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 8 * @deprecated since 9 + * @useinstead ohos.distributedDataObject.DistributedObjectV9.on */ on(type: 'status', callback: Callback<{ sessionId: string, networkId: string, status: 'online' | 'offline' }>): void; @@ -190,6 +195,7 @@ declare namespace distributedDataObject { * @syscap SystemCapability.DistributedDataManager.DataObject.DistributedObject * @since 8 * @deprecated since 9 + * @useinstead ohos.distributedDataObject.DistributedObjectV9.off */ off(type: 'status', callback?: Callback<{ sessionId: string, deviceId: string, status: 'online' | 'offline' }>): void; @@ -306,7 +312,7 @@ declare namespace distributedDataObject { * the saved data secure level is S0, it is not safe, can only save public data, if there is privacy data, * you should encrypt it * - * the saved data will be released when + * The saved data will be released when * 1. saved after 24h. * 2. app uninstalled. * 3. after resume data success, system will auto delete the saved data. @@ -326,7 +332,7 @@ declare namespace distributedDataObject { * the saved data secure level is S0, it is not safe, can only save public data, if there is privacy data, * you should encrypt it. * - * the saved data will be released when + * The saved data will be released when * 1. saved after 24h. * 2. app uninstalled. * 3. after resume data success, system will auto delete the saved data. -- Gitee From 7c623c4e720283924461291a2ff91385409a1626 Mon Sep 17 00:00:00 2001 From: "yanxiaotao@huawei.com" Date: Thu, 20 Oct 2022 17:57:17 +0800 Subject: [PATCH 208/438] add error code for wifi 1020 Signed-off-by: yanxiaotao@huawei.com --- api/@ohos.wifi.d.ts | 102 ++ api/@ohos.wifimanager.d.ts | 1958 ++++++++++++++++++++++++++++++++++++ 2 files changed, 2060 insertions(+) create mode 100644 api/@ohos.wifimanager.d.ts diff --git a/api/@ohos.wifi.d.ts b/api/@ohos.wifi.d.ts index 5636e31101..7d3aef4518 100644 --- a/api/@ohos.wifi.d.ts +++ b/api/@ohos.wifi.d.ts @@ -31,6 +31,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function enableWifi(): boolean; @@ -43,6 +44,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function disableWifi(): boolean; @@ -54,6 +56,7 @@ declare namespace wifi { * @since 6 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function isWifiActive(): boolean; @@ -67,6 +70,7 @@ declare namespace wifi { * @since 6 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.LOCATION + * @deprecated since 9 */ function scan(): boolean; @@ -78,6 +82,7 @@ declare namespace wifi { * @since 6 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or ohos.permission.LOCATION) + * @deprecated since 9 */ function getScanInfos(): Promise>; function getScanInfos(callback: AsyncCallback>): void; @@ -90,6 +95,7 @@ declare namespace wifi { * @since 9 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or ohos.permission.LOCATION) + * @deprecated since 9 */ function getScanInfosSync(): Array; @@ -105,6 +111,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function addDeviceConfig(config: WifiDeviceConfig): Promise; function addDeviceConfig(config: WifiDeviceConfig, callback: AsyncCallback): void; @@ -150,6 +157,7 @@ declare namespace wifi { * @since 9 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO + * @deprecated since 9 */ function addCandidateConfig(config: WifiDeviceConfig): Promise; function addCandidateConfig(config: WifiDeviceConfig, callback: AsyncCallback): void; @@ -165,6 +173,7 @@ declare namespace wifi { * @since 9 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO + * @deprecated since 9 */ function removeCandidateConfig(networkId: number): Promise; function removeCandidateConfig(networkId: number, callback: AsyncCallback): void; @@ -179,6 +188,7 @@ declare namespace wifi { * @since 9 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION + * @deprecated since 9 */ function getCandidateConfigs(): Array; @@ -193,6 +203,7 @@ declare namespace wifi { * @since 9 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO + * @deprecated since 9 */ function connectToCandidateConfig(networkId: number): void; @@ -206,6 +217,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function connectToNetwork(networkId: number): boolean; @@ -220,6 +232,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG and * ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function connectToDevice(config: WifiDeviceConfig): boolean; @@ -232,6 +245,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function disconnect(): boolean; @@ -245,6 +259,7 @@ declare namespace wifi { * @since 6 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function getSignalLevel(rssi: number, band: number): number; @@ -255,6 +270,7 @@ declare namespace wifi { * @since 6 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function getLinkedInfo(): Promise; function getLinkedInfo(callback: AsyncCallback): void; @@ -266,6 +282,7 @@ declare namespace wifi { * @since 7 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function isConnected(): boolean; @@ -279,6 +296,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.Core * @permission ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function getSupportedFeatures(): number; @@ -290,6 +308,7 @@ declare namespace wifi { * @since 7 * @syscap SystemCapability.Communication.WiFi.Core * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function isFeatureSupported(featureId: number): boolean; @@ -303,6 +322,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_LOCAL_MAC and ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function getDeviceMacAddress(): string[]; @@ -315,6 +335,7 @@ declare namespace wifi { * @since 7 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function getIpInfo(): IpInfo; @@ -325,6 +346,7 @@ declare namespace wifi { * @since 7 * @syscap SystemCapability.Communication.WiFi.Core * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function getCountryCode(): string; @@ -336,6 +358,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function reassociate(): boolean; @@ -347,6 +370,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function reconnect(): boolean; @@ -360,6 +384,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.GET_WIFI_CONFIG * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function getDeviceConfigs(): Array; @@ -374,6 +399,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function updateNetwork(config: WifiDeviceConfig): number; @@ -388,6 +414,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function disableNetwork(netId: number): boolean; @@ -400,6 +427,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function removeAllNetwork(): boolean; @@ -417,6 +445,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function removeDevice(id: number): boolean; @@ -430,6 +459,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function enableHotspot(): boolean; @@ -443,6 +473,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function disableHotspot(): boolean; @@ -454,6 +485,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function isHotspotDualBandSupported(): boolean; @@ -465,6 +497,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function isHotspotActive(): boolean; @@ -481,6 +514,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function setHotspotConfig(config: HotspotConfig): boolean; @@ -492,6 +526,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function getHotspotConfig(): HotspotConfig; @@ -505,6 +540,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function getStations(): Array; @@ -515,6 +551,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function getP2pLinkedInfo(): Promise; function getP2pLinkedInfo(callback: AsyncCallback): void; @@ -526,6 +563,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION + * @deprecated since 9 */ function getCurrentGroup(): Promise; function getCurrentGroup(callback: AsyncCallback): void; @@ -537,6 +575,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION + * @deprecated since 9 */ function getP2pPeerDevices(): Promise; function getP2pPeerDevices(callback: AsyncCallback): void; @@ -551,6 +590,7 @@ declare namespace wifi { * @since 9 * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG + * @deprecated since 9 */ function getP2pLocalDevice(): Promise; function getP2pLocalDevice(callback: AsyncCallback): void; @@ -563,6 +603,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function createGroup(config: WifiP2PConfig): boolean; @@ -573,6 +614,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function removeGroup(): boolean; @@ -584,6 +626,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION + * @deprecated since 9 */ function p2pConnect(config: WifiP2PConfig): boolean; @@ -594,6 +637,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function p2pCancelConnect(): boolean; @@ -604,6 +648,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION + * @deprecated since 9 */ function startDiscoverDevices(): boolean; @@ -614,6 +659,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function stopDiscoverDevices(): boolean; @@ -626,6 +672,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function deletePersistentGroup(netId: number): boolean; @@ -637,6 +684,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function getP2pGroups(): Promise>; function getP2pGroups(callback: AsyncCallback>): void; @@ -650,6 +698,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function setDeviceName(devName: string): boolean; @@ -660,6 +709,7 @@ declare namespace wifi { * @since 7 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function on(type: "wifiStateChange", callback: Callback): void; @@ -671,6 +721,7 @@ declare namespace wifi { * @since 7 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function off(type: "wifiStateChange", callback?: Callback): void; @@ -681,6 +732,7 @@ declare namespace wifi { * @since 7 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function on(type: "wifiConnectionChange", callback: Callback): void; @@ -692,6 +744,7 @@ declare namespace wifi { * @since 7 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function off(type: "wifiConnectionChange", callback?: Callback): void; @@ -702,6 +755,7 @@ declare namespace wifi { * @since 7 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function on(type: "wifiScanStateChange", callback: Callback): void; @@ -713,6 +767,7 @@ declare namespace wifi { * @since 7 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function off(type: "wifiScanStateChange", callback?: Callback): void; @@ -723,6 +778,7 @@ declare namespace wifi { * @since 7 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function on(type: "wifiRssiChange", callback: Callback): void; @@ -734,6 +790,7 @@ declare namespace wifi { * @since 7 * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function off(type: "wifiRssiChange", callback?: Callback): void; @@ -745,6 +802,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function on(type: "streamChange", callback: Callback): void; @@ -757,6 +815,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function off(type: "streamChange", callback?: Callback): void; @@ -768,6 +827,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function on(type: "deviceConfigChange", callback: Callback): void; @@ -779,6 +839,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function off(type: "deviceConfigChange", callback?: Callback): void; @@ -789,6 +850,7 @@ declare namespace wifi { * @since 7 * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function on(type: "hotspotStateChange", callback: Callback): void; @@ -800,6 +862,7 @@ declare namespace wifi { * @since 7 * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function off(type: "hotspotStateChange", callback?: Callback): void; @@ -811,6 +874,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function on(type: "hotspotStaJoin", callback: Callback): void; @@ -823,6 +887,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function off(type: "hotspotStaJoin", callback?: Callback): void; @@ -834,6 +899,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function on(type: "hotspotStaLeave", callback: Callback): void; @@ -845,6 +911,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. + * @deprecated since 9 */ function off(type: "hotspotStaLeave", callback?: Callback): void; @@ -855,6 +922,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function on(type: "p2pStateChange", callback: Callback): void; @@ -864,6 +932,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function off(type: "p2pStateChange", callback?: Callback): void; @@ -874,6 +943,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function on(type: "p2pConnectionChange", callback: Callback): void; @@ -883,6 +953,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function off(type: "p2pConnectionChange", callback?: Callback): void; @@ -893,6 +964,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION + * @deprecated since 9 */ function on(type: "p2pDeviceChange", callback: Callback): void; @@ -903,6 +975,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.LOCATION + * @deprecated since 9 */ function off(type: "p2pDeviceChange", callback?: Callback): void; @@ -913,6 +986,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION + * @deprecated since 9 */ function on(type: "p2pPeerDeviceChange", callback: Callback): void; @@ -922,6 +996,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.LOCATION + * @deprecated since 9 */ function off(type: "p2pPeerDeviceChange", callback?: Callback): void; @@ -932,6 +1007,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function on(type: "p2pPersistentGroupChange", callback: Callback): void; @@ -941,6 +1017,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function off(type: "p2pPersistentGroupChange", callback?: Callback): void; @@ -951,6 +1028,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function on(type: "p2pDiscoveryChange", callback: Callback): void; @@ -960,6 +1038,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO + * @deprecated since 9 */ function off(type: "p2pDiscoveryChange", callback?: Callback): void; @@ -969,6 +1048,7 @@ declare namespace wifi { * @since 9 * @systemapi Hide this for inner system use. * @syscap SystemCapability.Communication.WiFi.STA + * @deprecated since 9 */ enum EapMethod { EAP_NONE, @@ -988,6 +1068,7 @@ declare namespace wifi { * @since 9 * @systemapi Hide this for inner system use. * @syscap SystemCapability.Communication.WiFi.STA + * @deprecated since 9 */ enum Phase2Method { PHASE2_NONE, @@ -1006,6 +1087,7 @@ declare namespace wifi { * @since 9 * @systemapi Hide this for inner system use. * @syscap SystemCapability.Communication.WiFi.STA + * @deprecated since 9 */ interface WifiEapConfig { /** EAP authentication method */ @@ -1053,6 +1135,7 @@ declare namespace wifi { * * @since 6 * @syscap SystemCapability.Communication.WiFi.STA + * @deprecated since 9 */ interface WifiDeviceConfig { /** Wi-Fi SSID: the maximum length is 32 */ @@ -1114,6 +1197,7 @@ declare namespace wifi { * @since 7 * @systemapi Hide this for inner system use. * @syscap SystemCapability.Communication.WiFi.STA + * @deprecated since 9 */ interface IpConfig { ipAddress: number; @@ -1128,6 +1212,7 @@ declare namespace wifi { * @since 9 * @systemapi Hide this for inner system use. * @syscap SystemCapability.Communication.WiFi.STA + * @deprecated since 9 */ interface WifiInfoElem { /** Element id */ @@ -1141,6 +1226,7 @@ declare namespace wifi { * * @since 9 * @syscap SystemCapability.Communication.WiFi.STA + * @deprecated since 9 */ enum WifiChannelWidth { WIDTH_20MHZ = 0, @@ -1156,6 +1242,7 @@ declare namespace wifi { * * @since 6 * @syscap SystemCapability.Communication.WiFi.STA + * @deprecated since 9 */ interface WifiScanInfo { /** Wi-Fi SSID: the maximum length is 32 */ @@ -1215,6 +1302,7 @@ declare namespace wifi { * * @since 6 * @syscap SystemCapability.Communication.WiFi.Core + * @deprecated since 9 */ enum WifiSecurityType { /** Invalid security type */ @@ -1278,6 +1366,7 @@ declare namespace wifi { * * @since 6 * @syscap SystemCapability.Communication.WiFi.STA + * @deprecated since 9 */ interface WifiLinkedInfo { /** The SSID of the Wi-Fi hotspot */ @@ -1343,6 +1432,7 @@ declare namespace wifi { * * @since 7 * @syscap SystemCapability.Communication.WiFi.STA + * @deprecated since 9 */ interface IpInfo { /** The IP address of the Wi-Fi connection */ @@ -1373,6 +1463,7 @@ declare namespace wifi { * @since 7 * @systemapi Hide this for inner system use. * @syscap SystemCapability.Communication.WiFi.AP.Core + * @deprecated since 9 */ interface HotspotConfig { /** The SSID of the Wi-Fi hotspot */ @@ -1397,6 +1488,7 @@ declare namespace wifi { * @since 7 * @systemapi Hide this for inner system use. * @syscap SystemCapability.Communication.WiFi.AP.Core + * @deprecated since 9 */ interface StationInfo { /** the network name of the Wi-Fi client */ @@ -1415,6 +1507,7 @@ declare namespace wifi { * @since 7 * @systemapi Hide this for inner system use. * @syscap SystemCapability.Communication.WiFi.STA + * @deprecated since 9 */ enum IpType { /** Use statically configured IP settings */ @@ -1433,6 +1526,7 @@ declare namespace wifi { * @since 6 * @systemapi Hide this for inner system use. * @syscap SystemCapability.Communication.WiFi.STA + * @deprecated since 9 */ export enum SuppState { /** The supplicant is not associated with or is disconnected from the AP. */ @@ -1477,6 +1571,7 @@ declare namespace wifi { * * @since 6 * @syscap SystemCapability.Communication.WiFi.STA + * @deprecated since 9 */ export enum ConnState { /** The device is searching for an available AP. */ @@ -1509,6 +1604,7 @@ declare namespace wifi { * * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @deprecated since 9 */ interface WifiP2pDevice { /** Device name */ @@ -1532,6 +1628,7 @@ declare namespace wifi { * * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @deprecated since 9 */ interface WifiP2PConfig { /** Device mac address */ @@ -1558,6 +1655,7 @@ declare namespace wifi { * * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @deprecated since 9 */ interface WifiP2pGroupInfo { /** Indicates whether it is group owner */ @@ -1593,6 +1691,7 @@ declare namespace wifi { * * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @deprecated since 9 */ enum P2pConnectState { DISCONNECTED = 0, @@ -1604,6 +1703,7 @@ declare namespace wifi { * * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @deprecated since 9 */ interface WifiP2pLinkedInfo { /** Connection status */ @@ -1621,6 +1721,7 @@ declare namespace wifi { * * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @deprecated since 9 */ enum P2pDeviceStatus { CONNECTED = 0, @@ -1635,6 +1736,7 @@ declare namespace wifi { * * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P + * @deprecated since 9 */ enum GroupOwnerBand { GO_BAND_AUTO = 0, diff --git a/api/@ohos.wifimanager.d.ts b/api/@ohos.wifimanager.d.ts new file mode 100644 index 0000000000..c28639f811 --- /dev/null +++ b/api/@ohos.wifimanager.d.ts @@ -0,0 +1,1958 @@ +/* + * Copyright (C) 2021-2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { AsyncCallback, Callback } from './basic'; + +/** + * Provides methods to operate or manage Wi-Fi. + * + * @since 9 + * @import import wifimanager from '@ohos.wifimanager'; + */ +declare namespace wifimanager { + /** + * Enables Wi-Fi. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION + * @systemapi Hide this for inner system use. + */ + function enableWifi(): void; + + /** + * Disables Wi-Fi. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION + * @systemapi Hide this for inner system use. + */ + function disableWifi(): void; + + /** + * Queries the Wi-Fi status + * + * @return Returns {@code true} if the Wi-Fi is active, returns {@code false} otherwise. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.GET_WIFI_INFO + */ + function isWifiActive(): boolean; + + /** + * Scans Wi-Fi hotspots. + * + *

This API works in asynchronous mode.

+ * + * @return Returns {@code true} if the scanning is successful, returns {@code false} otherwise. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.LOCATION + */ + function scan(): boolean; + + /** + * Obtains the hotspot information that scanned. + * + * @return Returns information about scanned Wi-Fi hotspots if any. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or ohos.permission.LOCATION) + */ + function getScanResults(): Promise>; + function getScanResults(callback: AsyncCallback>): void; + + /** + * Obtains the scanned results. + * + * @return Returns information about scanned Wi-Fi hotspots if any. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or ohos.permission.LOCATION) + */ + function getScanResultsSync(): Array; + + /** + * Adds Wi-Fi connection configuration to the device. + * + *

The configuration will be updated when the configuration is added.

+ * + * @param config Indicates the device configuration for connection to the Wi-Fi network. + * @return Returns {@code networkId} if the configuration is added; returns {@code -1} otherwise. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG + * @systemapi Hide this for inner system use. + */ + function addDeviceConfig(config: WifiDeviceConfig): Promise; + function addDeviceConfig(config: WifiDeviceConfig, callback: AsyncCallback): void; + + /** + * Adds a specified untrusted hotspot configuration. + * + *

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 - device config which to be added. + * + * @since 7 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.SET_WIFI_INFO + * @deprecated since 9 + */ + function addUntrustedConfig(config: WifiDeviceConfig): Promise; + function addUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback): void; + + /** + * Removes a specified untrusted hotspot configuration. + * + *

This method removes one configuration at a time. + * @param config - device config which to be removed. + * + * @since 7 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.SET_WIFI_INFO + * @deprecated since 9 + */ + function removeUntrustedConfig(config: WifiDeviceConfig): Promise; + function removeUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback): void; + + /** + * Adds a specified candidate hotspot configuration and returns the networkId. + * + *

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 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.SET_WIFI_INFO + */ + function addCandidateConfig(config: WifiDeviceConfig): Promise; + function addCandidateConfig(config: WifiDeviceConfig, callback: AsyncCallback): void; + + /** + * Removes a specified candidate hotspot configuration, only the configration which is added by ourself is allowed + * to be removed. + * + * @param networkId - Network ID which will be removed. + * @throws {ErrorCode} when failed to remove the hotspot configuration. + * @return {@code true} if the candidate hotspot configuration is removed, returns {@code false} otherwise. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.SET_WIFI_INFO + */ + 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. + * + *

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 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION + */ + function getCandidateConfigs(): Array; + + /** + * Connect to a specified candidate hotspot configuration, only the configration which is added by ourself + * is allowed to be connected. + * + *

This method connect to a configuration at a time. + * + * @param networkId - Network ID which will be connected. + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.SET_WIFI_INFO + */ + function connectToCandidateConfig(networkId: number): void; + + /** + * Connects to Wi-Fi network. + * + * @param networkId ID of the connected network. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.MANAGE_WIFI_CONNECTION + * @systemapi Hide this for inner system use. + */ + function connectToNetwork(networkId: number): void; + + /** + * Connects to Wi-Fi network. + * + * @param config Indicates the device configuration for connection to the Wi-Fi network. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG and + * ohos.permission.MANAGE_WIFI_CONNECTION + * @systemapi Hide this for inner system use. + */ + function connectToDevice(config: WifiDeviceConfig): void; + + /** + * Disconnects Wi-Fi network. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION + * @systemapi Hide this for inner system use. + */ + function disconnect(): boolean; + + /** + * Calculates the Wi-Fi signal level based on the Wi-Fi RSSI and frequency band. + * + * @param rssi Indicates the Wi-Fi RSSI. + * @band Indicates the Wi-Fi frequency band. + * @return Returns Wi-Fi signal level ranging from 0 to 4. + * + * @since 6 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.GET_WIFI_INFO + */ + function getSignalLevel(rssi: number, band: number): number; + + /** + * Obtains information about a Wi-Fi connection. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.GET_WIFI_INFO + */ + function getLinkedInfo(): Promise; + function getLinkedInfo(callback: AsyncCallback): void; + + /** + * Checks whether a Wi-Fi connection has been set up. + * + * @return Returns {@code true} if a Wi-Fi connection has been set up, returns {@code false} otherwise. + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.GET_WIFI_INFO + */ + function isConnected(): boolean; + + /** + * Obtains the features supported by this device. + * + *

To check whether this device supports a specified feature. + * + * @return Returns the features supported by this device. + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2400001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.Core + * @permission ohos.permission.GET_WIFI_INFO + * @systemapi Hide this for inner system use. + */ + function getSupportedFeatures(): number; + + /** + * Checks whether this device supports a specified feature. + * + * @param featureId Indicates the ID of the feature. + * @return Returns {@code true} if this device supports the specified feature, returns {@code false} otherwise. + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2400001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.Core + * @permission ohos.permission.GET_WIFI_INFO + */ + function isFeatureSupported(featureId: number): boolean; + + /** + * Obtains the MAC address of a Wi-Fi device. Wi-Fi must be enabled. + * + *

The MAC address is unique and cannot be changed. + * + * @return Returns the MAC address of the Wi-Fi device. + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.GET_WIFI_LOCAL_MAC and ohos.permission.GET_WIFI_INFO + * @systemapi Hide this for inner system use. + */ + function getDeviceMacAddress(): string[]; + + /** + * Obtains the IP information of a Wi-Fi connection. + * + *

The IP information includes the host IP address, gateway address, and DNS information. + * + * @return Returns the IP information of the Wi-Fi connection. + * @since 7 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.GET_WIFI_INFO + */ + function getIpInfo(): IpInfo; + + /** + * Obtains the country code of this device. + * + * @return Returns the country code of this device. + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2400001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.Core + * @permission ohos.permission.GET_WIFI_INFO + */ + function getCountryCode(): string; + + /** + * Re-associates to current network. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION + * @systemapi Hide this for inner system use. + */ + function reassociate(): void; + + /** + * Re-connects to current network. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION + * @systemapi Hide this for inner system use. + */ + function reconnect(): void; + + /** + * Obtains the list of all existing Wi-Fi configurations. + * + *

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 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.GET_WIFI_CONFIG + * @systemapi Hide this for inner system use. + */ + function getDeviceConfigs(): Array; + + /** + * Updates the specified Wi-Fi configuration. + * + * @param config Indicates the Wi-Fi configuration to update. + * + * @return Returns the network ID in the updated Wi-Fi configuration if the update is successful; + * returns {@code -1} if the specified Wi-Fi configuration is not contained in the list. + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG + * @systemapi Hide this for inner system use. + */ + function updateNetwork(config: WifiDeviceConfig): number; + + /** + * Disables a specified network. + * + *

The disabled network will not be associated with again. + * + * @param netId Identifies the network to disable. + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION + * @systemapi Hide this for inner system use. + */ + function disableNetwork(netId: number): void; + + /** + * Removes all the saved Wi-Fi configurations. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION + * @systemapi Hide this for inner system use. + */ + function removeAllNetwork(): void; + + /** + * Deletes a Wi-Fi network with a specified ID. + * + *

After a Wi-Fi network is deleted, its configuration will be deleted from the list of Wi-Fi configurations. + * If the Wi-Fi network is being connected, the connection will be interrupted. + * The application can only delete Wi-Fi networks it has created. + * + * @param id Indicates the ID of the Wi-Fi network, + * which can be obtained using the {@link #addDeviceConfig} or {@link #getLinkedInfo} method. + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION + * @systemapi Hide this for inner system use. + */ + function removeDevice(id: number): void; + + /** + * Enables a Wi-Fi hotspot. + * + *

This method is asynchronous. After the Wi-Fi hotspot is enabled, Wi-Fi may be disabled. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2600001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.AP.Core + * @permission ohos.permission.MANAGE_WIFI_HOTSPOT + * @systemapi Hide this for inner system use. + */ + function enableHotspot(): void; + + /** + * Disables a Wi-Fi hotspot. + * + *

This method is asynchronous. If Wi-Fi is enabled after the Wi-Fi hotspot is disabled, Wi-Fi may be re-enabled. + * + * @return Returns {@code true} if this method is called successfully, returns {@code false} otherwise. + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2600001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.AP.Core + * @permission ohos.permission.MANAGE_WIFI_HOTSPOT + * @systemapi Hide this for inner system use. + */ + function disableHotspot(): void; + + /** + * Checks whether a device serving as a Wi-Fi hotspot supports both the 2.4 GHz and 5 GHz Wi-Fi. + * + * @return Returns {@code true} if the method is called successfully, returns {@code false} otherwise. + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2600001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.AP.Core + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.MANAGE_WIFI_HOTSPOT + * @systemapi Hide this for inner system use. + */ + function isHotspotDualBandSupported(): boolean; + + /** + * Checks whether Wi-Fi hotspot is active on a device. + * + * @return Returns {@code true} if Wi-Fi hotspot is enabled, returns {@code false} otherwise. + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2600001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.AP.Core + * @permission ohos.permission.GET_WIFI_INFO + * @systemapi Hide this for inner system use. + */ + function isHotspotActive(): boolean; + + /** + * Sets the hotspot for a device. + * + *

Only OPEN and WPA2 PSK hotspots can be configured. + * + * @param config Indicates the Wi-Fi hotspot configuration. + * The SSID and {@code securityType} must be available and correct. + * If {@code securityType} is not {@code open}, {@code preSharedKey} must be available and correct. + * @return Returns {@code true} if the method is called successfully, returns {@code false} otherwise. + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2600001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.AP.Core + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG + * @systemapi Hide this for inner system use. + */ + function setHotspotConfig(config: HotspotConfig): void; + + /** + * Obtains the Wi-Fi hotspot configuration. + * + * @return Returns the configuration of an existing or enabled Wi-Fi hotspot. + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2600001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.AP.Core + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG + * @systemapi Hide this for inner system use. + */ + function getHotspotConfig(): HotspotConfig; + + /** + * Obtains the list of clients that are connected to a Wi-Fi hotspot. + * + *

This method can only be used on a device that serves as a Wi-Fi hotspot. + * + * @return Returns the list of clients that are connected to the Wi-Fi hotspot. + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2600001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.AP.Core + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.MANAGE_WIFI_HOTSPOT + * @systemapi Hide this for inner system use. + */ + function getStations(): Array; + + /** + * Obtains information about a P2P connection. + * + * @return Returns the P2P connection information. + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2800001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO + */ + function getP2pLinkedInfo(): Promise; + function getP2pLinkedInfo(callback: AsyncCallback): void; + + /** + * Obtains information about the current group. + * + * @return Returns the current group information. + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2800001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION + */ + function getCurrentGroup(): Promise; + function getCurrentGroup(callback: AsyncCallback): void; + + /** + * Obtains the information about the found devices. + * + * @return Returns the found devices list. + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2800001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION + */ + function getP2pPeerDevices(): Promise; + function getP2pPeerDevices(callback: AsyncCallback): void; + + /** + * Obtains the information about own device info. + * + *

deviceAddress in the returned WifiP2pDevice will be set "00:00:00:00:00:00", + * if ohos.permission.GET_WIFI_LOCAL_MAC is not granted. + * + * @return Returns the information about own device info. + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2800001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG + */ + function getP2pLocalDevice(): Promise; + function getP2pLocalDevice(callback: AsyncCallback): void; + + /** + * Creates a P2P group. + * + * @param config Indicates the configuration for creating a group. + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2800001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO + */ + function createGroup(config: WifiP2PConfig): void; + + /** + * Removes a P2P group. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2800001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO + */ + function removeGroup(): void; + + /** + * Initiates a P2P connection to a device with the specified configuration. + * + * @param config Indicates the configuration for connecting to a specific group. + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2800001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION + */ + function p2pConnect(config: WifiP2PConfig): void; + + /** + * Canceling a P2P connection. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2800001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO + */ + function p2pCancelConnect(): void; + + /** + * Discovers Wi-Fi P2P devices. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2800001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION + */ + function startDiscoverDevices(): void; + + /** + * Stops discovering Wi-Fi P2P devices. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2800001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO + */ + function stopDiscoverDevices(): void; + + /** + * Deletes the persistent P2P group with the specified network ID. + * + * @param netId Indicates the network ID of the group to be deleted. + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2800001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION + * @systemapi Hide this for inner system use. + */ + function deletePersistentGroup(netId: number): void; + + /** + * Obtains information about the groups. + * + * @return Returns the groups information. + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2800001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION + * @systemapi Hide this for inner system use. + */ + function getP2pGroups(): Promise>; + function getP2pGroups(callback: AsyncCallback>): void; + + /** + * Sets the name of the Wi-Fi P2P device. + * + * @param devName Indicates the name to be set. + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2800001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION + * @systemapi Hide this for inner system use. + */ + function setDeviceName(devName: string): void; + + /** + * Subscribe Wi-Fi status change events. + * + * @return Returns 0: inactive, 1: active, 2: activating, 3: deactivating + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.GET_WIFI_INFO + */ + function on(type: "wifiStateChange", callback: Callback): void; + + /** + * Unsubscribe Wi-Fi status change events. + * + *

All callback functions will be deregistered If there is no specific callback parameter.

+ * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.GET_WIFI_INFO + */ + function off(type: "wifiStateChange", callback?: Callback): void; + + /** + * Subscribe Wi-Fi connection change events. + * + * @return Returns 0: disconnected, 1: connected + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.GET_WIFI_INFO + */ + function on(type: "wifiConnectionChange", callback: Callback): void; + + /** + * Unsubscribe Wi-Fi connection change events. + * + *

All callback functions will be deregistered If there is no specific callback parameter.

+ * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.GET_WIFI_INFO + */ + function off(type: "wifiConnectionChange", callback?: Callback): void; + + /** + * Subscribe Wi-Fi scan status change events. + * + * @return Returns 0: scan fail, 1: scan success + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.GET_WIFI_INFO + */ + function on(type: "wifiScanStateChange", callback: Callback): void; + + /** + * Unsubscribe Wi-Fi scan status change events. + * + *

All callback functions will be deregistered If there is no specific callback parameter.

+ * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.GET_WIFI_INFO + */ + function off(type: "wifiScanStateChange", callback?: Callback): void; + + /** + * Subscribe Wi-Fi rssi change events. + * + * @return Returns RSSI value in dBm + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.GET_WIFI_INFO + */ + function on(type: "wifiRssiChange", callback: Callback): void; + + /** + * Unsubscribe Wi-Fi rssi change events. + * + *

All callback functions will be deregistered If there is no specific callback parameter.

+ * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.GET_WIFI_INFO + */ + function off(type: "wifiRssiChange", callback?: Callback): void; + + /** + * Subscribe Wi-Fi stream change events. + * + * @return Returns 0: stream none, 1: stream down, 2: stream up, 3: stream bidirectional + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.MANAGE_WIFI_CONNECTION + * @systemapi Hide this for inner system use. + */ + function on(type: "streamChange", callback: Callback): void; + + /** + * Unsubscribe Wi-Fi stream change events. + * + *

All callback functions will be deregistered If there is no specific callback parameter.

+ * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.MANAGE_WIFI_CONNECTION + * @systemapi Hide this for inner system use. + */ + function off(type: "streamChange", callback?: Callback): void; + + /** + * Subscribe Wi-Fi device config change events. + * + * @return Returns 0: config is added, 1: config is changed, 2: config is removed. + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.GET_WIFI_INFO + * @systemapi Hide this for inner system use. + */ + function on(type: "deviceConfigChange", callback: Callback): void; + + /** + * Subscribe Wi-Fi device config change events. + * + * @return Returns 0: config is added, 1: config is changed, 2: config is removed. + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2500001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.STA + * @permission ohos.permission.GET_WIFI_INFO + * @systemapi Hide this for inner system use. + */ + function off(type: "deviceConfigChange", callback?: Callback): void; + + /** + * Subscribe Wi-Fi hotspot state change events. + * + * @return Returns 0: inactive, 1: active, 2: activating, 3: deactivating + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2600001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.AP.Core + * @permission ohos.permission.GET_WIFI_INFO + */ + function on(type: "hotspotStateChange", callback: Callback): void; + + /** + * Unsubscribe Wi-Fi hotspot state change events. + * + *

All callback functions will be deregistered If there is no specific callback parameter.

+ * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2600001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.AP.Core + * @permission ohos.permission.GET_WIFI_INFO + */ + function off(type: "hotspotStateChange", callback?: Callback): void; + + /** + * Subscribe Wi-Fi hotspot sta join events. + * + * @return Returns StationInfo + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2600001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.AP.Core + * @permission ohos.permission.MANAGE_WIFI_HOTSPOT + * @systemapi Hide this for inner system use. + */ + function on(type: "hotspotStaJoin", callback: Callback): void; + + /** + * Unsubscribe Wi-Fi hotspot sta join events. + * + *

All callback functions will be deregistered If there is no specific callback parameter.

+ * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2600001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.AP.Core + * @permission ohos.permission.MANAGE_WIFI_HOTSPOT + * @systemapi Hide this for inner system use. + */ + function off(type: "hotspotStaJoin", callback?: Callback): void; + + /** + * Subscribe Wi-Fi hotspot sta leave events. + * + * @return Returns {@link #StationInfo} object + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2600001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.AP.Core + * @permission ohos.permission.MANAGE_WIFI_HOTSPOT + * @systemapi Hide this for inner system use. + */ + function on(type: "hotspotStaLeave", callback: Callback): void; + + /** + * Unsubscribe Wi-Fi hotspot sta leave events. + * + * @return Returns {@link #StationInfo} object + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2600001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.AP.Core + * @permission ohos.permission.MANAGE_WIFI_HOTSPOT + * @systemapi Hide this for inner system use. + */ + function off(type: "hotspotStaLeave", callback?: Callback): void; + + /** + * Subscribe P2P status change events. + * + * @return Returns 1: idle, 2: starting, 3:started, 4: closing, 5: closed + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2800001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO + */ + function on(type: "p2pStateChange", callback: Callback): void; + + /** + * Unsubscribe P2P status change events. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2800001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO + */ + function off(type: "p2pStateChange", callback?: Callback): void; + + /** + * Subscribe P2P connection change events. + * + * @return Returns WifiP2pLinkedInfo + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2800001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO + */ + function on(type: "p2pConnectionChange", callback: Callback): void; + + /** + * Unsubscribe P2P connection change events. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2800001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO + */ + function off(type: "p2pConnectionChange", callback?: Callback): void; + + /** + * Subscribe P2P local device change events. + * + * @return Returns WifiP2pDevice + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2800001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION + */ + function on(type: "p2pDeviceChange", callback: Callback): void; + + /** + * Unsubscribe P2P local device change events. + * + * @return Returns WifiP2pDevice + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2800001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.LOCATION + */ + function off(type: "p2pDeviceChange", callback?: Callback): void; + + /** + * Subscribe P2P peer device change events. + * + * @return Returns WifiP2pDevice[] + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2800001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION + */ + function on(type: "p2pPeerDeviceChange", callback: Callback): void; + + /** + * Unsubscribe P2P peer device change events. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2800001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.LOCATION + */ + function off(type: "p2pPeerDeviceChange", callback?: Callback): void; + + /** + * Subscribe P2P persistent group change events. + * + * @return Returns void + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2800001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO + */ + function on(type: "p2pPersistentGroupChange", callback: Callback): void; + + /** + * Unsubscribe P2P persistent group change events. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2800001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO + */ + function off(type: "p2pPersistentGroupChange", callback?: Callback): void; + + /** + * Subscribe P2P discovery events. + * + * @return Returns 0: initial state, 1: discovery succeeded + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2800001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO + */ + function on(type: "p2pDiscoveryChange", callback: Callback): void; + + /** + * Unsubscribe P2P discovery events. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Invalid parameters. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2800001 - Unspecified error. + * @syscap SystemCapability.Communication.WiFi.P2P + * @permission ohos.permission.GET_WIFI_INFO + */ + function off(type: "p2pDiscoveryChange", callback?: Callback): void; + + /** + * Wi-Fi EAP method. + * + * @since 9 + * @systemapi Hide this for inner system use. + * @syscap SystemCapability.Communication.WiFi.STA + */ + enum EapMethod { + EAP_NONE, + EAP_PEAP, + EAP_TLS, + EAP_TTLS, + EAP_PWD, + EAP_SIM, + EAP_AKA, + EAP_AKA_PRIME, + EAP_UNAUTH_TLS, + } + + /** + * Wi-Fi phase 2 method. + * + * @since 9 + * @systemapi Hide this for inner system use. + * @syscap SystemCapability.Communication.WiFi.STA + */ + enum Phase2Method { + PHASE2_NONE, + PHASE2_PAP, + PHASE2_MSCHAP, + PHASE2_MSCHAPV2, + PHASE2_GTC, + PHASE2_SIM, + PHASE2_AKA, + PHASE2_AKA_PRIME, + } + + /** + * Wi-Fi EAP config. + * + * @since 9 + * @systemapi Hide this for inner system use. + * @syscap SystemCapability.Communication.WiFi.STA + */ + interface WifiEapConfig { + /** EAP authentication method */ + eapMethod: EapMethod; + + /** Phase 2 authentication method */ + phase2Method: Phase2Method; + + /** The identity */ + identity: string; + + /** Anonymous identity */ + anonymousIdentity: string; + + /** Password */ + password: string; + + /** CA certificate alias */ + caCertAliases: string; + + /** CA certificate path */ + caPath: string; + + /** Client certificate alias */ + clientCertAliases: string; + + /** Alternate subject match */ + altSubjectMatch: string; + + /** Domain suffix match */ + domainSuffixMatch: string; + + /** Realm for Passpoint credential */ + realm: string; + + /** Public Land Mobile Network of the provider of Passpoint credential */ + plmn: string; + + /** Sub ID of the SIM card */ + eapSubId: number; + } + + /** + * Wi-Fi device configuration information. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.STA + */ + interface WifiDeviceConfig { + /** Wi-Fi SSID: the maximum length is 32 */ + ssid: string; + + /** Wi-Fi bssid(MAC): the length is 6 */ + bssid: string; + + /** Wi-Fi key: maximum length is 64 */ + preSharedKey: string; + + /** Hide SSID or not, false(default): not hide */ + isHiddenSsid: boolean; + + /** Security type: reference definition of WifiSecurityType */ + securityType: WifiSecurityType; + + /** The UID of the Wi-Fi configuration creator */ + /* @systemapi */ + creatorUid: number; + + /** Disable reason */ + /* @systemapi */ + disableReason: number; + + /** Allocated networkId */ + /* @systemapi */ + netId: number; + + /** Random mac type */ + /* @systemapi */ + randomMacType: number; + + /** Random mac address, the length is 6 */ + /* @systemapi */ + randomMacAddr: string; + + /** IP Type */ + /* @systemapi */ + ipType: IpType; + + /** IP config of static */ + /* @systemapi */ + staticIp: IpConfig; + + /** + * EAP config info. + * @systemapi + */ + eapConfig: WifiEapConfig; + } + + /** + * Wi-Fi IP configuration information. + * + * @since 9 + * @systemapi Hide this for inner system use. + * @syscap SystemCapability.Communication.WiFi.STA + */ + interface IpConfig { + ipAddress: number; + gateway: number; + dnsServers: number[]; + domains: Array; + } + + /** + * Wi-Fi information elements. + * + * @since 9 + * @systemapi Hide this for inner system use. + * @syscap SystemCapability.Communication.WiFi.STA + */ + interface WifiInfoElem { + /** Element id */ + eid: number; + /** Element content */ + content: Uint8Array; + } + + /** + * Describes the wifi channel width. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.STA + */ + enum WifiChannelWidth { + WIDTH_20MHZ = 0, + WIDTH_40MHZ = 1, + WIDTH_80MHZ = 2, + WIDTH_160MHZ = 3, + WIDTH_80MHZ_PLUS = 4, + WIDTH_INVALID + } + + /** + * Describes the scanned Wi-Fi information. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.STA + */ + interface WifiScanInfo { + /** Wi-Fi SSID: the maximum length is 32 */ + ssid: string; + + /** Wi-Fi bssid(MAC): the length is 6 */ + bssid: string; + + /** Hotspot capability */ + capabilities: string; + + /** Security type: reference definition of WifiSecurityType */ + securityType: WifiSecurityType; + + /** Received signal strength indicator (RSSI) */ + rssi: number; + + /** Frequency band, 1: 2.4G, 2: 5G */ + band: number; + + /** Frequency */ + frequency: number; + + /** Channel width */ + channelWidth: number; + + /** + * Center frequency 0. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.STA + */ + centerFrequency0: number; + + /** + * Center frequency 1. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.STA + */ + centerFrequency1: number; + + /** + * Information elements. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.STA + */ + infoElems: Array; + + /** Time stamp */ + timestamp: number; + } + + /** + * Describes the wifi security type. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.Core + */ + enum WifiSecurityType { + /** Invalid security type */ + WIFI_SEC_TYPE_INVALID = 0, + + /** Open */ + WIFI_SEC_TYPE_OPEN = 1, + + /** Wired Equivalent Privacy (WEP) */ + WIFI_SEC_TYPE_WEP = 2, + + /** Pre-shared key (PSK) */ + WIFI_SEC_TYPE_PSK = 3, + + /** Simultaneous Authentication of Equals (SAE) */ + WIFI_SEC_TYPE_SAE = 4, + + /** + * EAP authentication. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.Core + */ + WIFI_SEC_TYPE_EAP = 5, + + /** + * SUITE_B_192 192 bit level. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.Core + */ + WIFI_SEC_TYPE_EAP_SUITE_B = 6, + + /** + * Opportunististic Wireless Encryption. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.Core + */ + WIFI_SEC_TYPE_OWE = 7, + + /** + * 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. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.Core + */ + WIFI_SEC_TYPE_WAPI_PSK = 9, + } + + /** + * Wi-Fi connection information. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.STA + */ + interface WifiLinkedInfo { + /** The SSID of the Wi-Fi hotspot */ + ssid: string; + + /** The BSSID of the Wi-Fi hotspot */ + bssid: string; + + /** The ID(uniquely identifies) of a Wi-Fi connection. */ + /* @systemapi */ + networkId: number; + + /** The RSSI(dBm) of a Wi-Fi access point. */ + rssi: number; + + /** The frequency band of a Wi-Fi access point. */ + band: number; + + /** The speed of a Wi-Fi access point. */ + linkSpeed: number; + + /** The frequency of a Wi-Fi access point. */ + frequency: number; + + /** Whether the SSID of the access point (AP) of this Wi-Fi connection is hidden. */ + isHidden: boolean; + + /** Whether this Wi-Fi connection restricts the data volume. */ + isRestricted: boolean; + + /** The load value of this Wi-Fi connection. A greater value indicates a higher load. */ + /* @systemapi */ + chload: number; + + /** The signal-to-noise ratio (SNR) of this Wi-Fi connection. */ + /* @systemapi */ + snr: number; + + /** + * 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. */ + macAddress: string; + + /** The IP address of this Wi-Fi connection. */ + ipAddress: number; + + /** The state of the supplicant of this Wi-Fi connection. */ + /* @systemapi */ + suppState: SuppState; + + /** The state of this Wi-Fi connection. */ + connState: ConnState; + } + + /** + * Wi-Fi IP information. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.STA + */ + interface IpInfo { + /** The IP address of the Wi-Fi connection */ + ipAddress: number; + + /** The gateway of the Wi-Fi connection */ + gateway: number; + + /** The network mask of the Wi-Fi connection */ + netmask: number; + + /** The primary DNS server IP address of the Wi-Fi connection */ + primaryDns: number; + + /** The secondary DNS server IP address of the Wi-Fi connection */ + secondDns: number; + + /** The DHCP server IP address of the Wi-Fi connection */ + serverIp: number; + + /** The IP address lease duration of the Wi-Fi connection */ + leaseDuration: number; + } + + /** + * Wi-Fi hotspot configuration information. + * + * @since 9 + * @systemapi Hide this for inner system use. + * @syscap SystemCapability.Communication.WiFi.AP.Core + */ + interface HotspotConfig { + /** The SSID of the Wi-Fi hotspot */ + ssid: string; + + /** The encryption mode of the Wi-Fi hotspot */ + securityType: WifiSecurityType; + + /** The frequency band of the Wi-Fi hotspot */ + band: number; + + /** The password of the Wi-Fi hotspot */ + preSharedKey: string; + + /** The maximum number of connections allowed by the Wi-Fi hotspot */ + maxConn: number; + } + + /** + * Wi-Fi station information. + * + * @since 9 + * @systemapi Hide this for inner system use. + * @syscap SystemCapability.Communication.WiFi.AP.Core + */ + interface StationInfo { + /** the network name of the Wi-Fi client */ + name: string; + + /** The MAC address of the Wi-Fi client */ + macAddress: string; + + /** The IP address of the Wi-Fi client */ + ipAddress: string; + } + + /** + * Wi-Fi IP type enumeration. + * + * @since 9 + * @systemapi Hide this for inner system use. + * @syscap SystemCapability.Communication.WiFi.STA + */ + enum IpType { + /** Use statically configured IP settings */ + STATIC, + + /** Use dynamically configured IP settings */ + DHCP, + + /** No IP details are assigned */ + UNKNOWN, + } + + /** + * The state of the supplicant enumeration. + * + * @since 9 + * @systemapi Hide this for inner system use. + * @syscap SystemCapability.Communication.WiFi.STA + */ + export enum SuppState { + /** The supplicant is not associated with or is disconnected from the AP. */ + DISCONNECTED, + + /** The network interface is disabled. */ + INTERFACE_DISABLED, + + /** The supplicant is disabled. */ + INACTIVE, + + /** The supplicant is scanning for a Wi-Fi connection. */ + SCANNING, + + /** The supplicant is authenticating with a specified AP. */ + AUTHENTICATING, + + /** The supplicant is associating with a specified AP. */ + ASSOCIATING, + + /** The supplicant is associated with a specified AP. */ + ASSOCIATED, + + /** The four-way handshake is ongoing. */ + FOUR_WAY_HANDSHAKE, + + /** The group handshake is ongoing. */ + GROUP_HANDSHAKE, + + /** All authentication is completed. */ + COMPLETED, + + /** Failed to establish a connection to the supplicant. */ + UNINITIALIZED, + + /** The supplicant is in an unknown or invalid state. */ + INVALID + } + + /** + * The state of Wi-Fi connection enumeration. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.STA + */ + export enum ConnState { + /** The device is searching for an available AP. */ + SCANNING, + + /** The Wi-Fi connection is being set up. */ + CONNECTING, + + /** The Wi-Fi connection is being authenticated. */ + AUTHENTICATING, + + /** The IP address of the Wi-Fi connection is being obtained. */ + OBTAINING_IPADDR, + + /** The Wi-Fi connection has been set up. */ + CONNECTED, + + /** The Wi-Fi connection is being torn down. */ + DISCONNECTING, + + /** The Wi-Fi connection has been torn down. */ + DISCONNECTED, + + /** Failed to set up the Wi-Fi connection. */ + UNKNOWN + } + + /** + * P2P device information. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.P2P + */ + interface WifiP2pDevice { + /** Device name */ + deviceName: string; + + /** Device mac address */ + deviceAddress: string; + + /** Primary device type */ + primaryDeviceType: string; + + /** Device status */ + deviceStatus: P2pDeviceStatus; + + /** Device group capabilitys */ + groupCapabilitys: number; + } + + /** + * P2P config. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.P2P + */ + interface WifiP2PConfig { + /** Device mac address */ + deviceAddress: string; + + /** + * Group network ID. When creating a group, -1 indicates creates a temporary group, + * -2: indicates creates a persistent group + */ + netId: number; + + /* The passphrase of this {@code WifiP2pConfig} instance */ + passphrase: string; + + /** Group name */ + groupName: string; + + /** Group owner band */ + goBand: GroupOwnerBand; + } + + /** + * P2P group information. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.P2P + */ + interface WifiP2pGroupInfo { + /** Indicates whether it is group owner */ + isP2pGo: boolean; + + /** Group owner information */ + ownerInfo: WifiP2pDevice; + + /** The group passphrase */ + passphrase: string; + + /** Interface name */ + interface: string; + + /** Group name */ + groupName: string; + + /** Network ID */ + networkId: number; + + /** Frequency */ + frequency: number; + + /** Client list */ + clientDevices: WifiP2pDevice[]; + + /** Group owner IP address */ + goIpAddress: string; + } + + /** + * P2P connection status. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.P2P + */ + enum P2pConnectState { + DISCONNECTED = 0, + CONNECTED = 1, + } + + /** + * P2P linked information. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.P2P + */ + interface WifiP2pLinkedInfo { + /** Connection status */ + connectState: P2pConnectState; + + /** Indicates whether it is group owner */ + isGroupOwner: boolean; + + /** Group owner address */ + groupOwnerAddr: string; + } + + /** + * P2P device status. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.P2P + */ + enum P2pDeviceStatus { + CONNECTED = 0, + INVITED = 1, + FAILED = 2, + AVAILABLE = 3, + UNAVAILABLE = 4, + } + + /** + * P2P group owner band. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.P2P + */ + enum GroupOwnerBand { + GO_BAND_AUTO = 0, + GO_BAND_2GHZ = 1, + GO_BAND_5GHZ = 2, + } +} + +export default wifimanager; -- Gitee From e57f34e32ad678532ea0c3d284360c3747ea49fe Mon Sep 17 00:00:00 2001 From: wangqing Date: Thu, 20 Oct 2022 17:59:18 +0800 Subject: [PATCH 209/438] fix delete_systemapi_plugin Signed-off-by: wangqing --- build-tools/delete_systemapi_plugin.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build-tools/delete_systemapi_plugin.js b/build-tools/delete_systemapi_plugin.js index db69d1a5f1..1eb44f5833 100644 --- a/build-tools/delete_systemapi_plugin.js +++ b/build-tools/delete_systemapi_plugin.js @@ -129,6 +129,9 @@ function formatImportDeclaration(url) { 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.name && + ts.isIdentifier(clauseNode.namedBindings.name)) { + clauseSet.add(clauseNode.namedBindings.name.escapedText.toString()); } else if (clauseNode.namedBindings && clauseNode.namedBindings.elements) { clauseNode.namedBindings.elements.forEach(ele => { if (ele.name && ts.isIdentifier(ele.name)) { -- Gitee From 91c1a10e90980946e39b59e35ad0931494f7438e Mon Sep 17 00:00:00 2001 From: "yanxiaotao@huawei.com" Date: Thu, 20 Oct 2022 18:05:21 +0800 Subject: [PATCH 210/438] add error code for wifi 1020 Signed-off-by: yanxiaotao@huawei.com --- api/@ohos.wifiext.d.ts | 6 ++ api/@ohos.wifimanagerext.d.ts | 113 ++++++++++++++++++++++++++++++++++ 2 files changed, 119 insertions(+) create mode 100644 api/@ohos.wifimanagerext.d.ts diff --git a/api/@ohos.wifiext.d.ts b/api/@ohos.wifiext.d.ts index c881d0a132..5dee0b5744 100644 --- a/api/@ohos.wifiext.d.ts +++ b/api/@ohos.wifiext.d.ts @@ -33,6 +33,7 @@ declare namespace wifiext { * @since 8 * @permission ohos.permission.MANAGE_WIFI_HOTSPOT_EXT * @syscap SystemCapability.Communication.WiFi.AP.Extension + * @deprecated since 9 */ function enableHotspot(): boolean; @@ -43,6 +44,7 @@ declare namespace wifiext { * @since 8 * @permission ohos.permission.MANAGE_WIFI_HOTSPOT_EXT * @syscap SystemCapability.Communication.WiFi.AP.Extension + * @deprecated since 9 */ function disableHotspot(): boolean; @@ -54,6 +56,7 @@ declare namespace wifiext { * @since 8 * @permission ohos.permission.GET_WIFI_INFO * @syscap SystemCapability.Communication.WiFi.AP.Extension + * @deprecated since 9 */ function getSupportedPowerModel(): Promise>; function getSupportedPowerModel(callback: AsyncCallback>): void; @@ -66,6 +69,7 @@ declare namespace wifiext { * @since 8 * @permission ohos.permission.GET_WIFI_INFO * @syscap SystemCapability.Communication.WiFi.AP.Extension + * @deprecated since 9 */ function getPowerModel (): Promise; function getPowerModel (callback: AsyncCallback): void; @@ -78,6 +82,7 @@ declare namespace wifiext { * @since 8 * @permission ohos.permission.MANAGE_WIFI_HOTSPOT_EXT * @syscap SystemCapability.Communication.WiFi.AP.Extension + * @deprecated since 9 */ function setPowerModel(model: PowerModel) : boolean @@ -86,6 +91,7 @@ declare namespace wifiext { * * @since 8 * @syscap SystemCapability.Communication.WiFi.AP.Extension + * @deprecated since 9 */ export enum PowerModel { /** Sleeping model. */ diff --git a/api/@ohos.wifimanagerext.d.ts b/api/@ohos.wifimanagerext.d.ts new file mode 100644 index 0000000000..82b84fbf0e --- /dev/null +++ b/api/@ohos.wifimanagerext.d.ts @@ -0,0 +1,113 @@ +/* + * 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 { AsyncCallback, Callback } from './basic'; + +/** + * Provides extended methods to operate or manage Wi-Fi. + * + *

The APIs involved in this file are non-general APIs. + * These extended APIs are only used by some product types, such as routers. + * Common products should not use these APIs.

+ * + * @since 8 + * @import import wifiext from '@ohos.wifiext'; + */ +declare namespace wifimanagerext { + /** + * Enables a Wi-Fi hotspot. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2700001 - Unspecified error. + * @permission ohos.permission.MANAGE_WIFI_HOTSPOT_EXT + * @syscap SystemCapability.Communication.WiFi.AP.Extension + */ + function enableHotspot(): void; + + /** + * Disables a Wi-Fi hotspot. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2700001 - Unspecified error. + * @permission ohos.permission.MANAGE_WIFI_HOTSPOT_EXT + * @syscap SystemCapability.Communication.WiFi.AP.Extension + */ + function disableHotspot(): void; + + /** + * Obtains the supported power model. + * + * @return Returns the array of supported power model. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2700001 - Unspecified error. + * @permission ohos.permission.GET_WIFI_INFO + * @syscap SystemCapability.Communication.WiFi.AP.Extension + */ + function getSupportedPowerModel(): Promise>; + function getSupportedPowerModel(callback: AsyncCallback>): void; + + /** + * Obtains the current Wi-Fi power mode. + * + * @return Returns the current Wi-Fi power mode. If a value less than zero is returned, it indicates a failure. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2700001 - Unspecified error. + * @permission ohos.permission.GET_WIFI_INFO + * @syscap SystemCapability.Communication.WiFi.AP.Extension + */ + function getPowerModel (): Promise; + function getPowerModel (callback: AsyncCallback): void; + + /** + * Set the current Wi-Fi power mode. + * + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 2700001 - Unspecified error. + * @permission ohos.permission.MANAGE_WIFI_HOTSPOT_EXT + * @syscap SystemCapability.Communication.WiFi.AP.Extension + */ + function setPowerModel(model: PowerModel) : void + + /** + * The power model enumeration. + * + * @since 9 + * @syscap SystemCapability.Communication.WiFi.AP.Extension + */ + export enum PowerModel { + /** Sleeping model. */ + SLEEPING = 0, + + /** General model. */ + GENERAL = 1, + + /** Through wall model. */ + THROUGH_WALL = 2, + } +} + +export default wifimanagerext; -- Gitee From 7e28c6719e9a18a03ac6eacf5b6f34b328f9104b Mon Sep 17 00:00:00 2001 From: "yanxiaotao@huawei.com" Date: Thu, 20 Oct 2022 18:07:01 +0800 Subject: [PATCH 211/438] add error code for wifi 1020 Signed-off-by: yanxiaotao@huawei.com --- api/@ohos.wifimanagerext.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.wifimanagerext.d.ts b/api/@ohos.wifimanagerext.d.ts index 82b84fbf0e..f740bc09ec 100644 --- a/api/@ohos.wifimanagerext.d.ts +++ b/api/@ohos.wifimanagerext.d.ts @@ -22,8 +22,8 @@ import { AsyncCallback, Callback } from './basic'; * These extended APIs are only used by some product types, such as routers. * Common products should not use these APIs.

* - * @since 8 - * @import import wifiext from '@ohos.wifiext'; + * @since 9 + * @import import wifimanagerext from '@ohos.wifimanagerext'; */ declare namespace wifimanagerext { /** -- Gitee From a01340d2e5f7c41b95d53e5a5b1cdb30b0099976 Mon Sep 17 00:00:00 2001 From: cc_ggboy Date: Thu, 20 Oct 2022 20:13:41 +0800 Subject: [PATCH 212/438] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cc_ggboy --- api/@ohos.abilityAccessCtrl.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/@ohos.abilityAccessCtrl.d.ts b/api/@ohos.abilityAccessCtrl.d.ts index a8c7a3a08e..23474f7e6f 100644 --- a/api/@ohos.abilityAccessCtrl.d.ts +++ b/api/@ohos.abilityAccessCtrl.d.ts @@ -42,6 +42,14 @@ import { Permissions } from './permissions'; * @useinstead ohos.abilityAccessCtrl.AtManager#checkAccessToken */ verifyAccessToken(tokenID: number, permissionName: string): Promise; + + /** + * Checks whether a specified application has been granted the given permission. + * @param tokenID The tokenId of specified application. + * @param permissionName The permission name to be verified. Permissions type only support the valid permission name. + * @return Returns permission verify result. + * @since 9 + */ verifyAccessToken(tokenID: number, permissionName: Permissions): Promise; /** -- Gitee From 3454d183dd010181454a4d7f06ff3ecd04bea803 Mon Sep 17 00:00:00 2001 From: wangqing Date: Thu, 20 Oct 2022 20:59:22 +0800 Subject: [PATCH 213/438] fix api_check_plugin Signed-off-by: wangqing --- build-tools/api_check_plugin/entry.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/build-tools/api_check_plugin/entry.js b/build-tools/api_check_plugin/entry.js index cc37411cf7..4abb8c21ec 100644 --- a/build-tools/api_check_plugin/entry.js +++ b/build-tools/api_check_plugin/entry.js @@ -28,11 +28,16 @@ function checkEntry(url) { try { const execSync = require("child_process").execSync; execSync("cd interface/sdk-js/build-tools/api_check_plugin && npm install"); - const path2 = path2 = path.resolve(sourceDirname, '../../../../', "ci_tool/ci_build/readme_file.txt"); + const path2 = path.resolve(sourceDirname, '../../../../', "ci_tool/ci_build/readme_file.txt"); fs.access(path2, fs.constants.R_OK | fs.constants.W_OK, (err) => { const checkResult2 = err ? 'no access!' : 'can read/write'; result += `checkResult2 = ${checkResult2} ||| ${path2} ||| \n`; }); + const path3 = path.resolve(__dirname, '../../../../', "ci_tool/ci_build/readme_file.txt"); + fs.access(path3, fs.constants.R_OK | fs.constants.W_OK, (err) => { + const checkResult3 = err ? 'no access!' : 'can read/write'; + result += `checkResult2 = ${checkResult3} ||| ${path3} ||| \n`; + }); const { scanEntry } = require(path.resolve(__dirname, "./src/api_check_plugin")); result += scanEntry(url); const content = fs.readFileSync(url, "utf-8"); -- Gitee From e6ef5aa141bd130e5fecdea854214bcd4bb2bfc5 Mon Sep 17 00:00:00 2001 From: zhuhongtao666 Date: Mon, 10 Oct 2022 15:34:23 +0800 Subject: [PATCH 214/438] fileio_add_errcode Signed-off-by: zhuhongtao666 --- api/@ohos.file.fs.d.ts | 496 +++++++++++++++++++++++++++++++++++++++++ api/@ohos.fileio.d.ts | 59 +++-- 2 files changed, 533 insertions(+), 22 deletions(-) create mode 100644 api/@ohos.file.fs.d.ts diff --git a/api/@ohos.file.fs.d.ts b/api/@ohos.file.fs.d.ts new file mode 100644 index 0000000000..17d95750eb --- /dev/null +++ b/api/@ohos.file.fs.d.ts @@ -0,0 +1,496 @@ +/* + * 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 { AsyncCallback } from './basic' + +export default fileIo; + +/** + * fileio + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + * @import import fileio from '@ohos.file.js'; + */ +declare namespace fileIo { + export { open }; + export { openSync }; + export { read }; + export { readSync }; + export { stat }; + export { statSync }; + export { truncate }; + export { truncateSync }; + export { write }; + export { writeSync }; + export { File }; + export { OpenMode }; + export { Stat }; + + /** + * Mode Indicates the open flags. + * @since 9 + * @syscap SystemCapability.FileManagement.File.FileIO + */ + namespace OpenMode { + const READ_ONLY = 0o0; // Read only Permission + const WRITE_ONLY = 0o1; // Write only Permission + const READ_WRITE = 0o2; // Write and Read Permission + const CREATE = 0o100; // If not exist, create file + const TRUNC = 0o1000; // File truncate len 0 + const APPEND = 0o2000; // File append write + const NONBLOCK = 0o4000; // File open in nonblocking mode + const DIR = 0o200000; // File is Dir + const NOFOLLOW = 0o400000; // File is not symbolic link + const SYNC = 0o4010000; // SYNC IO + } +} + +/** + * Open file. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + * @function open + * @param {string} path - path. + * @param {number} [mode = OpenMode.READ_ONLY] - mode. + * @param {AsyncCallback} [callback] - callback. + * @returns {void | Promise} no callback return Promise otherwise return void + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + */ +declare function open(path: string, mode?: number): Promise; +declare function open(path: string, callback: AsyncCallback): void; +declare function open(path: string, mode: number, callback: AsyncCallback): void; +/** + * Open file with sync interface. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + * @function openSync + * @param {string} path - path. + * @param {number} [mode = OpenMode.READ_ONLY] - mode. + * @returns {File} open fd + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900006 - No such device or address + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900014 - Device or resource busy + * @throws { BusinessError } 13900015 - File exists + * @throws { BusinessError } 13900017 - No such device + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900022 - Too many open files + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900029 - Resource deadlock would occur + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + */ +declare function openSync(path: string, mode?: number): File; + +/** + * Read file. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + * @function read + * @param {number} fd - file descriptor. + * @param {ArrayBuffer} buffer - file descriptor. + * @param {Object} [options] - options. + * @param {number} [options.offset = 0] - offset. + * @param {number} [options.length = 0] - length. + * @param {AsyncCallback} [callback] - callback. + * @returns {void | Promise} no callback return Promise otherwise return void + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + */ +declare function read(fd: number, buffer: ArrayBuffer, options?: { + offset?: number; + length?: number; +}): Promise +declare function read(fd: number, buffer: ArrayBuffer, callback: AsyncCallback): void; +declare function read(fd: number, buffer: ArrayBuffer, options: { + offset?: number; + length?: number; +}, callback: AsyncCallback): void; +/** + * Read file with sync interface. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + * @function readSync + * @param {number} fd - file descriptor. + * @param {ArrayBuffer} buffer - file descriptor. + * @param {Object} [options] - options. + * @param {number} [options.offset = 0] - offset. + * @param {number} [options.length = 0] - length. + * @returns {number} number of bytesRead + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900042 - Unknown error + */ +declare function readSync(fd: number, buffer: ArrayBuffer, options?: { + offset?: number; + length?: number; +}): number; + +/** + * Get file information. + * @static + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + * @param {string | number} file - path or file descriptor. + * @param {AsyncCallback} [callback] - callback. + * @returns {void | Promise} no callback return Promise otherwise return void + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + */ +declare function stat(file: string | number): Promise; +declare function stat(file: string | number, callback: AsyncCallback): void; +/** + * Get file information with sync interface. + * @static + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + * @param {string | number} file - path or file descriptor. + * @returns {Stat} stat success + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900011 - Out of memory + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900031 - Function not implemented + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900038 - Value too large for defined data type + * @throws { BusinessError } 13900042 - Unknown error + */ +declare function statSync(file: string | number): Stat; + + /** + * Truncate file. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + * @function truncate + * @param {string | number} file - path or file descriptor. + * @param {number} [len = 0] - len. + * @param {AsyncCallback} [callback] - callback. + * @returns {void | Promise} no callback return Promise otherwise return void + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + */ +declare function truncate(file: string | number, len?: number): Promise; +declare function truncate(file: string | number, callback: AsyncCallback): void; +declare function truncate(file: string | number, len: number, callback: AsyncCallback): void; +/** + * Truncate file with sync interface. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + * @function truncateSync + * @param {string | number} file - path or file descriptor. + * @param {number} [len = 0] - len. + * @returns {void} truncate success + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900002 - No such file or directory + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900012 - Permission denied + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900018 - Not a directory + * @throws { BusinessError } 13900019 - Is a directory + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900023 - Text file busy + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900027 - Read-only file system + * @throws { BusinessError } 13900030 - File name too long + * @throws { BusinessError } 13900033 - Too many symbolic links encountered + * @throws { BusinessError } 13900042 - Unknown error + */ +declare function truncateSync(file: string | number, len?: number): void; + +/** + * Write file. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + * @function write + * @param {number} fd - file descriptor. + * @param {ArrayBuffer | string} buffer - file descriptor. + * @param {Object} [options] - options. + * @param {number} [options.offset = 0] - offset. + * @param {number} [options.length = 0] - length. + * @param {string} [options.encoding = 'utf-8'] - encoding. + * @param {AsyncCallback} [callback] - callback. + * @returns {void | Promise} no callback return Promise otherwise return void + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + */ +declare function write(fd: number, buffer: ArrayBuffer | string, options?: { + offset?: number; + length?: number; + encoding?: string; +}): Promise; +declare function write(fd: number, buffer: ArrayBuffer | string, callback: AsyncCallback): void; +declare function write(fd: number, buffer: ArrayBuffer | string, options: { + offset?: number; + length?: number; + encoding?: string; +}, callback: AsyncCallback): void; +/** + * Write file with sync interface. + * + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + * @function writeSync + * @param {number} fd - file descriptor. + * @param {ArrayBuffer | string} buffer - file descriptor. + * @param {Object} [options] - options. + * @param {number} [options.offset = 0] - offset. + * @param {number} [options.length = 0] - length. + * @param {string} [options.encoding = 'utf-8'] - encoding. + * @returns {number} on success number of bytesRead + * @throws { BusinessError } 13900001 - Operation not permitted + * @throws { BusinessError } 13900004 - Interrupted system call + * @throws { BusinessError } 13900005 - I/O error + * @throws { BusinessError } 13900008 - Bad file descriptor + * @throws { BusinessError } 13900010 - Try again + * @throws { BusinessError } 13900013 - Bad address + * @throws { BusinessError } 13900020 - Invalid argument + * @throws { BusinessError } 13900024 - File too large + * @throws { BusinessError } 13900025 - No space left on device + * @throws { BusinessError } 13900034 - Operation would block + * @throws { BusinessError } 13900041 - Quota exceeded + * @throws { BusinessError } 13900042 - Unknown error + */ +declare function writeSync(fd: number, buffer: ArrayBuffer | string, options?: { + offset?: number; + length?: number; + encoding?: string; +}): number; + +/** + * File object. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ +declare interface File { + /** + * @type {number} + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + * @readonly + */ + readonly fd: number; +} +/** + * Stat object. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + */ +declare interface Stat { + /** + * @type {number} + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + * @readonly + */ + readonly ino: number; + /** + * @type {number} + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + * @readonly + */ + readonly mode: number; + /** + * @type {number} + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + * @readonly + */ + readonly uid: number; + /** + * @type {number} + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + * @readonly + */ + readonly gid: number; + /** + * @type {number} + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + * @readonly + */ + readonly size: number; + /** + * @type {number} + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + * @readonly + */ + readonly atime: number; + /** + * @type {number} + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + * @readonly + */ + readonly mtime: number; + /** + * @type {number} + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + * @readonly + */ + readonly ctime: number; + /** + * whether path/fd is block device. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + * @returns {boolean} is or not + */ + isBlockDevice(): boolean; + /** + * whether path/fd is character device. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + * @returns {boolean} is or not + */ + isCharacterDevice(): boolean; + /** + * whether path/fd is directory. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + * @returns {boolean} is or not + */ + isDirectory(): boolean; + /** + * whether path/fd is fifo. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + * @returns {boolean} is or not + */ + isFIFO(): boolean; + /** + * whether path/fd is file. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + * @returns {boolean} is or not + */ + isFile(): boolean; + /** + * whether path/fd is socket. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + * @returns {boolean} is or not + */ + isSocket(): boolean; + /** + * whether path/fd is symbolic link. + * @syscap SystemCapability.FileManagement.File.FileIO + * @since 9 + * @returns {boolean} is or not + */ + isSymbolicLink(): boolean; +} diff --git a/api/@ohos.fileio.d.ts b/api/@ohos.fileio.d.ts index 40ce3da342..5317eb7967 100644 --- a/api/@ohos.fileio.d.ts +++ b/api/@ohos.fileio.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -84,7 +84,6 @@ declare namespace fileIO { export { writeSync }; export { Dir }; export { Dirent }; - export { ReadOut }; export { Stat }; export { Stream }; @@ -281,7 +280,8 @@ declare function chmodSync(path: string, mode: number): void; * @note N/A * @syscap SystemCapability.FileManagement.File.FileIO * @since 7 - * @permission N/A + * @deprecated since 9 + * @useinstead ohos.file.fs.truncate * @function ftruncate * @param {number} fd - fd. * @param {number} [len = 0] - len. @@ -298,7 +298,8 @@ declare function ftruncate(fd: number, len: number, callback: AsyncCallback): void; * @note N/A * @syscap SystemCapability.FileManagement.File.FileIO * @since 7 - * @permission N/A + * @deprecated since 9 + * @useinstead ohos.file.fs.statSync * @function fstatSync * @param {number} fd - fd. * @returns {Stat} @@ -620,7 +623,8 @@ declare function mkdtempSync(prefix: string): string; * @note N/A * @syscap SystemCapability.FileManagement.File.FileIO * @since 7 - * @permission N/A + * @deprecated since 9 + * @useinstead ohos.file.fs.open * @function open * @param {string} path - path. * @param {number} [flags = 0] - flags. @@ -639,7 +643,8 @@ declare function open(path: string, flags: number, mode: number, callback: Async * @note N/A * @syscap SystemCapability.FileManagement.File.FileIO * @since 6 - * @permission N/A + * @deprecated since 9 + * @useinstead ohos.file.fs.openSync * @function openSync * @param {string} path - path. * @param {number} [flags = 0] - flags. @@ -727,7 +732,8 @@ declare function readTextSync(filePath: string, options?: { * @note N/A * @syscap SystemCapability.FileManagement.File.FileIO * @since 6 - * @permission N/A + * @deprecated since 9 + * @useinstead ohos.file.fs.read * @function read * @param {number} fd - file descriptor. * @param {ArrayBuffer} buffer - file descriptor. @@ -756,7 +762,8 @@ declare function read(fd: number, buffer: ArrayBuffer, options: { * @note N/A * @syscap SystemCapability.FileManagement.File.FileIO * @since 6 - * @permission N/A + * @deprecated since 9 + * @useinstead ohos.file.fs.readSync * @function readSync * @param {number} fd - file descriptor. * @param {ArrayBuffer} buffer - file descriptor. @@ -836,7 +843,8 @@ declare function rmdirSync(path: string): void; * @note N/A * @syscap SystemCapability.FileManagement.File.FileIO * @since 6 - * @permission N/A + * @deprecated since 9 + * @useinstead ohos.file.fs.stat * @param {string} path - path. * @param {AsyncCallback} [callback] - callback. * @returns {void | Promise} no callback return Promise otherwise return void @@ -850,7 +858,8 @@ declare function stat(path: string, callback: AsyncCallback): void; * @note N/A * @syscap SystemCapability.FileManagement.File.FileIO * @since 6 - * @permission N/A + * @deprecated since 9 + * @useinstead ohos.file.fs.statSync * @param {string} path - path. * @returns {Stat} stat success * @throws {TypedError | Error} stat fail @@ -892,7 +901,8 @@ declare function symlink(target: string, srcPath: string, callback: AsyncCallbac * @note N/A * @syscap SystemCapability.FileManagement.File.FileIO * @since 7 - * @permission N/A + * @deprecated since 9 + * @useinstead ohos.file.fs.truncate * @function truncate * @param {string} path - path. * @param {number} [len = 0] - len. @@ -909,7 +919,8 @@ declare function truncate(path: string, len: number, callback: AsyncCallback; + displayName?: Array; /** * @type {Array} * @syscap SystemCapability.FileManagement.File.FileIO @@ -1180,7 +1193,7 @@ export type Filter = { * @since 9 * @readonly */ - mimeType: Array; + mimeType?: Array; /** * @type {number} * @syscap SystemCapability.FileManagement.File.FileIO @@ -1188,7 +1201,7 @@ export type Filter = { * @since 9 * @readonly */ - fileSizeOver: number; + fileSizeOver?: number; /** * @type {number} * @syscap SystemCapability.FileManagement.File.FileIO @@ -1196,7 +1209,7 @@ export type Filter = { * @since 9 * @readonly */ - lastModifiedAfter: number; + lastModifiedAfter?: number; /** * @type {boolean} * @syscap SystemCapability.FileManagement.File.FileIO @@ -1204,14 +1217,15 @@ export type Filter = { * @since 9 * @readonly */ - excludeMedia: boolean; + excludeMedia?: boolean; } /** * Stat * @syscap SystemCapability.FileManagement.File.FileIO * @since 6 - * @permission N/A + * @deprecated since 9 + * @useinstead ohos.file.fs.Stat */ declare interface Stat { /** @@ -1545,6 +1559,7 @@ declare interface Stream { * ReadOut * @syscap SystemCapability.FileManagement.File.FileIO * @since 6 + * @deprecated since 9 * @permission N/A */ declare interface ReadOut { -- Gitee From dea34fafa0908afec70b8c091be8dfe4c5ea061b Mon Sep 17 00:00:00 2001 From: herunlei Date: Thu, 20 Oct 2022 21:57:26 +0800 Subject: [PATCH 215/438] replace unsupported rmSync function to unlinkSync function Signed-off-by: herunlei --- build-tools/permissions_converter/convert.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-tools/permissions_converter/convert.js b/build-tools/permissions_converter/convert.js index 31af90f3d5..3c54fb7e7d 100644 --- a/build-tools/permissions_converter/convert.js +++ b/build-tools/permissions_converter/convert.js @@ -56,7 +56,7 @@ const getPermissions = downloadPath => { const convertJsonToDTS = (permissions, outputFilePath) => { if (fs.existsSync(outputFilePath)) { - fs.rmSync(outputFilePath, { recursive: true, force: true }); + fs.unlinkSync(outputFilePath); } fs.appendFileSync(outputFilePath, copyRight, 'utf8'); fs.appendFileSync(outputFilePath, typeHead, 'utf8'); -- Gitee From e1c1971a429742be8ccc2b3792571c866b7e0dcb Mon Sep 17 00:00:00 2001 From: yqhan Date: Mon, 5 Sep 2022 21:30:57 +0800 Subject: [PATCH 216/438] Add interface of Worker exception information issue: https://gitee.com/openharmony/interface_sdk-js/issues/I5PTU7 Describe: Add interface exception information. Signed-off-by: yqhan --- api/@ohos.worker.d.ts | 389 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 383 insertions(+), 6 deletions(-) diff --git a/api/@ohos.worker.d.ts b/api/@ohos.worker.d.ts index fffe7241f1..f1e54446fa 100644 --- a/api/@ohos.worker.d.ts +++ b/api/@ohos.worker.d.ts @@ -67,7 +67,7 @@ export interface Event { * @since 7 * @syscap SystemCapability.Utils.Lang */ - export interface ErrorEvent extends Event { +export interface ErrorEvent extends Event { /** * Information about the exception. * @since 7 @@ -109,7 +109,7 @@ export interface Event { * @since 7 * @syscap SystemCapability.Utils.Lang */ - export interface MessageEvent extends Event { +export interface MessageEvent extends Event { /** * Data transferred when an exception occurs. * @since 7 @@ -134,8 +134,10 @@ export interface PostMessageOptions { } /** - * Implements evemt listening. + * Implements event listening. * @since 7 + * @deprecated since 9 + * @useinstead ohos.worker.WorkerEventListener * @syscap SystemCapability.Utils.Lang */ export interface EventListener { @@ -143,11 +145,31 @@ export interface EventListener { * Specifies the callback to invoke. * @param evt Event class for the callback to invoke. * @since 7 + * @deprecated since 9 + * @useinstead ohos.worker.WorkerEventListener.(event: Event): void | Promise * @syscap SystemCapability.Utils.Lang */ (evt: Event): void | Promise; } +/** + * Implements event listening. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + export interface WorkerEventListener { + /** + * Specifies the callback function to be invoked. + * @param event Event class for the callback to invoke. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200004 - Worker instance is not running. + * @throws {BusinessError} 10200005 - The invoked API is not supported in workers. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + (event: Event): void | Promise; +} + /** * Type of message, only "message" and "messageerror". * @since 7 @@ -158,14 +180,18 @@ type MessageType = "message" | "messageerror"; /** * Specific event features. * @since 7 + * @deprecated since 9 + * @useinstead ohos.worker.WorkerEventTarget * @syscap SystemCapability.Utils.Lang */ - export interface EventTarget { +export interface EventTarget { /** * Adds an event listener to the worker. * @param type Type of the event to listen for. * @param listener Callback to invoke when an event of the specified type occurs. * @since 7 + * @deprecated since 9 + * @useinstead ohos.worker.WorkerEventTarget.addEventListener * @syscap SystemCapability.Utils.Lang */ addEventListener( @@ -177,6 +203,8 @@ type MessageType = "message" | "messageerror"; * Dispatches the event defined for the worker. * @param event Event to dispatch. * @since 7 + * @deprecated since 9 + * @useinstead ohos.worker.WorkerEventTarget.dispatchEvent * @syscap SystemCapability.Utils.Lang */ dispatchEvent(event: Event): boolean; @@ -186,6 +214,8 @@ type MessageType = "message" | "messageerror"; * @param type Type of the event for which the event listener is removed. * @param callback Callback of the event listener to remove. * @since 7 + * @deprecated since 9 + * @useinstead ohos.worker.WorkerEventTarget.removeEventListener * @syscap SystemCapability.Utils.Lang */ removeEventListener( @@ -196,6 +226,53 @@ type MessageType = "message" | "messageerror"; /** * Removes all event listeners for the worker. * @since 7 + * @deprecated since 9 + * @useinstead ohos.worker.WorkerEventTarget.removeAllListener + * @syscap SystemCapability.Utils.Lang + */ + removeAllListener(): void; +} + +/** + * Specific worker event features. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ +export interface WorkerEventTarget { + /** + * Adds an event listener to the worker. + * @param type Type of the event to listen for. + * @param listener Callback to invoke when an event of the specified type occurs. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200004 - Worker instance is not running. + * @throws {BusinessError} 10200005 - The invoked API is not supported in workers. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + addEventListener(type: string, listener: WorkerEventListener): void; + /** + * Handle the event defined for the worker. + * @param event Event to dispatch. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200004 - Worker instance is not running. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + dispatchEvent(event: Event): boolean; + /** + * Remove an event defined for the worker. + * @param type Type of the event for which the event listener is cancelled. + * @param callback Callback of the event listener to remove. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200004 - Worker instance is not running. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + removeEventListener(type: string, callback?: WorkerEventListener): void; + /** + * Remove all event listeners for the worker. + * @throws {BusinessError} 10200004 - Worker instance is not running. + * @since 9 * @syscap SystemCapability.Utils.Lang */ removeAllListener(): void; @@ -204,12 +281,16 @@ type MessageType = "message" | "messageerror"; /** * Specifies the worker thread running environment, which is isolated from the host thread environment. * @since 7 + * @deprecated since 9 + * @useinstead ohos.worker.GlobalScope * @syscap SystemCapability.Utils.Lang */ declare interface WorkerGlobalScope extends EventTarget { /** * Worker name specified when there is a new worker. * @since 7 + * @deprecated since 9 + * @useinstead ohos.worker.GlobalScope.name * @syscap SystemCapability.Utils.Lang */ readonly name: string; @@ -220,18 +301,53 @@ declare interface WorkerGlobalScope extends EventTarget { * The event handler is executed in the worker thread. * @param ev Error data. * @since 7 + * @deprecated since 9 + * @useinstead ohos.worker.GlobalScope.onerror * @syscap SystemCapability.Utils.Lang */ onerror?: (ev: ErrorEvent) => void; readonly self: WorkerGlobalScope & typeof globalThis; } +/** + * The environment Specified in which worker threads run, which is isolated from the host thread environment. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + declare interface GlobalScope extends WorkerEventTarget { + /** + * Name of Worker specified when there is a new worker. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + readonly name: string; + + /** + * The onerror attribute of parentPort specified. + * the event handler to be called when an exception occurs during worker execution. + * The event handler is executed in the worker thread. + * @param ev Error data. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + onerror?: (ev: ErrorEvent) => void; + /** + * Specify the type attribute for self. + * @param self type is read-only. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + readonly self: GlobalScope & typeof globalThis; +} + /** * Specifies the worker thread running environment, which is isolated from the host thread environment * @since 7 + * @deprecated since 9 + * @useinstead ohos.worker.ThreadWorkerGlobalScope * @syscap SystemCapability.Utils.Lang */ - export interface DedicatedWorkerGlobalScope extends WorkerGlobalScope { +export interface DedicatedWorkerGlobalScope extends WorkerGlobalScope { /** * The onmessage attribute of parentPort specifies the event handler * to be called then the worker thread receives a message sent by @@ -239,6 +355,8 @@ declare interface WorkerGlobalScope extends EventTarget { * The event handler is executed in the worker thread. * @param ev Message received. * @since 7 + * @deprecated since 9 + * @useinstead ohos.worker.ThreadWorkerGlobalScope.onmessage * @syscap SystemCapability.Utils.Lang */ onmessage?: (this: DedicatedWorkerGlobalScope, ev: MessageEvent) => void; @@ -249,6 +367,8 @@ declare interface WorkerGlobalScope extends EventTarget { * The event handler is executed in the worker thread. * @param ev Error data. * @since 7 + * @deprecated since 9 + * @useinstead ohos.worker.ThreadWorkerGlobalScope.onmessageerror * @syscap SystemCapability.Utils.Lang */ onmessageerror?: (this: DedicatedWorkerGlobalScope, ev: MessageEvent) => void; @@ -256,6 +376,8 @@ declare interface WorkerGlobalScope extends EventTarget { /** * Close the worker thread to stop the worker from receiving messages * @since 7 + * @deprecated since 9 + * @useinstead ohos.worker.ThreadWorkerGlobalScope.close * @syscap SystemCapability.Utils.Lang */ close(): void; @@ -266,6 +388,7 @@ declare interface WorkerGlobalScope extends EventTarget { * @param transfer array cannot contain null. * @since 7 * @deprecated since 9 + * @useinstead ohos.worker.ThreadWorkerGlobalScope.postMessage * @syscap SystemCapability.Utils.Lang */ postMessage(messageObject: Object, transfer: Transferable[]): void; @@ -281,18 +404,253 @@ declare interface WorkerGlobalScope extends EventTarget { postMessage(messageObject: Object, transfer: ArrayBuffer[]): void; } +/** + * Specifies the thread-worker running environment, which is isolated from the host-thread environment + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ +export interface ThreadWorkerGlobalScope extends GlobalScope { + /** + * The onmessage attribute of parentPort specifies the event handler + * to be called then the worker thread receives a message sent by + * the host thread through worker postMessage. + * The event handler is executed in the worker thread. + * @param ev Message received. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200004 - Worker instance is not running. + * @throws {BusinessError} 10200005 - The invoked API is not supported in workers. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + onmessage?: (this: ThreadWorkerGlobalScope, ev: MessageEvent) => void; + + /** + * The onmessage attribute of parentPort specifies the event handler + * to be called then the worker receives a message that cannot be deserialized. + * The event handler is executed in the worker thread. + * @param ev Error data. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200004 - Worker instance is not running. + * @throws {BusinessError} 10200005 - The invoked API is not supported in workers. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + onmessageerror?: (this: ThreadWorkerGlobalScope, ev: MessageEvent) => void; + + /** + * Close the worker thread to stop the worker from receiving messages + * @throws {BusinessError} 10200004 - Worker instance is not running. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + close(): void; + + /** + * Send a message to host thread from the worker + * @param messageObject Data to be sent to the worker + * @param transfer array cannot contain null. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200004 - Worker instance is not running. + * @throws {BusinessError} 10200006 - Serializing an uncaught exception failed. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + postMessage(messageObject: Object, transfer: ArrayBuffer[]): void; + + /** + * Send a message to be host thread from the worker + * @param messageObject Data to be sent to the worker + * @param options Option can be set for postmessage. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200004 - Worker instance is not running. + * @throws {BusinessError} 10200006 - Serializing an uncaught exception failed. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + postMessage(messageObject: Object, options?: PostMessageOptions): void; +} + /** * JS cross-thread communication tool * @since 7 * @syscap SystemCapability.Utils.Lang */ declare namespace worker { + /** + * The ThreadWorker class contains all Worker functions. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + class ThreadWorker implements WorkerEventTarget { + /** + * Creates a worker instance + * @param scriptURL URL of the script to be executed by the worker + * @param options Options that can be set for the worker + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200003 - Worker initialization failure. + * @throws {BusinessError} 10200007 - The worker file patch is invalid path. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + constructor(scriptURL: string, options?: WorkerOptions); + /** + * The onexit attribute of the worker specifies the event handler to be called + * when the worker exits. The handler is executed in the host thread. + * @param code Code indicating the worker exit state + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200004 - Worker instance is not running. + * @throws {BusinessError} 10200005 - The invoked API is not supported in workers. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + onexit?: (code: number) => void; + /** + * The onerror attribute of the worker specifies the event handler to be called + * when an exception occurs during worker execution. + * The event handler is executed in the host thread. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200004 - Worker instance is not running. + * @throws {BusinessError} 10200005 - The invoked API is not supported in workers. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + onerror?: (err: ErrorEvent) => void; + /** + * The onmessage attribute of the worker specifies the event handler + * to be called then the host thread receives a message created by itself + * and sent by the worker through the parentPort.postMessage. + * The event handler is executed in the host thread. + * @param event Message received. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200004 - Worker instance is not running. + * @throws {BusinessError} 10200005 - The invoked API is not supported in workers. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + onmessage?: (event: MessageEvent) => void; + /** + * The onmessage attribute of the worker specifies the event handler + * when the worker receives a message that cannot be serialized. + * The event handler is executed in the host thread. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200004 - Worker instance is not running. + * @throws {BusinessError} 10200005 - The invoked API is not supported in workers. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + onmessageerror?: (event: MessageEvent) => void; + /** + * Sends a message to the worker thread. + * The data is transferred using the structured clone algorithm. + * @param message Data to be sent to the worker + * @param transfer ArrayBuffer instance that can be transferred. + * The transferList array cannot contain null. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200004 - Worker instance is not running. + * @throws {BusinessError} 10200006 - Serializing an uncaught exception failed. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + postMessage(message: Object, transfer: ArrayBuffer[]): void; + /** + * Sends a message to the worker thread. + * The data is transferred using the structured clone algorithm. + * @param message Data to be sent to the worker + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200004 - Worker instance is not running. + * @throws {BusinessError} 10200006 - Serializing an uncaught exception failed. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + postMessage(message: Object, options?: PostMessageOptions): void; + /** + * Adds an event listener to the worker. + * @param type Adds an event listener to the worker. + * @param listener Callback to invoke when an event of the specified type occurs. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200004 - Worker instance is not running. + * @throws {BusinessError} 10200005 - The invoked API is not supported in workers. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + on(type: string, listener: WorkerEventListener): void; + /** + * Adds an event listener to the worker + * and removes the event listener automatically after it is invoked once. + * @param type Type of the event to listen for + * @param listener Callback to invoke when an event of the specified type occurs + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200004 - Worker instance is not running. + * @throws {BusinessError} 10200005 - The invoked API is not supported in workers. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + once(type: string, listener: WorkerEventListener): void; + /** + * Removes an event listener to the worker. + * @param type Type of the event for which the event listener is removed. + * @param listener Callback of the event listener to remove. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200004 - Worker instance is not running. + * @throws {BusinessError} 10200005 - The invoked API is not supported in workers. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + off(type: string, listener?: WorkerEventListener): void; + /** + * Terminates the worker thread to stop the worker from receiving messages + * @throws {BusinessError} 10200004 - Worker instance is not running. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + terminate(): void; + /** + * Adds an event listener to the worker. + * @param type Type of the event to listen for. + * @param listener Callback to invoke when an event of the specified type occurs. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200004 - Worker instance is not running. + * @throws {BusinessError} 10200005 - The invoked API is not supported in workers. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + addEventListener(type: string, listener: WorkerEventListener): void; + /** + * Handle the event defined for the worker. + * @param event Event to dispatch. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200004 - Worker instance is not running. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + dispatchEvent(event: Event): boolean; + /** + * Remove an event defined for the worker. + * @param type Type of the event for which the event listener is cancelled. + * @param callback Callback of the event listener to remove. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 10200004 - Worker instance is not running. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + removeEventListener(type: string, callback?: WorkerEventListener): void; + /** + * Remove all event listeners for the worker. + * @throws {BusinessError} 10200004 - Worker instance is not running. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + removeAllListener(): void; + } + class Worker implements EventTarget { /** * Creates a worker instance * @param scriptURL URL of the script to be executed by the worker * @param options Options that can be set for the worker * @since 7 + * @deprecated since 9 + * @useinstead ohos.worker.ThreadWorker.constructor * @syscap SystemCapability.Utils.Lang */ constructor(scriptURL: string, options?: WorkerOptions); @@ -302,6 +660,8 @@ declare namespace worker { * when the worker exits. The handler is executed in the host thread. * @param code Code indicating the worker exit state * @since 7 + * @deprecated since 9 + * @useinstead ohos.worker.ThreadWorker.onexit * @syscap SystemCapability.Utils.Lang */ onexit?: (code: number) => void; @@ -311,6 +671,8 @@ declare namespace worker { * when an exception occurs during worker execution. * The event handler is executed in the host thread. * @since 7 + * @deprecated since 9 + * @useinstead ohos.worker.ThreadWorker.onerror * @syscap SystemCapability.Utils.Lang */ onerror?: (err: ErrorEvent) => void; @@ -322,6 +684,8 @@ declare namespace worker { * The event handler is executed in the host thread. * @param event Message received. * @since 7 + * @deprecated since 9 + * @useinstead ohos.worker.ThreadWorker.onmessage * @syscap SystemCapability.Utils.Lang */ onmessage?: (event: MessageEvent) => void; @@ -331,6 +695,8 @@ declare namespace worker { * when the worker receives a message that cannot be serialized. * The event handler is executed in the host thread. * @since 7 + * @deprecated since 9 + * @useinstead ohos.worker.ThreadWorker.onmessageerror * @syscap SystemCapability.Utils.Lang */ onmessageerror?: (event: MessageEvent) => void; @@ -342,6 +708,8 @@ declare namespace worker { * @param transfer ArrayBuffer instance that can be transferred. * The transferList array cannot contain null. * @since 7 + * @deprecated since 9 + * @useinstead ohos.worker.ThreadWorker.postMessage * @syscap SystemCapability.Utils.Lang */ postMessage(message: Object, transfer: ArrayBuffer[]): void; @@ -352,6 +720,8 @@ declare namespace worker { * @param type Adds an event listener to the worker. * @param listener Callback to invoke when an event of the specified type occurs. * @since 7 + * @deprecated since 9 + * @useinstead ohos.worker.ThreadWorker.on * @syscap SystemCapability.Utils.Lang */ on(type: string, listener: EventListener): void; @@ -362,6 +732,8 @@ declare namespace worker { * @param type Type of the event to listen for * @param listener Callback to invoke when an event of the specified type occurs * @since 7 + * @deprecated since 9 + * @useinstead ohos.worker.ThreadWorker.once * @syscap SystemCapability.Utils.Lang */ once(type: string, listener: EventListener): void; @@ -371,6 +743,8 @@ declare namespace worker { * @param type Type of the event for which the event listener is removed. * @param listener Callback of the event listener to remove. * @since 7 + * @deprecated since 9 + * @useinstead ohos.worker.ThreadWorker.off * @syscap SystemCapability.Utils.Lang */ off(type: string, listener?: EventListener): void; @@ -378,11 +752,14 @@ declare namespace worker { /** * Terminates the worker thread to stop the worker from receiving messages * @since 7 + * @deprecated since 9 + * @useinstead ohos.worker.ThreadWorker.terminate * @syscap SystemCapability.Utils.Lang */ terminate(): void; } const parentPort: DedicatedWorkerGlobalScope; -} + const workerPort: ThreadWorkerGlobalScope; +} export default worker; \ No newline at end of file -- Gitee From ea8128cbdc6761f8c5c744650dd8b73d5be1c191 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Wed, 31 Aug 2022 15:32:15 +0800 Subject: [PATCH 217/438] houhaoyu@huawei.com rename Clear Signed-off-by: houhaoyu Change-Id: Ic4a43fc736198fbaaf654f816852f4de7f977c00 --- api/@internal/component/ets/common_ts_ets_api.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/api/@internal/component/ets/common_ts_ets_api.d.ts b/api/@internal/component/ets/common_ts_ets_api.d.ts index 1416b44d75..f1c673e5e6 100644 --- a/api/@internal/component/ets/common_ts_ets_api.d.ts +++ b/api/@internal/component/ets/common_ts_ets_api.d.ts @@ -81,9 +81,17 @@ declare class AppStorage { /** * Called when a cleanup occurs. * @since 7 + * @deprecated since 9 + * @useinstead AppStorage.Clear */ static staticClear(): boolean; + /** + * Called when a cleanup occurs. + * @since 9 + */ + static Clear(): boolean; + /** * Called when the data can be changed. * @since 7 -- Gitee From 6ac1a547c2824c4053024adf42108b2af0ccdde9 Mon Sep 17 00:00:00 2001 From: zhangxiuping Date: Tue, 18 Oct 2022 20:51:22 +0800 Subject: [PATCH 218/438] update nfc api 9 for throw exceptions. Signed-off-by: zhangxiuping --- api/@ohos.nfc.tag.d.ts | 68 ++++--- api/tag/nfctech.d.ts | 406 ++++++++++++++++++++++++----------------- 2 files changed, 274 insertions(+), 200 deletions(-) diff --git a/api/@ohos.nfc.tag.d.ts b/api/@ohos.nfc.tag.d.ts index 1543c240c6..761c31f24e 100644 --- a/api/@ohos.nfc.tag.d.ts +++ b/api/@ohos.nfc.tag.d.ts @@ -99,7 +99,7 @@ declare namespace tag { } /** - * NfcForum Type definition. The Ndef tag may use one of them. + * NfcForum Type definition. The NDEF tag may use one of them. * * @since 9 * @syscap SystemCapability.Communication.NFC.Core @@ -247,75 +247,85 @@ declare namespace tag { /** * Obtains an {@link IsoDepTag} object based on the tag information. * - *

During tag reading, if the tag supports the IsoDep technology, an {@link IsoDepTag} object + * During tag reading, if the tag supports the IsoDep technology, an {@link IsoDepTag} object * will be created based on the tag information. * - * @param tagInfo Indicates the tag information. - * @permission ohos.permission.NFC_TAG - * + * @param { TagInfo } tagInfo - Indicates the diapatched tag information. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @syscap SystemCapability.Communication.NFC.Core * @since 9 */ - function getIsoDepTag(tagInfo: TagInfo): IsoDepTag + function getIsoDep(tagInfo: TagInfo): IsoDepTag /** * Obtains an {@link NdefTag} object based on the tag information. * - *

During tag reading, if the tag supports the NDEF technology, an {@link NdefTag} object + * During tag reading, if the tag supports the NDEF technology, an {@link NdefTag} object * will be created based on the tag information. * - * @param tagInfo Indicates the tag information. - * @permission ohos.permission.NFC_TAG - * + * @param { TagInfo } tagInfo - Indicates the diapatched tag information. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @syscap SystemCapability.Communication.NFC.Core * @since 9 */ - function getNdefTag(tagInfo: TagInfo): NdefTag + function getNdef(tagInfo: TagInfo): NdefTag /** * Obtains an {@link MifareClassicTag} object based on the tag information. * - *

During tag reading, if the tag supports the MifareClassic technology, + * During tag reading, if the tag supports the MifareClassic technology, * an {@link MifareClassicTag} object will be created based on the tag information. * - * @param tagInfo Indicates the tag information. - * @permission ohos.permission.NFC_TAG - * + * @param { TagInfo } tagInfo - Indicates the diapatched tag information. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @syscap SystemCapability.Communication.NFC.Core * @since 9 */ - function getMifareClassicTag(tagInfo: TagInfo): MifareClassicTag + function getMifareClassic(tagInfo: TagInfo): MifareClassicTag /** * Obtains an {@link MifareUltralightTag} object based on the tag information. * - *

During tag reading, if the tag supports the MifareUltralight technology, + * During tag reading, if the tag supports the MifareUltralight technology, * an {@link MifareUltralightTag} object will be created based on the tag information. * - * @param tagInfo Indicates the tag information. - * @permission ohos.permission.NFC_TAG - * + * @param { TagInfo } tagInfo - Indicates the diapatched tag information. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @syscap SystemCapability.Communication.NFC.Core * @since 9 */ - function getMifareUltralightTag(tagInfo: TagInfo): MifareUltralightTag + function getMifareUltralight(tagInfo: TagInfo): MifareUltralightTag /** * Obtains an {@link NdefFormatableTag} object based on the tag information. * - *

During tag reading, if the tag supports the NdefFormatable technology, + * During tag reading, if the tag supports the NdefFormatable technology, * an {@link NdefFormatableTag} object will be created based on the tag information. * - * @param tagInfo Indicates the tag information. - * @permission ohos.permission.NFC_TAG - * + * @param { TagInfo } tagInfo - Indicates the diapatched tag information. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @syscap SystemCapability.Communication.NFC.Core * @since 9 */ - function getNdefFormatableTag(tagInfo: TagInfo): NdefFormatableTag + function getNdefFormatable(tagInfo: TagInfo): NdefFormatableTag /** * Parse a {@link TagInfo} object from Want. * - * @param want The want object that contains the values of TagInfo. - * @return The TagInfo object that's parsed. + * @param { Want } want - The want object that contains the values of TagInfo. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 801 - Capability not supported. * @syscap SystemCapability.Communication.NFC.Core - * @permission ohos.permission.NFC_TAG * @since 9 */ function getTagInfo(want: Want): TagInfo diff --git a/api/tag/nfctech.d.ts b/api/tag/nfctech.d.ts index 72c7aa22cc..b7632d3029 100644 --- a/api/tag/nfctech.d.ts +++ b/api/tag/nfctech.d.ts @@ -148,26 +148,32 @@ export interface NfcVTag extends TagSession { */ export interface IsoDepTag extends TagSession { /** - * Get Historical bytes of the tag. - * @return the Historical bytes. + * Gets IsoDep Historical bytes of the tag, which is based on NfcA RF technology. + * It could be null if not based on NfcA. + * + * @return { number[] } Returns the Historical bytes, the length could be 0. * @since 9 - * @permission ohos.permission.NFC_TAG */ getHistoricalBytes(): number[]; /** - * Get HiLayerResponse bytes of the tag. - * @return HiLayerResponse bytes + * Gets IsoDep HiLayer Response bytes of the tag, which is based on NfcB RF technology. + * It could be null if not based on NfcB. + * + * @return { number[] } Returns HiLayer Response bytes, the length could be 0. * @since 9 - * @permission ohos.permission.NFC_TAG */ getHiLayerResponse(): number[]; /** - * Check if externded apdu length supported or not. - * @return return true if externded apdu length supported, otherwise false. - * @since 9 + * Checks if extended apdu length supported or not. + * + * @return { boolean } Returns true if extended apdu length supported, otherwise false. * @permission ohos.permission.NFC_TAG + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @since 9 */ isExtendedApduSupported(): Promise; isExtendedApduSupported(callback: AsyncCallback): void; @@ -175,59 +181,64 @@ export interface IsoDepTag extends TagSession { export interface NdefMessage { /** - * Get all records of a ndef message. - * @return record list of a ndef message + * Obtains all records of an NDEF message. + * + * @return { tag.NdefRecord[] } Records the list of NDEF records. * @since 9 - * @permission ohos.permission.NFC_TAG */ getNdefRecords(): tag.NdefRecord[]; /** - * Create a ndef record with uri data. - * @param uri uri data for new a ndef record - * @return the instance of NdefRecord + * Creates an NDEF record with uri data. + * + * @param { string } uri - Uri data for new NDEF record. + * @return { tag.NdefRecord } The instance of NdefRecord. + * @throws { BusinessError } 401 - The parameter check failed. * @since 9 - * @permission ohos.permission.NFC_TAG */ makeUriRecord(uri: string): tag.NdefRecord; /** - * Create a ndef record with text data. - * @param text text data for new a ndef record - * @param locale language code for the ndef record. if locale is null, use default locale - * @return the instance of NdefRecord + * Creates an NDEF record with text data. + * + * @param { string } text - Text data for new an NDEF record. + * @param { string } locale - Language code for the NDEF record. if locale is null, use default locale. + * @return { tag.NdefRecord } The instance of NdefRecord. + * @throws { BusinessError } 401 - The parameter check failed. * @since 9 - * @permission ohos.permission.NFC_TAG */ makeTextRecord(text: string, locale: string): tag.NdefRecord; /** - * Create a ndef record with mime data. - * @param mimeType type of mime data for new a ndef record - * @param mimeData mime data for new a ndef record - * @return the instance of NdefRecord + * Creates an NDEF record with mime data. + * + * @param { string } mimeType type of mime data for new an NDEF record. + * @param { string } mimeData mime data for new an NDEF record. + * @return { tag.NdefRecord } The instance of NdefRecord. + * @throws { BusinessError } 401 - The parameter check failed. * @since 9 - * @permission ohos.permission.NFC_TAG */ makeMimeRecord(mimeType: string, mimeData: number[]): tag.NdefRecord; /** - * Create a ndef record with external data. - * @param domainName domain name of issuing organization for the external data - * @param serviceName domain specific type of data for the external data - * @param externalData data payload of a ndef record - * @return the instance of NdefRecord + * Creates an NDEF record with external data. + * + * @param { string } domainName - Domain name of issuing organization for the external data. + * @param { string } serviceName - Domain specific type of data for the external data. + * @param { number[] } externalData - Data payload of an NDEF record. + * @return { tag.NdefRecord } The instance of NdefRecord. + * @throws { BusinessError } 401 - The parameter check failed. * @since 9 - * @permission ohos.permission.NFC_TAG */ makeExternalRecord(domainName: string, serviceName: string, externalData: number[]): tag.NdefRecord; /** - * Parse a ndef message into raw bytes. - * @param ndefMessage a ndef message to parse - * @return raw bytes of a ndef message + * Parses an NDEF message into raw bytes. + * + * @param { NdefMessage } ndefMessage - An NDEF message to parse. + * @return { number[] } Returns the raw bytes of an NDEF message. + * @throws { BusinessError } 401 - The parameter check failed. * @since 9 - * @permission ohos.permission.NFC_TAG */ messageToBytes(ndefMessage: NdefMessage): number[]; } @@ -240,90 +251,105 @@ export interface NdefMessage { */ export interface NdefTag extends TagSession { /** - * Create a ndef message with raw bytes. - * @param data raw bytes to parse ndef message - * @return the instance of NdefMessage + * Creates an NDEF message with raw bytes. + * + * @param { number[] } data - The raw bytes to parse NDEF message. + * @return { NdefMessage } The instance of NdefMessage. + * @throws { BusinessError } 401 - The parameter check failed. * @since 9 - * @permission ohos.permission.NFC_TAG */ createNdefMessage(data: number[]): NdefMessage; /** - * Create a ndef message with record list. - * @param ndefRecords record list to parse ndef message - * @return the instance of NdefMessage + * Creates an NDEF message with record list. + * + * @param { tag.NdefRecord[] } ndefRecords - The NDEF records to parse NDEF message. + * @return { NdefMessage } The instance of NdefMessage. + * @throws { BusinessError } 401 - The parameter check failed. * @since 9 - * @permission ohos.permission.NFC_TAG */ createNdefMessage(ndefRecords: tag.NdefRecord[]): NdefMessage; /** - * Get the type of the Ndef tag. - * @return type of Ndef tag. + * Gets the type of NDEF tag. + * + * @return { tag.NfcForumType } The type of NDEF tag. * @since 9 - * @permission ohos.permission.NFC_TAG */ getNdefTagType(): tag.NfcForumType; /** - * Get the ndef message that was read from ndef tag when tag discovery. - * @return ndef message. + * Gets the NDEF message that was read from NDEF tag when tag discovery. + * + * @return { NdefMessage } The instance of NdefMessage. * @since 9 - * @permission ohos.permission.NFC_TAG */ getNdefMessage(): NdefMessage; /** - * Check if ndef tag is writable. - * @return return true if the tag is writable, otherwise return false. + * Checks if NDEF tag is writable. + * + * @return { boolean } Returns true if the tag is writable, otherwise returns false. * @since 9 - * @permission ohos.permission.NFC_TAG */ - isNdefWritable(): Promise; - isNdefWritable(callback: AsyncCallback): void; + isNdefWritable(): boolean; /** - * Read ndef message on this tag. - * @return ndef message in tag. - * @since 9 + * Reads NDEF message on this tag. + * + * @return { NdefMessage } The NDEF message in tag. * @permission ohos.permission.NFC_TAG + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @since 9 */ readNdef(): Promise; readNdef(callback: AsyncCallback): void; /** - * Write ndef message into this tag. - * @param msg ndef message to write - * @return Error code of write. if return 0, means successful. - * @since 9 + * Writes NDEF message into this tag. + * + * @param { NdefMessage } msg - The NDEF message to be written. * @permission ohos.permission.NFC_TAG + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @since 9 */ - writeNdef(msg: NdefMessage): Promise; - writeNdef(msg: NdefMessage, callback: AsyncCallback): void; + writeNdef(msg: NdefMessage): Promise; + writeNdef(msg: NdefMessage, callback: AsyncCallback): void; /** - * Check ndef tag can be set read-only - * @return return true if the tag can be set readonly, otherwise return false. - * @since 9 + * Checks NDEF tag can be set read-only. + * + * @return { boolean } Returns true if the tag can be set readonly, otherwise returns false. * @permission ohos.permission.NFC_TAG + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @since 9 */ canSetReadOnly(): boolean; /** - * Set ndef tag read-only - * @return if return 0 means successful, otherwise the error code. - * @since 9 + * Sets the NDEF tag read-only. + * * @permission ohos.permission.NFC_TAG + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @since 9 */ - setReadOnly(): Promise; - setReadOnly(callback: AsyncCallback): void; + setReadOnly(): Promise; + setReadOnly(callback: AsyncCallback): void; /** - * Convert the Nfc forum type into byte array defined in Nfc forum. - * @param type Nfc forum type of ndef tag - * @return Nfc forum type byte array + * Converts the NFC forum type into string defined in NFC forum. + * + * @param { tag.NfcForumType } type - NFC forum type of NDEF tag. + * @return { string } The NFC forum string type. + * @throws { BusinessError } 401 - The parameter check failed. * @since 9 - * @permission ohos.permission.NFC_TAG */ getNdefTagTypeString(type: tag.NfcForumType): string; } @@ -336,136 +362,161 @@ export interface NdefTag extends TagSession { */ export interface MifareClassicTag extends TagSession { /** - * Authenticate a sector with the key.Only successful authentication sector can be operated. - * @param sectorIndex Index of sector to authenticate - * @param key key(6-bytes) to authenticate - * @param isKeyA KeyA flag. true means KeyA, otherwise KeyB - * @return Result of authenticattion. if return ture, means successful. - * @since 9 + * Authenticates a sector with the key.Only successful authentication sector can be operated. + * + * @param { number } sectorIndex - Index of sector to authenticate. + * @param { number[] } key - The key(6-bytes) to authenticate. + * @param { boolean } isKeyA - KeyA flag. true means KeyA, otherwise KeyB. * @permission ohos.permission.NFC_TAG + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @since 9 */ - authenticateSector(sectorIndex: number, key: number[], isKeyA: boolean): Promise; - authenticateSector(sectorIndex: number, key: number[], isKeyA: boolean, callback: AsyncCallback): void; + authenticateSector(sectorIndex: number, key: number[], isKeyA: boolean): Promise; + authenticateSector(sectorIndex: number, key: number[], isKeyA: boolean, callback: AsyncCallback): void; /** - * Read a block, one block size is 16 bytes. - * @param blockIndex index of block to read - * @return the block data - * @since 9 + * Reads a block, one block size is 16 bytes. + * + * @param { number } blockIndex - The index of block to read. + * @return { number[] } Returns the block data. * @permission ohos.permission.NFC_TAG + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @since 9 */ readSingleBlock(blockIndex: number): Promise; readSingleBlock(blockIndex: number, callback: AsyncCallback): void; /** - * Write a block, one block size is 16 bytes. - * @param blockIndex index of block to write - * @param data block data to write - * @return Error code of write. if return 0, means successful. + * Writes a block, one block size is 16 bytes. + * + * @param { number } blockIndex - The index of block to write. + * @param { number } data - The block data to write. + * @permission ohos.permission.NFC_TAG + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. * @since 9 - * @permission ohos.pemission.NFC_TAG */ - writeSingleBlock(blockIndex: number, data: number[]): Promise; - writeSingleBlock(blockIndex: number, data: number[], callback: AsyncCallback): void; + writeSingleBlock(blockIndex: number, data: number[]): Promise; + writeSingleBlock(blockIndex: number, data: number[], callback: AsyncCallback): void; /** - * Increment a value block - * @param blockIndex index of block to increment - * @param value value to increment, none-negative - * @return Error code of increment. if return 0, means successful. - * @since 9 + * Increments the contents of a block, and stores the result in the internal transfer buffer. + * + * @param { number } blockIndex - The index of block to increment. + * @param { number } value - The value to increment, none-negative. * @permission ohos.permission.NFC_TAG + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @since 9 */ - incrementBlock(blockIndex: number, value: number): Promise; - incrementBlock(blockIndex: number, value: number, callback: AsyncCallback): void; + incrementBlock(blockIndex: number, value: number): Promise; + incrementBlock(blockIndex: number, value: number, callback: AsyncCallback): void; /** - * Decrement a value block - * @param blockIndex index of block to decrement - * @param value value to increment, none-negative - * @return Error code of decrement. if return 0, means successful. - * @since 9 + * Decrements the contents of a block, and stores the result in the internal transfer buffer. + * + * @param { number } blockIndex - The index of block to decrement. + * @param { number } value - The value to decrement, none-negative. * @permission ohos.permission.NFC_TAG + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @since 9 */ - decrementBlock(blockIndex: number, value: number): Promise; - decrementBlock(blockIndex: number, value: number, callback: AsyncCallback): void; + decrementBlock(blockIndex: number, value: number): Promise; + decrementBlock(blockIndex: number, value: number, callback: AsyncCallback): void; /** - * Copy from the value of register to the value block - * @param blockIndex index of value block to copy to - * @return if return 0, means successful. otherwise the error code - * @since 9 + * Writes the contents of the internal transfer buffer to a value block. + * + * @param { number } blockIndex - The index of value block to be written. * @permission ohos.permission.NFC_TAG + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @since 9 */ - transferToBlock(blockIndex: number): Promise; - transferToBlock(blockIndex: number, callback: AsyncCallback): void; + transferToBlock(blockIndex: number): Promise; + transferToBlock(blockIndex: number, callback: AsyncCallback): void; /** - * Copy from the value block to the register - * @param blockIndex index of value block to copy from - * @return if return 0, means successful. otherwise the error code - * @since 9 + * Moves the contents of a block into the internal transfer buffer. + * + * @param { number } blockIndex - The index of value block to be moved from. * @permission ohos.permission.NFC_TAG + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @since 9 */ - restoreFromBlock(blockIndex: number): Promise; - restoreFromBlock(blockIndex: number, callback: AsyncCallback): void; + restoreFromBlock(blockIndex: number): Promise; + restoreFromBlock(blockIndex: number, callback: AsyncCallback): void; /** - * Get the number of sectors in mifareclassic tag - * @return the number of sectors. + * Gets the number of sectors in MifareClassic tag. + * + * @return { number } Returns the number of sectors. * @since 9 - * @permission ohos.permission.NFC_TAG */ getSectorCount(): number; /** - * Get the number of blocks in the sector. - * @param sectorIndex index of sector - * @return the number of blocks. + * Gets the number of blocks in the sector. + * + * @param { number } sectorIndex - The index of sector. + * @return { number } Returns the number of blocks. + * @throws { BusinessError } 401 - The parameter check failed. * @since 9 - * @permission ohos.permission.NFC_TAG */ getBlockCountInSector(sectorIndex: number): number; /** - * Get the type of the MifareClassic tag. - * @return type of MifareClassic tag. + * Gets the type of the MifareClassic tag. + * + * @return { tag.MifareClassicType } Returns type of MifareClassic tag. * @since 9 - * @permission ohos.permission.NFC_TAG */ getType(): tag.MifareClassicType; /** - * Get size of the tag in bytes, see {@code MifareTagSize}. - * @return size of the tag + * Gets size of the tag in bytes. + * + * @return { number } Returns the size of the tag. * @since 9 - * @permission ohos.permission.NFC_TAG */ getTagSize(): number; /** - * check if if tag is emulated - * @return return true if tag is emulated, otherwise return false. + * Checks if the tag is emulated or not. + * + * @return { boolean } Returns true if tag is emulated, otherwise false. * @since 9 - * @permission ohos.permission.NFC_TAG */ isEmulatedTag(): boolean; /** - * Get the first block of the specific sector. - * @param sectorIndex index of sector - * @return index of first block in the sector + * Gets the first block of the specific sector. + * + * @param { number } sectorIndex - The index of sector. + * @return { number } Returns index of first block in the sector. + * @throws { BusinessError } 401 - The parameter check failed. * @since 9 - * @permission ohos.permission.NFC_TAG */ getBlockIndex(sectorIndex: number): number; /** - * Get the sector index, that the sector contains the specific block. - * @param blockIndex index of block - * @return the sector index + * Gets the sector index, that the sector contains the specific block. + * + * @param { number } blockIndex - The index of block. + * @return { number } Returns the sector index. + * @throws { BusinessError } 401 - The parameter check failed. * @since 9 - * @permission ohos.permission.NFC_TAG */ getSectorIndex(blockIndex: number): number; } @@ -478,31 +529,38 @@ export interface MifareClassicTag extends TagSession { */ export interface MifareUltralightTag extends TagSession { /** - * Read 4 pages, total is 16 bytes. page size is 4bytes. - * @param pageIndex index of page to read - * @return 4 pages data - * @since 9 + * Reads 4 pages, total is 16 bytes. Page size is 4 bytes. + * + * @param { number } pageIndex - The index of page to read. + * @return { number[] } Returns 4 pages data. * @permission ohos.permission.NFC_TAG + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @since 9 */ readMultiplePages(pageIndex: number): Promise; readMultiplePages(pageIndex: number, callback: AsyncCallback): void; /** - * Write a page, total 4 bytes. - * @param pageIndex index of page to write - * @param data page data to write - * @return Error code of write. if return 0, means successful. - * @since 9 + * Writes a page, total 4 bytes. + * + * @param { number } pageIndex - The index of page to write. + * @param { number[] } data - The page data to write. * @permission ohos.permission.NFC_TAG + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @since 9 */ - writeSinglePages(pageIndex: number, data: number[]): Promise; - writeSinglePages(pageIndex: number, data: number[], callback: AsyncCallback): void; + writeSinglePage(pageIndex: number, data: number[]): Promise; + writeSinglePage(pageIndex: number, data: number[], callback: AsyncCallback): void; /** - * Get the type of the MifareUltralight tag in bytes. - * @return type of MifareUltralight tag. + * Gets the type of the MifareUltralight tag. + * + * @return { tag.MifareUltralightType } Returns the type of MifareUltralight tag. * @since 9 - * @permission ohos.permission.NFC_TAG */ getType(): tag.MifareUltralightType; } @@ -515,22 +573,28 @@ export interface MifareUltralightTag extends TagSession { */ export interface NdefFormatableTag extends TagSession { /** - * Format a tag as NDEF tag, then write Ndef message into the Ndef Tag - * @param message Ndef message to write while format successful. it can be null, then only format the tag. - * @return if return 0, means successful. otherwise the error code - * @since 9 + * Formats a tag as NDEF tag, writes NDEF message into the NDEF Tag. + * + * @param { NdefMessage } message - NDEF message to write while format. It can be null, then only format the tag. * @permission ohos.permission.NFC_TAG + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @since 9 */ - format(message: NdefMessage): Promise; - format(message: NdefMessage, callback: AsyncCallback): void; + format(message: NdefMessage): Promise; + format(message: NdefMessage, callback: AsyncCallback): void; /** - * Format a tag as NDEF tag, then write Ndef message into the Ndef Tag, then set the tag readonly - * @param message Ndef message to write while format successful. it can be null, then only format the tag. - * @return if return 0, means successful. otherwise the error code - * @since 9 + * Formats a tag as NDEF tag, writes NDEF message into the NDEF Tag, then sets the tag readonly. + * + * @param { NdefMessage } message - NDEF message to write while format. It can be null, then only format the tag. * @permission ohos.permission.NFC_TAG + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - The parameter check failed. + * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @since 9 */ - formatReadOnly(message: NdefMessage): Promise; - formatReadOnly(message: NdefMessage, callback: AsyncCallback): void; + formatReadOnly(message: NdefMessage): Promise; + formatReadOnly(message: NdefMessage, callback: AsyncCallback): void; } \ No newline at end of file -- Gitee From b925bb57964b7811bba303e97a53edfea5042f94 Mon Sep 17 00:00:00 2001 From: leihonglin Date: Fri, 21 Oct 2022 11:14:46 +0800 Subject: [PATCH 219/438] Add interface code comments. Signed-off-by: leihonglin --- api/common/lite/viewmodel.d.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/api/common/lite/viewmodel.d.ts b/api/common/lite/viewmodel.d.ts index bd23458986..abb1309d47 100644 --- a/api/common/lite/viewmodel.d.ts +++ b/api/common/lite/viewmodel.d.ts @@ -109,10 +109,30 @@ export interface Options> { onDestroy?(): void; } +/** + * Used for ide. + * @systemapi + * @hide + * @since 4 + */ type DefaultData = object; + +/** + * Used for ide. + * @systemapi + * @hide + * @since 4 + */ type CombinedOptions = object & Options & ThisType; + +/** + * @syscap SystemCapability.ArkUI.ArkUI.Lite + * @systemapi + * @hide + * @since 4 + */ export declare function extendViewModel( options: CombinedOptions ): ViewModel & Data; -- Gitee From fcdc78c2fdd7c4c12509689bf8afe15937d3e415 Mon Sep 17 00:00:00 2001 From: "yanxiaotao@huawei.com" Date: Fri, 21 Oct 2022 14:09:11 +0800 Subject: [PATCH 220/438] add error code for wifi 1021 Signed-off-by: yanxiaotao@huawei.com --- api/{@ohos.wifimanager.d.ts => @ohos.wifiManager.d.ts} | 10 ++++------ ...s.wifimanagerext.d.ts => @ohos.wifiManagerExt.d.ts} | 6 +++--- 2 files changed, 7 insertions(+), 9 deletions(-) rename api/{@ohos.wifimanager.d.ts => @ohos.wifiManager.d.ts} (99%) rename api/{@ohos.wifimanagerext.d.ts => @ohos.wifiManagerExt.d.ts} (96%) diff --git a/api/@ohos.wifimanager.d.ts b/api/@ohos.wifiManager.d.ts similarity index 99% rename from api/@ohos.wifimanager.d.ts rename to api/@ohos.wifiManager.d.ts index c28639f811..976505740c 100644 --- a/api/@ohos.wifimanager.d.ts +++ b/api/@ohos.wifiManager.d.ts @@ -19,16 +19,15 @@ import { AsyncCallback, Callback } from './basic'; * Provides methods to operate or manage Wi-Fi. * * @since 9 - * @import import wifimanager from '@ohos.wifimanager'; + * @import import wifiManager from '@ohos.wifiManager'; */ -declare namespace wifimanager { +declare namespace wifiManager { /** * Enables Wi-Fi. * * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. - * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2500001 - Unspecified error. * @syscap SystemCapability.Communication.WiFi.STA @@ -43,9 +42,8 @@ declare namespace wifimanager { * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. - * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. @@ -1955,4 +1953,4 @@ declare namespace wifimanager { } } -export default wifimanager; +export default wifiManager; diff --git a/api/@ohos.wifimanagerext.d.ts b/api/@ohos.wifiManagerExt.d.ts similarity index 96% rename from api/@ohos.wifimanagerext.d.ts rename to api/@ohos.wifiManagerExt.d.ts index f740bc09ec..75e11e6635 100644 --- a/api/@ohos.wifimanagerext.d.ts +++ b/api/@ohos.wifiManagerExt.d.ts @@ -23,9 +23,9 @@ import { AsyncCallback, Callback } from './basic'; * Common products should not use these APIs.

* * @since 9 - * @import import wifimanagerext from '@ohos.wifimanagerext'; + * @import import wifiManagerExt from '@ohos.wifiManagerExt'; */ -declare namespace wifimanagerext { +declare namespace wifiManagerExt { /** * Enables a Wi-Fi hotspot. * @@ -110,4 +110,4 @@ declare namespace wifimanagerext { } } -export default wifimanagerext; +export default wifiManagerExt; -- Gitee From 9063636413d5f68c1b236a87b9f3cad2414eb6bb Mon Sep 17 00:00:00 2001 From: wangqing Date: Fri, 21 Oct 2022 15:34:50 +0800 Subject: [PATCH 221/438] =?UTF-8?q?api=5Fcheck=E8=81=94=E8=B0=83=E9=AA=8C?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangqing --- build-tools/api_check_plugin/entry.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-tools/api_check_plugin/entry.js b/build-tools/api_check_plugin/entry.js index 4abb8c21ec..f97227165b 100644 --- a/build-tools/api_check_plugin/entry.js +++ b/build-tools/api_check_plugin/entry.js @@ -46,7 +46,7 @@ function checkEntry(url) { removeDir(path.resolve(__dirname, "node_modules")); } catch (error) { // catch error - result = `CATCHERROR : ${error}, mdFilePath = ${url}, __dirname = ${__dirname}, sourceDirname = ${sourceDirname}`; + result += `CATCHERROR : ${error}, mdFilePath = ${url}, __dirname = ${__dirname}, sourceDirname = ${sourceDirname}`; } writeResultFile(result, path.resolve(__dirname, "./Result.txt"), {}); } -- Gitee From b9feac95d266e701bc833d1873fc9ff7ad55672f Mon Sep 17 00:00:00 2001 From: ma-shaoyin Date: Fri, 21 Oct 2022 15:44:09 +0800 Subject: [PATCH 222/438] Signed-off-by: ma-shaoyin Changes to be committed: --- api/@ohos.inputmethod.d.ts | 6 +-- api/@ohos.inputmethodextensionability.d.ts | 55 +--------------------- api/@ohos.inputmethodextensioncontext.d.ts | 28 ----------- 3 files changed, 4 insertions(+), 85 deletions(-) diff --git a/api/@ohos.inputmethod.d.ts b/api/@ohos.inputmethod.d.ts index b551539641..3a14e58aa8 100644 --- a/api/@ohos.inputmethod.d.ts +++ b/api/@ohos.inputmethod.d.ts @@ -566,14 +566,14 @@ declare namespace inputMethod { * @since 9 * @syscap SystemCapability.MiscServices.InputMethodFramework */ - readonly name?: string; + readonly name: string; /** * The id of input method * @since 9 * @syscap SystemCapability.MiscServices.InputMethodFramework */ - readonly id?: string; + readonly id: string; /** * The label of input method @@ -601,7 +601,7 @@ declare namespace inputMethod { * @since 9 * @syscap SystemCapability.MiscServices.InputMethodFramework */ - extra?: object; + extra: object; } } diff --git a/api/@ohos.inputmethodextensionability.d.ts b/api/@ohos.inputmethodextensionability.d.ts index 9736dd016c..cf6c86fad1 100644 --- a/api/@ohos.inputmethodextensionability.d.ts +++ b/api/@ohos.inputmethodextensionability.d.ts @@ -15,7 +15,6 @@ import rpc from "./@ohos.rpc"; import Want from './@ohos.application.Want'; -import ExtensionAbility from './@ohos.application.ExtensionAbility'; import InputMethodExtensionContext from "./@ohos.inputmethodextensioncontext"; /** @@ -25,7 +24,7 @@ import InputMethodExtensionContext from "./@ohos.inputmethodextensioncontext"; * @syscap SystemCapability.MiscServices.InputMethodFramework * @StageModelOnly */ -export default class InputMethodExtensionAbility extends ExtensionAbility { +export default class InputMethodExtensionAbility { /** * Indicates input method extension ability context. * @since 9 @@ -56,56 +55,4 @@ export default class InputMethodExtensionAbility extends ExtensionAbility { * @StageModelOnly */ onDestroy(): void; - - /** - * Called back when a input method extension is started. - * - * @since 9 - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @param want Indicates the want of service extension to start. - * @param startId Indicates the number of times the service extension has been started. The {@code startId} is - * incremented by 1 every time the service extension is started. For example, if the service extension - * has been started for six times. - * @return - - * @throws {BusinessError} 401 - parameter error. - * @StageModelOnly - */ - onRequest(want: Want, startId: number): void; - - /** - * Called back when a input method extension is first connected to an ability. - * - * @since 9 - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @param want Indicates connection information about the Service ability. - * @return Returns the proxy of the Service ability. - * @throws {BusinessError} 401 - parameter error. - * @StageModelOnly - */ - onConnect(want: Want): rpc.RemoteObject; - - /** - * Called back when all abilities connected to a input method extension are disconnected. - * - * @since 9 - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @param want Indicates disconnection information about the service extension. - * @return - - * @throws {BusinessError} 401 - parameter error. - * @StageModelOnly - */ - onDisconnect(want: Want): void; - - /** - * Called when a new client attempts to connect to a input method extension after all previous client connections to it - * are disconnected. - * - * @since 9 - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @param want Indicates the want of the service extension being connected. - * @return - - * @throws {BusinessError} 401 - parameter error. - * @StageModelOnly - */ - onReconnect(want: Want): void; } \ No newline at end of file diff --git a/api/@ohos.inputmethodextensioncontext.d.ts b/api/@ohos.inputmethodextensioncontext.d.ts index c09bd7e0a3..b9f7b9f386 100644 --- a/api/@ohos.inputmethodextensioncontext.d.ts +++ b/api/@ohos.inputmethodextensioncontext.d.ts @@ -26,34 +26,6 @@ import ExtensionContext from './application/ExtensionContext'; * @StageModelOnly */ export default class InputMethodExtensionContext extends ExtensionContext { - /** - * Input method extension uses this method to start a specific ability. - * - * @since 9 - * @deprecated 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 - * @deprecated since 9 - * @useinstead ohos.inputmethodextensioncontext.InputMethodExtensionContext.destroy - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @return - - * @StageModelOnly - */ - terminateSelf(callback: AsyncCallback): void; - terminateSelf(): Promise; - /** * Destroy the input method extension. * -- Gitee From bee76b5c9a680e53a56b9ffec0d34863716c3535 Mon Sep 17 00:00:00 2001 From: "yanxiaotao@huawei.com" Date: Fri, 21 Oct 2022 16:07:46 +0800 Subject: [PATCH 223/438] add error code for wifi 1021 Signed-off-by: yanxiaotao@huawei.com --- api/@ohos.wifiManager.d.ts | 162 +++++++++++++++++----------------- api/@ohos.wifiManagerExt.d.ts | 10 +-- 2 files changed, 86 insertions(+), 86 deletions(-) diff --git a/api/@ohos.wifiManager.d.ts b/api/@ohos.wifiManager.d.ts index 976505740c..ef1eb42deb 100644 --- a/api/@ohos.wifiManager.d.ts +++ b/api/@ohos.wifiManager.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2022 Huawei Device Co., Ltd. + * 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 @@ -29,7 +29,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. @@ -59,7 +59,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO */ @@ -75,7 +75,7 @@ declare namespace wifiManager { * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.LOCATION */ @@ -90,7 +90,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or ohos.permission.LOCATION) */ @@ -106,7 +106,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or ohos.permission.LOCATION) */ @@ -125,7 +125,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG * @systemapi Hide this for inner system use. @@ -144,7 +144,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO * @deprecated since 9 @@ -162,7 +162,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO * @deprecated since 9 @@ -183,7 +183,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO */ @@ -202,7 +202,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO */ @@ -220,7 +220,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION */ @@ -237,7 +237,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO */ @@ -253,7 +253,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. @@ -270,7 +270,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG and * ohos.permission.MANAGE_WIFI_CONNECTION @@ -285,7 +285,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. @@ -304,7 +304,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO */ @@ -318,7 +318,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO */ @@ -333,7 +333,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO */ @@ -349,7 +349,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2400001 - Unspecified error. + * @throws {BusinessError} 2400001 - System exception. * @syscap SystemCapability.Communication.WiFi.Core * @permission ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. @@ -365,7 +365,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2400001 - Unspecified error. + * @throws {BusinessError} 2400001 - System exception. * @syscap SystemCapability.Communication.WiFi.Core * @permission ohos.permission.GET_WIFI_INFO */ @@ -381,7 +381,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_LOCAL_MAC and ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. @@ -397,7 +397,7 @@ declare namespace wifiManager { * @since 7 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO */ @@ -410,7 +410,7 @@ declare namespace wifiManager { * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2400001 - Unspecified error. + * @throws {BusinessError} 2400001 - System exception. * @syscap SystemCapability.Communication.WiFi.Core * @permission ohos.permission.GET_WIFI_INFO */ @@ -423,7 +423,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. @@ -437,7 +437,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. @@ -455,7 +455,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.GET_WIFI_CONFIG * @systemapi Hide this for inner system use. @@ -474,7 +474,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG * @systemapi Hide this for inner system use. @@ -491,7 +491,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. @@ -505,7 +505,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. @@ -526,7 +526,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. @@ -542,7 +542,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2600001 - Unspecified error. + * @throws {BusinessError} 2600001 - System exception. * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. @@ -559,7 +559,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2600001 - Unspecified error. + * @throws {BusinessError} 2600001 - System exception. * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. @@ -574,7 +574,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2600001 - Unspecified error. + * @throws {BusinessError} 2600001 - System exception. * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. @@ -589,7 +589,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2600001 - Unspecified error. + * @throws {BusinessError} 2600001 - System exception. * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. @@ -610,7 +610,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2600001 - Unspecified error. + * @throws {BusinessError} 2600001 - System exception. * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG * @systemapi Hide this for inner system use. @@ -625,7 +625,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2600001 - Unspecified error. + * @throws {BusinessError} 2600001 - System exception. * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG * @systemapi Hide this for inner system use. @@ -642,7 +642,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2600001 - Unspecified error. + * @throws {BusinessError} 2600001 - System exception. * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. @@ -656,7 +656,7 @@ declare namespace wifiManager { * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - Unspecified error. + * @throws {BusinessError} 2800001 - System exception. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO */ @@ -670,7 +670,7 @@ declare namespace wifiManager { * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - Unspecified error. + * @throws {BusinessError} 2800001 - System exception. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION */ @@ -685,7 +685,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - Unspecified error. + * @throws {BusinessError} 2800001 - System exception. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION */ @@ -702,7 +702,7 @@ declare namespace wifiManager { * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - Unspecified error. + * @throws {BusinessError} 2800001 - System exception. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG */ @@ -717,7 +717,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - Unspecified error. + * @throws {BusinessError} 2800001 - System exception. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO */ @@ -730,7 +730,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - Unspecified error. + * @throws {BusinessError} 2800001 - System exception. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO */ @@ -744,7 +744,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - Unspecified error. + * @throws {BusinessError} 2800001 - System exception. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION */ @@ -757,7 +757,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - Unspecified error. + * @throws {BusinessError} 2800001 - System exception. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO */ @@ -770,7 +770,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - Unspecified error. + * @throws {BusinessError} 2800001 - System exception. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION */ @@ -782,7 +782,7 @@ declare namespace wifiManager { * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - Unspecified error. + * @throws {BusinessError} 2800001 - System exception. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO */ @@ -797,7 +797,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - Unspecified error. + * @throws {BusinessError} 2800001 - System exception. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. @@ -812,7 +812,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - Unspecified error. + * @throws {BusinessError} 2800001 - System exception. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION * @systemapi Hide this for inner system use. @@ -829,7 +829,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - Unspecified error. + * @throws {BusinessError} 2800001 - System exception. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. @@ -844,7 +844,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO */ @@ -859,7 +859,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO */ @@ -873,7 +873,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO */ @@ -888,7 +888,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO */ @@ -902,7 +902,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO */ @@ -917,7 +917,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO */ @@ -931,7 +931,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO */ @@ -946,7 +946,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO */ @@ -961,7 +961,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. @@ -978,7 +978,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. @@ -994,7 +994,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. @@ -1010,7 +1010,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - Unspecified error. + * @throws {BusinessError} 2500001 - System exception. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. @@ -1026,7 +1026,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2600001 - Unspecified error. + * @throws {BusinessError} 2600001 - System exception. * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.GET_WIFI_INFO */ @@ -1042,7 +1042,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2600001 - Unspecified error. + * @throws {BusinessError} 2600001 - System exception. * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.GET_WIFI_INFO */ @@ -1057,7 +1057,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2600001 - Unspecified error. + * @throws {BusinessError} 2600001 - System exception. * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. @@ -1074,7 +1074,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2600001 - Unspecified error. + * @throws {BusinessError} 2600001 - System exception. * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. @@ -1090,7 +1090,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2600001 - Unspecified error. + * @throws {BusinessError} 2600001 - System exception. * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. @@ -1106,7 +1106,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2600001 - Unspecified error. + * @throws {BusinessError} 2600001 - System exception. * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. @@ -1121,7 +1121,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - Unspecified error. + * @throws {BusinessError} 2800001 - System exception. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO */ @@ -1134,7 +1134,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - Unspecified error. + * @throws {BusinessError} 2800001 - System exception. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO */ @@ -1148,7 +1148,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - Unspecified error. + * @throws {BusinessError} 2800001 - System exception. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO */ @@ -1161,7 +1161,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - Unspecified error. + * @throws {BusinessError} 2800001 - System exception. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO */ @@ -1175,7 +1175,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - Unspecified error. + * @throws {BusinessError} 2800001 - System exception. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION */ @@ -1189,7 +1189,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - Unspecified error. + * @throws {BusinessError} 2800001 - System exception. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.LOCATION */ @@ -1203,7 +1203,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - Unspecified error. + * @throws {BusinessError} 2800001 - System exception. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION */ @@ -1216,7 +1216,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - Unspecified error. + * @throws {BusinessError} 2800001 - System exception. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.LOCATION */ @@ -1230,7 +1230,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - Unspecified error. + * @throws {BusinessError} 2800001 - System exception. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO */ @@ -1243,7 +1243,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - Unspecified error. + * @throws {BusinessError} 2800001 - System exception. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO */ @@ -1257,7 +1257,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - Unspecified error. + * @throws {BusinessError} 2800001 - System exception. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO */ @@ -1270,7 +1270,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - Unspecified error. + * @throws {BusinessError} 2800001 - System exception. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO */ diff --git a/api/@ohos.wifiManagerExt.d.ts b/api/@ohos.wifiManagerExt.d.ts index 75e11e6635..03ab526b94 100644 --- a/api/@ohos.wifiManagerExt.d.ts +++ b/api/@ohos.wifiManagerExt.d.ts @@ -32,7 +32,7 @@ declare namespace wifiManagerExt { * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2700001 - Unspecified error. + * @throws {BusinessError} 2700001 - System exception. * @permission ohos.permission.MANAGE_WIFI_HOTSPOT_EXT * @syscap SystemCapability.Communication.WiFi.AP.Extension */ @@ -44,7 +44,7 @@ declare namespace wifiManagerExt { * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2700001 - Unspecified error. + * @throws {BusinessError} 2700001 - System exception. * @permission ohos.permission.MANAGE_WIFI_HOTSPOT_EXT * @syscap SystemCapability.Communication.WiFi.AP.Extension */ @@ -58,7 +58,7 @@ declare namespace wifiManagerExt { * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2700001 - Unspecified error. + * @throws {BusinessError} 2700001 - System exception. * @permission ohos.permission.GET_WIFI_INFO * @syscap SystemCapability.Communication.WiFi.AP.Extension */ @@ -73,7 +73,7 @@ declare namespace wifiManagerExt { * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2700001 - Unspecified error. + * @throws {BusinessError} 2700001 - System exception. * @permission ohos.permission.GET_WIFI_INFO * @syscap SystemCapability.Communication.WiFi.AP.Extension */ @@ -86,7 +86,7 @@ declare namespace wifiManagerExt { * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2700001 - Unspecified error. + * @throws {BusinessError} 2700001 - System exception. * @permission ohos.permission.MANAGE_WIFI_HOTSPOT_EXT * @syscap SystemCapability.Communication.WiFi.AP.Extension */ -- Gitee From 0cc8a6e25e5f5e50ab818fe500c035baf2fedd71 Mon Sep 17 00:00:00 2001 From: lihuihui Date: Fri, 21 Oct 2022 18:00:23 +0800 Subject: [PATCH 224/438] modify s1-s4 Signed-off-by: lihuihui --- api/@ohos.data.rdb.d.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index 0e15ef27b8..f9e2fd141d 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -138,15 +138,6 @@ declare namespace rdb { * @since 9 */ enum SecurityLevel { - /** - * S0: mains the db is public. - * There is no impact even if the data is leaked. - * - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - S0 = 0, - /** * S1: mains the db is low level security * There are some low impact, when the data is leaked. -- Gitee From 1d9abf8f874bc85cfa1f802bc78e5204b18ccebe Mon Sep 17 00:00:00 2001 From: lihuihui Date: Fri, 21 Oct 2022 18:41:02 +0800 Subject: [PATCH 225/438] modify suggest Signed-off-by: lihuihui --- api/@ohos.data.rdb.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index f9e2fd141d..38dfeb4914 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -332,7 +332,7 @@ declare namespace rdb { beginTransaction():void; /** - * commit the the sql you have excuted. + * commit the the sql you have executed. * * @since 8 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -340,7 +340,7 @@ declare namespace rdb { commit():void; /** - * roll back the sql you have already excuted + * roll back the sql you have already executed * * @since 8 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -710,7 +710,7 @@ declare namespace rdb { executeSql(sql: string, bindArgs?: Array): Promise; /** - * beginTransaction before excute your sql. + * BeginTransaction before excute your sql. * * @throws {BusinessError} 401 - if the parameter type is incorrect. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -719,7 +719,7 @@ declare namespace rdb { beginTransaction():void; /** - * commit the the sql you have excuted. + * Commit the the sql you have executed. * * @throws {BusinessError} 401 - if the parameter type is incorrect. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -728,7 +728,7 @@ declare namespace rdb { commit():void; /** - * roll back the sql you have already excuted. + * Roll back the sql you have already executed. * * @throws {BusinessError} 401 - if the parameter type is incorrect. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core -- Gitee From a58a6f03728dd39bfa058240146259e04df80a0c Mon Sep 17 00:00:00 2001 From: duanweiling Date: Sat, 22 Oct 2022 20:04:55 +0800 Subject: [PATCH 226/438] update error code for preferences Signed-off-by: duanweiling --- api/@ohos.data.preferences.d.ts | 223 +++++++++++++++++++++++++------- 1 file changed, 175 insertions(+), 48 deletions(-) diff --git a/api/@ohos.data.preferences.d.ts b/api/@ohos.data.preferences.d.ts index 7355e75a0d..3129833c98 100644 --- a/api/@ohos.data.preferences.d.ts +++ b/api/@ohos.data.preferences.d.ts @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import {AsyncCallback, Callback} from './basic'; import Context from "./application/Context"; /** @@ -30,13 +30,27 @@ declare namespace preferences { *

The {@link references} instance loads all data of the preferences file and * resides in the memory. You can use removePreferencesFromCache to remove the instance from the memory. * - * @param context Indicates the context of application or capability. - * @param name Indicates the preferences file name. - * @return Returns the {@link Preferences} instance matching the specified preferences file name. - * @throws BusinessError if invoked failed - * @since 9 + * @param {Context} context - Indicates the context of application or capability. + * @param {string} name - Indicates the preferences file name. + * @param {AsyncCallback} callback - the {@link Preferences} instance matching the specified + * preferences file name. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @since 9 */ function getPreferences(context: Context, name: string, callback: AsyncCallback): void; + + /** + * Obtains a {@link Preferences} instance matching a specified preferences file name. + * + *

The {@link references} instance loads all data of the preferences file and + * resides in the memory. You can use removePreferencesFromCache to remove the instance from the memory. + * + * @param {Context} context - Indicates the context of application or capability. + * @param {string} name - Indicates the preferences file name. + * @returns {Promise} the {@link Preferences} instance matching the specified preferences file name. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @since 9 + */ function getPreferences(context: Context, name: string): Promise; /** @@ -48,12 +62,31 @@ declare namespace preferences { * of the instance. In addition, do not use the instance to perform data operations. Otherwise, data inconsistency * will occur. * - * @param context Indicates the context of application or capability. - * @param name Indicates the preferences file name. - * @throws BusinessError if invoked failed + * @param {Context} context - Indicates the context of application or capability. + * @param {string} name - Indicates the preferences file name. + * @param {AsyncCallback} callback - Indicates the callback function. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @throws {BusinessError} 15500010 - if failed to delete preferences file. * @since 9 */ function deletePreferences(context: Context, name: string, callback: AsyncCallback): void; + + /** + * Deletes a {@link Preferences} instance matching a specified preferences file name + * from the cache which is performed by removePreferencesFromCache and deletes the + * preferences file. + * + *

When deleting the {@link Preferences} instance, you must release all references + * of the instance. In addition, do not use the instance to perform data operations. Otherwise, data inconsistency + * will occur. + * + * @param {Context} context - Indicates the context of application or capability. + * @param {string} name - Indicates the preferences file name. + * @returns {Promise} a promise object. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @throws {BusinessError} 15500010 - if failed to delete preferences file. + * @since 9 + */ function deletePreferences(context: Context, name: string): Promise; /** @@ -64,12 +97,28 @@ declare namespace preferences { * of the instance. In addition, do not use the instance to perform data operations. Otherwise, data inconsistency * will occur. * - * @param context Indicates the context of application or capability. - * @param name Indicates the preferences file name. - * @throws BusinessError if invoked failed + * @param {Context} context - Indicates the context of application or capability. + * @param {string} name - Indicates the preferences file name. + * @param {AsyncCallback} callback - Indicates the callback function. + * @throws {BusinessError} 401 - if the parameter type is incorrect. * @since 9 */ function removePreferencesFromCache(context: Context, name: string, callback: AsyncCallback): void; + + /** + * Deletes a {@link Preferences} instance matching a specified preferences file name + * from the cache. + * + *

When deleting the {@link Preferences} instance, you must release all references + * of the instance. In addition, do not use the instance to perform data operations. Otherwise, data inconsistency + * will occur. + * + * @param {Context} context - Indicates the context of application or capability. + * @param {string} name - Indicates the preferences file name. + * @returns {Promise} a promise object. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @since 9 + */ function removePreferencesFromCache(context: Context, name: string): Promise; /** @@ -77,7 +126,7 @@ declare namespace preferences { * *

The preferences data is stored in a file, which matches only one {@link Preferences} instance in the memory. * You can use getPreferences to obtain the {@link Preferences} instance matching - * the file that stores preferences data, and use emovePreferencesFromCache + * the file that stores preferences data, and use movePreferencesFromCache * to remove the {@link Preferences} instance from the memory. * * @syscap SystemCapability.DistributedDataManager.Preferences.Core @@ -86,39 +135,71 @@ declare namespace preferences { */ interface Preferences { /** - * Obtains the value of a preferences in the int format. - * - *

If the value is {@code null} or not in the int format, the default value is returned. - * - * @param key Indicates the key of the preferences. It cannot be {@code null} or empty. - * @param defValue Indicates the default value to return. - * @return Returns the value matching the specified key if it is found; returns the default value otherwise. - * @throws BusinessError if invoked failed - * @since 9 - */ + * Obtains the value of a preferences in the int format. + * + *

If the value is {@code null} or not in the int format, the default value is returned. + * + * @param {string} key - Indicates the key of the preferences. It cannot be {@code null} or empty. + * @param {ValueType} defValue - Indicates the default value to return. + * @param {AsyncCallback} callback - the value matching the specified key if it is found; + * returns the default value otherwise. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @since 9 + */ get(key: string, defValue: ValueType, callback: AsyncCallback): void; + + /** + * Obtains the value of a preferences in the int format. + * + *

If the value is {@code null} or not in the int format, the default value is returned. + * + * @param {string} key - Indicates the key of the preferences. It cannot be {@code null} or empty. + * @param {ValueType} defValue - Indicates the default value to return. + * @returns {Promise} the value matching the specified key if it is found; + * returns the default value otherwise. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @since 9 + */ get(key: string, defValue: ValueType): Promise; /** - * Obtains all the keys and values of a preferences in an object. - * - * @return Returns the values and keys in an object. - * @throws BusinessError if invoked failed - * @since 9 - */ + * Obtains all the keys and values of a preferences in an object. + * + * @param {AsyncCallback} callback - the values and keys in an object. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @since 9 + */ getAll(callback: AsyncCallback): void; + + /** + * Obtains all the keys and values of a preferences in an object. + * + * @returns {Promise} the values and keys in an object. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @since 9 + */ getAll(): Promise; /** * Checks whether the {@link Preferences} object contains a preferences matching a specified key. * - * @param key Indicates the key of the preferences to check for. - * @return Returns {@code true} if the {@link Preferences} object contains a preferences with the specified key; - * returns {@code false} otherwise. - * @throws BusinessError if invoked failed + * @param {string} key - Indicates the key of the preferences to modify. It cannot be {@code null} or empty. + * @param {AsyncCallback} callback - {@code true} if the {@link Preferences} object contains a preferences + * with the specified key;returns {@code false} otherwise. + * @throws {BusinessError} 401 - if the parameter type is incorrect. * @since 9 */ has(key: string, callback: AsyncCallback): void; + + /** + * Checks whether the {@link Preferences} object contains a preferences matching a specified key. + * + * @param {string} key - Indicates the key of the preferences to modify. It cannot be {@code null} or empty. + * @returns {Promise} {@code true} if the {@link Preferences} object contains + * a preferences with the specified key; returns {@code false} otherwise. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @since 9 + */ has(key: string): Promise; /** @@ -127,13 +208,28 @@ declare namespace preferences { *

You can call the {@link #flush} method to save the {@link Preferences} object to the * file. * - * @param key Indicates the key of the preferences to modify. It cannot be {@code null} or empty. - * @param value Indicates the value of the preferences. - * MAX_KEY_LENGTH. - * @throws BusinessError if invoked failed + * @param {string} key - Indicates the key of the preferences to modify. It cannot be {@code null} or empty. + * @param {ValueType} value - Indicates the value of the preferences. + * MAX_KEY_LENGTH. + * @param {AsyncCallback} callback - Indicates the callback function. + * @throws {BusinessError} 401 - if the parameter type is incorrect. * @since 9 */ put(key: string, value: ValueType, callback: AsyncCallback): void; + + /** + * Sets an int value for the key in the {@link Preferences} object. + * + *

You can call the {@link #flush} method to save the {@link Preferences} object to the + * file. + * + * @param {string} key - Indicates the key of the preferences to modify. It cannot be {@code null} or empty. + * @param {ValueType} value - Indicates the value of the preferences. + * MAX_KEY_LENGTH. + * @returns {Promise} a promise object. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @since 9 + */ put(key: string, value: ValueType): Promise; /** @@ -142,40 +238,70 @@ declare namespace preferences { *

You can call the {@link #flush} method to save the {@link Preferences} object to the * file. * - * @param key Indicates the key of the preferences to delete. It cannot be {@code null} or empty. - * MAX_KEY_LENGTH. - * @throws BusinessError if invoked failed + * @param {string} key - Indicates the key of the preferences to delete. It cannot be {@code null} or empty. + * MAX_KEY_LENGTH. + * @param {AsyncCallback} callback - Indicates the callback function. + * @throws {BusinessError} 401 - if the parameter type is incorrect. * @since 9 */ delete(key: string, callback: AsyncCallback): void; - delete(key: string): Promise; /** - * Clears all preferences from the {@link Preferences} object. + * Deletes the preferences with a specified key from the {@link Preferences} object. * *

You can call the {@link #flush} method to save the {@link Preferences} object to the * file. * - * @throws BusinessError if invoked failed + * @param {string} key - Indicates the key of the preferences to delete. It cannot be {@code null} or empty. + * MAX_KEY_LENGTH. + * @returns {Promise} a promise object. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @since 9 + */ + delete(key: string): Promise; + + /** + * Clears all preferences from the {@link Preferences} object. + * + *

You can call the {@link #flush} method to save the {@link Preferences} object to the file. + * + * @param {AsyncCallback} callback - Indicates the callback function. * @since 9 */ clear(callback: AsyncCallback): void; + + /** + * Clears all preferences from the {@link Preferences} object. + * + *

You can call the {@link #flush} method to save the {@link Preferences} object to the file. + * + * @returns {Promise} a promise object. + * @since 9 + */ clear(): Promise; /** * Asynchronously saves the {@link Preferences} object to the file. * - * @throws BusinessError if invoked failed + * @param {AsyncCallback} callback - Indicates the callback function. * @since 9 */ flush(callback: AsyncCallback): void; + + /** + * Asynchronously saves the {@link Preferences} object to the file. + * + * @returns {Promise} a promise object. + * @since 9 + */ flush(): Promise; /** * Registers an observer to listen for the change of a {@link Preferences} object. * - * @param callback Indicates the callback when preferences changes. - * @throws BusinessError if invoked failed + * @param {Callback} callback - indicates the callback when preferences changes. + * @param {Callback<{key: string}>} callback - Indicates the callback function. + * @throws {BusinessError} 401 - if the parameter type is incorrect. * @since 9 */ on(type: 'change', callback: Callback<{ key: string }>): void; @@ -183,8 +309,9 @@ declare namespace preferences { /** * Unregisters an existing observer. * - * @param callback Indicates the registered callback. - * @throws BusinessError if invoked failed + * @param {Callback} callback - indicates the callback when preferences changes. + * @param {Callback<{key: string}>} callback - Indicates the callback function. + * @throws {BusinessError} 401 - if the parameter type is incorrect. * @since 9 */ off(type: 'change', callback?: Callback<{ key: string }>): void; -- Gitee From afef4d84c2e96a1da1371f4dc98fa9c00a10e9c7 Mon Sep 17 00:00:00 2001 From: lichenchen Date: Thu, 20 Oct 2022 22:53:33 +0800 Subject: [PATCH 227/438] =?UTF-8?q?=E8=B4=A6=E5=8F=B7js=E6=8E=A5=E5=8F=A3d?= =?UTF-8?q?ts=E9=94=99=E8=AF=AF=E7=A0=81=E6=8F=8F=E8=BF=B0=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lichenchen --- api/@ohos.account.appAccount.d.ts | 89 ++++++++++++----------- api/@ohos.account.distributedAccount.d.ts | 1 + api/@ohos.account.osAccount.d.ts | 79 +++++++++++--------- 3 files changed, 92 insertions(+), 77 deletions(-) diff --git a/api/@ohos.account.appAccount.d.ts b/api/@ohos.account.appAccount.d.ts index c1c808ad92..7f20b3b89a 100644 --- a/api/@ohos.account.appAccount.d.ts +++ b/api/@ohos.account.appAccount.d.ts @@ -65,8 +65,8 @@ declare namespace appAccount { * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid name or options. - * @throws {BusinessError} 12300008 - the account indicated by name already exist. - * @throws {BusinessError} 12300011 - the account number has reached the upper limit. + * @throws {BusinessError} 12300004 - the account indicated by name already exist. + * @throws {BusinessError} 12300007 - the account number has reached the upper limit. * @since 9 */ createAccount(name: string, callback: AsyncCallback): void; @@ -95,8 +95,10 @@ declare namespace appAccount { * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid owner or options. - * @throws {BusinessError} 12300011 - the account number has reached the upper limit. - * @throws {BusinessError} 12400002 - the account authenticator service does not exist. + * @throws {BusinessError} 12300007 - the account number has reached the upper limit. + * @throws {BusinessError} 12300010 - account service busy. + * @throws {BusinessError} 12300113 - the account authenticator service does not exist. + * @throws {BusinessError} 12300114 - authenticator service exception. * @since 9 */ createAccountImplicitly(owner: string, callback: AuthCallback): void; @@ -184,7 +186,6 @@ declare namespace appAccount { * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid name or bundlename. * @throws {BusinessError} 12300003 - the account indicated by localId dose not exist. - * @throws {BusinessError} 12400001 - the application indicated by bundlename does not exist. * @since 9 */ checkAppAccess(name: string, bundleName: string, callback: AsyncCallback): void; @@ -249,7 +250,7 @@ declare namespace appAccount { * @returns void. * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. - * @throws {BusinessError} 12300002 - invalid name or credentialType. + * @throws {BusinessError} 12300002 - invalid name, credentialType or credential. * @throws {BusinessError} 12300003 - the account indicated by localId dose not exist. * @since 9 */ @@ -349,7 +350,7 @@ declare namespace appAccount { * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid name, key or value. * @throws {BusinessError} 12300003 - the account indicated by name dose not exist. - * @throws {BusinessError} 12400008 - the number of customized data has reached the upper limit. + * @throws {BusinessError} 12400003 - the number of customized data has reached the upper limit. * @since 9 */ setCustomData(name: string, key: string, value: string, callback: AsyncCallback): void; @@ -427,7 +428,7 @@ declare namespace appAccount { * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid owner. - * @throws {BusinessError} 12300003 - the account indicated by owner dose not exist. + * @throws {BusinessError} 12400001 - the application indicated by bundlename does not exist. * @since 9 */ getAccountsByOwner(owner: string, callback: AsyncCallback>): void; @@ -454,7 +455,7 @@ declare namespace appAccount { * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid name or credentialType. * @throws {BusinessError} 12300003 - the account indicated by name dose not exist. - * @throws {BusinessError} 12300019 - credential does not exist. + * @throws {BusinessError} 12300102 - credential does not exist. * @since 9 */ getCredential(name: string, credentialType: string, callback: AsyncCallback): void; @@ -492,7 +493,7 @@ declare namespace appAccount { * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid name or key. * @throws {BusinessError} 12300003 - the account indicated by name dose not exist. - * @throws {BusinessError} 12400009 - the customData does not exist. + * @throws {BusinessError} 12400002 - the customData does not exist. * @since 9 */ getCustomData(name: string, key: string, callback: AsyncCallback): void; @@ -507,6 +508,7 @@ declare namespace appAccount { * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid name or key. * @throws {BusinessError} 12300003 - the account indicated by name dose not exist. + * @throws {BusinessError} 12400002 - the customData does not exist. * @since 9 */ getCustomDataSync(name: string, key: string): string; @@ -536,8 +538,8 @@ declare namespace appAccount { * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid type or owners. - * @throws {BusinessError} 12300003 - the account indicated by owners dose not exist. - * @throws {BusinessError} 12300005 - the listener has been registered. + * @throws {BusinessError} 12300011 - the callback has been registered. + * @throws {BusinessError} 12400001 - the application indicated by owner does not exist. * @since 9 */ on(type: 'accountChange', owners: Array, callback: Callback>): void; @@ -557,7 +559,7 @@ declare namespace appAccount { * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid type. - * @throws {BusinessError} 12300005 - the listener has been registered. + * @throws {BusinessError} 12300012 - the callback has not been registered. * @since 9 */ off(type: 'accountChange', callback?: Callback>): void; @@ -588,10 +590,9 @@ declare namespace appAccount { * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid name, owner, authType or options. * @throws {BusinessError} 12300003 - the account indicated by owner dose not exist. - * @throws {BusinessError} 12300016 - authentication timeout. - * @throws {BusinessError} 12300017 - authentication service is busy. - * @throws {BusinessError} 12300018 - authentication service is locked. - * @throws {BusinessError} 12400001 - the application indicated by name does not exist. + * @throws {BusinessError} 12300010 - account service busy. + * @throws {BusinessError} 12300113 - the account authenticator service does not exist. + * @throws {BusinessError} 12300114 - authenticator service exception. * @since 9 */ auth(name: string, owner: string, authType: string, callback: AuthCallback): void; @@ -620,8 +621,7 @@ declare namespace appAccount { * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid name, owner or authType. * @throws {BusinessError} 12300003 - the account indicated by owner dose not exist. - * @throws {BusinessError} 12300015 - the authType is not supported on current device. - * @throws {BusinessError} 12400001 - the application indicated by name does not exist. + * @throws {BusinessError} 12300107 - the authType is not found. * @since 9 */ getAuthToken(name: string, owner: string, authType: string, callback: AsyncCallback): void; @@ -654,9 +654,7 @@ declare namespace appAccount { * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid name, owner, authType or token. * @throws {BusinessError} 12300003 - the account indicated by name dose not exist. - * @throws {BusinessError} 12300015 - the authType is not supported on current device. - * @throws {BusinessError} 12300019 - credential does not exist. - * @throws {BusinessError} 12400007 - the number of token has reached the upper limit. + * @throws {BusinessError} 12400004 - the number of token has reached the upper limit. * @since 9 */ setAuthToken(name: string, authType: string, token: string, callback: AsyncCallback): void; @@ -691,8 +689,7 @@ declare namespace appAccount { * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid name, owner, authType or token. * @throws {BusinessError} 12300003 - the account indicated by name dose not exist. - * @throws {BusinessError} 12300015 - the authType is not supported on current device. - * @throws {BusinessError} 12300019 - credential does not exist. + * @throws {BusinessError} 12300107 - the authType is not found. * @since 9 */ deleteAuthToken(name: string, owner: string, authType: string, token: string, callback: AsyncCallback): void; @@ -727,8 +724,9 @@ declare namespace appAccount { * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid name, authType or bundleName. * @throws {BusinessError} 12300003 - the account indicated by name dose not exist. - * @throws {BusinessError} 12300015 - the authType is not supported on current device. - * @throws {BusinessError} 12300019 - credential does not exist. + * @throws {BusinessError} 12300107 - the authType is not found. + * @throws {BusinessError} 12400001 - the application indicated by name does not exist. + * @throws {BusinessError} 12400005 - the size of authorization list reaches the upper limit. * @since 9 */ setAuthTokenVisibility(name: string, authType: string, bundleName: string, isVisible: boolean, callback: AsyncCallback): void; @@ -761,8 +759,7 @@ declare namespace appAccount { * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid name, authType or bundleName. * @throws {BusinessError} 12300003 - the account indicated by name dose not exist. - * @throws {BusinessError} 12300015 - the authType is not supported on current device. - * @throws {BusinessError} 12300019 - credential does not exist. + * @throws {BusinessError} 12300107 - the authType is not found. * @since 9 */ checkAuthTokenVisibility(name: string, authType: string, bundleName: string, callback: AsyncCallback): void; @@ -819,8 +816,7 @@ declare namespace appAccount { * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid name or authType. * @throws {BusinessError} 12300003 - the account indicated by name dose not exist. - * @throws {BusinessError} 12300015 - the authType is not supported on current device. - * @throws {BusinessError} 12300019 - credential does not exist. + * @throws {BusinessError} 12300107 - the authType is not found. * @since 9 */ getAuthList(name: string, authType: string, callback: AsyncCallback>): void; @@ -847,7 +843,8 @@ declare namespace appAccount { * @returns Returns the authenticator callback related to the session id. * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. - * @throws {BusinessError} 12400005 - the session indicated by sessionId does not exist. + * @throws {BusinessError} 12300002 - invalid session id. + * @throws {BusinessError} 12300108 - the session indicated by sessionId does not exist. * @since 9 */ getAuthCallback(sessionId: string, callback: AsyncCallback): void; @@ -871,7 +868,7 @@ declare namespace appAccount { * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid owner. - * @throws {BusinessError} 12300003 - the account indicated by owner dose not exist. + * @throws {BusinessError} 12300113 - the account authenticator service does not exist. * @since 9 */ queryAuthenticatorInfo(owner: string, callback: AsyncCallback): void; @@ -885,9 +882,11 @@ declare namespace appAccount { * @returns boolean * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. - * @throws {BusinessError} 12300002 - invalid name or owner. + * @throws {BusinessError} 12300002 - invalid name, owner or labels. * @throws {BusinessError} 12300003 - the account indicated by owner dose not exist. - * @throws {BusinessError} 12400001 - the application indicated by name does not exist. + * @throws {BusinessError} 12300010 - account service busy. + * @throws {BusinessError} 12300113 - the account authenticator service does not exist. + * @throws {BusinessError} 12300114 - authenticator service exception. * @since 9 */ checkAccountLabels(name: string, owner: string, labels: Array, callback: AsyncCallback): void; @@ -901,9 +900,9 @@ declare namespace appAccount { * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid name or credentialType. - * @throws {BusinessError} 12300019 - credential does not exist. - * @throws {BusinessError} 12400001 - the application indicated by name does not exist. - * since 9 + * @throws {BusinessError} 12300003 - the account indicated by name dose not exist. + * @throws {BusinessError} 12300102 - credential does not exist. + * @since 9 */ deleteCredential(name: string, credentialType: string, callback: AsyncCallback): void; deleteCredential(name: string, credentialType: string): Promise; @@ -915,6 +914,8 @@ declare namespace appAccount { * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid options. + * @throws {BusinessError} 12300010 - account service busy. + * @throws {BusinessError} 12300114 - authenticator service exception. * @since 9 */ selectAccountsByOptions(options: SelectAccountsOptions, callback: AsyncCallback>): void; @@ -931,8 +932,9 @@ declare namespace appAccount { * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid name, owner or options. * @throws {BusinessError} 12300003 - the account indicated by owner dose not exist. - * @throws {BusinessError} 12400001 - the application indicated by name does not exist. - * @throws {BusinessError} 12400002 - he account authenticator service does not exist. + * @throws {BusinessError} 12300010 - account service busy. + * @throws {BusinessError} 12300113 - the account authenticator service does not exist. + * @throws {BusinessError} 12300114 - authenticator service exception. * @since 9 */ verifyCredential(name: string, owner: string, callback: AuthCallback): void; @@ -949,8 +951,9 @@ declare namespace appAccount { * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid owner or options. - * @throws {BusinessError} 12300003 - the account indicated by owner dose not exist. - * @throws {BusinessError} 12400002 - the account authenticator service does not exist. + * @throws {BusinessError} 12300010 - account service busy. + * @throws {BusinessError} 12300113 - the account authenticator service does not exist. + * @throws {BusinessError} 12300114 - authenticator service exception. * @since 9 */ setAuthenticatorProperties(owner: string, callback: AuthCallback): void; @@ -1441,6 +1444,8 @@ declare namespace appAccount { * @param callback Indicates the authenticator callback. * @returns void. * @since 8 + * @deprecated since 9 + * @useinstead appAccount.Authenticator#createAccountImplicitly */ addAccountImplicitly(authType: string, callerBundleName: string, options: {[key: string]: any}, callback: AuthenticatorCallback): void; @@ -1462,6 +1467,8 @@ declare namespace appAccount { * @param callback Indicates the authenticator callback. * @returns void. * @since 8 + * @deprecated since 9 + * @useinstead appAccount.Authenticator#auth */ authenticate(name: string, authType: string, callerBundleName: string, options: {[key: string]: any}, callback: AuthenticatorCallback): void; diff --git a/api/@ohos.account.distributedAccount.d.ts b/api/@ohos.account.distributedAccount.d.ts index 3e3b41439a..6d92f11f88 100644 --- a/api/@ohos.account.distributedAccount.d.ts +++ b/api/@ohos.account.distributedAccount.d.ts @@ -82,6 +82,7 @@ declare namespace distributedAccount { * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid accountInfo. + * @throws {BusinessError} 12300003 - the account indicated by accountInfo dose not exist. * @since 9 */ setOsAccountDistributedInfo(accountInfo: DistributedInfo, callback: AsyncCallback): void; diff --git a/api/@ohos.account.osAccount.d.ts b/api/@ohos.account.osAccount.d.ts index 92a81d4b44..093b0dbfbb 100644 --- a/api/@ohos.account.osAccount.d.ts +++ b/api/@ohos.account.osAccount.d.ts @@ -52,8 +52,8 @@ declare namespace osAccount { * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid localId. * @throws {BusinessError} 12300003 - the account indicated by localId dose not exist. - * @throws {BusinessError} 12300003 - the account indicated by localId has been activated. - * @throws {BusinessError} 12300010 - account service is busy. + * @throws {BusinessError} 12300008 - the localId indicates restricted account. + * @throws {BusinessError} 12300009 - the account indicated by localId has been activated. * @systemapi Hide this for inner system use. * @since 7 */ @@ -94,7 +94,7 @@ declare namespace osAccount { /** * Checks whether an OS account is activated based on its local ID. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. * @param localId Indicates the local ID of the OS account. * @returns void * @throws {BusinessError} 201 - permission denied. @@ -151,7 +151,6 @@ declare namespace osAccount { * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid localId or constraint. * @throws {BusinessError} 12300003 - the account indicated by localId dose not exist. - * @throws {BusinessError} 12300004 - the localId indicates restricted account. * @since 9 */ checkConstraintEnabled(localId: number, constraint: string, callback: AsyncCallback): void; @@ -219,7 +218,7 @@ declare namespace osAccount { * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid localId. * @throws {BusinessError} 12300003 - the account indicated by localId dose not exist. - * @throws {BusinessError} 12300004 - the localId indicates restricted account. + * @throws {BusinessError} 12300008 - the localId indicates restricted account. * @systemapi Hide this for inner system use. * @since 7 */ @@ -247,7 +246,7 @@ declare namespace osAccount { * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid localId or constraints. * @throws {BusinessError} 12300003 - the account indicated by localId dose not exist. - * @throws {BusinessError} 12300004 - the localId indicates restricted account. + * @throws {BusinessError} 12300008 - the localId indicates restricted account. * @systemapi Hide this for inner system use. * @since 7 */ @@ -266,7 +265,7 @@ declare namespace osAccount { * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid localId or localName. * @throws {BusinessError} 12300003 - the account indicated by localId dose not exist. - * @throws {BusinessError} 12300004 - the localId indicates restricted account. + * @throws {BusinessError} 12300008 - the localId indicates restricted account. * @systemapi Hide this for inner system use. * @since 7 */ @@ -399,7 +398,6 @@ declare namespace osAccount { * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid localId. * @throws {BusinessError} 12300003 - the account indicated by localId dose not exist. - * @throws {BusinessError} 12300004 - the localId indicates restricted account. * @since 9 */ getOsAccountConstraints(localId: number, callback: AsyncCallback>): void; @@ -449,7 +447,9 @@ declare namespace osAccount { * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid localName. - * @throws {BusinessError} 12300003 - the account indicated by localId dose not exist. + * @throws {BusinessError} 12300005 - multi-user not supported. + * @throws {BusinessError} 12300006 - unsupported account type. + * @throws {BusinessError} 12300007 - the number of account reaches the upper limit. * @systemapi Hide this for inner system use. * @since 7 */ @@ -467,6 +467,9 @@ declare namespace osAccount { * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid type or domainInfo. + * @throws {BusinessError} 12300005 - multi-user not supported. + * @throws {BusinessError} 12300006 - unsupported account type. + * @throws {BusinessError} 12300007 - the number of account reaches the upper limit. * @systemapi Hide this for inner system use. * @since 8 */ @@ -543,7 +546,7 @@ declare namespace osAccount { * The same application running on different devices obtains the same DVID, whereas different applications * obtain different DVIDs. *

- * @permission ohos.permission.DISTRIBUTED_DATASYNC or ohos.permission.MANAGE_LOCAL_ACCOUNTS + * @permission ohos.permission.DISTRIBUTED_DATASYNC or ohos.permission.MANAGE_LOCAL_ACCOUNTS. * @returns Returns the DVID if obtained; returns an empty string if no OHOS account has logged in. * @since 7 * @deprecated since 9 @@ -560,7 +563,7 @@ declare namespace osAccount { * The same application running on different devices obtains the same DVID, whereas different applications * obtain different DVIDs. *

- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.DISTRIBUTED_DATASYNC or ohos.permission.MANAGE_LOCAL_ACCOUNTS. * @returns Returns the DVID if obtained; returns an empty string if no OHOS account has logged in. * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. @@ -598,6 +601,7 @@ declare namespace osAccount { * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid localId or photo. * @throws {BusinessError} 12300003 - the account indicated by localId dose not exist. + * @throws {BusinessError} 12300008 - the localId indicates restricted account. * @systemapi Hide this for inner system use. * @since 7 */ @@ -621,6 +625,8 @@ declare namespace osAccount { * @returns localId. * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. + * @throws {BusinessError} 12300002 - invalid serialNumber. + * @throws {BusinessError} 12300003 - the account indicated by serialNumber dose not exist. * @since 9 */ queryOsAccountLocalIdBySerialNumber(serialNumber: number, callback: AsyncCallback): void; @@ -662,7 +668,8 @@ declare namespace osAccount { * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. - * @throws {BusinessError} 12300005 - the listener has been registered. + * @throws {BusinessError} 12300002 - invalid type or name. + * @throws {BusinessError} 12300011 - the callback has been registered. * @systemapi Hide this for inner system use. * @since 7 */ @@ -677,7 +684,8 @@ declare namespace osAccount { * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. - * @throws {BusinessError} 12300006 - the listener has not been registered. + * @throws {BusinessError} 12300002 - invalid type or name. + * @throws {BusinessError} 12300012 - the callback has not been registered. * @systemapi Hide this for inner system use. * @since 7 */ @@ -882,8 +890,6 @@ declare namespace osAccount { * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid authType or authTrustLevel. - * @throws {BusinessError} 12300014 - the authTrustLevel is not supported on current device - * @throws {BusinessError} 12300015 - the authType is not supported on current device. * @systemapi Hide this for inner system use. * @since 8 */ @@ -931,12 +937,12 @@ declare namespace osAccount { * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid challenge, authType or authTrustLevel. - * @throws {BusinessError} 12300014 - the authTrustLevel is not supported on current device - * @throws {BusinessError} 12300015 - the authType is not supported on current device. - * @throws {BusinessError} 12300016 - authentication timeout. - * @throws {BusinessError} 12300017 - authentication service is busy. - * @throws {BusinessError} 12300018 - authentication service is locked. - * @throws {BusinessError} 12300019 - the credential does not exist. + * @throws {BusinessError} 12300101 - token is invalid. + * @throws {BusinessError} 12300105 - unsupported authTrustLevel. + * @throws {BusinessError} 12300106 - unsupported authType. + * @throws {BusinessError} 12300110 - authentication is locked. + * @throws {BusinessError} 12300111 - authentication timeout. + * @throws {BusinessError} 12300112 - authentication service is busy. * @systemapi Hide this for inner system use. * @since 8 */ @@ -955,13 +961,12 @@ declare namespace osAccount { * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid userId, challenge, authType or authTrustLevel. - * @throws {BusinessError} 12300003 - the account indicated by userId dose not exist. - * @throws {BusinessError} 12300014 - the authTrustLevel is not supported on current device - * @throws {BusinessError} 12300015 - the authType is not supported on current device. - * @throws {BusinessError} 12300016 - authentication timeout. - * @throws {BusinessError} 12300017 - authentication service is busy. - * @throws {BusinessError} 12300018 - authentication service is locked. - * @throws {BusinessError} 12300019 - the credential does not exist. + * @throws {BusinessError} 12300101 - token is invalid. + * @throws {BusinessError} 12300105 - unsupported authTrustLevel. + * @throws {BusinessError} 12300106 - unsupported authType. + * @throws {BusinessError} 12300110 - authentication is locked. + * @throws {BusinessError} 12300111 - authentication timeout. + * @throws {BusinessError} 12300112 - authentication service is busy. * @systemapi Hide this for inner system use. * @since 8 */ @@ -1003,7 +1008,7 @@ declare namespace osAccount { * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. - * @throws {BusinessError} 12300007 - PIN inputer has been registered. + * @throws {BusinessError} 12300103 - the credential inputer has been registered. * @systemapi Hide this for inner system use. * @since 8 */ @@ -1062,6 +1067,8 @@ declare namespace osAccount { * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid credentialInfo. + * @throws {BusinessError} 12300101 - token is invalid. + * @throws {BusinessError} 12300106 - unsupported authType. * @systemapi Hide this for inner system use. * @since 8 */ @@ -1076,6 +1083,8 @@ declare namespace osAccount { * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid credentialInfo. + * @throws {BusinessError} 12300101 - token is invalid. + * @throws {BusinessError} 12300106 - unsupported authType. * @systemapi Hide this for inner system use. * @since 8 */ @@ -1112,7 +1121,7 @@ declare namespace osAccount { * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. - * @throws {BusinessError} 12300002 - invalid token. + * @throws {BusinessError} 12300101 - token is invalid. * @systemapi Hide this for inner system use. * @since 8 */ @@ -1127,7 +1136,9 @@ declare namespace osAccount { * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. - * @throws {BusinessError} 12300002 - invalid credentialId or token. + * @throws {BusinessError} 12300002 - invalid credentialId. + * @throws {BusinessError} 12300101 - token is invalid. + * @throws {BusinessError} 12300102 - credential not found. * @systemapi Hide this for inner system use. * @since 8 */ @@ -1143,11 +1154,7 @@ declare namespace osAccount { * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid authType. - * @throws {BusinessError} 12300015 - the authType is not supported on current device. - * @throws {BusinessError} 12300016 - authentication timeout. - * @throws {BusinessError} 12300017 - authentication service is busy. - * @throws {BusinessError} 12300018 - authentication service is locked. - * @throws {BusinessError} 12300019 - the credential does not exist. + * @throws {BusinessError} 12300102 - credential not found. * @systemapi Hide this for inner system use. * @since 8 */ -- Gitee From d9d2d45293b4ee628cf9dbcee4bae83995c185f3 Mon Sep 17 00:00:00 2001 From: bixuefeng Date: Thu, 20 Oct 2022 21:19:51 +0800 Subject: [PATCH 228/438] Feature: BaseEvent add pen types Signed-off-by: bixuefeng Change-Id: I48a121809cfbbf6e7a43dba3530019c7ea37d53c --- api/@internal/component/ets/common.d.ts | 45 +++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index d8623f93e0..ff1b97873a 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -668,6 +668,28 @@ declare enum SourceType { TouchScreen, } +/** + * Defines the event tool type. + * @since 9 + */ +declare enum SourceTool { + /** + * Unknown type. + * @since 9 + */ + Unknown, + + /** + * The finger type. + */ + FINGER, + + /** + * The pen type. + */ + PEN, +} + /** * Defines the Border Image Repeat Mode. * @since 9 @@ -747,6 +769,29 @@ declare interface BaseEvent { * @since 8 */ source: SourceType; + + /** + * Touch pressure. + * @since 9 + */ + pressure: number; + + /** + * The angle between pencil projection on plane-X-Y and axis-Z. + * @since 9 + */ + tiltX: number; + + /** + * The angle between pencil projection on plane-Y-Z and axis-Z. + * @since 9 + */ + tiltY: number; + + /** + * The event tool type info. + */ + sourceTool: SourceTool; } /** -- Gitee From c4f6cb273f3c4245d259306f753e9cff6ffbc64a Mon Sep 17 00:00:00 2001 From: zhaogan Date: Fri, 21 Oct 2022 20:38:26 +0800 Subject: [PATCH 229/438] Issue: #I5X294 Description: remove modulesInfo and ModuleSourceDirs from applicationInfo Sig: SIG_ApplicaitonFramework Feature or Bugfix: Bugfix Binary Source: No Signed-off-by: zhaogan --- api/@ohos.bundle.appControl.d.ts | 2 +- api/@ohos.bundle.bundleManager.d.ts | 367 ++++++++++++++++++-- api/bundleManager/abilityInfo.d.ts | 211 +---------- api/bundleManager/applicationInfo.d.ts | 17 - api/bundleManager/bundleInfo.d.ts | 27 +- api/bundleManager/extensionAbilityInfo.d.ts | 122 +------ 6 files changed, 348 insertions(+), 398 deletions(-) diff --git a/api/@ohos.bundle.appControl.d.ts b/api/@ohos.bundle.appControl.d.ts index 098b2621a1..519affca68 100644 --- a/api/@ohos.bundle.appControl.d.ts +++ b/api/@ohos.bundle.appControl.d.ts @@ -14,7 +14,7 @@ */ import { AsyncCallback } from './basic'; -import Want from './@ohos.application.Want'; +import Want from './@ohos.app.ability.Want'; /** * Used for application interception control diff --git a/api/@ohos.bundle.bundleManager.d.ts b/api/@ohos.bundle.bundleManager.d.ts index 3f2f3f8bb3..12f7b31f2b 100644 --- a/api/@ohos.bundle.bundleManager.d.ts +++ b/api/@ohos.bundle.bundleManager.d.ts @@ -19,7 +19,7 @@ import { Metadata as _Metadata } from './bundleManager/metadata'; import { HapModuleInfo as _HapModuleInfo } from './bundleManager/hapModuleInfo'; import { PermissionDef as _PermissionDef } from './bundleManager/permissionDef'; import { ElementName as _ElementName } from './bundleManager/elementName'; -import Want from './@ohos.application.Want'; +import Want from './@ohos.app.ability.Want'; import image from './@ohos.multimedia.image'; import * as _AbilityInfo from './bundleManager/abilityInfo'; import * as _BundleInfo from './bundleManager/bundleInfo'; @@ -225,6 +225,334 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; GET_EXTENSION_ABILITY_INFO_WITH_METADATA = 0x00000004, } + /** + * This enumeration value is used to identify various types of extension ability + * @enum {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + export enum ExtensionAbilityType { + /** + * Indicates extension info with type of form + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + FORM = 0, + + /** + * Indicates extension info with type of work schedule + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + WORK_SCHEDULER = 1, + + /** + * Indicates extension info with type of input method + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + INPUT_METHOD = 2, + + /** + * Indicates extension info with type of service + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + SERVICE = 3, + + /** + * Indicates extension info with type of accessibility + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + ACCESSIBILITY = 4, + + /** + * Indicates extension info with type of dataShare + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi + * @since 9 + */ + DATA_SHARE = 5, + + /** + * Indicates extension info with type of filesShare + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + FILE_SHARE = 6, + + /** + * Indicates extension info with type of staticSubscriber + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + STATIC_SUBSCRIBER = 7, + + /** + * Indicates extension info with type of wallpaper + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + WALLPAPER = 8, + + /** + * Indicates extension info with type of backup + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + BACKUP = 9, + + /** + * Indicates extension info with type of window + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + WINDOW = 10, + + /** + * Indicates extension info with type of enterprise admin + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + ENTERPRISE_ADMIN = 11, + + /** + * Indicates extension info with type of thumbnail + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + THUMBNAIL = 13, + + /** + * Indicates extension info with type of preview + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + PREVIEW = 14, + + /** + * Indicates extension info with type of unspecified + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + UNSPECIFIED = 255, + } + + /** + * PermissionGrantState + * @enum {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + export enum PermissionGrantState { + /** + * PERMISSION_DENIED + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + PERMISSION_DENIED = -1, + + /** + * PERMISSION_GRANTED + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + PERMISSION_GRANTED = 0, + } + + /** + * Support window mode + * @enum {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + export enum SupportWindowMode { + /** + * Indicates supported window mode of full screen mode + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + FULL_SCREEN = 0, + /** + * Indicates supported window mode of split mode + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + SPLIT = 1, + /** + * Indicates supported window mode of floating mode + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + FLOATING = 2, + } + + /** + * Launch type + * @enum {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + export enum LaunchType { + /** + * Indicates that the ability has only one instance + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + SINGLETON = 0, + + /** + * Indicates that the ability can have multiple instances + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + STANDARD = 1, + + /** + * Indicates that the ability can have specified instances + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + SPECIFIED = 2, + } + + /** + * Indicates ability type + * @enum {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + export enum AbilityType { + /** + * Indicates an unknown ability type + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + UNKNOWN, + + /** + * Indicates that the ability has a UI + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + PAGE, + + /** + * Indicates that the ability does not have a UI + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + SERVICE, + + /** + * Indicates that the ability is used to provide data access services + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + DATA, + } + + /** + * Display orientation + * @enum {number} + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + export enum DisplayOrientation { + /** + * Indicates that the system automatically determines the display orientation + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + UNSPECIFIED, + + /** + * Indicates the landscape orientation + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + LANDSCAPE, + + /** + * Indicates the portrait orientation + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + PORTRAIT, + + /** + * Indicates the page ability orientation is the same as that of the nearest ability in the stack + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + FOLLOW_RECENT, + + /** + * Indicates the inverted landscape orientation + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + LANDSCAPE_INVERTED, + + /** + * Indicates the inverted portrait orientation + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + PORTRAIT_INVERTED, + + /** + * Indicates the orientation can be auto-rotated + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + AUTO_ROTATION, + + /** + * Indicates the landscape orientation rotated with sensor + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + AUTO_ROTATION_LANDSCAPE, + + /** + * Indicates the portrait orientation rotated with sensor + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + AUTO_ROTATION_PORTRAIT, + + /** + * Indicates the sensor restricted mode + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + AUTO_ROTATION_RESTRICTED, + + /** + * Indicates the sensor landscape restricted mode + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + AUTO_ROTATION_LANDSCAPE_RESTRICTED, + + /** + * Indicates the sensor portrait restricted mode + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + AUTO_ROTATION_PORTRAIT_RESTRICTED, + + /** + * Indicates the locked orientation mode + * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @since 9 + */ + LOCKED, + } + /** * Obtains own bundleInfo. * @param { number } bundleFlags - Indicates the flag used to specify information contained in the BundleInfo objects that will be returned. @@ -447,7 +775,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * Query the ExtensionAbilityInfo by the given Want. ohos.permission.GET_BUNDLE_INFO_PRIVILEGED is required for cross user access. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @param { Want } want - Indicates the Want containing the application bundle name to be queried. - * @param { ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType.. + * @param { ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType. * @param { number } extensionAbilityFlags - Indicates the flag used to specify information contained in the ExtensionAbilityInfo objects that will be returned. * @param { number } userId - Indicates the user ID. * @returns { Promise> } Returns a list of ExtensionAbilityInfo objects. @@ -964,13 +1292,6 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; */ export type ReqPermissionDetail = _BundleInfo.ReqPermissionDetail; - /** - * Indicates the PermissionGrantState. - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - export type PermissionGrantState = _BundleInfo.PermissionGrantState; - /** * Indicates the SignatureInfo. * @syscap SystemCapability.BundleManager.BundleFramework.Core @@ -992,27 +1313,6 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; */ export type AbilityInfo = _AbilityInfo.AbilityInfo; - /** - * Contains basic Ability information, which indicates ability type. - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - export type AbilityType = _AbilityInfo.AbilityType; - - /** - * Contains basic Ability information. Indicates display orientation. - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - export type DisplayOrientation = _AbilityInfo.DisplayOrientation; - - /** - * Contains basic Ability information. Indicates support window mode. - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - export type SupportWindowMode = _AbilityInfo.SupportWindowMode; - /** * Contains basic Ability information. Indicates the window size.. * @syscap SystemCapability.BundleManager.BundleFramework.Core @@ -1027,13 +1327,6 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; */ export type ExtensionAbilityInfo = _ExtensionAbilityInfo.ExtensionAbilityInfo; - /** - * Indicates extension ability type - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - export type ExtensionAbilityType = _ExtensionAbilityInfo.ExtensionAbilityType; - /** * Indicates the defined permission details in file config.json. * @syscap SystemCapability.BundleManager.BundleFramework.Core diff --git a/api/bundleManager/abilityInfo.d.ts b/api/bundleManager/abilityInfo.d.ts index e3a0325bf9..d4ec20138c 100644 --- a/api/bundleManager/abilityInfo.d.ts +++ b/api/bundleManager/abilityInfo.d.ts @@ -14,7 +14,8 @@ */ import { ApplicationInfo } from './applicationInfo'; -import { Metadata } from './metadata' +import { Metadata } from './metadata'; +import bundleManager from './../@ohos.bundle.bundleManager'; /** * Obtains configuration information about an ability @@ -113,28 +114,28 @@ export interface AbilityInfo { /** * Enumerates types of templates that can be used by an ability - * @type {AbilityType} + * @type {bundleManager.AbilityType} * @syscap SystemCapability.BundleManager.BundleFramework * @FAModelOnly * @since 9 */ - readonly type: AbilityType; + readonly type: bundleManager.AbilityType; /** * Enumerates ability display orientations - * @type {DisplayOrientation} + * @type {bundleManager.DisplayOrientation} * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ - readonly orientation: DisplayOrientation; + readonly orientation: bundleManager.DisplayOrientation; /** * Enumerates ability launch type - * @type {LaunchType} + * @type {bundleManager.LaunchType} * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ - readonly launchType: LaunchType; + readonly launchType: bundleManager.LaunchType; /** * The permissions that others need to launch this ability @@ -205,11 +206,11 @@ export interface AbilityInfo { /** * Indicates which window mode is supported - * @type {Array} + * @type {Array} * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ - readonly supportWindowModes: Array; + readonly supportWindowModes: Array; /** * Indicates window size @@ -275,195 +276,3 @@ export interface WindowSize { */ readonly minWindowHeight: number; } - -/** - * Support window mode - * @enum {number} - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ -export enum SupportWindowMode { - /** - * Indicates supported window mode of full screen mode - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - FULL_SCREEN = 0, - /** - * Indicates supported window mode of split mode - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - SPLIT = 1, - /** - * Indicates supported window mode of floating mode - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - FLOATING = 2, -} - -/** - * Launch type - * @enum {number} - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ -export enum LaunchType { - /** - * Indicates that the ability has only one instance - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - SINGLETON = 0, - - /** - * Indicates that the ability can have multiple instances - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - STANDARD = 1, - - /** - * Indicates that the ability can have specified instances - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - SPECIFIED = 2, -} - -/** - * Indicates ability type - * @enum {number} - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ -export enum AbilityType { - /** - * Indicates an unknown ability type - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - UNKNOWN, - - /** - * Indicates that the ability has a UI - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - PAGE, - - /** - * Indicates that the ability does not have a UI - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - SERVICE, - - /** - * Indicates that the ability is used to provide data access services - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - DATA, -} - - -/** - * Display orientation - * @enum {number} - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ -export enum DisplayOrientation { - /** - * Indicates that the system automatically determines the display orientation - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - UNSPECIFIED, - - /** - * Indicates the landscape orientation - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - LANDSCAPE, - - /** - * Indicates the portrait orientation - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - PORTRAIT, - - /** - * Indicates the page ability orientation is the same as that of the nearest ability in the stack - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - FOLLOW_RECENT, - - /** - * Indicates the inverted landscape orientation - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - LANDSCAPE_INVERTED, - - /** - * Indicates the inverted portrait orientation - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - PORTRAIT_INVERTED, - - /** - * Indicates the orientation can be auto-rotated - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - AUTO_ROTATION, - - /** - * Indicates the landscape orientation rotated with sensor - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - AUTO_ROTATION_LANDSCAPE, - - /** - * Indicates the portrait orientation rotated with sensor - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - AUTO_ROTATION_PORTRAIT, - - /** - * Indicates the sensor restricted mode - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - AUTO_ROTATION_RESTRICTED, - - /** - * Indicates the sensor landscape restricted mode - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - AUTO_ROTATION_LANDSCAPE_RESTRICTED, - - /** - * Indicates the sensor portrait restricted mode - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - AUTO_ROTATION_PORTRAIT_RESTRICTED, - - /** - * Indicates the locked orientation mode - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - LOCKED, -} diff --git a/api/bundleManager/applicationInfo.d.ts b/api/bundleManager/applicationInfo.d.ts index 2ea06512bd..d4a4e78242 100644 --- a/api/bundleManager/applicationInfo.d.ts +++ b/api/bundleManager/applicationInfo.d.ts @@ -13,7 +13,6 @@ * limitations under the License. */ -import { HapModuleInfo } from './hapModuleInfo'; import { Metadata } from './metadata'; import { Resource } from '../global/resource'; @@ -96,14 +95,6 @@ export interface ApplicationInfo { */ readonly process: string; - /** - * Indicates the path storing the module resources of the application - * @type {Array} - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - readonly moduleSourceDirs: Array; - /** * Indicates the permissions required for accessing the application. * @type {Array} @@ -112,14 +103,6 @@ export interface ApplicationInfo { */ readonly permissions: Array; - /** - * Indicates modules information about an application - * @type {Array} - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - readonly modulesInfo: Array; - /** * Indicates the path where the {@code Entry.hap} file of the application is saved * @type {string} diff --git a/api/bundleManager/bundleInfo.d.ts b/api/bundleManager/bundleInfo.d.ts index 55a81553c5..a594847041 100644 --- a/api/bundleManager/bundleInfo.d.ts +++ b/api/bundleManager/bundleInfo.d.ts @@ -15,6 +15,7 @@ import { ApplicationInfo } from './applicationInfo'; import { HapModuleInfo } from './hapModuleInfo'; +import bundleManager from './../@ohos.bundle.bundleManager'; /** * Obtains configuration information about a bundle @@ -97,11 +98,11 @@ export interface BundleInfo { /** * Indicates the grant state of required permissions - * @type {Array} + * @type {Array} * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ - readonly permissionGrantStates: Array; + readonly permissionGrantStates: Array; /** * Indicates the SignatureInfo of the bundle @@ -192,28 +193,6 @@ export interface UsedScene { when: string; } -/** - * PermissionGrantState - * @enum {number} - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - export enum PermissionGrantState { - /** - * PERMISSION_DENIED - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - PERMISSION_DENIED = -1, - - /** - * PERMISSION_GRANTED - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - PERMISSION_GRANTED = 0, -} - /** * Indicates SignatureInfo * @typedef SignatureInfo diff --git a/api/bundleManager/extensionAbilityInfo.d.ts b/api/bundleManager/extensionAbilityInfo.d.ts index 538dec8952..e6eaf60187 100644 --- a/api/bundleManager/extensionAbilityInfo.d.ts +++ b/api/bundleManager/extensionAbilityInfo.d.ts @@ -14,7 +14,8 @@ */ import { ApplicationInfo } from './applicationInfo'; -import { Metadata } from './metadata' +import { Metadata } from './metadata'; +import bundleManager from './../@ohos.bundle.bundleManager'; /** * Extension information about a bundle @@ -81,11 +82,11 @@ export interface ExtensionAbilityInfo { /** * Enumerates types of the extension ability info - * @type {ExtensionAbilityType} + * @type {bundleManager.ExtensionAbilityType} * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ - readonly extensionAbilityType: ExtensionAbilityType; + readonly extensionAbilityType: bundleManager.ExtensionAbilityType; /** * The permissions that others need to use this extension ability info @@ -135,118 +136,3 @@ export interface ExtensionAbilityInfo { */ readonly writePermission: string; } - -/** - * This enumeration value is used to identify various types of extension ability - * @enum {number} - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - export enum ExtensionAbilityType { - /** - * Indicates extension info with type of form - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - FORM = 0, - - /** - * Indicates extension info with type of work schedule - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - WORK_SCHEDULER = 1, - - /** - * Indicates extension info with type of input method - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - INPUT_METHOD = 2, - - /** - * Indicates extension info with type of service - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @systemapi - * @since 9 - */ - SERVICE = 3, - - /** - * Indicates extension info with type of accessibility - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - ACCESSIBILITY = 4, - - /** - * Indicates extension info with type of dataShare - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @systemapi - * @since 9 - */ - DATA_SHARE = 5, - - /** - * Indicates extension info with type of filesShare - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - FILE_SHARE = 6, - - /** - * Indicates extension info with type of staticSubscriber - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - STATIC_SUBSCRIBER = 7, - - /** - * Indicates extension info with type of wallpaper - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - WALLPAPER = 8, - - /** - * Indicates extension info with type of backup - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - BACKUP = 9, - - /** - * Indicates extension info with type of window - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - WINDOW = 10, - - /** - * Indicates extension info with type of enterprise admin - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - ENTERPRISE_ADMIN = 11, - - /** - * Indicates extension info with type of thumbnail - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - THUMBNAIL = 13, - - /** - * Indicates extension info with type of preview - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - PREVIEW = 14, - - /** - * Indicates extension info with type of unspecified - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - UNSPECIFIED = 255, -} -- Gitee From b5335b4508b80508ccfb31b5c90badf55d136a5c Mon Sep 17 00:00:00 2001 From: zhaoxinyu Date: Mon, 24 Oct 2022 11:52:34 +0800 Subject: [PATCH 230/438] fix promptAction can not show function tips Signed-off-by: zhaoxinyu Change-Id: I9fcc817e61cb547f5d783306faf709cb4fa20c1b --- api/@ohos.promptAction.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.promptAction.d.ts b/api/@ohos.promptAction.d.ts index 478755f04b..468512dbbb 100644 --- a/api/@ohos.promptAction.d.ts +++ b/api/@ohos.promptAction.d.ts @@ -214,4 +214,4 @@ declare namespace promptAction { function showActionMenu(options: ActionMenuOptions): Promise; } -export default prompt; +export default promptAction; -- Gitee From 4d8fe6f9e367d4a96d8479ce3e4dfdb8e8ab933f Mon Sep 17 00:00:00 2001 From: zhaoxinyu Date: Mon, 24 Oct 2022 12:04:07 +0800 Subject: [PATCH 231/438] add deprecate info in d.ts Signed-off-by: zhaoxinyu Change-Id: Ie04ee9db5a5296b6e3a19fd7d3705fbd2b0a5319 --- api/@system.prompt.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/@system.prompt.d.ts b/api/@system.prompt.d.ts index c2b4c100ad..78025362a6 100644 --- a/api/@system.prompt.d.ts +++ b/api/@system.prompt.d.ts @@ -17,6 +17,8 @@ * Defines the options of ShowToast. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 3 + * @deprecated since 8 + * @useinstead ohos.prompt */ export interface ShowToastOptions { /** -- Gitee From b2dac0f14cd1d152cc75e3c6f570e29df4f47872 Mon Sep 17 00:00:00 2001 From: "yanxiaotao@huawei.com" Date: Mon, 24 Oct 2022 21:55:25 +0800 Subject: [PATCH 232/438] add error code for wifi 1024 Signed-off-by: yanxiaotao@huawei.com --- api/@ohos.wifi.d.ts | 326 ------------------------------------- api/@ohos.wifiManager.d.ts | 8 +- 2 files changed, 4 insertions(+), 330 deletions(-) diff --git a/api/@ohos.wifi.d.ts b/api/@ohos.wifi.d.ts index 7d3aef4518..6fe8e9cf95 100644 --- a/api/@ohos.wifi.d.ts +++ b/api/@ohos.wifi.d.ts @@ -87,18 +87,6 @@ declare namespace wifi { function getScanInfos(): Promise>; function getScanInfos(callback: AsyncCallback>): void; - /** - * Obtains the scanned results. - * - * @return Returns information about scanned Wi-Fi hotspots if any. - * - * @since 9 - * @syscap SystemCapability.Communication.WiFi.STA - * @permission ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or ohos.permission.LOCATION) - * @deprecated since 9 - */ - function getScanInfosSync(): Array; - /** * Adds Wi-Fi connection configuration to the device. * @@ -145,68 +133,6 @@ declare namespace wifi { function removeUntrustedConfig(config: WifiDeviceConfig): Promise; function removeUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback): void; - /** - * Adds a specified candidate hotspot configuration and returns the networkId. - * - *

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 - * @deprecated since 9 - */ - function addCandidateConfig(config: WifiDeviceConfig): Promise; - function addCandidateConfig(config: WifiDeviceConfig, callback: AsyncCallback): void; - - /** - * Removes a specified candidate hotspot configuration, only the configration which is added by ourself is allowed - * to be removed. - * - * @param networkId - Network ID which will be removed. - * @throws {ErrorCode} when failed to remove the hotspot configuration. - * @return {@code true} if the candidate hotspot configuration is removed, returns {@code false} otherwise. - * - * @since 9 - * @syscap SystemCapability.Communication.WiFi.STA - * @permission ohos.permission.SET_WIFI_INFO - * @deprecated since 9 - */ - 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. - * - *

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 - * @deprecated since 9 - */ - function getCandidateConfigs(): Array; - - /** - * Connect to a specified candidate hotspot configuration, only the configration which is added by ourself - * is allowed to be connected. - * - *

This method connect to a configuration at a time. - * - * @param networkId - Network ID which will be connected. - * @throws {ErrCode} if operation is failed. - * @since 9 - * @syscap SystemCapability.Communication.WiFi.STA - * @permission ohos.permission.SET_WIFI_INFO - * @deprecated since 9 - */ - function connectToCandidateConfig(networkId: number): void; - /** * Connects to Wi-Fi network. * @@ -580,21 +506,6 @@ declare namespace wifi { function getP2pPeerDevices(): Promise; function getP2pPeerDevices(callback: AsyncCallback): void; - /** - * Obtains the information about own device info. - * - *

deviceAddress in the returned WifiP2pDevice will be set "00:00:00:00:00:00", - * if ohos.permission.GET_WIFI_LOCAL_MAC is not granted. - * - * @return Returns the information about own device info. - * @since 9 - * @syscap SystemCapability.Communication.WiFi.P2P - * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG - * @deprecated since 9 - */ - function getP2pLocalDevice(): Promise; - function getP2pLocalDevice(callback: AsyncCallback): void; - /** * Creates a P2P group. * @@ -676,19 +587,6 @@ declare namespace wifi { */ function deletePersistentGroup(netId: number): boolean; - /** - * Obtains information about the groups. - * - * @return Returns the groups information. - * @since 9 - * @syscap SystemCapability.Communication.WiFi.P2P - * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION - * @systemapi Hide this for inner system use. - * @deprecated since 9 - */ - function getP2pGroups(): Promise>; - function getP2pGroups(callback: AsyncCallback>): void; - /** * Sets the name of the Wi-Fi P2P device. * @@ -819,30 +717,6 @@ declare namespace wifi { */ function off(type: "streamChange", callback?: Callback): void; - /** - * Subscribe Wi-Fi device config change events. - * - * @return Returns 0: config is added, 1: config is changed, 2: config is removed. - * @since 9 - * @syscap SystemCapability.Communication.WiFi.STA - * @permission ohos.permission.GET_WIFI_INFO - * @systemapi Hide this for inner system use. - * @deprecated since 9 - */ - function on(type: "deviceConfigChange", callback: Callback): void; - - /** - * Subscribe Wi-Fi device config change events. - * - * @return Returns 0: config is added, 1: config is changed, 2: config is removed. - * @since 9 - * @syscap SystemCapability.Communication.WiFi.STA - * @permission ohos.permission.GET_WIFI_INFO - * @systemapi Hide this for inner system use. - * @deprecated since 9 - */ - function off(type: "deviceConfigChange", callback?: Callback): void; - /** * Subscribe Wi-Fi hotspot state change events. * @@ -1042,94 +916,6 @@ declare namespace wifi { */ function off(type: "p2pDiscoveryChange", callback?: Callback): void; - /** - * Wi-Fi EAP method. - * - * @since 9 - * @systemapi Hide this for inner system use. - * @syscap SystemCapability.Communication.WiFi.STA - * @deprecated since 9 - */ - enum EapMethod { - EAP_NONE, - EAP_PEAP, - EAP_TLS, - EAP_TTLS, - EAP_PWD, - EAP_SIM, - EAP_AKA, - EAP_AKA_PRIME, - EAP_UNAUTH_TLS, - } - - /** - * Wi-Fi phase 2 method. - * - * @since 9 - * @systemapi Hide this for inner system use. - * @syscap SystemCapability.Communication.WiFi.STA - * @deprecated since 9 - */ - enum Phase2Method { - PHASE2_NONE, - PHASE2_PAP, - PHASE2_MSCHAP, - PHASE2_MSCHAPV2, - PHASE2_GTC, - PHASE2_SIM, - PHASE2_AKA, - PHASE2_AKA_PRIME, - } - - /** - * Wi-Fi EAP config. - * - * @since 9 - * @systemapi Hide this for inner system use. - * @syscap SystemCapability.Communication.WiFi.STA - * @deprecated since 9 - */ - interface WifiEapConfig { - /** EAP authentication method */ - eapMethod: EapMethod; - - /** Phase 2 authentication method */ - phase2Method: Phase2Method; - - /** The identity */ - identity: string; - - /** Anonymous identity */ - anonymousIdentity: string; - - /** Password */ - password: string; - - /** CA certificate alias */ - caCertAliases: string; - - /** CA certificate path */ - caPath: string; - - /** Client certificate alias */ - clientCertAliases: string; - - /** Alternate subject match */ - altSubjectMatch: string; - - /** Domain suffix match */ - domainSuffixMatch: string; - - /** Realm for Passpoint credential */ - realm: string; - - /** Public Land Mobile Network of the provider of Passpoint credential */ - plmn: string; - - /** Sub ID of the SIM card */ - eapSubId: number; - } - /** * Wi-Fi device configuration information. * @@ -1180,15 +966,6 @@ declare namespace wifi { /** IP config of static */ /* @systemapi */ staticIp: IpConfig; - - /** - * EAP config info. - * - * @since 9 - * @systemapi - * @syscap SystemCapability.Communication.WiFi.STA - */ - eapConfig: WifiEapConfig; } /** @@ -1206,37 +983,6 @@ declare namespace wifi { domains: Array; } - /** - * Wi-Fi information elements. - * - * @since 9 - * @systemapi Hide this for inner system use. - * @syscap SystemCapability.Communication.WiFi.STA - * @deprecated since 9 - */ - interface WifiInfoElem { - /** Element id */ - eid: number; - /** Element content */ - content: Uint8Array; - } - - /** - * Describes the wifi channel width. - * - * @since 9 - * @syscap SystemCapability.Communication.WiFi.STA - * @deprecated since 9 - */ - enum WifiChannelWidth { - WIDTH_20MHZ = 0, - WIDTH_40MHZ = 1, - WIDTH_80MHZ = 2, - WIDTH_160MHZ = 3, - WIDTH_80MHZ_PLUS = 4, - WIDTH_INVALID - } - /** * Describes the scanned Wi-Fi information. * @@ -1269,30 +1015,6 @@ declare namespace wifi { /** Channel width */ channelWidth: number; - /** - * Center frequency 0. - * - * @since 9 - * @syscap SystemCapability.Communication.WiFi.STA - */ - centerFrequency0: number; - - /** - * Center frequency 1. - * - * @since 9 - * @syscap SystemCapability.Communication.WiFi.STA - */ - centerFrequency1: number; - - /** - * Information elements. - * - * @since 9 - * @syscap SystemCapability.Communication.WiFi.STA - */ - infoElems: Array; - /** Time stamp */ timestamp: number; } @@ -1319,46 +1041,6 @@ declare namespace wifi { /** Simultaneous Authentication of Equals (SAE) */ WIFI_SEC_TYPE_SAE = 4, - - /** - * EAP authentication. - * - * @since 9 - * @syscap SystemCapability.Communication.WiFi.Core - */ - WIFI_SEC_TYPE_EAP = 5, - - /** - * SUITE_B_192 192 bit level. - * - * @since 9 - * @syscap SystemCapability.Communication.WiFi.Core - */ - WIFI_SEC_TYPE_EAP_SUITE_B = 6, - - /** - * Opportunististic Wireless Encryption. - * - * @since 9 - * @syscap SystemCapability.Communication.WiFi.Core - */ - WIFI_SEC_TYPE_OWE = 7, - - /** - * 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. - * - * @since 9 - * @syscap SystemCapability.Communication.WiFi.Core - */ - WIFI_SEC_TYPE_WAPI_PSK = 9, } /** @@ -1405,14 +1087,6 @@ declare namespace wifi { /* @systemapi */ snr: number; - /** - * 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. */ macAddress: string; diff --git a/api/@ohos.wifiManager.d.ts b/api/@ohos.wifiManager.d.ts index ef1eb42deb..18372c1a5e 100644 --- a/api/@ohos.wifiManager.d.ts +++ b/api/@ohos.wifiManager.d.ts @@ -299,7 +299,7 @@ declare namespace wifiManager { * @band Indicates the Wi-Fi frequency band. * @return Returns Wi-Fi signal level ranging from 0 to 4. * - * @since 6 + * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. @@ -394,7 +394,7 @@ declare namespace wifiManager { *

The IP information includes the host IP address, gateway address, and DNS information. * * @return Returns the IP information of the Wi-Fi connection. - * @since 7 + * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2500001 - System exception. @@ -751,7 +751,7 @@ declare namespace wifiManager { function p2pConnect(config: WifiP2PConfig): void; /** - * Canceling a P2P connection. + * Disconnects a P2P connection. * * @since 9 * @throws {BusinessError} 201 - Permission denied. @@ -761,7 +761,7 @@ declare namespace wifiManager { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO */ - function p2pCancelConnect(): void; + function p2pDisconnect(): void; /** * Discovers Wi-Fi P2P devices. -- Gitee From e963caded920d0ffb0e99445c95c772b3431e1a0 Mon Sep 17 00:00:00 2001 From: "yanxiaotao@huawei.com" Date: Mon, 24 Oct 2022 22:06:32 +0800 Subject: [PATCH 233/438] add error code for wifi 1024 Signed-off-by: yanxiaotao@huawei.com --- api/@ohos.wifiManager.d.ts | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/api/@ohos.wifiManager.d.ts b/api/@ohos.wifiManager.d.ts index 18372c1a5e..3a3446287d 100644 --- a/api/@ohos.wifiManager.d.ts +++ b/api/@ohos.wifiManager.d.ts @@ -133,43 +133,6 @@ declare namespace wifiManager { function addDeviceConfig(config: WifiDeviceConfig): Promise; function addDeviceConfig(config: WifiDeviceConfig, callback: AsyncCallback): void; - /** - * Adds a specified untrusted hotspot configuration. - * - *

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 - device config which to be added. - * - * @since 7 - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Invalid parameters. - * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. - * @syscap SystemCapability.Communication.WiFi.STA - * @permission ohos.permission.SET_WIFI_INFO - * @deprecated since 9 - */ - function addUntrustedConfig(config: WifiDeviceConfig): Promise; - function addUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback): void; - - /** - * Removes a specified untrusted hotspot configuration. - * - *

This method removes one configuration at a time. - * @param config - device config which to be removed. - * - * @since 7 - * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Invalid parameters. - * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. - * @syscap SystemCapability.Communication.WiFi.STA - * @permission ohos.permission.SET_WIFI_INFO - * @deprecated since 9 - */ - function removeUntrustedConfig(config: WifiDeviceConfig): Promise; - function removeUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback): void; - /** * Adds a specified candidate hotspot configuration and returns the networkId. * -- Gitee From af5bc047378bc8421008107de39cc6bd26b03848 Mon Sep 17 00:00:00 2001 From: leafly2021 Date: Tue, 2 Aug 2022 20:09:16 +0800 Subject: [PATCH 234/438] add setDimBehind api throws Signed-off-by: leafly2021 Change-Id: Ieeae6014a706633edbda96a8a78e3cf62b1554b5 --- api/@ohos.window.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index 842d868fc1..0d13c47d0a 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -1766,6 +1766,7 @@ declare namespace window { * Sets the dimBehind of window. * @param dimBehindValue the specified dimBehind. * @syscap SystemCapability.WindowManager.WindowManager.Core + * @throws Throws an exception cause this device do not support * @since 7 * @deprecated since 9 */ @@ -1775,6 +1776,7 @@ declare namespace window { * Sets the dimBehind of window. * @param dimBehind the specified dimBehind. * @syscap SystemCapability.WindowManager.WindowManager.Core + * @throws Throws an exception cause this device do not support * @since 7 * @deprecated since 9 */ @@ -1880,6 +1882,7 @@ declare namespace window { * Sets whether outside can be touch or not. * @param touchable outside can be touch if true, or not if false. * @syscap SystemCapability.WindowManager.WindowManager.Core + * @throws Throws an exception cause this device do not support * @since 7 * @deprecated since 9 */ @@ -1889,6 +1892,7 @@ declare namespace window { * Sets whether outside can be touch or not. * @param touchable outside can be touch if true, or not if false. * @syscap SystemCapability.WindowManager.WindowManager.Core + * @throws Throws an exception cause this device do not support * @since 7 * @deprecated since 9 */ -- Gitee From 9e29fdf8a160813aa6b9bba3b1185a8b24386ace Mon Sep 17 00:00:00 2001 From: leafly2021 Date: Wed, 17 Aug 2022 16:21:21 +0800 Subject: [PATCH 235/438] add setWindowMode Signed-off-by: leafly2021 Change-Id: Ibfe671243b17b427c879609c9319d00d2ede7df5 --- api/@ohos.window.d.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/api/@ohos.window.d.ts b/api/@ohos.window.d.ts index 0d13c47d0a..53fdd45b23 100644 --- a/api/@ohos.window.d.ts +++ b/api/@ohos.window.d.ts @@ -1766,7 +1766,6 @@ declare namespace window { * Sets the dimBehind of window. * @param dimBehindValue the specified dimBehind. * @syscap SystemCapability.WindowManager.WindowManager.Core - * @throws Throws an exception cause this device do not support * @since 7 * @deprecated since 9 */ @@ -1776,7 +1775,6 @@ declare namespace window { * Sets the dimBehind of window. * @param dimBehind the specified dimBehind. * @syscap SystemCapability.WindowManager.WindowManager.Core - * @throws Throws an exception cause this device do not support * @since 7 * @deprecated since 9 */ @@ -1882,7 +1880,6 @@ declare namespace window { * Sets whether outside can be touch or not. * @param touchable outside can be touch if true, or not if false. * @syscap SystemCapability.WindowManager.WindowManager.Core - * @throws Throws an exception cause this device do not support * @since 7 * @deprecated since 9 */ @@ -1892,7 +1889,6 @@ declare namespace window { * Sets whether outside can be touch or not. * @param touchable outside can be touch if true, or not if false. * @syscap SystemCapability.WindowManager.WindowManager.Core - * @throws Throws an exception cause this device do not support * @since 7 * @deprecated since 9 */ @@ -1924,7 +1920,7 @@ declare namespace window { * @throws {BusinessError} 201 - If there is no permission * @throws {BusinessError} 401 - If param is invalid * @throws {BusinessError} 1300002 - If window state is abnormally - * @permission ohos.permission.PRIVACE_WINDOW + * @permission ohos.permission.PRIVACY_WINDOW * @syscap SystemCapability.WindowManager.WindowManager.Core * @since 9 */ @@ -1936,7 +1932,7 @@ declare namespace window { * @throws {BusinessError} 201 - If there is no permission * @throws {BusinessError} 401 - If param is invalid * @throws {BusinessError} 1300002 - If window state is abnormally - * @permission ohos.permission.PRIVACE_WINDOW + * @permission ohos.permission.PRIVACY_WINDOW * @syscap SystemCapability.WindowManager.WindowManager.Core * @since 9 */ -- Gitee From 49b945372785eeefae10f4dd47d2f1c60a6936e5 Mon Sep 17 00:00:00 2001 From: yangfan Date: Mon, 22 Aug 2022 23:50:10 +0800 Subject: [PATCH 236/438] =?UTF-8?q?=E5=BA=9F=E5=BC=83=E6=97=A7GridContaine?= =?UTF-8?q?r=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangfan Change-Id: I81766dc4266a15acc890a4335734e0219447bb27 --- api/@internal/component/ets/common.d.ts | 1 + api/@internal/component/ets/grid_container.d.ts | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index 0c71fd7f46..846499f532 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -1713,6 +1713,7 @@ declare class CommonMethod { /** * Sets the number of occupied columns and offset columns for a specific device width type. * @since 7 + * @deprecated since 9 */ useSizeType(value: { xs?: number | { span: number; offset: number }; diff --git a/api/@internal/component/ets/grid_container.d.ts b/api/@internal/component/ets/grid_container.d.ts index 28203fa47f..5c1cf27b75 100644 --- a/api/@internal/component/ets/grid_container.d.ts +++ b/api/@internal/component/ets/grid_container.d.ts @@ -16,6 +16,7 @@ /** * Defines the size type. * @since 7 + * @deprecated since 9 */ declare enum SizeType { /** @@ -52,29 +53,34 @@ declare enum SizeType { /** * Defines the options of GridContainer. * @since 7 + * @deprecated since 9 */ declare interface GridContainerOptions { /** * Sets the total number of columns in the current layout. * @since 7 + * @deprecated since 9 */ columns?: number | "auto"; /** * Select the device width type. * @since 7 + * @deprecated since 9 */ sizeType?: SizeType; /** * Grid layout column spacing. * @since 7 + * @deprecated since 9 */ gutter?: number | string; /** * Spacing on both sides of the grid layout. * @since 7 + * @deprecated since 9 */ margin?: number | string; } @@ -82,11 +88,13 @@ declare interface GridContainerOptions { /** * Defines the GridContainer component. * @since 7 + * @deprecated since 9 */ interface GridContainerInterface { /** * Defines the constructor of GridContainer. * @since 7 + * @deprecated since 9 */ (value?: GridContainerOptions): GridContainerAttribute; } @@ -94,6 +102,7 @@ interface GridContainerInterface { /** * Defines the grid container attribute from inheritance Column * @since 7 + * @deprecated since 9 */ declare class GridContainerAttribute extends ColumnAttribute {} -- Gitee From 41ae414f328260236dfad846b81003c073ba60d1 Mon Sep 17 00:00:00 2001 From: yuhaoge Date: Tue, 25 Oct 2022 17:01:10 +0800 Subject: [PATCH 237/438] enum class bugfix Signed-off-by: yuhaoge --- api/@ohos.web.webview.d.ts | 152 ++++++++++++++++++------------------- 1 file changed, 76 insertions(+), 76 deletions(-) diff --git a/api/@ohos.web.webview.d.ts b/api/@ohos.web.webview.d.ts index 1a839be4e6..8dce175e29 100644 --- a/api/@ohos.web.webview.d.ts +++ b/api/@ohos.web.webview.d.ts @@ -19,105 +19,105 @@ import {AsyncCallback} from "./basic"; import {Resource} from 'GlobalResource'; /** - * Defines the Web's request/response header. + * This module provides the capability to manage web modules. + * * @since 9 + * @syscap SystemCapability.Web.Webview.Core */ - declare interface HeaderV9 { - /** - * Gets the key of the request/response header. - * @since 9 - */ - headerKey: string; - +declare namespace webview { /** - * Gets the value of the request/response header. + * Defines the Web's request/response header. * @since 9 */ - headerValue: string; - } + interface HeaderV9 { + /** + * Gets the key of the request/response header. + * @since 9 + */ + headerKey: string; -/** - * Enum type supplied to {@link getHitTest} for indicating the cursor node HitTest. - * @since 9 - */ - declare enum HitTestTypeV9 { - /** - * The edit text. - * @since 9 - */ - EditText, + /** + * Gets the value of the request/response header. + * @since 9 + */ + headerValue: string; + } /** - * The email address. + * Enum type supplied to {@link getHitTest} for indicating the cursor node HitTest. * @since 9 */ - Email, + enum HitTestTypeV9 { + /** + * The edit text. + * @since 9 + */ + EditText, - /** - * The HTML::a tag with src=http. - * @since 9 - */ - HttpAnchor, + /** + * The email address. + * @since 9 + */ + Email, - /** - * The HTML::a tag with src=http + HTML::img. - * @since 9 - */ - HttpAnchorImg, + /** + * The HTML::a tag with src=http. + * @since 9 + */ + HttpAnchor, - /** - * The HTML::img tag. - * @since 9 - */ - Img, + /** + * The HTML::a tag with src=http + HTML::img. + * @since 9 + */ + HttpAnchorImg, - /** - * The map address. - * @since 9 - */ - Map, + /** + * The HTML::img tag. + * @since 9 + */ + Img, - /** - * The phone number. - * @since 9 - */ - Phone, + /** + * The map address. + * @since 9 + */ + Map, - /** - * Other unknown HitTest. - * @since 9 - */ - Unknown, - } + /** + * The phone number. + * @since 9 + */ + Phone, -/** - * Defines the hit test value, related to {@link getHitTestValue} method. - * @since 9 - */ -declare interface HitTestValue { + /** + * Other unknown HitTest. + * @since 9 + */ + Unknown, + } /** - * Get the hit test type. - * + * Defines the hit test value, related to {@link getHitTestValue} method. * @since 9 */ - type: HitTestTypeV9; + interface HitTestValue { - /** - * Get the hit test extra data. - * - * @since 9 - */ - extra: string; -} + /** + * Get the hit test type. + * + * @since 9 + */ + type: HitTestTypeV9; + + /** + * Get the hit test extra data. + * + * @since 9 + */ + extra: string; + } -/** - * This module provides the capability to manage web modules. - * - * @since 9 - * @syscap SystemCapability.Web.Webview.Core - */ -declare namespace webview { /** * Provides basic information of web storage. * @name WebStorageOrigin -- Gitee From 1cd2e503ea7f87299f59c45abe2fe951a42f2377 Mon Sep 17 00:00:00 2001 From: liu-binjun Date: Tue, 25 Oct 2022 16:35:03 +0800 Subject: [PATCH 238/438] feature:Rectification error code specification Signed-off-by: liu-binjun --- api/@ohos.geoLocationManager.d.ts | 670 ++++++++++++++++++++++++++++++ api/@ohos.geolocation.d.ts | 214 ---------- 2 files changed, 670 insertions(+), 214 deletions(-) create mode 100644 api/@ohos.geoLocationManager.d.ts diff --git a/api/@ohos.geoLocationManager.d.ts b/api/@ohos.geoLocationManager.d.ts new file mode 100644 index 0000000000..7e6e4a3a6a --- /dev/null +++ b/api/@ohos.geoLocationManager.d.ts @@ -0,0 +1,670 @@ +/* + * 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 { AsyncCallback, Callback } from './basic'; +import { WantAgent } from './@ohos.wantAgent'; + +/** + * Provides interfaces for initiating location requests, ending the location service, + * and obtaining the location result cached by the system. + * + * @since 9 + * @import import geoLocationManager from '@ohos.geoLocationManager' + */ +declare namespace geoLocationManager { + /** + * Registering the callback function for listening to country code changes. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @param callback Indicates the callback for reporting country code changes. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 901 - The operating system or running environment does not support this api. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301100 - The location switch is off. + * @throws { BusinessError } 3301500 - Failed to query the area information. + */ + function on(type: 'countryCodeChange', callback: Callback): void; + + /** + * Unregistering the callback function for listening to country code changes. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @param callback Indicates the callback for reporting country code changes. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 901 - The operating system or running environment does not support this api. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301100 - The location switch is off. + * @throws { BusinessError } 3301500 - Failed to query the area information. + */ + function off(type: 'countryCodeChange', callback?: Callback): void; + + /** + * Enable location switch + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + * @permission ohos.permission.MANAGE_SECURE_SETTINGS + * @param callback Indicates the callback for reporting the error message. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - System API is not allowed called by third HAP. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 901 - The operating system or running environment does not support this api. + * @throws { BusinessError } 3301000 - Location service is unavailable. + */ + function enableLocation(callback: AsyncCallback): void; + function enableLocation(): Promise; + + /** + * Disable location switch + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + * @permission ohos.permission.MANAGE_SECURE_SETTINGS + * @param callback Indicates the callback for reporting the error message. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - System API is not allowed called by third HAP. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 901 - The operating system or running environment does not support this api. + * @throws { BusinessError } 3301000 - Location service is unavailable. + */ + function disableLocation(callback: AsyncCallback): void; + function disableLocation(): Promise; + + /** + * Obtain the current country code. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @param callback Indicates the callback for reporting the country code. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 901 - The operating system or running environment does not support this api. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301500 - Failed to query the area information. + */ + function getCountryCode(callback: AsyncCallback): void; + function getCountryCode(): Promise; + + /** + * Enable the geographical location simulation function. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + * @param callback Indicates a callback function, which is used to report the error message. + * 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. + * @throws { BusinessError } 202 - System API is not allowed called by third HAP. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 901 - The operating system or running environment does not support this api. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301100 - The location switch is off. + */ + function enableLocationMock(callback: AsyncCallback): void; + function enableLocationMock(): Promise; + + /** + * Disable the geographical location simulation function. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + * @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. + * @throws { BusinessError } 202 - System API is not allowed called by third HAP. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 901 - The operating system or running environment does not support this api. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301100 - The location switch is off. + */ + function disableLocationMock(callback: AsyncCallback): void; + function disableLocationMock(): Promise; + + /** + * Set the configuration parameters for location simulation. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + * @param config Indicates the configuration parameters for location simulation. + * @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. + * @throws { BusinessError } 202 - System API is not allowed called by third HAP. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 901 - The operating system or running environment does not support this api. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301100 - The location switch is off. + */ + function setMockedLocations(config: LocationMockConfig, callback: AsyncCallback): void; + function setMockedLocations(config: LocationMockConfig): Promise; + + /** + * Enable the reverse geocoding simulation function. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + * @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. + * @throws { BusinessError } 202 - System API is not allowed called by third HAP. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 901 - The operating system or running environment does not support this api. + * @throws { BusinessError } 3301000 - Location service is unavailable. + */ + function enableReverseGeocodingMock(callback: AsyncCallback): void; + function enableReverseGeocodingMock(): Promise; + + /** + * Disable the reverse geocoding simulation function. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + * @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. + * @throws { BusinessError } 202 - System API is not allowed called by third HAP. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 901 - The operating system or running environment does not support this api. + * @throws { BusinessError } 3301000 - Location service is unavailable. + */ + function disableReverseGeocodingMock(callback: AsyncCallback): void; + function disableReverseGeocodingMock(): Promise; + + /** + * Set the configuration parameters for simulating reverse geocoding. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + * @param mockInfos Indicates the set of locations and place names to be simulated. + * @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. + * @throws { BusinessError } 202 - System API is not allowed called by third HAP. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 901 - The operating system or running environment does not support this api. + * @throws { BusinessError } 3301000 - Location service is unavailable. + */ + function setReverseGeocodingMockInfo(mockInfos: Array, callback: AsyncCallback): void; + function setReverseGeocodingMockInfo(mockInfos: Array): Promise; + + /** + * Querying location privacy protocol confirmation status. + * + * @since 9 + * @systemapi + * @syscap SystemCapability.Location.Location.Core + * @param type indicates location privacy protocol type. + * @param callback indicates the callback for reporting the location privacy protocol confirmation status. + * @throws { BusinessError } 202 - System API is not allowed called by third HAP. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 901 - The operating system or running environment does not support this api. + * @throws { BusinessError } 3301000 - Location service is unavailable. + */ + function isLocationPrivacyConfirmed(type: LocationPrivacyType, callback: AsyncCallback): void; + function isLocationPrivacyConfirmed(type: LocationPrivacyType,): Promise; + + /** + * Set location privacy protocol confirmation status. + * + * @since 9 + * @systemapi + * @syscap SystemCapability.Location.Location.Core + * @permission ohos.permission.MANAGE_SECURE_SETTINGS + * @param type indicates location privacy protocol type. + * @param isConfirmed indicates whether the location privacy protocol has been confirmed. + * @param callback Indicates the callback for reporting error message. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - System API is not allowed called by third HAP. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 901 - The operating system or running environment does not support this api. + * @throws { BusinessError } 3301000 - Location service is unavailable. + */ + function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean, callback: AsyncCallback): void; + function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean): Promise; + + /** + * Configuration parameters for simulating reverse geocoding. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + */ + export interface ReverseGeocodingMockInfo { + location: ReverseGeoCodeRequest; + geoAddress: GeoAddress; + } + + /** + * Parameters for configuring the location simulation function. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + */ + export interface LocationMockConfig { + timeInterval: number; + locations: Array; + } + + /** + * Satellite status information + * + * @since 9 + * @syscap SystemCapability.Location.Location.Gnss + */ + export interface SatelliteStatusInfo { + satellitesNumber: number; + satelliteIds: Array; + carrierToNoiseDensitys: Array; + altitudes: Array; + azimuths: Array; + carrierFrequencies: Array; + } + + /** + * Parameters for requesting to report cache location information + * + * @since 9 + * @syscap SystemCapability.Location.Location.Gnss + */ + export interface CachedGnssLocationsRequest { + reportingPeriodSec: number; + wakeUpCacheQueueFull: boolean; + } + + /** + * Configuring parameters in geo fence requests + * + * @since 9 + * @syscap SystemCapability.Location.Location.Geofence + */ + export interface GeofenceRequest { + priority: LocationRequestPriority; + scenario: LocationRequestScenario; + geofence: Geofence; + } + + /** + * Configuring parameters in geo fence requests + * + * @since 9 + * @syscap SystemCapability.Location.Location.Geofence + */ + export interface Geofence { + latitude: number; + longitude: number; + radius: number; + expiration: number; + } + + /** + * Configuring parameters in reverse geocode requests + * + * @since 9 + * @syscap SystemCapability.Location.Location.Geocoder + */ + export interface ReverseGeoCodeRequest { + locale?: string; + latitude: number; + longitude: number; + maxItems?: number; + } + + /** + * Configuring parameters in geocode requests + * + * @since 9 + * @syscap SystemCapability.Location.Location.Geocoder + */ + export interface GeoCodeRequest { + locale?: string; + description: string; + maxItems?: number; + minLatitude?: number; + minLongitude?: number; + maxLatitude?: number; + maxLongitude?: number; + } + + /** + * Data struct describes geographic locations. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Geocoder + */ + export interface GeoAddress { + /** + * Indicates latitude information. + * A positive value indicates north latitude, + * and a negative value indicates south latitude. + * @since 9 + */ + latitude?: number; + + /** + * Indicates longitude information. + * A positive value indicates east longitude , + * and a negative value indicates west longitude . + * @since 9 + */ + longitude?: number; + + /** + * Indicates language used for the location description. + * zh indicates Chinese, and en indicates English. + * @since 9 + */ + locale?: string; + + /** + * Indicates landmark of the location. + * @since 9 + */ + placeName?: string; + + /** + * Indicates country code. + * @since 9 + */ + countryCode?: string; + + /** + * Indicates country name. + * @since 9 + */ + countryName?: string; + + /** + * Indicates administrative region name. + * @since 9 + */ + administrativeArea?: string; + + /** + * Indicates sub-administrative region name. + * @since 9 + */ + subAdministrativeArea?: string; + + /** + * Indicates locality information. + * @since 9 + */ + locality?: string; + + /** + * Indicates sub-locality information. + * @since 9 + */ + subLocality?: string; + + /** + * Indicates road name. + * @since 9 + */ + roadName?: string; + + /** + * Indicates auxiliary road information. + * @since 9 + */ + subRoadName?: string; + + /** + * Indicates house information. + * @since 9 + */ + premises?: string; + + /** + * Indicates postal code. + * @since 9 + */ + postalCode?: string; + + /** + * Indicates phone number. + * @since 9 + */ + phoneNumber?: string; + + /** + * Indicates website URL. + * @since 9 + */ + addressUrl?: string; + + /** + * Indicates additional information. + * @since 9 + */ + descriptions?: Array; + + /** + * Indicates the amount of additional descriptive information. + * @since 9 + */ + descriptionsSize?: number; + + /** + * Indicates whether it is an mock GeoAddress + * @since 9 + */ + isFromMock?: Boolean; + } + + /** + * Configuring parameters in location requests + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + */ + export interface LocationRequest { + priority?: LocationRequestPriority; + scenario?: LocationRequestScenario; + timeInterval?: number; + distanceInterval?: number; + maxAccuracy?: number; + } + + /** + * Configuring parameters in current location requests + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + */ + export interface CurrentLocationRequest { + priority?: LocationRequestPriority; + scenario?: LocationRequestScenario; + maxAccuracy?: number; + timeoutMs?: number; + } + + /** + * Provides information about geographic locations + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + */ + export interface Location { + /** + * Indicates latitude information. + * A positive value indicates north latitude, + * and a negative value indicates south latitude. + * @since 9 + */ + latitude: number; + + /** + * Indicates Longitude information. + * A positive value indicates east longitude , + * and a negative value indicates west longitude . + * @since 9 + */ + longitude: number; + + /** + * Indicates location altitude, in meters. + * @since 9 + */ + altitude: number; + + /** + * Indicates location accuracy, in meters. + * @since 9 + */ + accuracy: number; + + /** + * Indicates speed, in m/s. + * @since 9 + */ + speed: number; + + /** + * Indicates location timestamp in the UTC format. + * @since 9 + */ + timeStamp: number; + + /** + * Indicates direction information. + * @since 9 + */ + direction: number; + + /** + * Indicates location timestamp since boot. + * @since 9 + */ + timeSinceBoot: number; + + /** + * Indicates additional information. + * @since 9 + */ + additions?: Array; + + /** + * Indicates the amount of additional descriptive information. + * @since 9 + */ + additionSize?: number; + + /** + * Indicates whether it is an mock location. + * @since 9 + */ + isFromMock?: Boolean; + } + + /** + * Enum for location priority + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + */ + export enum LocationRequestPriority { + UNSET = 0x200, + ACCURACY, + LOW_POWER, + FIRST_FIX, + } + + /** + * Enum for location scenario + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + */ + export enum LocationRequestScenario { + UNSET = 0x300, + NAVIGATION, + TRAJECTORY_TRACKING, + CAR_HAILING, + DAILY_LIFE_SERVICE, + NO_POWER, + } + + /** + * Enum for location privacy type + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + */ + export enum LocationPrivacyType { + OTHERS = 0, + STARTUP, + CORE_LOCATION, + } + + /** + * Location subsystem command structure + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + */ + export interface LocationCommand { + scenario: LocationRequestScenario; + command: string; + } + + /** + * Country code structure + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + */ + export interface CountryCode { + country: string; + type: CountryCodeType; + } + + /** + * Enum for country code type + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + */ + export enum CountryCodeType { + COUNTRY_CODE_FROM_LOCALE = 1, + COUNTRY_CODE_FROM_SIM, + COUNTRY_CODE_FROM_LOCATION, + COUNTRY_CODE_FROM_NETWORK, + } +} + +export default geoLocationManager; diff --git a/api/@ohos.geolocation.d.ts b/api/@ohos.geolocation.d.ts index fc4619ebec..5e0e3cfad1 100644 --- a/api/@ohos.geolocation.d.ts +++ b/api/@ohos.geolocation.d.ts @@ -149,24 +149,6 @@ declare namespace geolocation { */ function off(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void; - /** - * registering the callback function for listening to country code changes. - * - * @since 9 - * @syscap SystemCapability.Location.Location.Core - * @param callback Indicates the callback for reporting country code changes. - */ - function on(type: 'countryCodeChange', callback: Callback): void; - - /** - * unregistering the callback function for listening to country code changes. - * - * @since 9 - * @syscap SystemCapability.Location.Location.Core - * @param callback Indicates the callback for reporting country code changes. - */ - function off(type: 'countryCodeChange', callback?: Callback): void; - /** * obtain current location * @@ -304,127 +286,6 @@ declare namespace geolocation { function sendCommand(command: LocationCommand, callback: AsyncCallback): void; function sendCommand(command: LocationCommand): Promise; - /** - * obtain the current country code. - * - * @since 9 - * @syscap SystemCapability.Location.Location.Core - * @param callback Indicates the callback for reporting the country code. - */ - function getCountryCode(callback: AsyncCallback): void; - function getCountryCode(): Promise; - - /** - * enable 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 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(callback: AsyncCallback): void; - function enableLocationMock(scenario: LocationRequestScenario): Promise; - function enableLocationMock(): Promise; - - /** - * 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 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(callback: AsyncCallback): void; - function disableLocationMock(scenario: LocationRequestScenario): Promise; - function disableLocationMock(): Promise; - - /** - * set the configuration parameters for location simulation. - * - * @since 9 - * @syscap SystemCapability.Location.Location.Core - * @systemapi - * @param config Indicates the configuration parameters for location simulation. - * @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; - - /** - * enable the reverse geocoding simulation function. - * - * @since 9 - * @syscap SystemCapability.Location.Location.Core - * @systemapi - * @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; - - /** - * disable the reverse geocoding simulation function. - * - * @since 9 - * @syscap SystemCapability.Location.Location.Core - * @systemapi - * @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; - - /** - * set the configuration parameters for simulating reverse geocoding. - * - * @since 9 - * @syscap SystemCapability.Location.Location.Core - * @systemapi - * @param mockInfos Indicates the set of locations and place names to be simulated. - * @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; - - /** - * configuration parameters for simulating reverse geocoding. - * - * @since 9 - * @syscap SystemCapability.Location.Location.Core - * @systemapi - */ - export interface ReverseGeocodingMockInfo { - location: ReverseGeoCodeRequest; - geoAddress: GeoAddress; - } - - /** - * parameters for configuring the location simulation function. - * - * @since 9 - * @syscap SystemCapability.Location.Location.Core - * @systemapi - */ - export interface LocationMockConfig { - timeInterval: number; - locations: Array; - } - /** * satellite status information * @@ -480,33 +341,6 @@ declare namespace geolocation { expiration: number; } - /** - * querying location privacy protocol confirmation status. - * - * @since 8 - * @systemapi - * @syscap SystemCapability.Location.Location.Core - * @permission ohos.permission.LOCATION - * @param type indicates location privacy protocol type. - * @param callback indicates the callback for reporting the location privacy protocol confirmation status. - */ - function isLocationPrivacyConfirmed(type: LocationPrivacyType, callback: AsyncCallback): void; - function isLocationPrivacyConfirmed(type: LocationPrivacyType,): Promise; - - /** - * set location privacy protocol confirmation status. - * - * @since 8 - * @systemapi - * @syscap SystemCapability.Location.Location.Core - * @permission ohos.permission.LOCATION - * @param type indicates location privacy protocol type. - * @param isConfirmed indicates whether the location privacy protocol has been confirmed. - * @param callback Indicates the callback for reporting whether the action is set successfully. - */ - function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean, callback: AsyncCallback): void; - function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean): Promise; - /** * configuring parameters in reverse geocode requests * @@ -658,12 +492,6 @@ declare namespace geolocation { * @since 7 */ descriptionsSize?: number; - - /** - * Indicates whether it is an mock GeoAddress - * @since 9 - */ - isFromMock?: Boolean; } /** @@ -766,12 +594,6 @@ declare namespace geolocation { * @since 7 */ additionSize?: number; - - /** - * Indicates whether it is an mock location. - * @since 9 - */ - isFromMock?: Boolean; } /** @@ -812,12 +634,6 @@ declare namespace geolocation { * @permission ohos.permission.LOCATION */ export enum GeoLocationErrorCode { - /** - * Indicates function not supported. - * @since 9 - */ - NOT_SUPPORTED = 100, - /** * Indicates input parameter error. * @since 7 @@ -859,12 +675,6 @@ declare namespace geolocation { * @since 7 */ LOCATION_REQUEST_TIMEOUT_ERROR, - - /** - * Indicates country code query failed. - * @since 9 - */ - QUERY_COUNTRY_CODE_ERROR, } /** @@ -891,30 +701,6 @@ declare namespace geolocation { scenario: LocationRequestScenario; command: string; } - - /** - * country code structure - * - * @since 9 - * @syscap SystemCapability.Location.Location.Core - */ - export interface CountryCode { - country: string; - type: CountryCodeType; - } - - /** - * enum for country code type - * - * @since 9 - * @syscap SystemCapability.Location.Location.Core - */ - export enum CountryCodeType { - COUNTRY_CODE_FROM_LOCALE = 1, - COUNTRY_CODE_FROM_SIM, - COUNTRY_CODE_FROM_LOCATION, - COUNTRY_CODE_FROM_NETWORK, - } } export default geolocation; -- Gitee From dea9a4dbf0e9e500a940a8ac9e8b68d811032213 Mon Sep 17 00:00:00 2001 From: ma-shaoyin Date: Tue, 25 Oct 2022 18:29:34 +0800 Subject: [PATCH 239/438] Signed-off-by: ma-shaoyin ` Changes to be committed: --- api/@ohos.inputmethod.d.ts | 49 +++++----------------- api/@ohos.inputmethodengine.d.ts | 43 ++++++------------- api/@ohos.inputmethodextensioncontext.d.ts | 2 - 3 files changed, 22 insertions(+), 72 deletions(-) diff --git a/api/@ohos.inputmethod.d.ts b/api/@ohos.inputmethod.d.ts index 3a14e58aa8..57c9676bf0 100644 --- a/api/@ohos.inputmethod.d.ts +++ b/api/@ohos.inputmethod.d.ts @@ -133,8 +133,6 @@ declare namespace inputMethod { * Input method setting * @since 9 * @return :- - * @throws {BusinessError} 201 - permissions check fails. - * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800007 - settings extension error. * @syscap SystemCapability.MiscServices.InputMethodFramework * @StageModelOnly @@ -145,8 +143,6 @@ declare namespace inputMethod { * Input method controller * @since 9 * @return :- - * @throws {BusinessError} 201 - permissions check fails. - * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800006 - input method controller error. * @syscap SystemCapability.MiscServices.InputMethodFramework * @StageModelOnly @@ -161,8 +157,8 @@ declare namespace inputMethod { * @permission ohos.permission.CONNECT_IME_ABILITY * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 12800007 - settings extension error. * @throws {BusinessError} 12800005 - configuration persisting error. + * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework * @StageModelOnly */ @@ -176,8 +172,8 @@ declare namespace inputMethod { * @permission ohos.permission.CONNECT_IME_ABILITY * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 12800007 - settings extension error. * @throws {BusinessError} 12800005 - configuration persisting error. + * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework * @StageModelOnly */ @@ -187,9 +183,6 @@ declare namespace inputMethod { * Get current input method * @since 9 * @return The InputMethodProperty object of the current input method - * @throws {BusinessError} 201 - permissions check fails. - * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 12800007 - settings extension error. * @syscap SystemCapability.MiscServices.InputMethodFramework * @StageModelOnly */ @@ -204,7 +197,7 @@ declare namespace inputMethod { * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800005 - configuration persisting error. - * @throws {BusinessError} 12800007 - settings extension error. + * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework * @StageModelOnly */ @@ -219,7 +212,7 @@ declare namespace inputMethod { * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800005 - configuration persisting error. - * @throws {BusinessError} 12800007 - settings extension error. + * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework * @StageModelOnly */ @@ -229,9 +222,6 @@ declare namespace inputMethod { * Get the current input method subtype * @since 9 * @return The InputMethodSubtype object of the current input method - * @throws {BusinessError} 201 - permissions check fails. - * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 12800007 - settings extension error. * @syscap SystemCapability.MiscServices.InputMethodFramework * @StageModelOnly */ @@ -247,7 +237,7 @@ declare namespace inputMethod { * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800005 - configuration persisting error. - * @throws {BusinessError} 12800007 - settings extension error. + * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework * @StageModelOnly */ @@ -263,7 +253,7 @@ declare namespace inputMethod { * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800005 - configuration persisting error. - * @throws {BusinessError} 12800007 - settings extension error. + * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework * @StageModelOnly */ @@ -296,7 +286,6 @@ declare namespace inputMethod { * @since 9 * @param inputMethodProperty Indicates the specified input method * @return :- - * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800001 - package manager error. * @throws {BusinessError} 12800008 - input method manager service error. @@ -310,7 +299,6 @@ declare namespace inputMethod { * @since 9 * @param inputMethodProperty Indicates the specified input method * @return :- - * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800001 - package manager error. * @throws {BusinessError} 12800008 - input method manager service error. @@ -323,7 +311,6 @@ declare namespace inputMethod { * List subtype of current input method * @since 9 * @return :- - * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800001 - package manager error. * @throws {BusinessError} 12800008 - input method manager service error. @@ -336,8 +323,6 @@ declare namespace inputMethod { * List subtype of current input method * @since 9 * @return :- - * @throws {BusinessError} 201 - permissions check fails. - * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800001 - package manager error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework @@ -352,7 +337,6 @@ declare namespace inputMethod { * If true, collect enabled input methods. * If false, collect disabled input methods. * @return :- - * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800001 - package manager error. * @throws {BusinessError} 12800008 - input method manager service error. @@ -368,7 +352,6 @@ declare namespace inputMethod { * If true, collect enabled input methods. * If false, collect disabled input methods. * @return :- - * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800001 - package manager error. * @throws {BusinessError} 12800008 - input method manager service error. @@ -397,9 +380,6 @@ declare namespace inputMethod { * @permission ohos.permission.CONNECT_IME_ABILITY * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 12800001 - package manager error. - * @throws {BusinessError} 12800007 - settings extension error. - * @throws {BusinessError} 12800005 - configuration persisting error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework * @StageModelOnly @@ -412,10 +392,6 @@ declare namespace inputMethod { * @return - * @permission ohos.permission.CONNECT_IME_ABILITY * @throws {BusinessError} 201 - permissions check fails. - * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 12800001 - package manager error. - * @throws {BusinessError} 12800005 - configuration persisting error. - * @throws {BusinessError} 12800007 - settings extension error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework * @StageModelOnly @@ -447,7 +423,6 @@ declare namespace inputMethod { * @return :- * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 12800002 - input method engine error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ @@ -458,8 +433,6 @@ declare namespace inputMethod { * @since 9 * @return :- * @throws {BusinessError} 201 - permissions check fails. - * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 12800002 - input method engine error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ @@ -492,7 +465,7 @@ declare namespace inputMethod { * @permission ohos.permission.CONNECT_IME_ABILITY * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 12800002 - input method engine error. + * @throws {BusinessError} 12800003 - input method client error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ @@ -504,8 +477,7 @@ declare namespace inputMethod { * @return :- * @permission ohos.permission.CONNECT_IME_ABILITY * @throws {BusinessError} 201 - permissions check fails. - * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 12800002 - input method engine error. + * @throws {BusinessError} 12800003 - input method client error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ @@ -518,7 +490,7 @@ declare namespace inputMethod { * @permission ohos.permission.CONNECT_IME_ABILITY * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 12800002 - input method engine error. + * @throws {BusinessError} 12800003 - input method client error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ @@ -530,8 +502,7 @@ declare namespace inputMethod { * @return :- * @permission ohos.permission.CONNECT_IME_ABILITY * @throws {BusinessError} 201 - permissions check fails. - * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 12800002 - input method engine error. + * @throws {BusinessError} 12800003 - input method client error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ diff --git a/api/@ohos.inputmethodengine.d.ts b/api/@ohos.inputmethodengine.d.ts index 9046751db9..5e5785b638 100644 --- a/api/@ohos.inputmethodengine.d.ts +++ b/api/@ohos.inputmethodengine.d.ts @@ -217,10 +217,6 @@ declare namespace inputMethodEngine { /** * @since 9 * @return InputMethodAbility object of the current input method - * @throws {BusinessError} 201 - permissions check fails. - * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 801 - call unsupported api. - * @throws {BusinessError} 12800002 - input method engine error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ function getInputMethodAbility(): InputMethodAbility; @@ -235,9 +231,6 @@ declare namespace inputMethodEngine { /** * @since 9 * @return KeyboardDelegate object of the current input method - * @throws {BusinessError} 201 - permissions check fails. - * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 12800002 - input method engine error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ function getKeyboardDelegate(): KeyboardDelegate; @@ -255,20 +248,15 @@ declare namespace inputMethodEngine { interface KeyboardController { /** * @since 9 - * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 12800002 - input method engine error. - * @throws {BusinessError} 12800008 - input method manager service error. + * @throws {BusinessError} 12800003 - input method client error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ hide(callback: AsyncCallback): void; /** * @since 9 - * @throws {BusinessError} 201 - permissions check fails. - * @throws {BusinessError} 401 - parameter error. - * @throws {BusinessError} 12800002 - input method engine error. - * @throws {BusinessError} 12800008 - input method manager service error. + * @throws @throws {BusinessError} 12800003 - input method client error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ hide(): Promise; @@ -531,7 +519,6 @@ declare namespace inputMethodEngine { interface InputClient { /** * @since 9 - * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800003 - input method client error. * @syscap SystemCapability.MiscServices.InputMethodFramework @@ -540,7 +527,6 @@ declare namespace inputMethodEngine { /** * @since 9 - * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800003 - input method client error. * @syscap SystemCapability.MiscServices.InputMethodFramework @@ -549,8 +535,8 @@ declare namespace inputMethodEngine { /** * @since 9 - * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 12800002 - Input method engine error. * @throws {BusinessError} 12800003 - input method client error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ @@ -558,8 +544,8 @@ declare namespace inputMethodEngine { /** * @since 9 - * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 12800002 - Input method engine error. * @throws {BusinessError} 12800003 - input method client error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ @@ -567,8 +553,8 @@ declare namespace inputMethodEngine { /** * @since 9 - * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 12800002 - Input method engine error. * @throws {BusinessError} 12800003 - input method client error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ @@ -576,8 +562,8 @@ declare namespace inputMethodEngine { /** * @since 9 - * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 12800002 - Input method engine error. * @throws {BusinessError} 12800003 - input method client error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ @@ -585,8 +571,8 @@ declare namespace inputMethodEngine { /** * @since 9 - * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 12800002 - Input method engine error. * @throws {BusinessError} 12800003 - input method client error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ @@ -594,8 +580,8 @@ declare namespace inputMethodEngine { /** * @since 9 - * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 12800002 - Input method engine error. * @throws {BusinessError} 12800003 - input method client error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ @@ -603,43 +589,42 @@ declare namespace inputMethodEngine { /** * @since 9 - * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800003 - input method client error. + * @throws {BusinessError} 12800006 - Input method controller error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ getForward(length: number, callback: AsyncCallback): void; /** * @since 9 - * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800003 - input method client error. + * @throws {BusinessError} 12800006 - Input method controller error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ getForward(length: number): Promise; /** * @since 9 - * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800003 - input method client error. + * @throws {BusinessError} 12800006 - Input method controller error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ getBackward(length: number, callback: AsyncCallback): void; /** * @since 9 - * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800003 - input method client error. + * @throws {BusinessError} 12800006 - Input method controller error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ getBackward(length: number): Promise; /** * @since 9 - * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800003 - input method client error. * @syscap SystemCapability.MiscServices.InputMethodFramework @@ -648,8 +633,6 @@ declare namespace inputMethodEngine { /** * @since 9 - * @throws {BusinessError} 201 - permissions check fails. - * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800003 - input method client error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ @@ -662,7 +645,6 @@ declare namespace inputMethodEngine { * @syscap SystemCapability.MiscServices.InputMethodFramework * @param direction Indicates the distance of cursor to be moved. * @return - - * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800003 - input method client error. * @StageModelOnly @@ -676,7 +658,6 @@ declare namespace inputMethodEngine { * @syscap SystemCapability.MiscServices.InputMethodFramework * @param direction Indicates the distance of cursor to be moved. * @return - - * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800003 - input method client error. * @StageModelOnly diff --git a/api/@ohos.inputmethodextensioncontext.d.ts b/api/@ohos.inputmethodextensioncontext.d.ts index b9f7b9f386..fe7422c37e 100644 --- a/api/@ohos.inputmethodextensioncontext.d.ts +++ b/api/@ohos.inputmethodextensioncontext.d.ts @@ -32,7 +32,6 @@ export default class InputMethodExtensionContext extends ExtensionContext { * @since 9 * @syscap SystemCapability.MiscServices.InputMethodFramework * @return - - * @throws {BusinessError} 401 - parameter error. * @StageModelOnly */ destroy(callback: AsyncCallback): void; @@ -43,7 +42,6 @@ export default class InputMethodExtensionContext extends ExtensionContext { * @since 9 * @syscap SystemCapability.MiscServices.InputMethodFramework * @return - - * @throws {BusinessError} 401 - parameter error. * @StageModelOnly */ destroy(): Promise; -- Gitee From 418ed97d2c4306e8c15ad6cd857ae7c84573b82a Mon Sep 17 00:00:00 2001 From: zhaoxinyu Date: Tue, 25 Oct 2022 17:59:14 +0800 Subject: [PATCH 240/438] =?UTF-8?q?=E5=BA=9F=E5=BC=83=E6=97=A7GridContaine?= =?UTF-8?q?r=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhaoxinyu Change-Id: Ic42cc1d0a3050a17c64b50eb37884017771c992c --- api/@internal/component/ets/common.d.ts | 1 + api/@internal/component/ets/grid_container.d.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index 846499f532..ae52c00f69 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -1714,6 +1714,7 @@ declare class CommonMethod { * Sets the number of occupied columns and offset columns for a specific device width type. * @since 7 * @deprecated since 9 + * @useinstead grid_col/[GridColColumnOption] and grid_row/[GridRowColumnOption] */ useSizeType(value: { xs?: number | { span: number; offset: number }; diff --git a/api/@internal/component/ets/grid_container.d.ts b/api/@internal/component/ets/grid_container.d.ts index 5c1cf27b75..1c9e0cd0f4 100644 --- a/api/@internal/component/ets/grid_container.d.ts +++ b/api/@internal/component/ets/grid_container.d.ts @@ -17,6 +17,7 @@ * Defines the size type. * @since 7 * @deprecated since 9 + * @useinstead grid_col/[GridColColumnOption] and grid_row/[GridRowColumnOption] */ declare enum SizeType { /** @@ -54,6 +55,7 @@ declare enum SizeType { * Defines the options of GridContainer. * @since 7 * @deprecated since 9 + * @useinstead grid_col/[GridColOptions] and grid_row/[GridRowOptions] */ declare interface GridContainerOptions { /** @@ -89,6 +91,7 @@ declare interface GridContainerOptions { * Defines the GridContainer component. * @since 7 * @deprecated since 9 + * @useinstead grid_col/[GridColInterface] and grid_row/[GridRowInterface] */ interface GridContainerInterface { /** @@ -103,6 +106,7 @@ interface GridContainerInterface { * Defines the grid container attribute from inheritance Column * @since 7 * @deprecated since 9 + * @useinstead grid_col/[GridColAttribute] and grid_row/[GridRowAttribute] */ declare class GridContainerAttribute extends ColumnAttribute {} -- Gitee From 89151182778df1e4fbc347339cb4ee41502d3898 Mon Sep 17 00:00:00 2001 From: m00512953 Date: Tue, 25 Oct 2022 20:58:53 +0800 Subject: [PATCH 241/438] mingxihua@huawei.com.cn Signed-off-by: m00512953 --- api/@ohos.app.ability.contextConstant.d.ts | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 api/@ohos.app.ability.contextConstant.d.ts diff --git a/api/@ohos.app.ability.contextConstant.d.ts b/api/@ohos.app.ability.contextConstant.d.ts new file mode 100644 index 0000000000..96b8f12a60 --- /dev/null +++ b/api/@ohos.app.ability.contextConstant.d.ts @@ -0,0 +1,44 @@ +/* + * 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. + */ + +/** + * The context of an application. It allows access to application-specific resources. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @StageModelOnly + */ + declare namespace contextConstant { + + /** + * 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 + } +} + +export default contextConstant; \ No newline at end of file -- Gitee From 5869eef0e7d42308d60a72f1acee9a0af89fc643 Mon Sep 17 00:00:00 2001 From: "yanxiaotao@huawei.com" Date: Tue, 25 Oct 2022 21:48:02 +0800 Subject: [PATCH 242/438] add error code for wifi 1025 Signed-off-by: yanxiaotao@huawei.com --- api/@ohos.wifi.d.ts | 45 +++++++++++++++++++++++++++++++++++ api/@ohos.wifiManagerExt.d.ts | 24 +++++++++---------- 2 files changed, 57 insertions(+), 12 deletions(-) diff --git a/api/@ohos.wifi.d.ts b/api/@ohos.wifi.d.ts index 6fe8e9cf95..769cba4e70 100644 --- a/api/@ohos.wifi.d.ts +++ b/api/@ohos.wifi.d.ts @@ -32,6 +32,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.enableWifi */ function enableWifi(): boolean; @@ -45,6 +46,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.disableWifi */ function disableWifi(): boolean; @@ -57,6 +59,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.isWifiActive */ function isWifiActive(): boolean; @@ -71,6 +74,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.LOCATION * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.scan */ function scan(): boolean; @@ -83,6 +87,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or ohos.permission.LOCATION) * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.getScanResults */ function getScanInfos(): Promise>; function getScanInfos(callback: AsyncCallback>): void; @@ -100,6 +105,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.addDeviceConfig */ function addDeviceConfig(config: WifiDeviceConfig): Promise; function addDeviceConfig(config: WifiDeviceConfig, callback: AsyncCallback): void; @@ -115,6 +121,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.addCandidateConfig */ function addUntrustedConfig(config: WifiDeviceConfig): Promise; function addUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback): void; @@ -129,6 +136,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.removeCandidateConfig */ function removeUntrustedConfig(config: WifiDeviceConfig): Promise; function removeUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback): void; @@ -144,6 +152,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.connectToNetwork */ function connectToNetwork(networkId: number): boolean; @@ -159,6 +168,7 @@ declare namespace wifi { * ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.connectToDevice */ function connectToDevice(config: WifiDeviceConfig): boolean; @@ -172,6 +182,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.disconnect */ function disconnect(): boolean; @@ -186,6 +197,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.getSignalLevel */ function getSignalLevel(rssi: number, band: number): number; @@ -197,6 +209,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.getLinkedInfo */ function getLinkedInfo(): Promise; function getLinkedInfo(callback: AsyncCallback): void; @@ -209,6 +222,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.isConnected */ function isConnected(): boolean; @@ -223,6 +237,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.getSupportedFeatures */ function getSupportedFeatures(): number; @@ -235,6 +250,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.Core * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.isFeatureSupported */ function isFeatureSupported(featureId: number): boolean; @@ -249,6 +265,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_LOCAL_MAC and ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.getDeviceMacAddress */ function getDeviceMacAddress(): string[]; @@ -262,6 +279,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.getIpInfo */ function getIpInfo(): IpInfo; @@ -273,6 +291,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.Core * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.getCountryCode */ function getCountryCode(): string; @@ -285,6 +304,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.reassociate */ function reassociate(): boolean; @@ -297,6 +317,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.reconnect */ function reconnect(): boolean; @@ -311,6 +332,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.GET_WIFI_CONFIG * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.getDeviceConfigs */ function getDeviceConfigs(): Array; @@ -326,6 +348,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.updateNetwork */ function updateNetwork(config: WifiDeviceConfig): number; @@ -341,6 +364,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.disableNetwork */ function disableNetwork(netId: number): boolean; @@ -354,6 +378,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.removeAllNetwork */ function removeAllNetwork(): boolean; @@ -372,6 +397,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.removeDevice */ function removeDevice(id: number): boolean; @@ -386,6 +412,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.enableHotspot */ function enableHotspot(): boolean; @@ -400,6 +427,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.disableHotspot */ function disableHotspot(): boolean; @@ -412,6 +440,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.isHotspotDualBandSupported */ function isHotspotDualBandSupported(): boolean; @@ -424,6 +453,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.isHotspotActive */ function isHotspotActive(): boolean; @@ -441,6 +471,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.setHotspotConfig */ function setHotspotConfig(config: HotspotConfig): boolean; @@ -453,6 +484,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.getHotspotConfig */ function getHotspotConfig(): HotspotConfig; @@ -467,6 +499,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.getStations */ function getStations(): Array; @@ -478,6 +511,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.getP2pLinkedInfo */ function getP2pLinkedInfo(): Promise; function getP2pLinkedInfo(callback: AsyncCallback): void; @@ -490,6 +524,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.getCurrentGroup */ function getCurrentGroup(): Promise; function getCurrentGroup(callback: AsyncCallback): void; @@ -502,6 +537,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.getP2pPeerDevices */ function getP2pPeerDevices(): Promise; function getP2pPeerDevices(callback: AsyncCallback): void; @@ -515,6 +551,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.createGroup */ function createGroup(config: WifiP2PConfig): boolean; @@ -526,6 +563,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.removeGroup */ function removeGroup(): boolean; @@ -538,6 +576,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.p2pConnect */ function p2pConnect(config: WifiP2PConfig): boolean; @@ -549,6 +588,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.p2pDisonnect */ function p2pCancelConnect(): boolean; @@ -560,6 +600,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.startDiscoverDevices */ function startDiscoverDevices(): boolean; @@ -571,6 +612,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.stopDiscoverDevices */ function stopDiscoverDevices(): boolean; @@ -584,6 +626,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.deletePersistentGroup */ function deletePersistentGroup(netId: number): boolean; @@ -597,6 +640,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.setDeviceName */ function setDeviceName(devName: string): boolean; @@ -608,6 +652,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifi.setDeviceName */ function on(type: "wifiStateChange", callback: Callback): void; diff --git a/api/@ohos.wifiManagerExt.d.ts b/api/@ohos.wifiManagerExt.d.ts index 03ab526b94..964cbdb073 100644 --- a/api/@ohos.wifiManagerExt.d.ts +++ b/api/@ohos.wifiManagerExt.d.ts @@ -51,9 +51,9 @@ declare namespace wifiManagerExt { function disableHotspot(): void; /** - * Obtains the supported power model. + * Obtains the supported power Mode. * - * @return Returns the array of supported power model. + * @return Returns the array of supported power Mode. * * @since 9 * @throws {BusinessError} 201 - Permission denied. @@ -62,8 +62,8 @@ declare namespace wifiManagerExt { * @permission ohos.permission.GET_WIFI_INFO * @syscap SystemCapability.Communication.WiFi.AP.Extension */ - function getSupportedPowerModel(): Promise>; - function getSupportedPowerModel(callback: AsyncCallback>): void; + function getSupportedPowerMode(): Promise>; + function getSupportedPowerMode(callback: AsyncCallback>): void; /** * Obtains the current Wi-Fi power mode. @@ -77,8 +77,8 @@ declare namespace wifiManagerExt { * @permission ohos.permission.GET_WIFI_INFO * @syscap SystemCapability.Communication.WiFi.AP.Extension */ - function getPowerModel (): Promise; - function getPowerModel (callback: AsyncCallback): void; + function getPowerMode (): Promise; + function getPowerMode (callback: AsyncCallback): void; /** * Set the current Wi-Fi power mode. @@ -90,22 +90,22 @@ declare namespace wifiManagerExt { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT_EXT * @syscap SystemCapability.Communication.WiFi.AP.Extension */ - function setPowerModel(model: PowerModel) : void + function setPowerMode(mode: PowerMode) : void /** - * The power model enumeration. + * The power Mode enumeration. * * @since 9 * @syscap SystemCapability.Communication.WiFi.AP.Extension */ - export enum PowerModel { - /** Sleeping model. */ + export enum PowerMode { + /** Sleeping Mode. */ SLEEPING = 0, - /** General model. */ + /** General Mode. */ GENERAL = 1, - /** Through wall model. */ + /** Through wall Mode. */ THROUGH_WALL = 2, } } -- Gitee From 83f935f6f331d104dd078062fb405cb850a8f7b9 Mon Sep 17 00:00:00 2001 From: Yippo Date: Tue, 25 Oct 2022 21:19:35 +0800 Subject: [PATCH 243/438] Description:ipc/rpc modify some description of api errorCode Feature or Bugfix:ipc/rpc modify some description of api errorCode Binary Source: No Signed-off-by: Yippo --- api/@ohos.rpc.d.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/api/@ohos.rpc.d.ts b/api/@ohos.rpc.d.ts index 6387bdb435..a2fe2513a3 100644 --- a/api/@ohos.rpc.d.ts +++ b/api/@ohos.rpc.d.ts @@ -1486,7 +1486,7 @@ declare namespace rpc { * Writes an anonymous shared memory object to this {@link MessageSequence} object. * @param ashmem Anonymous shared memory object to wrote. * @throws { BusinessError } 401 - check param failed - * @throws { BusinessError } 1900009 - write data to message sequence failed + * @throws { BusinessError } 1900003 - write to ashmem failed * @since 9 */ writeAshmem(ashmem: Ashmem): void; @@ -1495,7 +1495,7 @@ declare namespace rpc { * Reads the anonymous shared memory object from this {@link MessageSequence} object. * @return Anonymous share object obtained. * @throws { BusinessError } 401 - check param failed - * @throws { BusinessError } 1900009 - write data to message sequence failed + * @throws { BusinessError } 1900004 - read from ashmem failed * @since 9 */ readAshmem(): Ashmem; @@ -1849,7 +1849,7 @@ declare namespace rpc { * @return Returns the interface descriptor. * @since 7 * @deprecated since 9 - * @useinstead ohos.rpc.IRemoteObject#getInterfaceDescriptor + * @useinstead ohos.rpc.IRemoteObject#getDescriptor */ getInterfaceDescriptor(): string; @@ -1862,7 +1862,7 @@ declare namespace rpc { * @throws { BusinessError } 1900008 - proxy or remote object is invalid * @since 9 */ - getInterfaceDescriptor(): string; + getDescriptor(): string; /** * Checks whether an object is dead. @@ -2751,6 +2751,7 @@ declare namespace rpc { * Creates the shared file mapping on the virtual address space of this process. * The size of the mapping region is specified by this Ashmem object. * @param mapType Protection level of the memory region to which the shared file is mapped. + * @throws { BusinessError } 401 - check param failed * @throws { BusinessError } 1900001 - call mmap function failed * @since 9 */ @@ -2801,6 +2802,7 @@ declare namespace rpc { /** * Sets the protection level of the memory region to which the shared file is mapped. * @param protectionType Protection type to set. + * @throws { BusinessError } 401 - check param failed * @throws { BusinessError } 1900002 - os ioctl function failed * @since 9 */ @@ -2824,7 +2826,7 @@ declare namespace rpc { * @param size Size of the data to write * @param offset Start position of the data to write in the memory region associated with this Ashmem object. * @throws { BusinessError } 401 - check param failed - * @throws { BusinessError } 1900009 - write to ashmem failed + * @throws { BusinessError } 1900003 - write to ashmem failed * @since 9 */ writeAshmem(buf: number[], size: number, offset: number): void; @@ -2846,7 +2848,7 @@ declare namespace rpc { * @param offset Start position of the data to read in the memory region associated with this Ashmem object. * @return Data read. * @throws { BusinessError } 401 - check param failed - * @throws { BusinessError } 1900010 - read from ashmem failed + * @throws { BusinessError } 1900004 - read from ashmem failed * @since 9 */ readAshmem(size: number, offset: number): number[]; -- Gitee From 946e6d66fb782d83a4ca44ee6c72ff21409285a8 Mon Sep 17 00:00:00 2001 From: "yanxiaotao@huawei.com" Date: Tue, 25 Oct 2022 23:25:15 +0800 Subject: [PATCH 244/438] add error code for wifi 1025 Signed-off-by: yanxiaotao@huawei.com --- api/@ohos.wifi.d.ts | 135 ++++++++++++++++++++++++------------- api/@ohos.wifiManager.d.ts | 4 +- api/@ohos.wifiext.d.ts | 8 ++- 3 files changed, 99 insertions(+), 48 deletions(-) diff --git a/api/@ohos.wifi.d.ts b/api/@ohos.wifi.d.ts index 769cba4e70..0675de66ed 100644 --- a/api/@ohos.wifi.d.ts +++ b/api/@ohos.wifi.d.ts @@ -32,7 +32,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.enableWifi + * @useinstead ohos.wifiManager.wifiManager.enableWifi */ function enableWifi(): boolean; @@ -46,7 +46,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.disableWifi + * @useinstead ohos.wifiManager.wifiManager.disableWifi */ function disableWifi(): boolean; @@ -59,7 +59,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.isWifiActive + * @useinstead ohos.wifiManager.wifiManager.isWifiActive */ function isWifiActive(): boolean; @@ -74,7 +74,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.LOCATION * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.scan + * @useinstead ohos.wifiManager.wifiManager.scan */ function scan(): boolean; @@ -87,7 +87,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or ohos.permission.LOCATION) * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.getScanResults + * @useinstead ohos.wifiManager.wifiManager.getScanResults */ function getScanInfos(): Promise>; function getScanInfos(callback: AsyncCallback>): void; @@ -105,7 +105,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.addDeviceConfig + * @useinstead ohos.wifiManager.wifiManager.addDeviceConfig */ function addDeviceConfig(config: WifiDeviceConfig): Promise; function addDeviceConfig(config: WifiDeviceConfig, callback: AsyncCallback): void; @@ -121,7 +121,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.addCandidateConfig + * @useinstead ohos.wifiManager.wifiManager.addCandidateConfig */ function addUntrustedConfig(config: WifiDeviceConfig): Promise; function addUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback): void; @@ -136,7 +136,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.removeCandidateConfig + * @useinstead ohos.wifiManager.wifiManager.removeCandidateConfig */ function removeUntrustedConfig(config: WifiDeviceConfig): Promise; function removeUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback): void; @@ -152,7 +152,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.connectToNetwork + * @useinstead ohos.wifiManager.wifiManager.connectToNetwork */ function connectToNetwork(networkId: number): boolean; @@ -168,7 +168,7 @@ declare namespace wifi { * ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.connectToDevice + * @useinstead ohos.wifiManager.wifiManager.connectToDevice */ function connectToDevice(config: WifiDeviceConfig): boolean; @@ -182,7 +182,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.disconnect + * @useinstead ohos.wifiManager.wifiManager.disconnect */ function disconnect(): boolean; @@ -197,7 +197,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.getSignalLevel + * @useinstead ohos.wifiManager.wifiManager.getSignalLevel */ function getSignalLevel(rssi: number, band: number): number; @@ -209,7 +209,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.getLinkedInfo + * @useinstead ohos.wifiManager.wifiManager.getLinkedInfo */ function getLinkedInfo(): Promise; function getLinkedInfo(callback: AsyncCallback): void; @@ -222,7 +222,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.isConnected + * @useinstead ohos.wifiManager.wifiManager.isConnected */ function isConnected(): boolean; @@ -237,7 +237,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.getSupportedFeatures + * @useinstead ohos.wifiManager.wifiManager.getSupportedFeatures */ function getSupportedFeatures(): number; @@ -250,7 +250,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.Core * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.isFeatureSupported + * @useinstead ohos.wifiManager.wifiManager.isFeatureSupported */ function isFeatureSupported(featureId: number): boolean; @@ -265,7 +265,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_LOCAL_MAC and ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.getDeviceMacAddress + * @useinstead ohos.wifiManager.wifiManager.getDeviceMacAddress */ function getDeviceMacAddress(): string[]; @@ -279,7 +279,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.getIpInfo + * @useinstead ohos.wifiManager.wifiManager.getIpInfo */ function getIpInfo(): IpInfo; @@ -291,7 +291,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.Core * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.getCountryCode + * @useinstead ohos.wifiManager.wifiManager.getCountryCode */ function getCountryCode(): string; @@ -304,7 +304,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.reassociate + * @useinstead ohos.wifiManager.wifiManager.reassociate */ function reassociate(): boolean; @@ -317,7 +317,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.reconnect + * @useinstead ohos.wifiManager.wifiManager.reconnect */ function reconnect(): boolean; @@ -332,7 +332,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.GET_WIFI_CONFIG * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.getDeviceConfigs + * @useinstead ohos.wifiManager.wifiManager.getDeviceConfigs */ function getDeviceConfigs(): Array; @@ -348,7 +348,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.updateNetwork + * @useinstead ohos.wifiManager.wifiManager.updateNetwork */ function updateNetwork(config: WifiDeviceConfig): number; @@ -364,7 +364,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.disableNetwork + * @useinstead ohos.wifiManager.wifiManager.disableNetwork */ function disableNetwork(netId: number): boolean; @@ -378,7 +378,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.removeAllNetwork + * @useinstead ohos.wifiManager.wifiManager.removeAllNetwork */ function removeAllNetwork(): boolean; @@ -397,7 +397,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.removeDevice + * @useinstead ohos.wifiManager.wifiManager.removeDevice */ function removeDevice(id: number): boolean; @@ -412,7 +412,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.enableHotspot + * @useinstead ohos.wifiManager.wifiManager.enableHotspot */ function enableHotspot(): boolean; @@ -427,7 +427,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.disableHotspot + * @useinstead ohos.wifiManager.wifiManager.disableHotspot */ function disableHotspot(): boolean; @@ -440,7 +440,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.isHotspotDualBandSupported + * @useinstead ohos.wifiManager.wifiManager.isHotspotDualBandSupported */ function isHotspotDualBandSupported(): boolean; @@ -453,7 +453,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.isHotspotActive + * @useinstead ohos.wifiManager.wifiManager.isHotspotActive */ function isHotspotActive(): boolean; @@ -471,7 +471,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.setHotspotConfig + * @useinstead ohos.wifiManager.wifiManager.setHotspotConfig */ function setHotspotConfig(config: HotspotConfig): boolean; @@ -484,7 +484,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.getHotspotConfig + * @useinstead ohos.wifiManager.wifiManager.getHotspotConfig */ function getHotspotConfig(): HotspotConfig; @@ -499,7 +499,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.getStations + * @useinstead ohos.wifiManager.wifiManager.getStations */ function getStations(): Array; @@ -511,7 +511,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.getP2pLinkedInfo + * @useinstead ohos.wifiManager.wifiManager.getP2pLinkedInfo */ function getP2pLinkedInfo(): Promise; function getP2pLinkedInfo(callback: AsyncCallback): void; @@ -524,7 +524,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.getCurrentGroup + * @useinstead ohos.wifiManager.wifiManager.getCurrentGroup */ function getCurrentGroup(): Promise; function getCurrentGroup(callback: AsyncCallback): void; @@ -537,7 +537,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.getP2pPeerDevices + * @useinstead ohos.wifiManager.wifiManager.getP2pPeerDevices */ function getP2pPeerDevices(): Promise; function getP2pPeerDevices(callback: AsyncCallback): void; @@ -551,7 +551,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.createGroup + * @useinstead ohos.wifiManager.wifiManager.createGroup */ function createGroup(config: WifiP2PConfig): boolean; @@ -563,7 +563,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.removeGroup + * @useinstead ohos.wifiManager.wifiManager.removeGroup */ function removeGroup(): boolean; @@ -576,7 +576,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.p2pConnect + * @useinstead ohos.wifiManager.wifiManager.p2pConnect */ function p2pConnect(config: WifiP2PConfig): boolean; @@ -588,7 +588,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.p2pDisonnect + * @useinstead ohos.wifiManager.wifiManager.p2pDisonnect */ function p2pCancelConnect(): boolean; @@ -600,7 +600,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.startDiscoverDevices + * @useinstead ohos.wifiManager.wifiManager.startDiscoverDevices */ function startDiscoverDevices(): boolean; @@ -612,7 +612,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.stopDiscoverDevices + * @useinstead ohos.wifiManager.wifiManager.stopDiscoverDevices */ function stopDiscoverDevices(): boolean; @@ -626,7 +626,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.deletePersistentGroup + * @useinstead ohos.wifiManager.wifiManager.deletePersistentGroup */ function deletePersistentGroup(netId: number): boolean; @@ -640,7 +640,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.setDeviceName + * @useinstead ohos.wifiManager.wifiManager.setDeviceName */ function setDeviceName(devName: string): boolean; @@ -652,7 +652,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifi.setDeviceName + * @useinstead ohos.wifiManager.wifiManager.on#wifiStateChange */ function on(type: "wifiStateChange", callback: Callback): void; @@ -665,6 +665,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#wifiStateChange */ function off(type: "wifiStateChange", callback?: Callback): void; @@ -676,6 +677,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.on#wifiConnectionChange */ function on(type: "wifiConnectionChange", callback: Callback): void; @@ -688,6 +690,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#wifiConnectionChange */ function off(type: "wifiConnectionChange", callback?: Callback): void; @@ -699,6 +702,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.on#wifiScanStateChange */ function on(type: "wifiScanStateChange", callback: Callback): void; @@ -711,6 +715,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#wifiScanStateChange */ function off(type: "wifiScanStateChange", callback?: Callback): void; @@ -722,6 +727,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.on#wifiRssiChange */ function on(type: "wifiRssiChange", callback: Callback): void; @@ -734,6 +740,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#wifiRssiChange */ function off(type: "wifiRssiChange", callback?: Callback): void; @@ -746,6 +753,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.on#streamChange */ function on(type: "streamChange", callback: Callback): void; @@ -759,6 +767,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#streamChange */ function off(type: "streamChange", callback?: Callback): void; @@ -770,6 +779,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.on#hotspotStateChange */ function on(type: "hotspotStateChange", callback: Callback): void; @@ -782,6 +792,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#hotspotStateChange */ function off(type: "hotspotStateChange", callback?: Callback): void; @@ -794,6 +805,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.on#hotspotStaJoin */ function on(type: "hotspotStaJoin", callback: Callback): void; @@ -807,6 +819,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#hotspotStaJoin */ function off(type: "hotspotStaJoin", callback?: Callback): void; @@ -819,6 +832,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.on#hotspotStaLeave */ function on(type: "hotspotStaLeave", callback: Callback): void; @@ -831,6 +845,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#hotspotStaLeave */ function off(type: "hotspotStaLeave", callback?: Callback): void; @@ -842,6 +857,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.on#p2pStateChange */ function on(type: "p2pStateChange", callback: Callback): void; @@ -852,6 +868,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#p2pStateChange */ function off(type: "p2pStateChange", callback?: Callback): void; @@ -863,6 +880,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.on#p2pConnectionChange */ function on(type: "p2pConnectionChange", callback: Callback): void; @@ -873,6 +891,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#p2pConnectionChange */ function off(type: "p2pConnectionChange", callback?: Callback): void; @@ -884,6 +903,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.on#p2pDeviceChange */ function on(type: "p2pDeviceChange", callback: Callback): void; @@ -895,6 +915,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.LOCATION * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#p2pDeviceChange */ function off(type: "p2pDeviceChange", callback?: Callback): void; @@ -906,6 +927,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.on#p2pPeerDeviceChange */ function on(type: "p2pPeerDeviceChange", callback: Callback): void; @@ -916,6 +938,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.LOCATION * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#p2pPeerDeviceChange */ function off(type: "p2pPeerDeviceChange", callback?: Callback): void; @@ -927,6 +950,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.on#p2pPersistentGroupChange */ function on(type: "p2pPersistentGroupChange", callback: Callback): void; @@ -937,6 +961,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#p2pPersistentGroupChange */ function off(type: "p2pPersistentGroupChange", callback?: Callback): void; @@ -948,6 +973,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.on#p2pDiscoveryChange */ function on(type: "p2pDiscoveryChange", callback: Callback): void; @@ -958,6 +984,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.off#p2pDiscoveryChange */ function off(type: "p2pDiscoveryChange", callback?: Callback): void; @@ -967,6 +994,7 @@ declare namespace wifi { * @since 6 * @syscap SystemCapability.Communication.WiFi.STA * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.WifiDeviceConfig */ interface WifiDeviceConfig { /** Wi-Fi SSID: the maximum length is 32 */ @@ -1020,6 +1048,7 @@ declare namespace wifi { * @systemapi Hide this for inner system use. * @syscap SystemCapability.Communication.WiFi.STA * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.IpConfig */ interface IpConfig { ipAddress: number; @@ -1034,6 +1063,7 @@ declare namespace wifi { * @since 6 * @syscap SystemCapability.Communication.WiFi.STA * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.WifiScanInfo */ interface WifiScanInfo { /** Wi-Fi SSID: the maximum length is 32 */ @@ -1070,6 +1100,7 @@ declare namespace wifi { * @since 6 * @syscap SystemCapability.Communication.WiFi.Core * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.WifiSecurityType */ enum WifiSecurityType { /** Invalid security type */ @@ -1094,6 +1125,7 @@ declare namespace wifi { * @since 6 * @syscap SystemCapability.Communication.WiFi.STA * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.WifiLinkedInfo */ interface WifiLinkedInfo { /** The SSID of the Wi-Fi hotspot */ @@ -1152,6 +1184,7 @@ declare namespace wifi { * @since 7 * @syscap SystemCapability.Communication.WiFi.STA * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.IpInfo */ interface IpInfo { /** The IP address of the Wi-Fi connection */ @@ -1183,6 +1216,7 @@ declare namespace wifi { * @systemapi Hide this for inner system use. * @syscap SystemCapability.Communication.WiFi.AP.Core * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.HotspotConfig */ interface HotspotConfig { /** The SSID of the Wi-Fi hotspot */ @@ -1208,6 +1242,7 @@ declare namespace wifi { * @systemapi Hide this for inner system use. * @syscap SystemCapability.Communication.WiFi.AP.Core * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.StationInfo */ interface StationInfo { /** the network name of the Wi-Fi client */ @@ -1227,6 +1262,7 @@ declare namespace wifi { * @systemapi Hide this for inner system use. * @syscap SystemCapability.Communication.WiFi.STA * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.IpType */ enum IpType { /** Use statically configured IP settings */ @@ -1246,6 +1282,7 @@ declare namespace wifi { * @systemapi Hide this for inner system use. * @syscap SystemCapability.Communication.WiFi.STA * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.SuppState */ export enum SuppState { /** The supplicant is not associated with or is disconnected from the AP. */ @@ -1291,6 +1328,7 @@ declare namespace wifi { * @since 6 * @syscap SystemCapability.Communication.WiFi.STA * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.ConnState */ export enum ConnState { /** The device is searching for an available AP. */ @@ -1324,6 +1362,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.WifiP2pDevice */ interface WifiP2pDevice { /** Device name */ @@ -1348,6 +1387,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.WifiP2PConfig */ interface WifiP2PConfig { /** Device mac address */ @@ -1375,6 +1415,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.WifiP2pGroupInfo */ interface WifiP2pGroupInfo { /** Indicates whether it is group owner */ @@ -1411,6 +1452,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.P2pConnectState */ enum P2pConnectState { DISCONNECTED = 0, @@ -1423,6 +1465,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.WifiP2pLinkedInfo */ interface WifiP2pLinkedInfo { /** Connection status */ @@ -1441,6 +1484,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.P2pDeviceStatus */ enum P2pDeviceStatus { CONNECTED = 0, @@ -1456,6 +1500,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @deprecated since 9 + * @useinstead ohos.wifiManager.wifiManager.GroupOwnerBand */ enum GroupOwnerBand { GO_BAND_AUTO = 0, diff --git a/api/@ohos.wifiManager.d.ts b/api/@ohos.wifiManager.d.ts index 3a3446287d..ef56dd605c 100644 --- a/api/@ohos.wifiManager.d.ts +++ b/api/@ohos.wifiManager.d.ts @@ -1796,8 +1796,8 @@ declare namespace wifiManager { /** Device status */ deviceStatus: P2pDeviceStatus; - /** Device group capabilitys */ - groupCapabilitys: number; + /** Device group capability */ + groupCapability: number; } /** diff --git a/api/@ohos.wifiext.d.ts b/api/@ohos.wifiext.d.ts index 5dee0b5744..f995c2d4f2 100644 --- a/api/@ohos.wifiext.d.ts +++ b/api/@ohos.wifiext.d.ts @@ -34,6 +34,7 @@ declare namespace wifiext { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT_EXT * @syscap SystemCapability.Communication.WiFi.AP.Extension * @deprecated since 9 + * @useinstead ohos.wifiManagerExt.wifiManagerExt.enableHotspot */ function enableHotspot(): boolean; @@ -44,7 +45,8 @@ declare namespace wifiext { * @since 8 * @permission ohos.permission.MANAGE_WIFI_HOTSPOT_EXT * @syscap SystemCapability.Communication.WiFi.AP.Extension - * @deprecated since 9 + * @deprecated since 9 + * @useinstead ohos.wifiManagerExt.wifiManagerExt.disableHotspot */ function disableHotspot(): boolean; @@ -57,6 +59,7 @@ declare namespace wifiext { * @permission ohos.permission.GET_WIFI_INFO * @syscap SystemCapability.Communication.WiFi.AP.Extension * @deprecated since 9 + * @useinstead ohos.wifiManagerExt.wifiManagerExt.getSupportedPowerMode */ function getSupportedPowerModel(): Promise>; function getSupportedPowerModel(callback: AsyncCallback>): void; @@ -70,6 +73,7 @@ declare namespace wifiext { * @permission ohos.permission.GET_WIFI_INFO * @syscap SystemCapability.Communication.WiFi.AP.Extension * @deprecated since 9 + * @useinstead ohos.wifiManagerExt.wifiManagerExt.getPowerMode */ function getPowerModel (): Promise; function getPowerModel (callback: AsyncCallback): void; @@ -83,6 +87,7 @@ declare namespace wifiext { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT_EXT * @syscap SystemCapability.Communication.WiFi.AP.Extension * @deprecated since 9 + * @useinstead ohos.wifiManagerExt.wifiManagerExt.setPowerMode */ function setPowerModel(model: PowerModel) : boolean @@ -92,6 +97,7 @@ declare namespace wifiext { * @since 8 * @syscap SystemCapability.Communication.WiFi.AP.Extension * @deprecated since 9 + * @useinstead ohos.wifiManagerExt.wifiManagerExt.PowerMode */ export enum PowerModel { /** Sleeping model. */ -- Gitee From 60b19ca12daef661ba9e53fdbc03cc837dae20b0 Mon Sep 17 00:00:00 2001 From: "yanxiaotao@huawei.com" Date: Tue, 25 Oct 2022 23:28:13 +0800 Subject: [PATCH 245/438] add error code for wifi 1025 Signed-off-by: yanxiaotao@huawei.com --- api/@ohos.wifi.d.ts | 180 ++++++++++++++++++++--------------------- api/@ohos.wifiext.d.ts | 12 +-- 2 files changed, 96 insertions(+), 96 deletions(-) diff --git a/api/@ohos.wifi.d.ts b/api/@ohos.wifi.d.ts index 0675de66ed..ff7b6eb68f 100644 --- a/api/@ohos.wifi.d.ts +++ b/api/@ohos.wifi.d.ts @@ -32,7 +32,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.enableWifi + * @useinstead ohos.wifiManager.wifiManager.enableWifi */ function enableWifi(): boolean; @@ -46,7 +46,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.disableWifi + * @useinstead ohos.wifiManager.wifiManager.disableWifi */ function disableWifi(): boolean; @@ -59,7 +59,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.isWifiActive + * @useinstead ohos.wifiManager.wifiManager.isWifiActive */ function isWifiActive(): boolean; @@ -74,7 +74,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.LOCATION * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.scan + * @useinstead ohos.wifiManager.wifiManager.scan */ function scan(): boolean; @@ -87,7 +87,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or ohos.permission.LOCATION) * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.getScanResults + * @useinstead ohos.wifiManager.wifiManager.getScanResults */ function getScanInfos(): Promise>; function getScanInfos(callback: AsyncCallback>): void; @@ -105,7 +105,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.addDeviceConfig + * @useinstead ohos.wifiManager.wifiManager.addDeviceConfig */ function addDeviceConfig(config: WifiDeviceConfig): Promise; function addDeviceConfig(config: WifiDeviceConfig, callback: AsyncCallback): void; @@ -121,7 +121,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.addCandidateConfig + * @useinstead ohos.wifiManager.wifiManager.addCandidateConfig */ function addUntrustedConfig(config: WifiDeviceConfig): Promise; function addUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback): void; @@ -136,7 +136,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.removeCandidateConfig + * @useinstead ohos.wifiManager.wifiManager.removeCandidateConfig */ function removeUntrustedConfig(config: WifiDeviceConfig): Promise; function removeUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback): void; @@ -152,7 +152,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.connectToNetwork + * @useinstead ohos.wifiManager.wifiManager.connectToNetwork */ function connectToNetwork(networkId: number): boolean; @@ -168,7 +168,7 @@ declare namespace wifi { * ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.connectToDevice + * @useinstead ohos.wifiManager.wifiManager.connectToDevice */ function connectToDevice(config: WifiDeviceConfig): boolean; @@ -182,7 +182,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.disconnect + * @useinstead ohos.wifiManager.wifiManager.disconnect */ function disconnect(): boolean; @@ -197,7 +197,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.getSignalLevel + * @useinstead ohos.wifiManager.wifiManager.getSignalLevel */ function getSignalLevel(rssi: number, band: number): number; @@ -209,7 +209,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.getLinkedInfo + * @useinstead ohos.wifiManager.wifiManager.getLinkedInfo */ function getLinkedInfo(): Promise; function getLinkedInfo(callback: AsyncCallback): void; @@ -222,7 +222,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.isConnected + * @useinstead ohos.wifiManager.wifiManager.isConnected */ function isConnected(): boolean; @@ -237,7 +237,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.getSupportedFeatures + * @useinstead ohos.wifiManager.wifiManager.getSupportedFeatures */ function getSupportedFeatures(): number; @@ -250,7 +250,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.Core * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.isFeatureSupported + * @useinstead ohos.wifiManager.wifiManager.isFeatureSupported */ function isFeatureSupported(featureId: number): boolean; @@ -265,7 +265,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_LOCAL_MAC and ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.getDeviceMacAddress + * @useinstead ohos.wifiManager.wifiManager.getDeviceMacAddress */ function getDeviceMacAddress(): string[]; @@ -279,7 +279,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.getIpInfo + * @useinstead ohos.wifiManager.wifiManager.getIpInfo */ function getIpInfo(): IpInfo; @@ -291,7 +291,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.Core * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.getCountryCode + * @useinstead ohos.wifiManager.wifiManager.getCountryCode */ function getCountryCode(): string; @@ -304,7 +304,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.reassociate + * @useinstead ohos.wifiManager.wifiManager.reassociate */ function reassociate(): boolean; @@ -317,7 +317,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.reconnect + * @useinstead ohos.wifiManager.wifiManager.reconnect */ function reconnect(): boolean; @@ -332,7 +332,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.GET_WIFI_CONFIG * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.getDeviceConfigs + * @useinstead ohos.wifiManager.wifiManager.getDeviceConfigs */ function getDeviceConfigs(): Array; @@ -348,7 +348,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.updateNetwork + * @useinstead ohos.wifiManager.wifiManager.updateNetwork */ function updateNetwork(config: WifiDeviceConfig): number; @@ -364,7 +364,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.disableNetwork + * @useinstead ohos.wifiManager.wifiManager.disableNetwork */ function disableNetwork(netId: number): boolean; @@ -378,7 +378,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.removeAllNetwork + * @useinstead ohos.wifiManager.wifiManager.removeAllNetwork */ function removeAllNetwork(): boolean; @@ -397,7 +397,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.removeDevice + * @useinstead ohos.wifiManager.wifiManager.removeDevice */ function removeDevice(id: number): boolean; @@ -412,7 +412,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.enableHotspot + * @useinstead ohos.wifiManager.wifiManager.enableHotspot */ function enableHotspot(): boolean; @@ -427,7 +427,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.disableHotspot + * @useinstead ohos.wifiManager.wifiManager.disableHotspot */ function disableHotspot(): boolean; @@ -440,7 +440,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.isHotspotDualBandSupported + * @useinstead ohos.wifiManager.wifiManager.isHotspotDualBandSupported */ function isHotspotDualBandSupported(): boolean; @@ -453,7 +453,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.isHotspotActive + * @useinstead ohos.wifiManager.wifiManager.isHotspotActive */ function isHotspotActive(): boolean; @@ -471,7 +471,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.setHotspotConfig + * @useinstead ohos.wifiManager.wifiManager.setHotspotConfig */ function setHotspotConfig(config: HotspotConfig): boolean; @@ -484,7 +484,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.getHotspotConfig + * @useinstead ohos.wifiManager.wifiManager.getHotspotConfig */ function getHotspotConfig(): HotspotConfig; @@ -499,7 +499,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.getStations + * @useinstead ohos.wifiManager.wifiManager.getStations */ function getStations(): Array; @@ -511,7 +511,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.getP2pLinkedInfo + * @useinstead ohos.wifiManager.wifiManager.getP2pLinkedInfo */ function getP2pLinkedInfo(): Promise; function getP2pLinkedInfo(callback: AsyncCallback): void; @@ -524,7 +524,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.getCurrentGroup + * @useinstead ohos.wifiManager.wifiManager.getCurrentGroup */ function getCurrentGroup(): Promise; function getCurrentGroup(callback: AsyncCallback): void; @@ -537,7 +537,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.getP2pPeerDevices + * @useinstead ohos.wifiManager.wifiManager.getP2pPeerDevices */ function getP2pPeerDevices(): Promise; function getP2pPeerDevices(callback: AsyncCallback): void; @@ -551,7 +551,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.createGroup + * @useinstead ohos.wifiManager.wifiManager.createGroup */ function createGroup(config: WifiP2PConfig): boolean; @@ -563,7 +563,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.removeGroup + * @useinstead ohos.wifiManager.wifiManager.removeGroup */ function removeGroup(): boolean; @@ -576,7 +576,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.p2pConnect + * @useinstead ohos.wifiManager.wifiManager.p2pConnect */ function p2pConnect(config: WifiP2PConfig): boolean; @@ -588,7 +588,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.p2pDisonnect + * @useinstead ohos.wifiManager.wifiManager.p2pDisonnect */ function p2pCancelConnect(): boolean; @@ -600,7 +600,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.startDiscoverDevices + * @useinstead ohos.wifiManager.wifiManager.startDiscoverDevices */ function startDiscoverDevices(): boolean; @@ -612,7 +612,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.stopDiscoverDevices + * @useinstead ohos.wifiManager.wifiManager.stopDiscoverDevices */ function stopDiscoverDevices(): boolean; @@ -626,7 +626,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.deletePersistentGroup + * @useinstead ohos.wifiManager.wifiManager.deletePersistentGroup */ function deletePersistentGroup(netId: number): boolean; @@ -640,7 +640,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.setDeviceName + * @useinstead ohos.wifiManager.wifiManager.setDeviceName */ function setDeviceName(devName: string): boolean; @@ -652,7 +652,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#wifiStateChange + * @useinstead ohos.wifiManager.wifiManager.on#wifiStateChange */ function on(type: "wifiStateChange", callback: Callback): void; @@ -665,7 +665,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#wifiStateChange + * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#wifiStateChange */ function off(type: "wifiStateChange", callback?: Callback): void; @@ -677,7 +677,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#wifiConnectionChange + * @useinstead ohos.wifiManager.wifiManager.on#wifiConnectionChange */ function on(type: "wifiConnectionChange", callback: Callback): void; @@ -690,7 +690,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#wifiConnectionChange + * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#wifiConnectionChange */ function off(type: "wifiConnectionChange", callback?: Callback): void; @@ -702,7 +702,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#wifiScanStateChange + * @useinstead ohos.wifiManager.wifiManager.on#wifiScanStateChange */ function on(type: "wifiScanStateChange", callback: Callback): void; @@ -715,7 +715,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#wifiScanStateChange + * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#wifiScanStateChange */ function off(type: "wifiScanStateChange", callback?: Callback): void; @@ -727,7 +727,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#wifiRssiChange + * @useinstead ohos.wifiManager.wifiManager.on#wifiRssiChange */ function on(type: "wifiRssiChange", callback: Callback): void; @@ -740,7 +740,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#wifiRssiChange + * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#wifiRssiChange */ function off(type: "wifiRssiChange", callback?: Callback): void; @@ -753,7 +753,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#streamChange + * @useinstead ohos.wifiManager.wifiManager.on#streamChange */ function on(type: "streamChange", callback: Callback): void; @@ -767,7 +767,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#streamChange + * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#streamChange */ function off(type: "streamChange", callback?: Callback): void; @@ -779,7 +779,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#hotspotStateChange + * @useinstead ohos.wifiManager.wifiManager.on#hotspotStateChange */ function on(type: "hotspotStateChange", callback: Callback): void; @@ -792,7 +792,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#hotspotStateChange + * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#hotspotStateChange */ function off(type: "hotspotStateChange", callback?: Callback): void; @@ -805,7 +805,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#hotspotStaJoin + * @useinstead ohos.wifiManager.wifiManager.on#hotspotStaJoin */ function on(type: "hotspotStaJoin", callback: Callback): void; @@ -819,7 +819,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#hotspotStaJoin + * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#hotspotStaJoin */ function off(type: "hotspotStaJoin", callback?: Callback): void; @@ -832,7 +832,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#hotspotStaLeave + * @useinstead ohos.wifiManager.wifiManager.on#hotspotStaLeave */ function on(type: "hotspotStaLeave", callback: Callback): void; @@ -845,7 +845,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#hotspotStaLeave + * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#hotspotStaLeave */ function off(type: "hotspotStaLeave", callback?: Callback): void; @@ -857,7 +857,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#p2pStateChange + * @useinstead ohos.wifiManager.wifiManager.on#p2pStateChange */ function on(type: "p2pStateChange", callback: Callback): void; @@ -868,7 +868,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#p2pStateChange + * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#p2pStateChange */ function off(type: "p2pStateChange", callback?: Callback): void; @@ -880,7 +880,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#p2pConnectionChange + * @useinstead ohos.wifiManager.wifiManager.on#p2pConnectionChange */ function on(type: "p2pConnectionChange", callback: Callback): void; @@ -891,7 +891,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#p2pConnectionChange + * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#p2pConnectionChange */ function off(type: "p2pConnectionChange", callback?: Callback): void; @@ -903,7 +903,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#p2pDeviceChange + * @useinstead ohos.wifiManager.wifiManager.on#p2pDeviceChange */ function on(type: "p2pDeviceChange", callback: Callback): void; @@ -915,7 +915,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.LOCATION * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#p2pDeviceChange + * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#p2pDeviceChange */ function off(type: "p2pDeviceChange", callback?: Callback): void; @@ -927,7 +927,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#p2pPeerDeviceChange + * @useinstead ohos.wifiManager.wifiManager.on#p2pPeerDeviceChange */ function on(type: "p2pPeerDeviceChange", callback: Callback): void; @@ -938,7 +938,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.LOCATION * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#p2pPeerDeviceChange + * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#p2pPeerDeviceChange */ function off(type: "p2pPeerDeviceChange", callback?: Callback): void; @@ -950,7 +950,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#p2pPersistentGroupChange + * @useinstead ohos.wifiManager.wifiManager.on#p2pPersistentGroupChange */ function on(type: "p2pPersistentGroupChange", callback: Callback): void; @@ -961,7 +961,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#p2pPersistentGroupChange + * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#p2pPersistentGroupChange */ function off(type: "p2pPersistentGroupChange", callback?: Callback): void; @@ -973,7 +973,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#p2pDiscoveryChange + * @useinstead ohos.wifiManager.wifiManager.on#p2pDiscoveryChange */ function on(type: "p2pDiscoveryChange", callback: Callback): void; @@ -984,7 +984,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.off#p2pDiscoveryChange + * @useinstead ohos.wifiManager.wifiManager.off#p2pDiscoveryChange */ function off(type: "p2pDiscoveryChange", callback?: Callback): void; @@ -994,7 +994,7 @@ declare namespace wifi { * @since 6 * @syscap SystemCapability.Communication.WiFi.STA * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.WifiDeviceConfig + * @useinstead ohos.wifiManager.wifiManager.WifiDeviceConfig */ interface WifiDeviceConfig { /** Wi-Fi SSID: the maximum length is 32 */ @@ -1048,7 +1048,7 @@ declare namespace wifi { * @systemapi Hide this for inner system use. * @syscap SystemCapability.Communication.WiFi.STA * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.IpConfig + * @useinstead ohos.wifiManager.wifiManager.IpConfig */ interface IpConfig { ipAddress: number; @@ -1063,7 +1063,7 @@ declare namespace wifi { * @since 6 * @syscap SystemCapability.Communication.WiFi.STA * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.WifiScanInfo + * @useinstead ohos.wifiManager.wifiManager.WifiScanInfo */ interface WifiScanInfo { /** Wi-Fi SSID: the maximum length is 32 */ @@ -1100,7 +1100,7 @@ declare namespace wifi { * @since 6 * @syscap SystemCapability.Communication.WiFi.Core * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.WifiSecurityType + * @useinstead ohos.wifiManager.wifiManager.WifiSecurityType */ enum WifiSecurityType { /** Invalid security type */ @@ -1125,7 +1125,7 @@ declare namespace wifi { * @since 6 * @syscap SystemCapability.Communication.WiFi.STA * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.WifiLinkedInfo + * @useinstead ohos.wifiManager.wifiManager.WifiLinkedInfo */ interface WifiLinkedInfo { /** The SSID of the Wi-Fi hotspot */ @@ -1184,7 +1184,7 @@ declare namespace wifi { * @since 7 * @syscap SystemCapability.Communication.WiFi.STA * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.IpInfo + * @useinstead ohos.wifiManager.wifiManager.IpInfo */ interface IpInfo { /** The IP address of the Wi-Fi connection */ @@ -1216,7 +1216,7 @@ declare namespace wifi { * @systemapi Hide this for inner system use. * @syscap SystemCapability.Communication.WiFi.AP.Core * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.HotspotConfig + * @useinstead ohos.wifiManager.wifiManager.HotspotConfig */ interface HotspotConfig { /** The SSID of the Wi-Fi hotspot */ @@ -1242,7 +1242,7 @@ declare namespace wifi { * @systemapi Hide this for inner system use. * @syscap SystemCapability.Communication.WiFi.AP.Core * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.StationInfo + * @useinstead ohos.wifiManager.wifiManager.StationInfo */ interface StationInfo { /** the network name of the Wi-Fi client */ @@ -1262,7 +1262,7 @@ declare namespace wifi { * @systemapi Hide this for inner system use. * @syscap SystemCapability.Communication.WiFi.STA * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.IpType + * @useinstead ohos.wifiManager.wifiManager.IpType */ enum IpType { /** Use statically configured IP settings */ @@ -1282,7 +1282,7 @@ declare namespace wifi { * @systemapi Hide this for inner system use. * @syscap SystemCapability.Communication.WiFi.STA * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.SuppState + * @useinstead ohos.wifiManager.wifiManager.SuppState */ export enum SuppState { /** The supplicant is not associated with or is disconnected from the AP. */ @@ -1328,7 +1328,7 @@ declare namespace wifi { * @since 6 * @syscap SystemCapability.Communication.WiFi.STA * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.ConnState + * @useinstead ohos.wifiManager.wifiManager.ConnState */ export enum ConnState { /** The device is searching for an available AP. */ @@ -1362,7 +1362,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.WifiP2pDevice + * @useinstead ohos.wifiManager.wifiManager.WifiP2pDevice */ interface WifiP2pDevice { /** Device name */ @@ -1387,7 +1387,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.WifiP2PConfig + * @useinstead ohos.wifiManager.wifiManager.WifiP2PConfig */ interface WifiP2PConfig { /** Device mac address */ @@ -1415,7 +1415,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.WifiP2pGroupInfo + * @useinstead ohos.wifiManager.wifiManager.WifiP2pGroupInfo */ interface WifiP2pGroupInfo { /** Indicates whether it is group owner */ @@ -1452,7 +1452,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.P2pConnectState + * @useinstead ohos.wifiManager.wifiManager.P2pConnectState */ enum P2pConnectState { DISCONNECTED = 0, @@ -1465,7 +1465,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.WifiP2pLinkedInfo + * @useinstead ohos.wifiManager.wifiManager.WifiP2pLinkedInfo */ interface WifiP2pLinkedInfo { /** Connection status */ @@ -1484,7 +1484,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.P2pDeviceStatus + * @useinstead ohos.wifiManager.wifiManager.P2pDeviceStatus */ enum P2pDeviceStatus { CONNECTED = 0, @@ -1500,7 +1500,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.GroupOwnerBand + * @useinstead ohos.wifiManager.wifiManager.GroupOwnerBand */ enum GroupOwnerBand { GO_BAND_AUTO = 0, diff --git a/api/@ohos.wifiext.d.ts b/api/@ohos.wifiext.d.ts index f995c2d4f2..8c9374eb5b 100644 --- a/api/@ohos.wifiext.d.ts +++ b/api/@ohos.wifiext.d.ts @@ -34,7 +34,7 @@ declare namespace wifiext { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT_EXT * @syscap SystemCapability.Communication.WiFi.AP.Extension * @deprecated since 9 - * @useinstead ohos.wifiManagerExt.wifiManagerExt.enableHotspot + * @useinstead ohos.wifiManagerExt.wifiManagerExt.enableHotspot */ function enableHotspot(): boolean; @@ -46,7 +46,7 @@ declare namespace wifiext { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT_EXT * @syscap SystemCapability.Communication.WiFi.AP.Extension * @deprecated since 9 - * @useinstead ohos.wifiManagerExt.wifiManagerExt.disableHotspot + * @useinstead ohos.wifiManagerExt.wifiManagerExt.disableHotspot */ function disableHotspot(): boolean; @@ -59,7 +59,7 @@ declare namespace wifiext { * @permission ohos.permission.GET_WIFI_INFO * @syscap SystemCapability.Communication.WiFi.AP.Extension * @deprecated since 9 - * @useinstead ohos.wifiManagerExt.wifiManagerExt.getSupportedPowerMode + * @useinstead ohos.wifiManagerExt.wifiManagerExt.getSupportedPowerMode */ function getSupportedPowerModel(): Promise>; function getSupportedPowerModel(callback: AsyncCallback>): void; @@ -73,7 +73,7 @@ declare namespace wifiext { * @permission ohos.permission.GET_WIFI_INFO * @syscap SystemCapability.Communication.WiFi.AP.Extension * @deprecated since 9 - * @useinstead ohos.wifiManagerExt.wifiManagerExt.getPowerMode + * @useinstead ohos.wifiManagerExt.wifiManagerExt.getPowerMode */ function getPowerModel (): Promise; function getPowerModel (callback: AsyncCallback): void; @@ -87,7 +87,7 @@ declare namespace wifiext { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT_EXT * @syscap SystemCapability.Communication.WiFi.AP.Extension * @deprecated since 9 - * @useinstead ohos.wifiManagerExt.wifiManagerExt.setPowerMode + * @useinstead ohos.wifiManagerExt.wifiManagerExt.setPowerMode */ function setPowerModel(model: PowerModel) : boolean @@ -97,7 +97,7 @@ declare namespace wifiext { * @since 8 * @syscap SystemCapability.Communication.WiFi.AP.Extension * @deprecated since 9 - * @useinstead ohos.wifiManagerExt.wifiManagerExt.PowerMode + * @useinstead ohos.wifiManagerExt.wifiManagerExt.PowerMode */ export enum PowerModel { /** Sleeping model. */ -- Gitee From bffc539f86fcb3e8fba900afa1939834e91c4f84 Mon Sep 17 00:00:00 2001 From: xiexiyun Date: Wed, 26 Oct 2022 09:12:56 +0800 Subject: [PATCH 246/438] gridcol spell error Signed-off-by: xiexiyun Change-Id: I38da3caaa2e5d934e610dcb7c36ee4a59148d7ea --- api/@internal/component/ets/grid_col.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@internal/component/ets/grid_col.d.ts b/api/@internal/component/ets/grid_col.d.ts index cb493ec093..e9ddfe4aa3 100644 --- a/api/@internal/component/ets/grid_col.d.ts +++ b/api/@internal/component/ets/grid_col.d.ts @@ -89,7 +89,7 @@ interface GridColInterface { * Defines the constructor of GridContainer. * @since 9 */ - (optiion?: GridColOptions): GridColAttribute; + (option?: GridColOptions): GridColAttribute; } declare class GridColAttribute extends CommonMethod { -- Gitee From 9241030ecbcf1ddf80698e2501a06ffb5e41d8b9 Mon Sep 17 00:00:00 2001 From: ma-shaoyin Date: Wed, 26 Oct 2022 09:21:41 +0800 Subject: [PATCH 247/438] Signed-off-by: ma-shaoyin Changes to be committed: --- api/@ohos.inputmethod.d.ts | 23 ---------------------- api/@ohos.inputmethodengine.d.ts | 4 ---- api/@ohos.inputmethodextensionability.d.ts | 4 ---- api/@ohos.inputmethodextensioncontext.d.ts | 3 --- 4 files changed, 34 deletions(-) diff --git a/api/@ohos.inputmethod.d.ts b/api/@ohos.inputmethod.d.ts index 57c9676bf0..956e08c7ba 100644 --- a/api/@ohos.inputmethod.d.ts +++ b/api/@ohos.inputmethod.d.ts @@ -135,7 +135,6 @@ declare namespace inputMethod { * @return :- * @throws {BusinessError} 12800007 - settings extension error. * @syscap SystemCapability.MiscServices.InputMethodFramework - * @StageModelOnly */ function getSetting(): InputMethodSetting; @@ -145,7 +144,6 @@ declare namespace inputMethod { * @return :- * @throws {BusinessError} 12800006 - input method controller error. * @syscap SystemCapability.MiscServices.InputMethodFramework - * @StageModelOnly */ function getController(): InputMethodController; @@ -160,7 +158,6 @@ declare namespace inputMethod { * @throws {BusinessError} 12800005 - configuration persisting error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework - * @StageModelOnly */ function switchInputMethod(target: InputMethodProperty, callback: AsyncCallback): void; @@ -175,7 +172,6 @@ declare namespace inputMethod { * @throws {BusinessError} 12800005 - configuration persisting error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework - * @StageModelOnly */ function switchInputMethod(target: InputMethodProperty): Promise; @@ -184,7 +180,6 @@ declare namespace inputMethod { * @since 9 * @return The InputMethodProperty object of the current input method * @syscap SystemCapability.MiscServices.InputMethodFramework - * @StageModelOnly */ function getCurrentInputMethod(): InputMethodProperty; @@ -199,7 +194,6 @@ declare namespace inputMethod { * @throws {BusinessError} 12800005 - configuration persisting error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework - * @StageModelOnly */ function switchCurrentInputMethodSubtype(target: InputMethodSubtype, callback: AsyncCallback): void; @@ -214,7 +208,6 @@ declare namespace inputMethod { * @throws {BusinessError} 12800005 - configuration persisting error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework - * @StageModelOnly */ function switchCurrentInputMethodSubtype(target: InputMethodSubtype): Promise; @@ -223,7 +216,6 @@ declare namespace inputMethod { * @since 9 * @return The InputMethodSubtype object of the current input method * @syscap SystemCapability.MiscServices.InputMethodFramework - * @StageModelOnly */ function getCurrentInputMethodSubtype(): InputMethodSubtype; @@ -239,7 +231,6 @@ declare namespace inputMethod { * @throws {BusinessError} 12800005 - configuration persisting error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework - * @StageModelOnly */ function switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype, callback: AsyncCallback): void; @@ -255,7 +246,6 @@ declare namespace inputMethod { * @throws {BusinessError} 12800005 - configuration persisting error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework - * @StageModelOnly */ function switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype): Promise; @@ -290,7 +280,6 @@ declare namespace inputMethod { * @throws {BusinessError} 12800001 - package manager error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework - * @StageModelOnly */ listInputMethodSubtype(inputMethodProperty: InputMethodProperty, callback: AsyncCallback>): void; @@ -303,7 +292,6 @@ declare namespace inputMethod { * @throws {BusinessError} 12800001 - package manager error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework - * @StageModelOnly */ listInputMethodSubtype(inputMethodProperty: InputMethodProperty): Promise>; @@ -311,11 +299,9 @@ declare namespace inputMethod { * List subtype of current input method * @since 9 * @return :- - * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800001 - package manager error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework - * @StageModelOnly */ listCurrentInputMethodSubtype(callback: AsyncCallback>): void; @@ -326,7 +312,6 @@ declare namespace inputMethod { * @throws {BusinessError} 12800001 - package manager error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework - * @StageModelOnly */ listCurrentInputMethodSubtype(): Promise>; @@ -341,7 +326,6 @@ declare namespace inputMethod { * @throws {BusinessError} 12800001 - package manager error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework - * @StageModelOnly */ getInputMethods(enable: boolean, callback: AsyncCallback>): void; @@ -356,7 +340,6 @@ declare namespace inputMethod { * @throws {BusinessError} 12800001 - package manager error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework - * @StageModelOnly */ getInputMethods(enable: boolean): Promise>; @@ -379,10 +362,8 @@ declare namespace inputMethod { * @return :- * @permission ohos.permission.CONNECT_IME_ABILITY * @throws {BusinessError} 201 - permissions check fails. - * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework - * @StageModelOnly */ showOptionalInputMethods(callback: AsyncCallback): void; @@ -394,7 +375,6 @@ declare namespace inputMethod { * @throws {BusinessError} 201 - permissions check fails. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework - * @StageModelOnly */ showOptionalInputMethods(): Promise; @@ -422,7 +402,6 @@ declare namespace inputMethod { * @since 9 * @return :- * @throws {BusinessError} 201 - permissions check fails. - * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ @@ -464,7 +443,6 @@ declare namespace inputMethod { * @return :- * @permission ohos.permission.CONNECT_IME_ABILITY * @throws {BusinessError} 201 - permissions check fails. - * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800003 - input method client error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework @@ -489,7 +467,6 @@ declare namespace inputMethod { * @return :- * @permission ohos.permission.CONNECT_IME_ABILITY * @throws {BusinessError} 201 - permissions check fails. - * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800003 - input method client error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework diff --git a/api/@ohos.inputmethodengine.d.ts b/api/@ohos.inputmethodengine.d.ts index 5e5785b638..04a3b592da 100644 --- a/api/@ohos.inputmethodengine.d.ts +++ b/api/@ohos.inputmethodengine.d.ts @@ -248,7 +248,6 @@ declare namespace inputMethodEngine { interface KeyboardController { /** * @since 9 - * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800003 - input method client error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ @@ -625,7 +624,6 @@ declare namespace inputMethodEngine { /** * @since 9 - * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800003 - input method client error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ @@ -647,7 +645,6 @@ declare namespace inputMethodEngine { * @return - * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800003 - input method client error. - * @StageModelOnly */ moveCursor(direction: number, callback: AsyncCallback): void; @@ -660,7 +657,6 @@ declare namespace inputMethodEngine { * @return - * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 12800003 - input method client error. - * @StageModelOnly */ moveCursor(direction: number): Promise; } diff --git a/api/@ohos.inputmethodextensionability.d.ts b/api/@ohos.inputmethodextensionability.d.ts index cf6c86fad1..5961f6e39d 100644 --- a/api/@ohos.inputmethodextensionability.d.ts +++ b/api/@ohos.inputmethodextensionability.d.ts @@ -22,14 +22,12 @@ import InputMethodExtensionContext from "./@ohos.inputmethodextensioncontext"; * * @since 9 * @syscap SystemCapability.MiscServices.InputMethodFramework - * @StageModelOnly */ export default class InputMethodExtensionAbility { /** * Indicates input method extension ability context. * @since 9 * @syscap SystemCapability.MiscServices.InputMethodFramework - * @StageModelOnly */ context: InputMethodExtensionContext; @@ -41,7 +39,6 @@ export default class InputMethodExtensionAbility { * @param want Indicates the want of created service extension. * @return - * @throws {BusinessError} 401 - parameter error. - * @StageModelOnly */ onCreate(want: Want): void; @@ -52,7 +49,6 @@ export default class InputMethodExtensionAbility { * @syscap SystemCapability.MiscServices.InputMethodFramework * @return - * @throws {BusinessError} 401 - parameter error. - * @StageModelOnly */ onDestroy(): void; } \ No newline at end of file diff --git a/api/@ohos.inputmethodextensioncontext.d.ts b/api/@ohos.inputmethodextensioncontext.d.ts index fe7422c37e..c6521740a9 100644 --- a/api/@ohos.inputmethodextensioncontext.d.ts +++ b/api/@ohos.inputmethodextensioncontext.d.ts @@ -23,7 +23,6 @@ import ExtensionContext from './application/ExtensionContext'; * * @since 9 * @syscap SystemCapability.MiscServices.InputMethodFramework - * @StageModelOnly */ export default class InputMethodExtensionContext extends ExtensionContext { /** @@ -32,7 +31,6 @@ export default class InputMethodExtensionContext extends ExtensionContext { * @since 9 * @syscap SystemCapability.MiscServices.InputMethodFramework * @return - - * @StageModelOnly */ destroy(callback: AsyncCallback): void; @@ -42,7 +40,6 @@ export default class InputMethodExtensionContext extends ExtensionContext { * @since 9 * @syscap SystemCapability.MiscServices.InputMethodFramework * @return - - * @StageModelOnly */ destroy(): Promise; } \ No newline at end of file -- Gitee From 076789f2a60a26b123477230883ab0a145607ff5 Mon Sep 17 00:00:00 2001 From: xxb-wzy Date: Wed, 26 Oct 2022 09:55:52 +0800 Subject: [PATCH 248/438] Signed-off-by: xxb-wzy Change-Id: I167ba790db38fa0a2f6e786d4d313f200bd33e64 --- api/@ohos.multimedia.media.d.ts | 91 ++++++++++++++++++--------------- 1 file changed, 50 insertions(+), 41 deletions(-) diff --git a/api/@ohos.multimedia.media.d.ts b/api/@ohos.multimedia.media.d.ts index 9d9547f180..5bfba741bb 100644 --- a/api/@ohos.multimedia.media.d.ts +++ b/api/@ohos.multimedia.media.d.ts @@ -63,6 +63,7 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @import import media from '@ohos.multimedia.media' * @param callback Callback used to return AudioPlayer instance if the operation is successful; returns null otherwise. + * @systemapi */ function createVideoRecorder(callback: AsyncCallback): void; /** @@ -71,6 +72,7 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @import import media from '@ohos.multimedia.media' * @return A Promise instance used to return VideoRecorder instance if the operation is successful; returns null otherwise. + * @systemapi */ function createVideoRecorder(): Promise; @@ -662,6 +664,7 @@ declare namespace media { * Describes video recorder states. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi */ type VideoRecordState = 'idle' | 'prepared' | 'playing' | 'paused' | 'stopped' | 'error'; @@ -670,6 +673,7 @@ declare namespace media { * to create an VideoRecorder instance. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi */ interface VideoRecorder { /** @@ -679,6 +683,7 @@ declare namespace media { * @param config Recording parameters. * @param callback A callback instance used to return when prepare completed. * @permission ohos.permission.MICROPHONE + * @systemapi */ prepare(config: VideoRecorderConfig, callback: AsyncCallback): void; /** @@ -688,6 +693,7 @@ declare namespace media { * @param config Recording parameters. * @return A Promise instance used to return when prepare completed. * @permission ohos.permission.MICROPHONE + * @systemapi */ prepare(config: VideoRecorderConfig): Promise; /** @@ -695,6 +701,7 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @param callback Callback used to return the input surface id in string. + * @systemapi */ getInputSurface(callback: AsyncCallback): void; /** @@ -702,6 +709,7 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @return A Promise instance used to return the input surface id in string. + * @systemapi */ getInputSurface(): Promise; /** @@ -709,6 +717,7 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @param callback A callback instance used to return when start completed. + * @systemapi */ start(callback: AsyncCallback): void; /** @@ -716,6 +725,7 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @return A Promise instance used to return when start completed. + * @systemapi */ start(): Promise; /** @@ -723,6 +733,7 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @param callback A callback instance used to return when pause completed. + * @systemapi */ pause(callback: AsyncCallback): void; /** @@ -730,6 +741,7 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @return A Promise instance used to return when pause completed. + * @systemapi */ pause(): Promise; /** @@ -737,6 +749,7 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @param callback A callback instance used to return when resume completed. + * @systemapi */ resume(callback: AsyncCallback): void; /** @@ -744,6 +757,7 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @return A Promise instance used to return when resume completed. + * @systemapi */ resume(): Promise; /** @@ -751,6 +765,7 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @param callback A callback instance used to return when stop completed. + * @systemapi */ stop(callback: AsyncCallback): void; /** @@ -758,6 +773,7 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @return A Promise instance used to return when stop completed. + * @systemapi */ stop(): Promise; /** @@ -765,6 +781,7 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @param callback A callback instance used to return when release completed. + * @systemapi */ release(callback: AsyncCallback): void; /** @@ -772,6 +789,7 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @return A Promise instance used to return when release completed. + * @systemapi */ release(): Promise; /** @@ -781,6 +799,7 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @param callback A callback instance used to return when reset completed. + * @systemapi */ reset(callback: AsyncCallback): void; /** @@ -790,6 +809,7 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @return A Promise instance used to return when reset completed. + * @systemapi */ reset(): Promise; /** @@ -798,6 +818,7 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @param type Type of the video recording error event to listen for. * @param callback Callback used to listen for the video recording error event. + * @systemapi */ on(type: 'error', callback: ErrorCallback): void; @@ -805,6 +826,7 @@ declare namespace media { * video recorder state. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi */ readonly state: VideoRecordState; } @@ -1115,32 +1137,6 @@ declare namespace media { */ setSpeed(speed:number): Promise; - /** - * 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('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 - * @syscap SystemCapability.Multimedia.Media.VideoPlayer - * @param bitrate the playback bitrate must be expressed in bits per second. - * @return A Promise instance used to return actually selected bitrate. - */ - selectBitrate(bitrate: number): Promise; - - /** - * 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('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 - * @syscap SystemCapability.Multimedia.Media.VideoPlayer - * @param bitrate the playback bitrate must be expressed in bits per second. - * @param callback Callback used to return actually selected bitrate. - */ - selectBitrate(bitrate: number, callback: AsyncCallback): void; - /** * Listens for video playback completed events. * @since 8 @@ -1186,16 +1182,6 @@ declare namespace media { */ on(type: 'audioInterrupt', callback: (info: audio.InterruptEvent) => void): void; - /** - * Listens for available bitrates collect completed events for HLS protocal stream playback. - * This event will be reported after the {@link #prepare} called. - * @since 9 - * @syscap SystemCapability.Multimedia.Media.VideoPlayer - * @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: 'availableBitratesCollect', callback: (bitrates: Array) => void): void; - /** * Listens for playback error events. * @since 8 @@ -1357,12 +1343,14 @@ declare namespace media { * Provides the video recorder profile definitions. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi */ interface VideoRecorderProfile { /** * Indicates the audio bit rate. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi */ readonly audioBitrate: number; @@ -1370,6 +1358,7 @@ declare namespace media { * Indicates the number of audio channels. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi */ readonly audioChannels: number; @@ -1377,6 +1366,7 @@ declare namespace media { * Indicates the audio encoding format. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi */ readonly audioCodec: CodecMimeType; @@ -1384,6 +1374,7 @@ declare namespace media { * Indicates the audio sampling rate. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi */ readonly audioSampleRate: number; @@ -1391,6 +1382,7 @@ declare namespace media { * Indicates the output file format. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi */ readonly fileFormat: ContainerFormatType; @@ -1398,6 +1390,7 @@ declare namespace media { * Indicates the video bit rate. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi */ readonly videoBitrate: number; @@ -1405,6 +1398,7 @@ declare namespace media { * Indicates the video encoding format. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi */ readonly videoCodec: CodecMimeType; @@ -1412,6 +1406,7 @@ declare namespace media { * Indicates the video width. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi */ readonly videoFrameWidth: number; @@ -1419,6 +1414,7 @@ declare namespace media { * Indicates the video height. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi */ readonly videoFrameHeight: number; @@ -1426,6 +1422,7 @@ declare namespace media { * Indicates the video frame rate. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi */ readonly videoFrameRate: number; } @@ -1435,19 +1432,22 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @import import media from '@ohos.multimedia.media' + * @systemapi */ enum AudioSourceType { /** * default audio source type. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ + * @systemapi + */ AUDIO_SOURCE_TYPE_DEFAULT = 0, /** * source type mic. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ + * @systemapi + */ AUDIO_SOURCE_TYPE_MIC = 1, } @@ -1456,19 +1456,22 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @import import media from '@ohos.multimedia.media' + * @systemapi */ enum VideoSourceType { /** * surface raw data. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi */ VIDEO_SOURCE_TYPE_SURFACE_YUV = 0, /** * surface ES data. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder - */ + * @systemapi + */ VIDEO_SOURCE_TYPE_SURFACE_ES = 1, } @@ -1476,33 +1479,37 @@ declare namespace media { * Provides the video recorder configuration definitions. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi */ interface VideoRecorderConfig { /** * audio source type, details see @AudioSourceType . * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi */ - audioSourceType: AudioSourceType; + audioSourceType?: AudioSourceType; /** * video source type, details see @VideoSourceType . * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi */ videoSourceType: VideoSourceType; /** * video recorder profile, can get by "getVideoRecorderProfile", details see @VideoRecorderProfile . * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi */ profile: VideoRecorderProfile; /** * video output uri.support two kind of uri now. * format like: scheme + "://" + "context". - * file: file://path * fd: fd://fd * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi */ url: string; /** @@ -1510,12 +1517,14 @@ declare namespace media { * the range of rotation angle should be {0, 90, 180, 270}, default is 0. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi */ rotation?: number; /** * geographical location information. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder + * @systemapi */ location?: Location; } -- Gitee From 274398192d69ba89154697a968832e2369df98e6 Mon Sep 17 00:00:00 2001 From: "yanxiaotao@huawei.com" Date: Wed, 26 Oct 2022 10:53:13 +0800 Subject: [PATCH 249/438] add error code for wifi 1026 Signed-off-by: yanxiaotao@huawei.com --- api/@ohos.wifi.d.ts | 180 ++++++++++++++++++++--------------------- api/@ohos.wifiext.d.ts | 12 +-- 2 files changed, 96 insertions(+), 96 deletions(-) diff --git a/api/@ohos.wifi.d.ts b/api/@ohos.wifi.d.ts index ff7b6eb68f..476684b65d 100644 --- a/api/@ohos.wifi.d.ts +++ b/api/@ohos.wifi.d.ts @@ -32,7 +32,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.enableWifi + * @useinstead ohos.wifiManager/wifiManager.enableWifi */ function enableWifi(): boolean; @@ -46,7 +46,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.disableWifi + * @useinstead ohos.wifiManager/wifiManager.disableWifi */ function disableWifi(): boolean; @@ -59,7 +59,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.isWifiActive + * @useinstead ohos.wifiManager/wifiManager.isWifiActive */ function isWifiActive(): boolean; @@ -74,7 +74,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.LOCATION * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.scan + * @useinstead ohos.wifiManager/wifiManager.scan */ function scan(): boolean; @@ -87,7 +87,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or ohos.permission.LOCATION) * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.getScanResults + * @useinstead ohos.wifiManager/wifiManager.getScanResults */ function getScanInfos(): Promise>; function getScanInfos(callback: AsyncCallback>): void; @@ -105,7 +105,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.addDeviceConfig + * @useinstead ohos.wifiManager/wifiManager.addDeviceConfig */ function addDeviceConfig(config: WifiDeviceConfig): Promise; function addDeviceConfig(config: WifiDeviceConfig, callback: AsyncCallback): void; @@ -121,7 +121,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.addCandidateConfig + * @useinstead ohos.wifiManager/wifiManager.addCandidateConfig */ function addUntrustedConfig(config: WifiDeviceConfig): Promise; function addUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback): void; @@ -136,7 +136,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.removeCandidateConfig + * @useinstead ohos.wifiManager/wifiManager.removeCandidateConfig */ function removeUntrustedConfig(config: WifiDeviceConfig): Promise; function removeUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback): void; @@ -152,7 +152,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.connectToNetwork + * @useinstead ohos.wifiManager/wifiManager.connectToNetwork */ function connectToNetwork(networkId: number): boolean; @@ -168,7 +168,7 @@ declare namespace wifi { * ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.connectToDevice + * @useinstead ohos.wifiManager/wifiManager.connectToDevice */ function connectToDevice(config: WifiDeviceConfig): boolean; @@ -182,7 +182,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.disconnect + * @useinstead ohos.wifiManager/wifiManager.disconnect */ function disconnect(): boolean; @@ -197,7 +197,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.getSignalLevel + * @useinstead ohos.wifiManager/wifiManager.getSignalLevel */ function getSignalLevel(rssi: number, band: number): number; @@ -209,7 +209,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.getLinkedInfo + * @useinstead ohos.wifiManager/wifiManager.getLinkedInfo */ function getLinkedInfo(): Promise; function getLinkedInfo(callback: AsyncCallback): void; @@ -222,7 +222,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.isConnected + * @useinstead ohos.wifiManager/wifiManager.isConnected */ function isConnected(): boolean; @@ -237,7 +237,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.getSupportedFeatures + * @useinstead ohos.wifiManager/wifiManager.getSupportedFeatures */ function getSupportedFeatures(): number; @@ -250,7 +250,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.Core * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.isFeatureSupported + * @useinstead ohos.wifiManager/wifiManager.isFeatureSupported */ function isFeatureSupported(featureId: number): boolean; @@ -265,7 +265,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_LOCAL_MAC and ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.getDeviceMacAddress + * @useinstead ohos.wifiManager/wifiManager.getDeviceMacAddress */ function getDeviceMacAddress(): string[]; @@ -279,7 +279,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.getIpInfo + * @useinstead ohos.wifiManager/wifiManager.getIpInfo */ function getIpInfo(): IpInfo; @@ -291,7 +291,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.Core * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.getCountryCode + * @useinstead ohos.wifiManager/wifiManager.getCountryCode */ function getCountryCode(): string; @@ -304,7 +304,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.reassociate + * @useinstead ohos.wifiManager/wifiManager.reassociate */ function reassociate(): boolean; @@ -317,7 +317,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.reconnect + * @useinstead ohos.wifiManager/wifiManager.reconnect */ function reconnect(): boolean; @@ -332,7 +332,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.GET_WIFI_CONFIG * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.getDeviceConfigs + * @useinstead ohos.wifiManager/wifiManager.getDeviceConfigs */ function getDeviceConfigs(): Array; @@ -348,7 +348,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.updateNetwork + * @useinstead ohos.wifiManager/wifiManager.updateNetwork */ function updateNetwork(config: WifiDeviceConfig): number; @@ -364,7 +364,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.disableNetwork + * @useinstead ohos.wifiManager/wifiManager.disableNetwork */ function disableNetwork(netId: number): boolean; @@ -378,7 +378,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.removeAllNetwork + * @useinstead ohos.wifiManager/wifiManager.removeAllNetwork */ function removeAllNetwork(): boolean; @@ -397,7 +397,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.removeDevice + * @useinstead ohos.wifiManager/wifiManager.removeDevice */ function removeDevice(id: number): boolean; @@ -412,7 +412,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.enableHotspot + * @useinstead ohos.wifiManager/wifiManager.enableHotspot */ function enableHotspot(): boolean; @@ -427,7 +427,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.disableHotspot + * @useinstead ohos.wifiManager/wifiManager.disableHotspot */ function disableHotspot(): boolean; @@ -440,7 +440,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.isHotspotDualBandSupported + * @useinstead ohos.wifiManager/wifiManager.isHotspotDualBandSupported */ function isHotspotDualBandSupported(): boolean; @@ -453,7 +453,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.isHotspotActive + * @useinstead ohos.wifiManager/wifiManager.isHotspotActive */ function isHotspotActive(): boolean; @@ -471,7 +471,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.setHotspotConfig + * @useinstead ohos.wifiManager/wifiManager.setHotspotConfig */ function setHotspotConfig(config: HotspotConfig): boolean; @@ -484,7 +484,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.getHotspotConfig + * @useinstead ohos.wifiManager/wifiManager.getHotspotConfig */ function getHotspotConfig(): HotspotConfig; @@ -499,7 +499,7 @@ declare namespace wifi { * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.getStations + * @useinstead ohos.wifiManager/wifiManager.getStations */ function getStations(): Array; @@ -511,7 +511,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.getP2pLinkedInfo + * @useinstead ohos.wifiManager/wifiManager.getP2pLinkedInfo */ function getP2pLinkedInfo(): Promise; function getP2pLinkedInfo(callback: AsyncCallback): void; @@ -524,7 +524,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.getCurrentGroup + * @useinstead ohos.wifiManager/wifiManager.getCurrentGroup */ function getCurrentGroup(): Promise; function getCurrentGroup(callback: AsyncCallback): void; @@ -537,7 +537,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.getP2pPeerDevices + * @useinstead ohos.wifiManager/wifiManager.getP2pPeerDevices */ function getP2pPeerDevices(): Promise; function getP2pPeerDevices(callback: AsyncCallback): void; @@ -551,7 +551,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.createGroup + * @useinstead ohos.wifiManager/wifiManager.createGroup */ function createGroup(config: WifiP2PConfig): boolean; @@ -563,7 +563,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.removeGroup + * @useinstead ohos.wifiManager/wifiManager.removeGroup */ function removeGroup(): boolean; @@ -576,7 +576,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.p2pConnect + * @useinstead ohos.wifiManager/wifiManager.p2pConnect */ function p2pConnect(config: WifiP2PConfig): boolean; @@ -588,7 +588,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.p2pDisonnect + * @useinstead ohos.wifiManager/wifiManager.p2pDisonnect */ function p2pCancelConnect(): boolean; @@ -600,7 +600,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.startDiscoverDevices + * @useinstead ohos.wifiManager/wifiManager.startDiscoverDevices */ function startDiscoverDevices(): boolean; @@ -612,7 +612,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.stopDiscoverDevices + * @useinstead ohos.wifiManager/wifiManager.stopDiscoverDevices */ function stopDiscoverDevices(): boolean; @@ -626,7 +626,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.deletePersistentGroup + * @useinstead ohos.wifiManager/wifiManager.deletePersistentGroup */ function deletePersistentGroup(netId: number): boolean; @@ -640,7 +640,7 @@ declare namespace wifi { * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.setDeviceName + * @useinstead ohos.wifiManager/wifiManager.setDeviceName */ function setDeviceName(devName: string): boolean; @@ -652,7 +652,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#wifiStateChange + * @useinstead ohos.wifiManager/wifiManager.on#event:wifiStateChange */ function on(type: "wifiStateChange", callback: Callback): void; @@ -665,7 +665,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#wifiStateChange + * @useinstead ohos.wifiManager/wifiManager.off#event:wifiStateChange */ function off(type: "wifiStateChange", callback?: Callback): void; @@ -677,7 +677,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#wifiConnectionChange + * @useinstead ohos.wifiManager/wifiManager.on#event:wifiConnectionChange */ function on(type: "wifiConnectionChange", callback: Callback): void; @@ -690,7 +690,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#wifiConnectionChange + * @useinstead ohos.wifiManager/wifiManager.off#event:wifiConnectionChange */ function off(type: "wifiConnectionChange", callback?: Callback): void; @@ -702,7 +702,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#wifiScanStateChange + * @useinstead ohos.wifiManager/wifiManager.on#event:wifiScanStateChange */ function on(type: "wifiScanStateChange", callback: Callback): void; @@ -715,7 +715,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#wifiScanStateChange + * @useinstead ohos.wifiManager/wifiManager.off#event:wifiScanStateChange */ function off(type: "wifiScanStateChange", callback?: Callback): void; @@ -727,7 +727,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#wifiRssiChange + * @useinstead ohos.wifiManager/wifiManager.on#event:wifiRssiChange */ function on(type: "wifiRssiChange", callback: Callback): void; @@ -740,7 +740,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#wifiRssiChange + * @useinstead ohos.wifiManager/wifiManager.off#event:wifiRssiChange */ function off(type: "wifiRssiChange", callback?: Callback): void; @@ -753,7 +753,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#streamChange + * @useinstead ohos.wifiManager/wifiManager.on#event:streamChange */ function on(type: "streamChange", callback: Callback): void; @@ -767,7 +767,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#streamChange + * @useinstead ohos.wifiManager/wifiManager.off#event:streamChange */ function off(type: "streamChange", callback?: Callback): void; @@ -779,7 +779,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#hotspotStateChange + * @useinstead ohos.wifiManager/wifiManager.on#event:hotspotStateChange */ function on(type: "hotspotStateChange", callback: Callback): void; @@ -792,7 +792,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#hotspotStateChange + * @useinstead ohos.wifiManager/wifiManager.off#event:hotspotStateChange */ function off(type: "hotspotStateChange", callback?: Callback): void; @@ -805,7 +805,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#hotspotStaJoin + * @useinstead ohos.wifiManager/wifiManager.on#event:hotspotStaJoin */ function on(type: "hotspotStaJoin", callback: Callback): void; @@ -819,7 +819,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#hotspotStaJoin + * @useinstead ohos.wifiManager/wifiManager.off#event:hotspotStaJoin */ function off(type: "hotspotStaJoin", callback?: Callback): void; @@ -832,7 +832,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#hotspotStaLeave + * @useinstead ohos.wifiManager/wifiManager.on#event:hotspotStaLeave */ function on(type: "hotspotStaLeave", callback: Callback): void; @@ -845,7 +845,7 @@ declare namespace wifi { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#hotspotStaLeave + * @useinstead ohos.wifiManager/wifiManager.off#event:hotspotStaLeave */ function off(type: "hotspotStaLeave", callback?: Callback): void; @@ -857,7 +857,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#p2pStateChange + * @useinstead ohos.wifiManager/wifiManager.on#event:p2pStateChange */ function on(type: "p2pStateChange", callback: Callback): void; @@ -868,7 +868,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#p2pStateChange + * @useinstead ohos.wifiManager/wifiManager.off#event:p2pStateChange */ function off(type: "p2pStateChange", callback?: Callback): void; @@ -880,7 +880,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#p2pConnectionChange + * @useinstead ohos.wifiManager/wifiManager.on#event:p2pConnectionChange */ function on(type: "p2pConnectionChange", callback: Callback): void; @@ -891,7 +891,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#p2pConnectionChange + * @useinstead ohos.wifiManager/wifiManager.off#event:p2pConnectionChange */ function off(type: "p2pConnectionChange", callback?: Callback): void; @@ -903,7 +903,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#p2pDeviceChange + * @useinstead ohos.wifiManager/wifiManager.on#event:p2pDeviceChange */ function on(type: "p2pDeviceChange", callback: Callback): void; @@ -915,7 +915,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.LOCATION * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#p2pDeviceChange + * @useinstead ohos.wifiManager/wifiManager.off#event:p2pDeviceChange */ function off(type: "p2pDeviceChange", callback?: Callback): void; @@ -927,7 +927,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#p2pPeerDeviceChange + * @useinstead ohos.wifiManager/wifiManager.on#event:p2pPeerDeviceChange */ function on(type: "p2pPeerDeviceChange", callback: Callback): void; @@ -938,7 +938,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.LOCATION * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#p2pPeerDeviceChange + * @useinstead ohos.wifiManager/wifiManager.off#event:p2pPeerDeviceChange */ function off(type: "p2pPeerDeviceChange", callback?: Callback): void; @@ -950,7 +950,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#p2pPersistentGroupChange + * @useinstead ohos.wifiManager/wifiManager.on#event:p2pPersistentGroupChange */ function on(type: "p2pPersistentGroupChange", callback: Callback): void; @@ -961,7 +961,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.wifiManager.off#p2pPersistentGroupChange + * @useinstead ohos.wifiManager/wifiManager.off#event:p2pPersistentGroupChange */ function off(type: "p2pPersistentGroupChange", callback?: Callback): void; @@ -973,7 +973,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.on#p2pDiscoveryChange + * @useinstead ohos.wifiManager/wifiManager.on#event:p2pDiscoveryChange */ function on(type: "p2pDiscoveryChange", callback: Callback): void; @@ -984,7 +984,7 @@ declare namespace wifi { * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.off#p2pDiscoveryChange + * @useinstead ohos.wifiManager/wifiManager.off#event:p2pDiscoveryChange */ function off(type: "p2pDiscoveryChange", callback?: Callback): void; @@ -994,7 +994,7 @@ declare namespace wifi { * @since 6 * @syscap SystemCapability.Communication.WiFi.STA * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.WifiDeviceConfig + * @useinstead ohos.wifiManager/wifiManager.WifiDeviceConfig */ interface WifiDeviceConfig { /** Wi-Fi SSID: the maximum length is 32 */ @@ -1048,7 +1048,7 @@ declare namespace wifi { * @systemapi Hide this for inner system use. * @syscap SystemCapability.Communication.WiFi.STA * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.IpConfig + * @useinstead ohos.wifiManager/wifiManager.IpConfig */ interface IpConfig { ipAddress: number; @@ -1063,7 +1063,7 @@ declare namespace wifi { * @since 6 * @syscap SystemCapability.Communication.WiFi.STA * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.WifiScanInfo + * @useinstead ohos.wifiManager/wifiManager.WifiScanInfo */ interface WifiScanInfo { /** Wi-Fi SSID: the maximum length is 32 */ @@ -1100,7 +1100,7 @@ declare namespace wifi { * @since 6 * @syscap SystemCapability.Communication.WiFi.Core * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.WifiSecurityType + * @useinstead ohos.wifiManager/wifiManager.WifiSecurityType */ enum WifiSecurityType { /** Invalid security type */ @@ -1125,7 +1125,7 @@ declare namespace wifi { * @since 6 * @syscap SystemCapability.Communication.WiFi.STA * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.WifiLinkedInfo + * @useinstead ohos.wifiManager/wifiManager.WifiLinkedInfo */ interface WifiLinkedInfo { /** The SSID of the Wi-Fi hotspot */ @@ -1184,7 +1184,7 @@ declare namespace wifi { * @since 7 * @syscap SystemCapability.Communication.WiFi.STA * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.IpInfo + * @useinstead ohos.wifiManager/wifiManager.IpInfo */ interface IpInfo { /** The IP address of the Wi-Fi connection */ @@ -1216,7 +1216,7 @@ declare namespace wifi { * @systemapi Hide this for inner system use. * @syscap SystemCapability.Communication.WiFi.AP.Core * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.HotspotConfig + * @useinstead ohos.wifiManager/wifiManager.HotspotConfig */ interface HotspotConfig { /** The SSID of the Wi-Fi hotspot */ @@ -1242,7 +1242,7 @@ declare namespace wifi { * @systemapi Hide this for inner system use. * @syscap SystemCapability.Communication.WiFi.AP.Core * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.StationInfo + * @useinstead ohos.wifiManager/wifiManager.StationInfo */ interface StationInfo { /** the network name of the Wi-Fi client */ @@ -1262,7 +1262,7 @@ declare namespace wifi { * @systemapi Hide this for inner system use. * @syscap SystemCapability.Communication.WiFi.STA * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.IpType + * @useinstead ohos.wifiManager/wifiManager.IpType */ enum IpType { /** Use statically configured IP settings */ @@ -1282,7 +1282,7 @@ declare namespace wifi { * @systemapi Hide this for inner system use. * @syscap SystemCapability.Communication.WiFi.STA * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.SuppState + * @useinstead ohos.wifiManager/wifiManager.SuppState */ export enum SuppState { /** The supplicant is not associated with or is disconnected from the AP. */ @@ -1328,7 +1328,7 @@ declare namespace wifi { * @since 6 * @syscap SystemCapability.Communication.WiFi.STA * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.ConnState + * @useinstead ohos.wifiManager/wifiManager.ConnState */ export enum ConnState { /** The device is searching for an available AP. */ @@ -1362,7 +1362,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.WifiP2pDevice + * @useinstead ohos.wifiManager/wifiManager.WifiP2pDevice */ interface WifiP2pDevice { /** Device name */ @@ -1387,7 +1387,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.WifiP2PConfig + * @useinstead ohos.wifiManager/wifiManager.WifiP2PConfig */ interface WifiP2PConfig { /** Device mac address */ @@ -1415,7 +1415,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.WifiP2pGroupInfo + * @useinstead ohos.wifiManager/wifiManager.WifiP2pGroupInfo */ interface WifiP2pGroupInfo { /** Indicates whether it is group owner */ @@ -1452,7 +1452,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.P2pConnectState + * @useinstead ohos.wifiManager/wifiManager.P2pConnectState */ enum P2pConnectState { DISCONNECTED = 0, @@ -1465,7 +1465,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.WifiP2pLinkedInfo + * @useinstead ohos.wifiManager/wifiManager.WifiP2pLinkedInfo */ interface WifiP2pLinkedInfo { /** Connection status */ @@ -1484,7 +1484,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.P2pDeviceStatus + * @useinstead ohos.wifiManager/wifiManager.P2pDeviceStatus */ enum P2pDeviceStatus { CONNECTED = 0, @@ -1500,7 +1500,7 @@ declare namespace wifi { * @since 8 * @syscap SystemCapability.Communication.WiFi.P2P * @deprecated since 9 - * @useinstead ohos.wifiManager.wifiManager.GroupOwnerBand + * @useinstead ohos.wifiManager/wifiManager.GroupOwnerBand */ enum GroupOwnerBand { GO_BAND_AUTO = 0, diff --git a/api/@ohos.wifiext.d.ts b/api/@ohos.wifiext.d.ts index 8c9374eb5b..1b6f7296df 100644 --- a/api/@ohos.wifiext.d.ts +++ b/api/@ohos.wifiext.d.ts @@ -34,7 +34,7 @@ declare namespace wifiext { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT_EXT * @syscap SystemCapability.Communication.WiFi.AP.Extension * @deprecated since 9 - * @useinstead ohos.wifiManagerExt.wifiManagerExt.enableHotspot + * @useinstead ohos.wifiManagerExt/wifiManagerExt.enableHotspot */ function enableHotspot(): boolean; @@ -46,7 +46,7 @@ declare namespace wifiext { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT_EXT * @syscap SystemCapability.Communication.WiFi.AP.Extension * @deprecated since 9 - * @useinstead ohos.wifiManagerExt.wifiManagerExt.disableHotspot + * @useinstead ohos.wifiManagerExt/wifiManagerExt.disableHotspot */ function disableHotspot(): boolean; @@ -59,7 +59,7 @@ declare namespace wifiext { * @permission ohos.permission.GET_WIFI_INFO * @syscap SystemCapability.Communication.WiFi.AP.Extension * @deprecated since 9 - * @useinstead ohos.wifiManagerExt.wifiManagerExt.getSupportedPowerMode + * @useinstead ohos.wifiManagerExt/wifiManagerExt.getSupportedPowerMode */ function getSupportedPowerModel(): Promise>; function getSupportedPowerModel(callback: AsyncCallback>): void; @@ -73,7 +73,7 @@ declare namespace wifiext { * @permission ohos.permission.GET_WIFI_INFO * @syscap SystemCapability.Communication.WiFi.AP.Extension * @deprecated since 9 - * @useinstead ohos.wifiManagerExt.wifiManagerExt.getPowerMode + * @useinstead ohos.wifiManagerExt/wifiManagerExt.getPowerMode */ function getPowerModel (): Promise; function getPowerModel (callback: AsyncCallback): void; @@ -87,7 +87,7 @@ declare namespace wifiext { * @permission ohos.permission.MANAGE_WIFI_HOTSPOT_EXT * @syscap SystemCapability.Communication.WiFi.AP.Extension * @deprecated since 9 - * @useinstead ohos.wifiManagerExt.wifiManagerExt.setPowerMode + * @useinstead ohos.wifiManagerExt/wifiManagerExt.setPowerMode */ function setPowerModel(model: PowerModel) : boolean @@ -97,7 +97,7 @@ declare namespace wifiext { * @since 8 * @syscap SystemCapability.Communication.WiFi.AP.Extension * @deprecated since 9 - * @useinstead ohos.wifiManagerExt.wifiManagerExt.PowerMode + * @useinstead ohos.wifiManagerExt/wifiManagerExt.PowerMode */ export enum PowerModel { /** Sleeping model. */ -- Gitee From 727be4be917d364beda80715edceb428e2d295f0 Mon Sep 17 00:00:00 2001 From: zhancaijin Date: Mon, 24 Oct 2022 16:29:28 +0800 Subject: [PATCH 250/438] add dfx recovery api in newest namesapce. Signed-off-by: zhancaijin --- api/@ohos.app.ability.Ability.d.ts | 11 ++++++ api/@ohos.app.ability.AbilityConstant.d.ts | 29 +++++++++++++++ ....ts => @ohos.app.ability.appRecovery.d.ts} | 35 +++++++++---------- 3 files changed, 56 insertions(+), 19 deletions(-) mode change 100755 => 100644 api/@ohos.app.ability.Ability.d.ts rename api/{@ohos.application.appRecovery.d.ts => @ohos.app.ability.appRecovery.d.ts} (94%) diff --git a/api/@ohos.app.ability.Ability.d.ts b/api/@ohos.app.ability.Ability.d.ts old mode 100755 new mode 100644 index b41d046740..a3efd8a404 --- a/api/@ohos.app.ability.Ability.d.ts +++ b/api/@ohos.app.ability.Ability.d.ts @@ -309,4 +309,15 @@ export default class Ability { * @since 9 */ onMemoryLevel(level: AbilityConstant.MemoryLevel): void; + + /** + * Called back when an ability prepares to save. + * @param reason state type when save. + * @param wantParam Indicates the want parameter. + * @return 0 if ability agrees to save data successfully, otherwise errcode. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ + onSaveState(reason: AbilityConstant.StateType, wantParam : {[key: string]: any}): AbilityConstant.OnSaveResult; } diff --git a/api/@ohos.app.ability.AbilityConstant.d.ts b/api/@ohos.app.ability.AbilityConstant.d.ts index f5c61caeb2..b02c97e86e 100644 --- a/api/@ohos.app.ability.AbilityConstant.d.ts +++ b/api/@ohos.app.ability.AbilityConstant.d.ts @@ -58,6 +58,7 @@ declare namespace AbilityConstant { START_ABILITY = 1, CALL = 2, CONTINUATION = 3, + APP_RECOVERY = 4, } /** @@ -113,6 +114,34 @@ declare namespace AbilityConstant { WINDOW_MODE_SPLIT_SECONDARY = 101, WINDOW_MODE_FLOATING = 102, } + + /** + * Type of onSave result. + * @enum { number } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + export enum OnSaveResult { + ALL_AGREE = 0, + CONTINUATION_REJECT = 1, + CONTINUATION_MISMATCH = 2, + RECOVERY_AGREE = 3, + RECOVERY_REJECT = 4, + ALL_REJECT, + } + + /** + * Type of save state. + * @enum { number } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + export enum StateType { + CONTINUATION = 0, + APP_RECOVERY = 1, + } } export default AbilityConstant diff --git a/api/@ohos.application.appRecovery.d.ts b/api/@ohos.app.ability.appRecovery.d.ts similarity index 94% rename from api/@ohos.application.appRecovery.d.ts rename to api/@ohos.app.ability.appRecovery.d.ts index d98ff25612..a9c1cad363 100644 --- a/api/@ohos.application.appRecovery.d.ts +++ b/api/@ohos.app.ability.appRecovery.d.ts @@ -15,17 +15,16 @@ /** * This module provides the capability to app receovery. - * - * @since 9 + * @import appReceovery from '@ohos.app.ability.appRecovery' * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @import appReceovery from '@ohos.application.appRecovery' + * @since 9 */ declare namespace appReceovery { /** * The type of no restart mode. - * - * @since 9 + * @enum { number } * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 */ enum RestartFlag { /** @@ -56,9 +55,9 @@ declare namespace appReceovery { /** * The type of when to save. - * - * @since 9 + * @enum { number } * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 */ enum SaveOccasionFlag { /** @@ -74,9 +73,9 @@ declare namespace appReceovery { /** * The type of where to save. - * - * @since 9 + * @enum { number } * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 9 */ enum SaveModeFlag { /** @@ -92,31 +91,29 @@ declare namespace appReceovery { /** * Enable appRecovery and app supports save and restore - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param restart no restart mode * @param saveOccasion The type of When to save * @param saveMode The type of where to save - * @StageModelOnly + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 */ function enableAppRecovery(restart?: RestartFlag, saveOccasion?: SaveOccasionFlag, saveMode?: SaveModeFlag) : void; /** * Restart App when called - * - * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 */ function restartApp(): void; /** * Save App state data when called - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core * @return true if save data successfully, otherwise false - * @StageModelOnly + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 */ function saveAppState(): boolean; } -- Gitee From fd65862410d3125b74751eb94faad1cd501b7b82 Mon Sep 17 00:00:00 2001 From: ltdong Date: Wed, 26 Oct 2022 03:02:17 +0000 Subject: [PATCH 251/438] update api/@ohos.data.rdb.d.ts. Signed-off-by: ltdong --- api/@ohos.data.rdb.d.ts | 3070 +++++++++++++++++++-------------------- 1 file changed, 1532 insertions(+), 1538 deletions(-) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index 1b0bd3d1d7..63e0cf4803 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -13,9 +13,9 @@ * limitations under the License. */ -import {AsyncCallback, Callback} from './basic'; -import { ResultSet as _ResultSet } from './data/rdb/resultSet'; -import { ResultSetV9 as _ResultSetV9 } from './data/rdb/resultSet'; +import{ AsyncCallback, Callback } from './basic'; +import{ ResultSet as _ResultSet } from './data/rdb/resultSet'; +import{ ResultSetV9 as _ResultSetV9 } from './data/rdb/resultSet'; import Context from "./application/BaseContext"; import dataSharePredicates from './@ohos.data.dataSharePredicates'; @@ -26,8 +26,9 @@ import dataSharePredicates from './@ohos.data.dataSharePredicates'; * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 */ -declare namespace rdb { - /** +declare namespace rdb +{ + /** * Obtains an RDB store. * * You can set parameters of the RDB store as required. In general, this method is recommended @@ -42,8 +43,8 @@ declare namespace rdb { * @deprecated since 9 */ function getRdbStore(context: Context, config: StoreConfig, version: number, callback: AsyncCallback): void; - - /** + + /** * Obtains an RDB store. * * You can set parameters of the RDB store as required. In general, this method is recommended @@ -66,7 +67,7 @@ declare namespace rdb { * to obtain a rdb store. * * @param {Context} context - Indicates the context of application or capability. - * @param {StoreConfig} config - Indicates the {@link StoreConfig} configuration of the database related to this RDB store. + * @param {StoreConfigV9} config - Indicates the {@link StoreConfigV9} configuration of the database related to this RDB store. * @param {number} version - Indicates the database version for upgrade or downgrade. * @param {AsyncCallback} callback - the RDB store {@link RdbStoreV9}. * @throws {BusinessError} 401 - if the parameter type is incorrect. @@ -75,8 +76,8 @@ declare namespace rdb { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ - function getRdbStoreV9(context: Context, config: StoreConfig, version: number, callback: AsyncCallback): void; - + function getRdbStoreV9(context: Context, config: StoreConfigV9, version: number, callback: AsyncCallback): void; + /** * Obtains an RDB store. * @@ -84,7 +85,7 @@ declare namespace rdb { * to obtain a rdb store. * * @param {Context} context - Indicates the context of application or capability. - * @param {StoreConfig} config - Indicates the {@link StoreConfig} configuration of the database related to this RDB store. + * @param {StoreConfigV9} config - Indicates the {@link StoreConfigV9} configuration of the database related to this RDB store. * @param {number} version - Indicates the database version for upgrade or downgrade. * @returns {Promise} the RDB store {@link RdbStoreV9}. * @throws {BusinessError} 401 - if the parameter type is incorrect. @@ -93,20 +94,20 @@ declare namespace rdb { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ - function getRdbStoreV9(context: Context, config: StoreConfig, version: number): Promise; + function getRdbStoreV9(context: Context, config: StoreConfigV9, version: number): Promise; - /** + /** * Deletes the database with a specified name. * * @param {Context} context - Indicates the context of application or capability. * @param {string} name - Indicates the database name. * @param {AsyncCallback} callback - the callback of deleteRdbStore. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 - * @deprecated since 9 + * @deprecated since 9 */ function deleteRdbStore(context: Context, name: string, callback: AsyncCallback): void; - /** + /** * Deletes the database with a specified name. * * @param {Context} context - Indicates the context of application or capability. @@ -114,7 +115,7 @@ declare namespace rdb { * @returns {Promise} the promise returned by the function. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 - * @deprecated since 9 + * @deprecated since 9 */ function deleteRdbStore(context: Context, name: string): Promise; @@ -126,7 +127,7 @@ declare namespace rdb { * @param {AsyncCallback} callback - the callback of deleteRdbStore. * @throws {BusinessError} 401 - if the parameter type is incorrect. * @throws {BusinessError} 14800010 - if failed delete database by invalid database name - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ function deleteRdbStoreV9(context: Context, name: string, callback: AsyncCallback): void; @@ -183,8 +184,8 @@ declare namespace rdb { */ SUBSCRIBE_TYPE_REMOTE = 0, } - - /** + + /** * Describes the {@code RdbStoreV9} type. * * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -245,300 +246,300 @@ declare namespace rdb { * @import import data_rdb from '@ohos.data.rdb'; * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 - * @deprecated since 9 + * @deprecated since 9 */ interface RdbStore { /** - * Inserts a row of data into the target table. - * - * @param {string} table - Indicates the row of data to be inserted into the table. - * @param {ValuesBucket} values - Indicates the row of data {@link ValuesBucket} to be inserted into the table. - * @param {AsyncCallback} callback - the row ID if the operation is successful. returns -1 otherwise. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ + * Inserts a row of data into the target table. + * + * @param {string} table - Indicates the row of data to be inserted into the table. + * @param {ValuesBucket} values - Indicates the row of data {@link ValuesBucket} to be inserted into the table. + * @param {AsyncCallback} callback - the row ID if the operation is successful. returns -1 otherwise. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ insert(table: string, values: ValuesBucket, callback: AsyncCallback): void; - - /** - * Inserts a row of data into the target table. - * - * @param {string} table - Indicates the row of data to be inserted into the table. - * @param {ValuesBucket} values - Indicates the row of data {@link ValuesBucket} to be inserted into the table. - * @returns {Promise} return the row ID if the operation is successful. return -1 otherwise. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ + + /** + * Inserts a row of data into the target table. + * + * @param {string} table - Indicates the row of data to be inserted into the table. + * @param {ValuesBucket} values - Indicates the row of data {@link ValuesBucket} to be inserted into the table. + * @returns {Promise} return the row ID if the operation is successful. return -1 otherwise. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ insert(table: string, values: ValuesBucket): Promise; /** - * Inserts a batch of data into the target table. - * - * @param {string} table - Indicates the target table. - * @param {Array} values - Indicates the rows of data {@link ValuesBucket} to be inserted into the table. - * @param {AsyncCallback} callback - the number of values that were inserted if the operation is successful. returns -1 otherwise. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ + * Inserts a batch of data into the target table. + * + * @param {string} table - Indicates the target table. + * @param {Array} values - Indicates the rows of data {@link ValuesBucket} to be inserted into the table. + * @param {AsyncCallback} callback - the number of values that were inserted if the operation is successful. returns -1 otherwise. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ batchInsert(table: string, values: Array, callback: AsyncCallback): void; - - /** - * Inserts a batch of data into the target table. - * - * @param {string} table - Indicates the target table. - * @param {Array} values - Indicates the rows of data {@link ValuesBucket} to be inserted into the table. - * @returns {Promise} return the number of values that were inserted if the operation is successful. returns -1 otherwise. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ + + /** + * Inserts a batch of data into the target table. + * + * @param {string} table - Indicates the target table. + * @param {Array} values - Indicates the rows of data {@link ValuesBucket} to be inserted into the table. + * @returns {Promise} return the number of values that were inserted if the operation is successful. returns -1 otherwise. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ batchInsert(table: string, values: Array): Promise; /** - * Updates data in the database based on a a specified instance object of RdbPredicates. - * - * @param {ValuesBucket} values - Indicates Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. - * @param {RdbPredicates} predicates - Indicates the specified update condition by the instance object of {@link RdbPredicates}. - * @param {AsyncCallback} callback - the number of affected rows. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ + * Updates data in the database based on a a specified instance object of RdbPredicates. + * + * @param {ValuesBucket} values - Indicates Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. + * @param {RdbPredicates} predicates - Indicates the specified update condition by the instance object of {@link RdbPredicates}. + * @param {AsyncCallback} callback - the number of affected rows. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ update(values: ValuesBucket, predicates: RdbPredicates, callback: AsyncCallback): void; - - /** - * Updates data in the database based on a a specified instance object of RdbPredicates. - * - * @param {ValuesBucket} values - Indicates Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. - * @param {RdbPredicates} predicates - Indicates the specified update condition by the instance object of {@link RdbPredicates}. - * @returns {Promise} return the number of affected rows. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ + + /** + * Updates data in the database based on a a specified instance object of RdbPredicates. + * + * @param {ValuesBucket} values - Indicates Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. + * @param {RdbPredicates} predicates - Indicates the specified update condition by the instance object of {@link RdbPredicates}. + * @returns {Promise} return the number of affected rows. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ update(values: ValuesBucket, predicates: RdbPredicates): Promise; /** - * Deletes data from the database based on a specified instance object of RdbPredicates. - * - * @param {RdbPredicates} predicates - the specified delete condition by the instance object of {@link RdbPredicates}. - * @param {AsyncCallback} callback - the number of affected rows. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - delete(predicates: RdbPredicates, callback: AsyncCallback): void; - - /** - * Deletes data from the database based on a specified instance object of RdbPredicates. - * - * @param {RdbPredicates} predicates - the specified delete condition by the instance object of {@link RdbPredicates}. - * @returns {Promise} return the number of affected rows. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - delete(predicates: RdbPredicates): Promise; - - /** - * Queries data in the database based on specified conditions. - * - * @param {RdbPredicates} predicates - the specified query condition by the instance object of {@link RdbPredicates}. - * @param {Array} columns - the columns to query. If the value is empty array, the query applies to all columns. - * @param {AsyncCallback} callback - the {@link ResultSet} object if the operation is successful. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ + * Deletes data from the database based on a specified instance object of RdbPredicates. + * + * @param {RdbPredicates} predicates - the specified delete condition by the instance object of {@link RdbPredicates}. + * @param {AsyncCallback} callback - the number of affected rows. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + delete (predicates: RdbPredicates, callback: AsyncCallback): void; + + /** + * Deletes data from the database based on a specified instance object of RdbPredicates. + * + * @param {RdbPredicates} predicates - the specified delete condition by the instance object of {@link RdbPredicates}. + * @returns {Promise} return the number of affected rows. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + delete (predicates: RdbPredicates): Promise; + + /** + * Queries data in the database based on specified conditions. + * + * @param {RdbPredicates} predicates - the specified query condition by the instance object of {@link RdbPredicates}. + * @param {Array} columns - the columns to query. If the value is empty array, the query applies to all columns. + * @param {AsyncCallback} callback - the {@link ResultSet} object if the operation is successful. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ query(predicates: RdbPredicates, columns: Array, callback: AsyncCallback): void; - - /** - * Queries data in the database based on specified conditions. - * - * @param {RdbPredicates} predicates - the specified query condition by the instance object of {@link RdbPredicates}. - * @param {Array} columns - the columns to query. If the value is null, the query applies to all columns. - * @returns {Promise} return the {@link ResultSet} object if the operation is successful. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - query(predicates: RdbPredicates, columns?: Array): Promise; - - /** - * Deletes data from the database based on a specified instance object of RdbPredicates. - * - * @param {string} sql - Indicates the SQL statement to execute. - * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. - * @returns {Promise} return the {@link ResultSet} object if the operation is successful. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 8 - * @deprecated since 9 - */ + + /** + * Queries data in the database based on specified conditions. + * + * @param {RdbPredicates} predicates - the specified query condition by the instance object of {@link RdbPredicates}. + * @param {Array} columns - the columns to query. If the value is null, the query applies to all columns. + * @returns {Promise} return the {@link ResultSet} object if the operation is successful. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + query(predicates: RdbPredicates, columns ?: Array): Promise; + + /** + * Deletes data from the database based on a specified instance object of RdbPredicates. + * + * @param {string} sql - Indicates the SQL statement to execute. + * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. + * @returns {Promise} return the {@link ResultSet} object if the operation is successful. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ querySql(sql: string, bindArgs: Array, callback: AsyncCallback): void; - - /** - * Deletes data from the database based on a specified instance object of RdbPredicates. - * - * @param {string} sql - Indicates the SQL statement to execute. - * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. - * @returns {Promise} return the {@link ResultSet} object if the operation is successful. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 8 - * @deprecated since 9 - */ - querySql(sql: string, bindArgs?: Array): Promise; - - /** - * Executes an SQL statement that contains specified parameters but returns no value. - * - * @param {string} sql - Indicates the SQL statement to execute. - * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. - * @param {AsyncCallback} callback - the callback of executeSql. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 8 - * @deprecated since 9 - */ + + /** + * Deletes data from the database based on a specified instance object of RdbPredicates. + * + * @param {string} sql - Indicates the SQL statement to execute. + * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. + * @returns {Promise} return the {@link ResultSet} object if the operation is successful. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ + querySql(sql: string, bindArgs ?: Array): Promise; + + /** + * Executes an SQL statement that contains specified parameters but returns no value. + * + * @param {string} sql - Indicates the SQL statement to execute. + * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. + * @param {AsyncCallback} callback - the callback of executeSql. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ executeSql(sql: string, bindArgs: Array, callback: AsyncCallback): void; - - /** - * Executes an SQL statement that contains specified parameters but returns no value. - * - * @param {string} sql - Indicates the SQL statement to execute. - * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. - * @returns {Promise} the promise returned by the function. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 8 - * @deprecated since 9 - */ - executeSql(sql: string, bindArgs?: Array): Promise; - - /** - * beginTransaction before excute your sql. - * - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 8 - * @deprecated since 9 - */ - beginTransaction():void; - - /** - * commit the the sql you have excuted. - * - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 8 - * @deprecated since 9 - */ - commit():void; - - /** - * roll back the sql you have already excuted. - * - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 8 - * @deprecated since 9 - */ - rollBack():void; - - /** - * Set table to be distributed table. - * + + /** + * Executes an SQL statement that contains specified parameters but returns no value. + * + * @param {string} sql - Indicates the SQL statement to execute. + * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. + * @returns {Promise} the promise returned by the function. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ + executeSql(sql: string, bindArgs ?: Array): Promise; + + /** + * beginTransaction before excute your sql. + * + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ + beginTransaction(): void; + + /** + * commit the the sql you have excuted. + * + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ + commit(): void; + + /** + * roll back the sql you have already excuted. + * + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ + rollBack(): void; + + /** + * Set table to be distributed table. + * * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @param {Array} tables - Indicates the tables name you want to set. - * @param {AsyncCallback} callback - the callback of setDistributedTables. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 8 - * @deprecated since 9 - */ + * @param {Array} tables - Indicates the tables name you want to set. + * @param {AsyncCallback} callback - the callback of setDistributedTables. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ setDistributedTables(tables: Array, callback: AsyncCallback): void; - - /** - * Set table to be distributed table. - * + + /** + * Set table to be distributed table. + * * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @param {Array} tables - Indicates the tables name you want to set. - * @returns {Promise} the promise returned by the function. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 8 - * @deprecated since 9 - */ + * @param {Array} tables - Indicates the tables name you want to set. + * @returns {Promise} the promise returned by the function. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ setDistributedTables(tables: Array): Promise; /** - * Obtain distributed table name of specified remote device according to local table name. + * Obtain distributed table name of specified remote device according to local table name. * When query remote device database, distributed table name is needed. - * + * * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @param {string} device - Indicates the remote device. - * @param {AsyncCallback} callback - {string}: the distributed table name. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 8 - * @deprecated since 9 - */ + * @param {string} device - Indicates the remote device. + * @param {AsyncCallback} callback - {string}: the distributed table name. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ obtainDistributedTableName(device: string, table: string, callback: AsyncCallback): void; - - /** - * Obtain distributed table name of specified remote device according to local table name. + + /** + * Obtain distributed table name of specified remote device according to local table name. * When query remote device database, distributed table name is needed. - * + * * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @param {string} device - Indicates the remote device. - * @returns {Promise} {string}: the distributed table name. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 8 - * @deprecated since 9 - */ + * @param {string} device - Indicates the remote device. + * @returns {Promise} {string}: the distributed table name. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ obtainDistributedTableName(device: string, table: string): Promise; /** - * Sync data between devices. - * + * Sync data between devices. + * * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @param {string} device - Indicates the remote device. - * @param {AsyncCallback>} callback - {Array<[string, number]>}: devices sync status array, {string}: device id, {number}: device sync status. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 8 - * @deprecated since 9 - */ - sync(mode: SyncMode, predicates: RdbPredicates, callback: AsyncCallback>): void; - - /** - * Sync data between devices. - * + * @param {string} device - Indicates the remote device. + * @param {AsyncCallback>} callback - {Array<[string, number]>}: devices sync status array, {string}: device id, {number}: device sync status. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ + sync(mode: SyncMode, predicates: RdbPredicates, callback: AsyncCallback>): void; + + /** + * Sync data between devices. + * * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @param {string} device - Indicates the remote device. - * @returns {Promise>} {Array<[string, number]>}: devices sync status array, {string}: device id, {number}: device sync status. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 8 - * @deprecated since 9 - */ - sync(mode: SyncMode, predicates: RdbPredicates): Promise>; + * @param {string} device - Indicates the remote device. + * @returns {Promise>} {Array<[string, number]>}: devices sync status array, {string}: device id, {number}: device sync status. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ + sync(mode: SyncMode, predicates: RdbPredicates): Promise>; /** - * Registers an observer for the database. When data in the distributed database changes, + * Registers an observer for the database. When data in the distributed database changes, * the callback will be invoked. - * - * @param {string} event - Indicates the event must be string 'dataChange'. - * @param {SubscribeType} type - Indicates the subscription type, which is defined in {@link SubscribeType}. - * @param {AsyncCallback>} observer - {Array}: the observer of data change events in the distributed database. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 8 - * @deprecated since 9 - */ + * + * @param {string} event - Indicates the event must be string 'dataChange'. + * @param {SubscribeType} type - Indicates the subscription type, which is defined in {@link SubscribeType}. + * @param {AsyncCallback>} observer - {Array}: the observer of data change events in the distributed database. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ on(event: 'dataChange', type: SubscribeType, observer: Callback>): void; /** - * Remove specified observer of specified type from the database. - * - * @param {string} event - Indicates the event must be string 'dataChange'. - * @param {SubscribeType} type - Indicates the subscription type, which is defined in {@link SubscribeType}. - * @param {AsyncCallback>} observer - {Array}: the data change observer already registered. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 8 - * @deprecated since 9 - */ - off(event:'dataChange', type: SubscribeType, observer: Callback>): void; + * Remove specified observer of specified type from the database. + * + * @param {string} event - Indicates the event must be string 'dataChange'. + * @param {SubscribeType} type - Indicates the subscription type, which is defined in {@link SubscribeType}. + * @param {AsyncCallback>} observer - {Array}: the data change observer already registered. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ + off(event: 'dataChange', type: SubscribeType, observer: Callback>): void; } /** @@ -551,1301 +552,1294 @@ declare namespace rdb { * @since 9 */ interface RdbStoreV9 { - /** - * Inserts a row of data into the target table. - * - * @param {string} table - Indicates the row of data to be inserted into the table. - * @param {ValuesBucket} values - Indicates the row of data {@link ValuesBucket} to be inserted into the table. - * @param {AsyncCallback} callback - the row ID if the operation is successful. returns -1 otherwise. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ + /** + * Inserts a row of data into the target table. + * + * @param {string} table - Indicates the row of data to be inserted into the table. + * @param {ValuesBucket} values - Indicates the row of data {@link ValuesBucket} to be inserted into the table. + * @param {AsyncCallback} callback - the row ID if the operation is successful. returns -1 otherwise. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ insert(table: string, values: ValuesBucket, callback: AsyncCallback): void; - - /** - * Inserts a row of data into the target table. - * - * @param {string} table - Indicates the row of data to be inserted into the table. - * @param {ValuesBucket} values - Indicates the row of data {@link ValuesBucket} to be inserted into the table. - * @returns {Promise} return the row ID if the operation is successful. return -1 otherwise. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ + + /** + * Inserts a row of data into the target table. + * + * @param {string} table - Indicates the row of data to be inserted into the table. + * @param {ValuesBucket} values - Indicates the row of data {@link ValuesBucket} to be inserted into the table. + * @returns {Promise} return the row ID if the operation is successful. return -1 otherwise. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ insert(table: string, values: ValuesBucket): Promise; - /** - * Inserts a batch of data into the target table. - * - * @param {string} table - Indicates the target table. - * @param {Array} values - Indicates the rows of data {@link ValuesBucket} to be inserted into the table. - * @param {AsyncCallback} callback - the number of values that were inserted if the operation is successful. returns -1 otherwise. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ + /** + * Inserts a batch of data into the target table. + * + * @param {string} table - Indicates the target table. + * @param {Array} values - Indicates the rows of data {@link ValuesBucket} to be inserted into the table. + * @param {AsyncCallback} callback - the number of values that were inserted if the operation is successful. returns -1 otherwise. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ batchInsert(table: string, values: Array, callback: AsyncCallback): void; - - /** - * Inserts a batch of data into the target table. - * - * @param {string} table - Indicates the target table. - * @param {Array} values - Indicates the rows of data {@link ValuesBucket} to be inserted into the table. - * @returns {Promise} return the number of values that were inserted if the operation is successful. returns -1 otherwise. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ + + /** + * Inserts a batch of data into the target table. + * + * @param {string} table - Indicates the target table. + * @param {Array} values - Indicates the rows of data {@link ValuesBucket} to be inserted into the table. + * @returns {Promise} return the number of values that were inserted if the operation is successful. returns -1 otherwise. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ batchInsert(table: string, values: Array): Promise; - /** - * Updates data in the database based on a a specified instance object of RdbPredicatesV9. - * - * @param {ValuesBucket} values - Indicates Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. - * @param {RdbPredicatesV9} predicates - Indicates the specified update condition by the instance object of {@link RdbPredicatesV9}. - * @param {AsyncCallback} callback - the number of affected rows. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ + /** + * Updates data in the database based on a a specified instance object of RdbPredicatesV9. + * + * @param {ValuesBucket} values - Indicates Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. + * @param {RdbPredicatesV9} predicates - Indicates the specified update condition by the instance object of {@link RdbPredicatesV9}. + * @param {AsyncCallback} callback - the number of affected rows. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ update(values: ValuesBucket, predicates: RdbPredicatesV9, callback: AsyncCallback): void; - - /** - * Updates data in the database based on a a specified instance object of RdbPredicatesV9. - * - * @param {ValuesBucket} values - Indicates Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. - * @param {RdbPredicatesV9} predicates - Indicates the specified update condition by the instance object of {@link RdbPredicatesV9}. - * @returns {Promise} return the number of affected rows. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ + + /** + * Updates data in the database based on a a specified instance object of RdbPredicatesV9. + * + * @param {ValuesBucket} values - Indicates Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. + * @param {RdbPredicatesV9} predicates - Indicates the specified update condition by the instance object of {@link RdbPredicatesV9}. + * @returns {Promise} return the number of affected rows. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ update(values: ValuesBucket, predicates: RdbPredicatesV9): Promise; - /** - * Updates data in the database based on a a specified instance object of RdbPredicatesV9. - * - * @param {string} table - Indicates the target table. - * @param {ValuesBucket} values - Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. - * @param {DataSharePredicates} predicates - Indicates the specified update condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. - * @param {AsyncCallback} callback - the number of affected rows. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ + /** + * Updates data in the database based on a a specified instance object of RdbPredicatesV9. + * + * @param {string} table - Indicates the target table. + * @param {ValuesBucket} values - Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. + * @param {DataSharePredicates} predicates - Indicates the specified update condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. + * @param {AsyncCallback} callback - the number of affected rows. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ update(table: string, values: ValuesBucket, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; - - /** - * Updates data in the database based on a a specified instance object of RdbPredicatesV9. - * - * @param {string} table - Indicates the target table. - * @param {ValuesBucket} values - Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. - * @param {DataSharePredicates} predicates - Indicates the specified update condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. - * @returns {Promise} return the number of affected rows. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - update(table: string, values: ValuesBucket, predicates: dataSharePredicates.DataSharePredicates): Promise; - - /** - * Deletes data from the database based on a specified instance object of RdbPredicatesV9. - * - * @param {RdbPredicatesV9} predicates - the specified delete condition by the instance object of {@link RdbPredicatesV9}. - * @param {AsyncCallback} callback - the number of affected rows. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - delete(predicates: RdbPredicatesV9, callback: AsyncCallback): void; - - /** - * Deletes data from the database based on a specified instance object of RdbPredicatesV9. - * - * @param {RdbPredicatesV9} predicates - the specified delete condition by the instance object of {@link RdbPredicatesV9}. - * @returns {Promise} return the number of affected rows. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - delete(predicates: RdbPredicatesV9): Promise; - - /** - * Deletes data from the database based on a specified instance object of RdbPredicatesV9. - * - * @param {string} table - Indicates the target table. - * @param {DataSharePredicates} predicates - the specified delete condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. - * @param {AsyncCallback} callback - the number of affected rows. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - delete(table: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; - - /** - * Deletes data from the database based on a specified instance object of RdbPredicatesV9. - * - * @param {string} table - Indicates the target table. - * @param {DataSharePredicates} predicates - the specified delete condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. - * @param {AsyncCallback} callback - the number of affected rows. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - delete(table: string, predicates: dataSharePredicates.DataSharePredicates): Promise; - - /** - * Queries data in the database based on specified conditions. - * - * @param {RdbPredicatesV9} predicates - the specified query condition by the instance object of {@link RdbPredicatesV9}. - * @param {Array} columns - the columns to query. If the value is empty array, the query applies to all columns. - * @param {AsyncCallback} callback - the {@link ResultSetV9} object if the operation is successful. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - query(predicates: RdbPredicatesV9, columns: Array, callback: AsyncCallback): void; - - /** - * Queries data in the database based on specified conditions. - * - * @param {RdbPredicatesV9} predicates - the specified query condition by the instance object of {@link RdbPredicatesV9}. - * @param {Array} columns - the columns to query. If the value is null, the query applies to all columns. - * @returns {Promise} return the {@link ResultSetV9} object if the operation is successful. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - query(predicates: RdbPredicatesV9, columns?: Array): Promise; - - /** - * Queries data in the database based on specified conditions. - * - * @param {string} table - Indicates the target table. - * @param {dataSharePredicates.DataSharePredicates} predicates - the specified query condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. - * @param {Array} columns - the columns to query. If the value is empty array, the query applies to all columns. - * @param {AsyncCallback} callback - the {@link ResultSetV9} object if the operation is successful. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - query(table: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array, callback: AsyncCallback): void; - - /** - * Queries data in the database based on specified conditions. - * - * @param {string} table - Indicates the target table. - * @param {dataSharePredicates.DataSharePredicates} predicates - the specified query condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. - * @param {Array} columns - the columns to query. If the value is null, the query applies to all columns. - * @returns {Promise} return the {@link ResultSetV9} object if the operation is successful. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - query(table: string, predicates: dataSharePredicates.DataSharePredicates, columns?: Array): Promise; - - /** - * Queries remote data in the database based on specified conditions before Synchronizing Data. - * - * @param {string} device - Indicates specified remote device. - * @param {string} table - Indicates the target table. - * @param {RdbPredicatesV9} predicates - the specified remote remote query condition by the instance object of {@link RdbPredicatesV9}. - * @param {Array} columns - the columns to remote query. If the value is empty array, the remote query applies to all columns. - * @param {AsyncCallback} callback - the {@link ResultSetV9} object if the operation is successful. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - remoteQuery(device: string, table: string, predicates: RdbPredicatesV9, columns: Array, callback: AsyncCallback): void; - - /** - * Queries remote data in the database based on specified conditions before Synchronizing Data. - * - * @param {string} device - Indicates specified remote device. - * @param {string} table - Indicates the target table. - * @param {RdbPredicatesV9} predicates - the specified remote remote query condition by the instance object of {@link RdbPredicatesV9}. - * @param {Array} columns - the columns to remote query. If the value is empty array, the remote query applies to all columns. - * @returns {Promise} return the {@link ResultSetV9} object if the operation is successful. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - remoteQuery(device: string, table: string, predicates: RdbPredicatesV9, columns: Array): Promise; - - /** - * Queries data in the database based on SQL statement. - * - * @param {string} sql - Indicates the SQL statement to execute. - * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. - * @param {AsyncCallback} callback - the {@link ResultSetV9} object if the operation is successful. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - querySql(sql: string, bindArgs: Array, callback: AsyncCallback): void; - - /** - * Deletes data from the database based on a specified instance object of RdbPredicatesV9. - * - * @param {string} sql - Indicates the SQL statement to execute. - * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. - * @returns {Promise} return the {@link ResultSetV9} object if the operation is successful. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - querySql(sql: string, bindArgs?: Array): Promise; - - /** - * Executes an SQL statement that contains specified parameters but returns no value. - * - * @param {string} sql - Indicates the SQL statement to execute. - * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. - * @param {AsyncCallback} callback - the callback of executeSql. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - executeSql(sql: string, bindArgs: Array, callback: AsyncCallback): void; - - /** - * Executes an SQL statement that contains specified parameters but returns no value. - * - * @param {string} sql - Indicates the SQL statement to execute. - * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. - * @returns {Promise} the promise returned by the function. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - executeSql(sql: string, bindArgs?: Array): Promise; - - /** - * beginTransaction before excute your sql. - * - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - beginTransaction():void; - - /** - * commit the the sql you have excuted. - * - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - commit():void; - - /** - * roll back the sql you have already excuted. - * - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - rollBack():void; - - /** - * Backs up a database in a specified name. - * - * @param {string} destName - Indicates the name that saves the database backup. - * @param {AsyncCallback} callback - the callback of backup. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - backup(destName:string, callback: AsyncCallback):void; - - /** - * Backs up a database in a specified name. - * - * @param {string} destName - Indicates the name that saves the database backup. - * @returns {Promise} the promise returned by the function. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - backup(destName:string): Promise; - - /** - * Restores a database from a specified database file. - * - * @param {string} srcName - Indicates the name that saves the database file. - * @param {AsyncCallback} callback - the callback of restore. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - restore(srcName:string, callback: AsyncCallback):void; - - /** - * Restores a database from a specified database file. - * - * @param {string} srcName - Indicates the name that saves the database file. - * @returns {Promise} the promise returned by the function. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - restore(srcName:string): Promise; - - /** - * Set table to be distributed table. - * - * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @param {Array} tables - Indicates the tables name you want to set. - * @param {AsyncCallback} callback - the callback of setDistributedTables. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - setDistributedTables(tables: Array, callback: AsyncCallback): void; - - /** - * Set table to be distributed table. - * - * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @param {Array} tables - Indicates the tables name you want to set. - * @returns {Promise} the promise returned by the function. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - setDistributedTables(tables: Array): Promise; - - /** - * Obtain distributed table name of specified remote device according to local table name. - * When query remote device database, distributed table name is needed. - * - * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @param {string} device - Indicates the remote device. - * @param {AsyncCallback} callback - {string}: the distributed table name. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - obtainDistributedTableName(device: string, table: string, callback: AsyncCallback): void; - - /** - * Obtain distributed table name of specified remote device according to local table name. - * When query remote device database, distributed table name is needed. - * - * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @param {string} device - Indicates the remote device. - * @returns {Promise} {string}: the distributed table name. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - obtainDistributedTableName(device: string, table: string): Promise; - - /** - * Sync data between devices. - * - * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @param {string} device - Indicates the remote device. - * @param {AsyncCallback>} callback - {Array<[string, number]>}: devices sync status array, {string}: device id, {number}: device sync status. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - sync(mode: SyncMode, predicates: RdbPredicatesV9, callback: AsyncCallback>): void; - - /** - * Sync data between devices. - * - * @permission ohos.permission.DISTRIBUTED_DATASYNC - * @param {string} device - Indicates the remote device. - * @returns {Promise>} {Array<[string, number]>}: devices sync status array, {string}: device id, {number}: device sync status. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - sync(mode: SyncMode, predicates: RdbPredicatesV9): Promise>; - - /** - * Registers an observer for the database. When data in the distributed database changes, - * the callback will be invoked. - * - * @param {string} event - Indicates the event must be string 'dataChange'. - * @param {SubscribeType} type - Indicates the subscription type, which is defined in {@link SubscribeType}. - * @param {AsyncCallback>} observer - {Array}: the observer of data change events in the distributed database. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - on(event: 'dataChange', type: SubscribeType, observer: Callback>): void; - - /** - * Remove specified observer of specified type from the database. - * - * @param {string} event - Indicates the event must be string 'dataChange'. - * @param {SubscribeType} type - Indicates the subscription type, which is defined in {@link SubscribeType}. - * @param {AsyncCallback>} observer - {Array}: the data change observer already registered. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - off(event:'dataChange', type: SubscribeType, observer: Callback>): void; - } - - /** - * Indicates possible value types - * - * @import import data_rdb from '@ohos.data.rdb'; - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - */ - type ValueType = number | string | boolean; - - /** - * Values in buckets are stored in key-value pairs - * - * @import import data_rdb from '@ohos.data.rdb'; - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - */ - type ValuesBucket = { - [key: string]: ValueType | Uint8Array | null; - } - /** - * Manages relational database configurations. - * - * @import import data_rdb from '@ohos.data.rdb'; - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - interface StoreConfig { - name: string; - } - - /** - * Manages relational database configurations. - * - * @import import data_rdb from '@ohos.data.rdb'; - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - interface StoreConfigV9 { - /** - * The database name. - * - * @import import data_rdb from '@ohos.data.rdb'; + /** + * Updates data in the database based on a a specified instance object of RdbPredicatesV9. + * + * @param {string} table - Indicates the target table. + * @param {ValuesBucket} values - Indicates the row of data to be updated in the database.The key-value pairs are associated with column names of the database table. + * @param {DataSharePredicates} predicates - Indicates the specified update condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. + * @returns {Promise} return the number of affected rows. + * @throws {BusinessError} 401 - if the parameter type is incorrect. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 - */ - name: string; - - /** - * Specifies whether the database is encrypted. + */ + update(table: string, values: ValuesBucket, predicates: dataSharePredicates.DataSharePredicates): Promise; + + /** + * Deletes data from the database based on a specified instance object of RdbPredicatesV9. * - * @import import data_rdb from '@ohos.data.rdb'; + * @param {RdbPredicatesV9} predicates - the specified delete condition by the instance object of {@link RdbPredicatesV9}. + * @param {AsyncCallback} callback - the number of affected rows. + * @throws {BusinessError} 401 - if the parameter type is incorrect. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 - */ - securityLevel: SecurityLevel; - + */ + delete (predicates: RdbPredicatesV9, callback: AsyncCallback): void; + /** - * Specifies whether the database is encrypted. - * - * @import import data_rdb from '@ohos.data.rdb'; + * Deletes data from the database based on a specified instance object of RdbPredicatesV9. + * + * @param {RdbPredicatesV9} predicates - the specified delete condition by the instance object of {@link RdbPredicatesV9}. + * @returns {Promise} return the number of affected rows. + * @throws {BusinessError} 401 - if the parameter type is incorrect. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 - */ - encrypt?: boolean; - } + */ + delete (predicates: RdbPredicatesV9): Promise; - /** - * Manages relational database configurations. - * - * @import import data_rdb from '@ohos.data.rdb'; - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - class RdbPredicates { /** - * A parameterized constructor used to create an RdbPredicates instance. - * - * @param {string} name - Indicates the table name of the database. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - constructor(name: string) - - /** - * Sync data between devices. - * - * @note When query database, this function should not be called. - * @param {Array} devices - Indicates specified remote devices. - * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 8 - * @deprecated since 9 - */ - inDevices(devices: Array): RdbPredicates; + * Deletes data from the database based on a specified instance object of RdbPredicatesV9. + * + * @param {string} table - Indicates the target table. + * @param {DataSharePredicates} predicates - the specified delete condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. + * @param {AsyncCallback} callback - the number of affected rows. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + delete (table: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; + + /** + * Deletes data from the database based on a specified instance object of RdbPredicatesV9. + * + * @param {string} table - Indicates the target table. + * @param {DataSharePredicates} predicates - the specified delete condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. + * @param {AsyncCallback} callback - the number of affected rows. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + delete (table: string, predicates: dataSharePredicates.DataSharePredicates): Promise; + + /** + * Queries data in the database based on specified conditions. + * + * @param {RdbPredicatesV9} predicates - the specified query condition by the instance object of {@link RdbPredicatesV9}. + * @param {Array} columns - the columns to query. If the value is empty array, the query applies to all columns. + * @param {AsyncCallback} callback - the {@link ResultSetV9} object if the operation is successful. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + query(predicates: RdbPredicatesV9, columns: Array, callback: AsyncCallback): void; + + /** + * Queries data in the database based on specified conditions. + * + * @param {RdbPredicatesV9} predicates - the specified query condition by the instance object of {@link RdbPredicatesV9}. + * @param {Array} columns - the columns to query. If the value is null, the query applies to all columns. + * @returns {Promise} return the {@link ResultSetV9} object if the operation is successful. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + query(predicates: RdbPredicatesV9, columns ?: Array): Promise; + + /** + * Queries data in the database based on specified conditions. + * + * @param {string} table - Indicates the target table. + * @param {dataSharePredicates.DataSharePredicates} predicates - the specified query condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. + * @param {Array} columns - the columns to query. If the value is empty array, the query applies to all columns. + * @param {AsyncCallback} callback - the {@link ResultSetV9} object if the operation is successful. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + query(table: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array, callback: AsyncCallback): void; + + /** + * Queries data in the database based on specified conditions. + * + * @param {string} table - Indicates the target table. + * @param {dataSharePredicates.DataSharePredicates} predicates - the specified query condition by the instance object of {@link dataSharePredicates.DataSharePredicates}. + * @param {Array} columns - the columns to query. If the value is null, the query applies to all columns. + * @returns {Promise} return the {@link ResultSetV9} object if the operation is successful. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + query(table: string, predicates: dataSharePredicates.DataSharePredicates, columns ?: Array): Promise; + + /** + * Queries remote data in the database based on specified conditions before Synchronizing Data. + * + * @param {string} device - Indicates specified remote device. + * @param {string} table - Indicates the target table. + * @param {RdbPredicatesV9} predicates - the specified remote remote query condition by the instance object of {@link RdbPredicatesV9}. + * @param {Array} columns - the columns to remote query. If the value is empty array, the remote query applies to all columns. + * @param {AsyncCallback} callback - the {@link ResultSetV9} object if the operation is successful. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + remoteQuery(device: string, table: string, predicates: RdbPredicatesV9, columns: Array, callback: AsyncCallback): void; + + /** + * Queries remote data in the database based on specified conditions before Synchronizing Data. + * + * @param {string} device - Indicates specified remote device. + * @param {string} table - Indicates the target table. + * @param {RdbPredicatesV9} predicates - the specified remote remote query condition by the instance object of {@link RdbPredicatesV9}. + * @param {Array} columns - the columns to remote query. If the value is empty array, the remote query applies to all columns. + * @returns {Promise} return the {@link ResultSetV9} object if the operation is successful. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + remoteQuery(device: string, table: string, predicates: RdbPredicatesV9, columns: Array): Promise; + + /** + * Queries data in the database based on SQL statement. + * + * @param {string} sql - Indicates the SQL statement to execute. + * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. + * @param {AsyncCallback} callback - the {@link ResultSetV9} object if the operation is successful. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + querySql(sql: string, bindArgs: Array, callback: AsyncCallback): void; + + /** + * Deletes data from the database based on a specified instance object of RdbPredicatesV9. + * + * @param {string} sql - Indicates the SQL statement to execute. + * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. + * @returns {Promise} return the {@link ResultSetV9} object if the operation is successful. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + querySql(sql: string, bindArgs ?: Array): Promise; + + /** + * Executes an SQL statement that contains specified parameters but returns no value. + * + * @param {string} sql - Indicates the SQL statement to execute. + * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. + * @param {AsyncCallback} callback - the callback of executeSql. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + executeSql(sql: string, bindArgs: Array, callback: AsyncCallback): void; + + /** + * Executes an SQL statement that contains specified parameters but returns no value. + * + * @param {string} sql - Indicates the SQL statement to execute. + * @param {Array} bindArgs - Indicates the {@link ValueType} values of the parameters in the SQL statement. The values are strings. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + executeSql(sql: string, bindArgs ?: Array): Promise; + + /** + * BeginTransaction before excute your sql. + * + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + beginTransaction(): void; + + /** + * Commit the the sql you have executed. + * + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + commit(): void; + + /** + * Roll back the sql you have already executed. + * + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + rollBack(): void; + + /** + * Backs up a database in a specified name. + * + * @param {string} destName - Indicates the name that saves the database backup. + * @param {AsyncCallback} callback - the callback of backup. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + backup(destName: string, callback: AsyncCallback): void; + + /** + * Backs up a database in a specified name. + * + * @param {string} destName - Indicates the name that saves the database backup. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + backup(destName: string): Promise; + + /** + * Restores a database from a specified database file. + * + * @param {string} srcName - Indicates the name that saves the database file. + * @param {AsyncCallback} callback - the callback of restore. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + restore(srcName: string, callback: AsyncCallback): void; + + /** + * Restores a database from a specified database file. + * + * @param {string} srcName - Indicates the name that saves the database file. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + restore(srcName: string): Promise; + + /** + * Set table to be distributed table. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param {Array} tables - Indicates the tables name you want to set. + * @param {AsyncCallback} callback - the callback of setDistributedTables. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + setDistributedTables(tables: Array, callback: AsyncCallback): void; /** - * Specify all remote devices which connect to local device when syncing distributed database. - * - * @note When query database, this function should not be called. - * @returns {RdbPredicates} - the {@link RdbPredicates} self. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 8 - * @deprecated since 9 - */ - inAllDevices(): RdbPredicates; - - /** - * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is equal - * to a specified value. - * - * @note This method is similar to = of the SQL statement. - * @param {string} field - Indicates the column name in the database table. - * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. - * @returns {RdbPredicates} - the {@link RdbPredicates} self. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - equalTo(field: string, value: ValueType): RdbPredicates; - - /** - * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is unequal to - * a specified value. - * - * @note This method is similar to != of the SQL statement. - * @param {string} field - Indicates the column name in the database table. - * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. - * @returns {RdbPredicates} - the {@link RdbPredicates} self. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - notEqualTo(field: string, value: ValueType): RdbPredicates; - - /** - * Adds a left parenthesis to the RdbPredicates. - * - * @note This method is similar to ( of the SQL statement and needs to be used together with endWrap(). - * @returns {RdbPredicates} - the {@link RdbPredicates} with the left parenthesis. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - beginWrap(): RdbPredicates; - - /** - * Adds a right parenthesis to the RdbPredicates. - * - * @note This method is similar to ) of the SQL statement and needs to be used together - * with beginWrap(). - * @returns {RdbPredicates} - the {@link RdbPredicates} with the right parenthesis. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - endWrap(): RdbPredicates; - - /** - * Adds an or condition to the RdbPredicates. - * - * @note This method is similar to or of the SQL statement. - * @return Returns the {@link RdbPredicates} with the or condition. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - or(): RdbPredicates; - /** - * Adds an and condition to the RdbPredicates. - * - * @note This method is similar to or of the SQL statement. - * @return Returns the {@link RdbPredicates} with the or condition. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - and(): RdbPredicates; - - /** - * Configures the RdbPredicates to match the field whose data type is string and value - * contains a specified value. - * - * @note This method is similar to contains of the SQL statement. - * @param {string} field - Indicates the column name in the database table. - * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. - * @returns {RdbPredicates} - the {@link RdbPredicates} self. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - contains(field: string, value: string): RdbPredicates; - - /** - * Configures the RdbPredicates to match the field whose data type is string and value starts - * with a specified string. - * - * @note This method is similar to value% of the SQL statement. - * @param {string} field - Indicates the column name in the database table. - * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. - * @returns {RdbPredicates} - the {@link RdbPredicates} self. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - beginsWith(field: string, value: string): RdbPredicates; - - /** - * Configures the RdbPredicates to match the field whose data type is string and value - * ends with a specified string. - * - * @note This method is similar to %value of the SQL statement. - * @param {string} field - Indicates the column name in the database table. - * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. - * @returns {RdbPredicates} - the {@link RdbPredicates} self. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - endsWith(field: string, value: string): RdbPredicates; - - /** - * Configures the RdbPredicates to match the fields whose value is null. - * - * @note This method is similar to is null of the SQL statement. - * @param {string} field - Indicates the column name in the database table. - * @returns {RdbPredicates} - the {@link RdbPredicates} self. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - isNull(field: string): RdbPredicates; - - /** - * Configures the RdbPredicates to match the specified fields whose value is not null. - * - * @note This method is similar to is not null of the SQL statement. - * @param {string} field - Indicates the column name in the database table. - * @returns {RdbPredicates} - the {@link RdbPredicates} self. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - isNotNull(field: string): RdbPredicates; - - /** - * Configures the RdbPredicates to match the fields whose data type is string and value is - * similar to a specified string. - * - * @note This method is similar to like of the SQL statement. - * @param {string} field - Indicates the column name in the database table. - * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. - * @returns {RdbPredicates} - the {@link RdbPredicates} that match the specified field. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - like(field: string, value: string): RdbPredicates; - - /** - * Configures RdbPredicates to match the specified field whose data type is string and the value contains - * a wildcard. - * - * @note Different from like, the input parameters of this method are case-sensitive. - * @param {string} field - Indicates the column name in the database table. - * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. - * @returns {RdbPredicates} - the SQL statement with the specified {@link RdbPredicates}. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - glob(field: string, value: string): RdbPredicates; - - /** - * Configures RdbPredicates to match the specified field whose data type is string and the value contains - * a wildcard. - * - * @param {string} field - Indicates the column name. - * @param {ValueType} low - Indicates the minimum value. - * @param {ValueType} high - Indicates the maximum value. - * @returns {RdbPredicates} - the SQL statement with the specified {@link RdbPredicates}. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - between(field: string, low: ValueType, high: ValueType): RdbPredicates; - - /** - * Configures RdbPredicates to match the specified field whose data type is int and value is - * out of a given range. - * - * @param {string} field - Indicates the column name in the database table. - * @param {ValueType} low - Indicates the minimum value. - * @param {ValueType} high - Indicates the maximum value to. - * @returns {RdbPredicates} - the SQL statement with the specified {@link RdbPredicates}. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - notBetween(field: string, low: ValueType, high: ValueType): RdbPredicates; - - /** - * Restricts the value of the field to be greater than the specified value. - * - * @param {string} field - Indicates the column name in the database table. - * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. - * @returns {RdbPredicates} - the SQL query statement with the specified {@link RdbPredicates}. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - greaterThan(field: string, value: ValueType): RdbPredicates; - - /** - * Restricts the value of the field to be smaller than the specified value. - * - * @param {string} field - Indicates the column name in the database table. - * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. - * @returns {RdbPredicates} - the SQL query statement with the specified {@link RdbPredicates}. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - lessThan(field: string, value: ValueType): RdbPredicates; - - /** - * Restricts the value of the field to be greater than or equal to the specified value. - * - * @param {string} field - Indicates the column name in the database table. - * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. - * @returns {RdbPredicates} - the SQL query statement with the specified {@link RdbPredicates}. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - greaterThanOrEqualTo(field: string, value: ValueType): RdbPredicates; - - /** - * Restricts the value of the field to be smaller than or equal to the specified value. - * - * @param {string} field - Indicates the column name in the database table. - * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. - * @returns {RdbPredicates} - the SQL query statement with the specified {@link RdbPredicates}. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - lessThanOrEqualTo(field: string, value: ValueType): RdbPredicates; - - /** - * Restricts the ascending order of the return list. When there are several orders, - * the one close to the head has the highest priority. - * - * @param {string} field - Indicates the column name for sorting the return list. - * @returns {RdbPredicates} - the SQL query statement with the specified {@link RdbPredicates}. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - orderByAsc(field: string): RdbPredicates; - - /** - * Restricts the descending order of the return list. When there are several orders, - * the one close to the head has the highest priority. - * - * @param {string} field - Indicates the column name for sorting the return list. - * @returns {RdbPredicates} - the SQL query statement with the specified {@link RdbPredicates}. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - orderByDesc(field: string): RdbPredicates; - - /** - * Restricts each row of the query result to be unique. - * - * @returns {RdbPredicates} - the SQL query statement with the specified {@link RdbPredicates}. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - distinct(): RdbPredicates; - - /** - * Restricts the max number of return records. - * - * @param {number} value - Indicates the max length of the return list. - * @returns {RdbPredicates} - the SQL query statement with the specified {@link RdbPredicates}. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - limitAs(value: number): RdbPredicates; - - /** - * Configures RdbPredicatesV9 to specify the start position of the returned result. - * - * @note Use this method together with limit(int). - * @param {number} rowOffset - Indicates the start position of the returned result. The value is a positive integer. - * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - offsetAs(rowOffset: number): RdbPredicates; - - /** - * Configures RdbPredicatesV9 to group query results by specified columns. - * - * @param {Array} fields - Indicates the specified columns by which query results are grouped. - * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - groupBy(fields: Array): RdbPredicates; - - /** - * Configures RdbPredicatesV9 to specify the index column. - * - * @note Before using this method, you need to create an index column. - * @param {string} field - Indicates the name of the index column. - * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - indexedBy(field: string): RdbPredicates; - - /** - * Configures RdbPredicatesV9 to match the specified field whose data type is ValueType array and values - * are within a given range. - * - * @param {string} field - Indicates the column name in the database table. - * @param {Array} value - Indicates the values to match with {@link RdbPredicatesV9}. - * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - in(field: string, value: Array): RdbPredicates; - - /** - * Configures RdbPredicatesV9 to match the specified field whose data type is ValueType array and values - * are out of a given range. - * - * @param {string} field - Indicates the column name in the database table. - * @param {Array} value - Indicates the values to match with {@link RdbPredicatesV9}. - * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 7 - * @deprecated since 9 - */ - notIn(field: string, value: Array): RdbPredicates; + * Set table to be distributed table. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param {Array} tables - Indicates the tables name you want to set. + * @returns {Promise} the promise returned by the function. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + setDistributedTables(tables: Array): Promise; + + /** + * Obtain distributed table name of specified remote device according to local table name. + * When query remote device database, distributed table name is needed. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param {string} device - Indicates the remote device. + * @param {AsyncCallback} callback - {string}: the distributed table name. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + obtainDistributedTableName(device: string, table: string, callback: AsyncCallback): void; + + /** + * Obtain distributed table name of specified remote device according to local table name. + * When query remote device database, distributed table name is needed. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param {string} device - Indicates the remote device. + * @returns {Promise} {string}: the distributed table name. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + obtainDistributedTableName(device: string, table: string): Promise; + + /** + * Sync data between devices. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param {string} device - Indicates the remote device. + * @param {AsyncCallback>} callback - {Array<[string, number]>}: devices sync status array, {string}: device id, {number}: device sync status. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + sync(mode: SyncMode, predicates: RdbPredicatesV9, callback: AsyncCallback>): void; + + /** + * Sync data between devices. + * + * @permission ohos.permission.DISTRIBUTED_DATASYNC + * @param {string} device - Indicates the remote device. + * @returns {Promise>} {Array<[string, number]>}: devices sync status array, {string}: device id, {number}: device sync status. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + sync(mode: SyncMode, predicates: RdbPredicatesV9): Promise>; + + /** + * Registers an observer for the database. When data in the distributed database changes, + * the callback will be invoked. + * + * @param {string} event - Indicates the event must be string 'dataChange'. + * @param {SubscribeType} type - Indicates the subscription type, which is defined in {@link SubscribeType}. + * @param {AsyncCallback>} observer - {Array}: the observer of data change events in the distributed database. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + on(event: 'dataChange', type: SubscribeType, observer: Callback>): void; + + /** + * Remove specified observer of specified type from the database. + * + * @param {string} event - Indicates the event must be string 'dataChange'. + * @param {SubscribeType} type - Indicates the subscription type, which is defined in {@link SubscribeType}. + * @param {AsyncCallback>} observer - {Array}: the data change observer already registered. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + off(event: 'dataChange', type: SubscribeType, observer: Callback>): void; } - + + /** + * Indicates possible value types + * + * @import import data_rdb from '@ohos.data.rdb'; + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + */ + type ValueType = number | string | boolean; + + /** + * Values in buckets are stored in key-value pairs + * + * @import import data_rdb from '@ohos.data.rdb'; + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + */ + type ValuesBucket = { [key:string]: ValueType | Uint8Array | null; +} + +/** + * Manages relational database configurations. + * + * @import import data_rdb from '@ohos.data.rdb'; + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ +interface StoreConfig { + name: string; +} + +/** + * Manages relational database configurations. + * + * @import import data_rdb from '@ohos.data.rdb'; + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ +interface StoreConfigV9 { /** - * Manages relational database configurations. + * The database name. * * @import import data_rdb from '@ohos.data.rdb'; * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ - class RdbPredicatesV9 { - /** - * A parameterized constructor used to create an RdbPredicates instance. - * - * @param {string} name - Indicates the table name of the database. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - constructor(name: string) - - /** - * Sync data between devices. - * - * @note When query database, this function should not be called. - * @param {Array} devices - Indicates specified remote devices. - * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - inDevices(devices: Array): RdbPredicatesV9; - - /** - * Specify all remote devices which connect to local device when syncing distributed database. - * - * @note When query database, this function should not be called. - * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - inAllDevices(): RdbPredicatesV9; - - /** - * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is equal - * to a specified value. - * - * @note This method is similar to = of the SQL statement. - * @param {string} field - Indicates the column name in the database table. - * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. - * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - equalTo(field: string, value: ValueType): RdbPredicatesV9; - - /** - * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is unequal to - * a specified value. - * - * @note This method is similar to != of the SQL statement. - * @param {string} field - Indicates the column name in the database table. - * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. - * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - notEqualTo(field: string, value: ValueType): RdbPredicatesV9; - - /** - * Adds a left parenthesis to the RdbPredicatesV9. - * - * @note This method is similar to ( of the SQL statement and needs to be used together with endWrap(). - * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} with the left parenthesis. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - beginWrap(): RdbPredicatesV9; - - /** - * Adds a right parenthesis to the RdbPredicatesV9. - * - * @note This method is similar to ) of the SQL statement and needs to be used together - * with beginWrap(). - * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} with the right parenthesis. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - endWrap(): RdbPredicatesV9; - - /** - * Adds an or condition to the RdbPredicatesV9. - * - * @note This method is similar to or of the SQL statement. - * @return Returns the {@link RdbPredicatesV9} with the or condition. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - or(): RdbPredicatesV9; - - /** - * Adds an and condition to the RdbPredicatesV9. - * - * @note This method is similar to or of the SQL statement. - * @return Returns the {@link RdbPredicatesV9} with the or condition. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - and(): RdbPredicatesV9; - - /** - * Configures the RdbPredicatesV9 to match the field whose data type is string and value - * contains a specified value. - * - * @note This method is similar to contains of the SQL statement. - * @param {string} field - Indicates the column name in the database table. - * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. - * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - contains(field: string, value: string): RdbPredicatesV9; - - /** - * Configures the RdbPredicatesV9 to match the field whose data type is string and value starts - * with a specified string. - * - * @note This method is similar to value% of the SQL statement. - * @param {string} field - Indicates the column name in the database table. - * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. - * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - beginsWith(field: string, value: string): RdbPredicatesV9; - - /** - * Configures the RdbPredicatesV9 to match the field whose data type is string and value - * ends with a specified string. - * - * @note This method is similar to %value of the SQL statement. - * @param {string} field - Indicates the column name in the database table. - * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. - * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - endsWith(field: string, value: string): RdbPredicatesV9; - - /** - * Configures the RdbPredicatesV9 to match the fields whose value is null. - * - * @note This method is similar to is null of the SQL statement. - * @param {string} field - Indicates the column name in the database table. - * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - isNull(field: string): RdbPredicatesV9; - - /** - * Configures the RdbPredicatesV9 to match the specified fields whose value is not null. - * - * @note This method is similar to is not null of the SQL statement. - * @param {string} field - Indicates the column name in the database table. - * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - isNotNull(field: string): RdbPredicatesV9; - - /** - * Configures the RdbPredicatesV9 to match the fields whose data type is string and value is - * similar to a specified string. - * - * @note This method is similar to like of the SQL statement. - * @param {string} field - Indicates the column name in the database table. - * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. - * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} that match the specified field. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - like(field: string, value: string): RdbPredicatesV9; - - /** - * Configures RdbPredicatesV9 to match the specified field whose data type is string and the value contains - * a wildcard. - * - * @note Different from like, the input parameters of this method are case-sensitive. - * @param {string} field - Indicates the column name in the database table. - * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. - * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - glob(field: string, value: string): RdbPredicatesV9; - - /** - * Configures RdbPredicatesV9 to match the specified field whose data type is string and the value contains - * a wildcard. - * - * @param {string} field - Indicates the column name. - * @param {ValueType} low - Indicates the minimum value. - * @param {ValueType} high - Indicates the maximum value. - * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - between(field: string, low: ValueType, high: ValueType): RdbPredicatesV9; - - /** - * Configures RdbPredicatesV9 to match the specified field whose data type is int and value is - * out of a given range. - * - * @param {string} field - Indicates the column name in the database table. - * @param {ValueType} low - Indicates the minimum value. - * @param {ValueType} high - Indicates the maximum value to. - * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - notBetween(field: string, low: ValueType, high: ValueType): RdbPredicatesV9; - - /** - * Restricts the value of the field to be greater than the specified value. - * - * @param {string} field - Indicates the column name in the database table. - * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. - * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - greaterThan(field: string, value: ValueType): RdbPredicatesV9; - - - /** - * Restricts the value of the field to be smaller than the specified value. - * - * @param {string} field - Indicates the column name in the database table. - * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. - * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - lessThan(field: string, value: ValueType): RdbPredicatesV9; - - /** - * Restricts the value of the field to be greater than or equal to the specified value. - * - * @param {string} field - Indicates the column name in the database table. - * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. - * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - greaterThanOrEqualTo(field: string, value: ValueType): RdbPredicatesV9; - - /** - * Restricts the value of the field to be smaller than or equal to the specified value. - * - * @param {string} field - Indicates the column name in the database table. - * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. - * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - lessThanOrEqualTo(field: string, value: ValueType): RdbPredicatesV9; - - /** - * Restricts the ascending order of the return list. When there are several orders, - * the one close to the head has the highest priority. - * - * @param {string} field - Indicates the column name for sorting the return list. - * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - orderByAsc(field: string): RdbPredicatesV9; - - /** - * Restricts the descending order of the return list. When there are several orders, - * the one close to the head has the highest priority. - * - * @param {string} field - Indicates the column name for sorting the return list. - * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - orderByDesc(field: string): RdbPredicatesV9; - - /** - * Restricts each row of the query result to be unique. - * - * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - distinct(): RdbPredicatesV9; - - /** - * Restricts the max number of return records. - * - * @param {number} value - Indicates the max length of the return list. - * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - limitAs(value: number): RdbPredicatesV9; - - /** - * Configures RdbPredicatesV9 to specify the start position of the returned result. - * - * @note Use this method together with limit(int). - * @param {number} rowOffset - Indicates the start position of the returned result. The value is a positive integer. - * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - offsetAs(rowOffset: number): RdbPredicatesV9; - - /** - * Configures RdbPredicatesV9 to group query results by specified columns. - * - * @param {Array} fields - Indicates the specified columns by which query results are grouped. - * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - groupBy(fields: Array): RdbPredicatesV9; - - /** - * Configures RdbPredicatesV9 to specify the index column. - * - * @note Before using this method, you need to create an index column. - * @param {string} field - Indicates the name of the index column. - * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - indexedBy(field: string): RdbPredicatesV9; - - /** - * Configures RdbPredicatesV9 to match the specified field whose data type is ValueType array and values - * are within a given range. - * - * @param {string} field - Indicates the column name in the database table. - * @param {Array} value - Indicates the values to match with {@link RdbPredicatesV9}. - * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - in(field: string, value: Array): RdbPredicatesV9; - - /** - * Configures RdbPredicatesV9 to match the specified field whose data type is ValueType array and values - * are out of a given range. - * - * @param {string} field - Indicates the column name in the database table. - * @param {Array} value - Indicates the values to match with {@link RdbPredicatesV9}. - * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. - * @throws {BusinessError} 401 - if the parameter type is incorrect. - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - notIn(field: string, value: Array): RdbPredicatesV9; - } + name: string; + + /** + * Specifies whether the database is encrypted. + * + * @import import data_rdb from '@ohos.data.rdb'; + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + securityLevel: SecurityLevel; + + /** + * Specifies whether the database is encrypted. + * + * @import import data_rdb from '@ohos.data.rdb'; + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + encrypt ?: boolean; +} + +/** + * Manages relational database configurations. + * + * @import import data_rdb from '@ohos.data.rdb'; + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ +class RdbPredicates { + /** + * A parameterized constructor used to create an RdbPredicates instance. + * + * @param {string} name - Indicates the table name of the database. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + constructor(name: string) + + /** + * Sync data between devices. + * + * @note When query database, this function should not be called. + * @param {Array} devices - Indicates specified remote devices. + * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ + inDevices(devices: Array): RdbPredicates; + + /** + * Specify all remote devices which connect to local device when syncing distributed database. + * + * @note When query database, this function should not be called. + * @returns {RdbPredicates} - the {@link RdbPredicates} self. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 8 + * @deprecated since 9 + */ + inAllDevices(): RdbPredicates; + + /** + * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is equal + * to a specified value. + * + * @note This method is similar to = of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. + * @returns {RdbPredicates} - the {@link RdbPredicates} self. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + equalTo(field: string, value: ValueType): RdbPredicates; + + /** + * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is unequal to + * a specified value. + * + * @note This method is similar to != of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. + * @returns {RdbPredicates} - the {@link RdbPredicates} self. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + notEqualTo(field: string, value: ValueType): RdbPredicates; + + /** + * Adds a left parenthesis to the RdbPredicates. + * + * @note This method is similar to ( of the SQL statement and needs to be used together with endWrap(). + * @returns {RdbPredicates} - the {@link RdbPredicates} with the left parenthesis. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + beginWrap(): RdbPredicates; + + /** + * Adds a right parenthesis to the RdbPredicates. + * + * @note This method is similar to ) of the SQL statement and needs to be used together + * with beginWrap(). + * @returns {RdbPredicates} - the {@link RdbPredicates} with the right parenthesis. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + endWrap(): RdbPredicates; + + /** + * Adds an or condition to the RdbPredicates. + * + * @note This method is similar to or of the SQL statement. + * @return Returns the {@link RdbPredicates} with the or condition. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + or (): RdbPredicates; + + /** + * Adds an and condition to the RdbPredicates. + * + * @note This method is similar to or of the SQL statement. + * @return Returns the {@link RdbPredicates} with the or condition. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + and(): RdbPredicates; + + /** + * Configures the RdbPredicates to match the field whose data type is string and value + * contains a specified value. + * + * @note This method is similar to contains of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. + * @returns {RdbPredicates} - the {@link RdbPredicates} self. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + contains(field: string, value: string): RdbPredicates; + + /** + * Configures the RdbPredicates to match the field whose data type is string and value starts + * with a specified string. + * + * @note This method is similar to value% of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. + * @returns {RdbPredicates} - the {@link RdbPredicates} self. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + beginsWith(field: string, value: string): RdbPredicates; + + /** + * Configures the RdbPredicates to match the field whose data type is string and value + * ends with a specified string. + * + * @note This method is similar to %value of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. + * @returns {RdbPredicates} - the {@link RdbPredicates} self. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + endsWith(field: string, value: string): RdbPredicates; + + /** + * Configures the RdbPredicates to match the fields whose value is null. + * + * @note This method is similar to is null of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @returns {RdbPredicates} - the {@link RdbPredicates} self. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + isNull(field: string): RdbPredicates; + + /** + * Configures the RdbPredicates to match the specified fields whose value is not null. + * + * @note This method is similar to is not null of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @returns {RdbPredicates} - the {@link RdbPredicates} self. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + isNotNull(field: string): RdbPredicates; + + /** + * Configures the RdbPredicates to match the fields whose data type is string and value is + * similar to a specified string. + * + * @note This method is similar to like of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. + * @returns {RdbPredicates} - the {@link RdbPredicates} that match the specified field. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + like(field: string, value: string): RdbPredicates; + + /** + * Configures RdbPredicates to match the specified field whose data type is string and the value contains + * a wildcard. + * + * @note Different from like, the input parameters of this method are case-sensitive. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. + * @returns {RdbPredicates} - the SQL statement with the specified {@link RdbPredicates}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + glob(field: string, value: string): RdbPredicates; + + /** + * Configures RdbPredicates to match the specified field whose data type is string and the value contains + * a wildcard. + * + * @param {string} field - Indicates the column name. + * @param {ValueType} low - Indicates the minimum value. + * @param {ValueType} high - Indicates the maximum value. + * @returns {RdbPredicates} - the SQL statement with the specified {@link RdbPredicates}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + between(field: string, low: ValueType, high: ValueType): RdbPredicates; + + /** + * Configures RdbPredicates to match the specified field whose data type is int and value is + * out of a given range. + * + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} low - Indicates the minimum value. + * @param {ValueType} high - Indicates the maximum value to. + * @returns {RdbPredicates} - the SQL statement with the specified {@link RdbPredicates}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + notBetween(field: string, low: ValueType, high: ValueType): RdbPredicates; + + /** + * Restricts the value of the field to be greater than the specified value. + * + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. + * @returns {RdbPredicates} - the SQL query statement with the specified {@link RdbPredicates}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + greaterThan(field: string, value: ValueType): RdbPredicates; + + /** + * Restricts the value of the field to be smaller than the specified value. + * + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. + * @returns {RdbPredicates} - the SQL query statement with the specified {@link RdbPredicates}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + lessThan(field: string, value: ValueType): RdbPredicates; + + /** + * Restricts the value of the field to be greater than or equal to the specified value. + * + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. + * @returns {RdbPredicates} - the SQL query statement with the specified {@link RdbPredicates}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + greaterThanOrEqualTo(field: string, value: ValueType): RdbPredicates; + + /** + * Restricts the value of the field to be smaller than or equal to the specified value. + * + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. + * @returns {RdbPredicates} - the SQL query statement with the specified {@link RdbPredicates}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + lessThanOrEqualTo(field: string, value: ValueType): RdbPredicates; + + /** + * Restricts the ascending order of the return list. When there are several orders, + * the one close to the head has the highest priority. + * + * @param {string} field - Indicates the column name for sorting the return list. + * @returns {RdbPredicates} - the SQL query statement with the specified {@link RdbPredicates}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + orderByAsc(field: string): RdbPredicates; + + /** + * Restricts the descending order of the return list. When there are several orders, + * the one close to the head has the highest priority. + * + * @param {string} field - Indicates the column name for sorting the return list. + * @returns {RdbPredicates} - the SQL query statement with the specified {@link RdbPredicates}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + orderByDesc(field: string): RdbPredicates; + + /** + * Restricts each row of the query result to be unique. + * + * @returns {RdbPredicates} - the SQL query statement with the specified {@link RdbPredicates}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + distinct(): RdbPredicates; + + /** + * Restricts the max number of return records. + * + * @param {number} value - Indicates the max length of the return list. + * @returns {RdbPredicates} - the SQL query statement with the specified {@link RdbPredicates}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + limitAs(value: number): RdbPredicates; + + /** + * Configures RdbPredicatesV9 to specify the start position of the returned result. + * + * @note Use this method together with limit(int). + * @param {number} rowOffset - Indicates the start position of the returned result. The value is a positive integer. + * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + offsetAs(rowOffset: number): RdbPredicates; + + /** + * Configures RdbPredicatesV9 to group query results by specified columns. + * + * @param {Array} fields - Indicates the specified columns by which query results are grouped. + * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + groupBy(fields: Array): RdbPredicates; + + /** + * Configures RdbPredicatesV9 to specify the index column. + * + * @note Before using this method, you need to create an index column. + * @param {string} field - Indicates the name of the index column. + * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + indexedBy(field: string): RdbPredicates; + + /** + * Configures RdbPredicatesV9 to match the specified field whose data type is ValueType array and values + * are within a given range. + * + * @param {string} field - Indicates the column name in the database table. + * @param {Array} value - Indicates the values to match with {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + in(field: string, value: Array): RdbPredicates; + + /** + * Configures RdbPredicatesV9 to match the specified field whose data type is ValueType array and values + * are out of a given range. + * + * @param {string} field - Indicates the column name in the database table. + * @param {Array} value - Indicates the values to match with {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 7 + * @deprecated since 9 + */ + notIn(field: string, value: Array): RdbPredicates; +} + +/** + * Manages relational database configurations. + * + * @import import data_rdb from '@ohos.data.rdb'; + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ +class RdbPredicatesV9 { + /** + * A parameterized constructor used to create an RdbPredicates instance. + * + * @param {string} name - Indicates the table name of the database. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + constructor(name: string) + + /** + * Sync data between devices. + * + * @note When query database, this function should not be called. + * @param {Array} devices - Indicates specified remote devices. + * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + inDevices(devices: Array): RdbPredicatesV9; + + /** + * Specify all remote devices which connect to local device when syncing distributed database. + * + * @note When query database, this function should not be called. + * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + inAllDevices(): RdbPredicatesV9; + + /** + * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is equal + * to a specified value. + * + * @note This method is similar to = of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + equalTo(field: string, value: ValueType): RdbPredicatesV9; + + /** + * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is unequal to + * a specified value. + * + * @note This method is similar to != of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + notEqualTo(field: string, value: ValueType): RdbPredicatesV9; + + /** + * Adds a left parenthesis to the RdbPredicatesV9. + * + * @note This method is similar to ( of the SQL statement and needs to be used together with endWrap(). + * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} with the left parenthesis. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + beginWrap(): RdbPredicatesV9; + + /** + * Adds a right parenthesis to the RdbPredicatesV9. + * + * @note This method is similar to ) of the SQL statement and needs to be used together + * with beginWrap(). + * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} with the right parenthesis. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + endWrap(): RdbPredicatesV9; + + /** + * Adds an or condition to the RdbPredicatesV9. + * + * @note This method is similar to or of the SQL statement. + * @return Returns the {@link RdbPredicatesV9} with the or condition. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + or (): RdbPredicatesV9; + + /** + * Adds an and condition to the RdbPredicatesV9. + * + * @note This method is similar to or of the SQL statement. + * @return Returns the {@link RdbPredicatesV9} with the or condition. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + and(): RdbPredicatesV9; + + /** + * Configures the RdbPredicatesV9 to match the field whose data type is string and value + * contains a specified value. + * + * @note This method is similar to contains of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + contains(field: string, value: string): RdbPredicatesV9; + + /** + * Configures the RdbPredicatesV9 to match the field whose data type is string and value starts + * with a specified string. + * + * @note This method is similar to value% of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + beginsWith(field: string, value: string): RdbPredicatesV9; + + /** + * Configures the RdbPredicatesV9 to match the field whose data type is string and value + * ends with a specified string. + * + * @note This method is similar to %value of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + endsWith(field: string, value: string): RdbPredicatesV9; + + /** + * Configures the RdbPredicatesV9 to match the fields whose value is null. + * + * @note This method is similar to is null of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + isNull(field: string): RdbPredicatesV9; + + /** + * Configures the RdbPredicatesV9 to match the specified fields whose value is not null. + * + * @note This method is similar to is not null of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + isNotNull(field: string): RdbPredicatesV9; + + /** + * Configures the RdbPredicatesV9 to match the fields whose data type is string and value is + * similar to a specified string. + * + * @note This method is similar to like of the SQL statement. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} that match the specified field. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + like(field: string, value: string): RdbPredicatesV9; + + /** + * Configures RdbPredicatesV9 to match the specified field whose data type is string and the value contains + * a wildcard. + * + * @note Different from like, the input parameters of this method are case-sensitive. + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + glob(field: string, value: string): RdbPredicatesV9; + + /** + * Configures RdbPredicatesV9 to match the specified field whose data type is string and the value contains + * a wildcard. + * + * @param {string} field - Indicates the column name. + * @param {ValueType} low - Indicates the minimum value. + * @param {ValueType} high - Indicates the maximum value. + * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + between(field: string, low: ValueType, high: ValueType): RdbPredicatesV9; + + /** + * Configures RdbPredicatesV9 to match the specified field whose data type is int and value is + * out of a given range. + * + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} low - Indicates the minimum value. + * @param {ValueType} high - Indicates the maximum value to. + * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + notBetween(field: string, low: ValueType, high: ValueType): RdbPredicatesV9; + + /** + * Restricts the value of the field to be greater than the specified value. + * + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + greaterThan(field: string, value: ValueType): RdbPredicatesV9; + + /** + * Restricts the value of the field to be smaller than the specified value. + * + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + lessThan(field: string, value: ValueType): RdbPredicatesV9; + + /** + * Restricts the value of the field to be greater than or equal to the specified value. + * + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + greaterThanOrEqualTo(field: string, value: ValueType): RdbPredicatesV9; + + /** + * Restricts the value of the field to be smaller than or equal to the specified value. + * + * @param {string} field - Indicates the column name in the database table. + * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + lessThanOrEqualTo(field: string, value: ValueType): RdbPredicatesV9; + + /** + * Restricts the ascending order of the return list. When there are several orders, + * the one close to the head has the highest priority. + * + * @param {string} field - Indicates the column name for sorting the return list. + * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + orderByAsc(field: string): RdbPredicatesV9; + + /** + * Restricts the descending order of the return list. When there are several orders, + * the one close to the head has the highest priority. + * + * @param {string} field - Indicates the column name for sorting the return list. + * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + orderByDesc(field: string): RdbPredicatesV9; + + /** + * Restricts each row of the query result to be unique. + * + * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + distinct(): RdbPredicatesV9; + + /** + * Restricts the max number of return records. + * + * @param {number} value - Indicates the max length of the return list. + * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + limitAs(value: number): RdbPredicatesV9; + + /** + * Configures RdbPredicatesV9 to specify the start position of the returned result. + * + * @note Use this method together with limit(int). + * @param {number} rowOffset - Indicates the start position of the returned result. The value is a positive integer. + * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + offsetAs(rowOffset: number): RdbPredicatesV9; + + /** + * Configures RdbPredicatesV9 to group query results by specified columns. + * + * @param {Array} fields - Indicates the specified columns by which query results are grouped. + * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + groupBy(fields: Array): RdbPredicatesV9; + + /** + * Configures RdbPredicatesV9 to specify the index column. + * + * @note Before using this method, you need to create an index column. + * @param {string} field - Indicates the name of the index column. + * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + indexedBy(field: string): RdbPredicatesV9; + + /** + * Configures RdbPredicatesV9 to match the specified field whose data type is ValueType array and values + * are within a given range. + * + * @param {string} field - Indicates the column name in the database table. + * @param {Array} value - Indicates the values to match with {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + in(field: string, value: Array): RdbPredicatesV9; + + /** + * Configures RdbPredicatesV9 to match the specified field whose data type is ValueType array and values + * are out of a given range. + * + * @param {string} field - Indicates the column name in the database table. + * @param {Array} value - Indicates the values to match with {@link RdbPredicatesV9}. + * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. + * @throws {BusinessError} 401 - if the parameter type is incorrect. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + notIn(field: string, value: Array): RdbPredicatesV9; +} - export type ResultSet = _ResultSet - export type ResultSetV9 = _ResultSetV9 +export type ResultSet = _ResultSet; +export type ResultSetV9 = _ResultSetV9; } export default rdb; -- Gitee From beacda4f9508c27eaf89755e3aa85e8108726344 Mon Sep 17 00:00:00 2001 From: "yanxiaotao@huawei.com" Date: Wed, 26 Oct 2022 11:42:52 +0800 Subject: [PATCH 252/438] add error code for wifi 1026 Signed-off-by: yanxiaotao@huawei.com --- api/@ohos.wifiManager.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.wifiManager.d.ts b/api/@ohos.wifiManager.d.ts index ef56dd605c..44160bc3e1 100644 --- a/api/@ohos.wifiManager.d.ts +++ b/api/@ohos.wifiManager.d.ts @@ -1796,8 +1796,8 @@ declare namespace wifiManager { /** Device status */ deviceStatus: P2pDeviceStatus; - /** Device group capability */ - groupCapability: number; + /** Device group capabilities */ + groupCapabilities: number; } /** -- Gitee From 7684ebb76fcdd7ee63fde8e3ccf1e4e5231f32a0 Mon Sep 17 00:00:00 2001 From: m00512953 Date: Wed, 26 Oct 2022 14:57:23 +0800 Subject: [PATCH 253/438] mingxihua@huawei.com.cn Signed-off-by: m00512953 --- api/@ohos.application.context.d.ts | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/api/@ohos.application.context.d.ts b/api/@ohos.application.context.d.ts index d9fc6b0c6b..da1ee4f905 100755 --- a/api/@ohos.application.context.d.ts +++ b/api/@ohos.application.context.d.ts @@ -99,24 +99,6 @@ declare namespace context { */ 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. * -- Gitee From 39be89b82349a585f2cde5858242e47978ee50de Mon Sep 17 00:00:00 2001 From: wangtao Date: Tue, 25 Oct 2022 19:19:59 +0800 Subject: [PATCH 254/438] audio SDK Signed-off-by: wangtao --- api/@ohos.multimedia.audio.d.ts | 726 +++++++++++++++++++++++++------- 1 file changed, 566 insertions(+), 160 deletions(-) diff --git a/api/@ohos.multimedia.audio.d.ts b/api/@ohos.multimedia.audio.d.ts index 0a92de745b..d273507577 100644 --- a/api/@ohos.multimedia.audio.d.ts +++ b/api/@ohos.multimedia.audio.d.ts @@ -22,12 +22,77 @@ import {ErrorCallback, AsyncCallback, Callback} from './basic'; */ declare namespace audio { /** - * Define local device network id for audio - * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Device - * @systemapi - */ + * Enumerates audio errors. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Core + */ + enum AudioErrors { + /** + * Invalid parameter. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Core + */ + ERROR_INVALID_PARAM = 6800101, + /** + * Allocate memory failed. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Core + */ + ERROR_NO_MEMORY = 6800102, + /** + * Operation not permit at current state. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Core + */ + ERROR_ILLEGAL_STATE = 6800103, + /** + * Unsupported option. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Core + */ + ERROR_UNSUPPORTED = 6800104, + /** + * Time out. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Core + */ + ERROR_TIMEOUT = 6800105, + /** + * Audio specific errors. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Core + */ + ERROR_STREAM_LIMIT = 6800201, + /** + * Default error. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Core + */ + ERROR_SYSTEM = 6800301 + } + + /** + * Define local device network id for audio + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Device + * @systemapi + */ const LOCAL_NETWORK_ID: string; + + /** + * Define default volume group id for audio + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Volume + */ + const DEFAULT_VOLUME_GROUP_ID: number; + + /** + * Define default interrupt group id for audio + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Interrupt + */ + const DEFAULT_INTERRUPT_GROUP_ID: number; + /** * Obtains an AudioManager instance. * @return AudioManager object. @@ -72,23 +137,25 @@ declare namespace audio { */ function createAudioRenderer(options: AudioRendererOptions): Promise; - /** - * Obtains a TonePlayer instance. This method uses an asynchronous callback to return the renderer instance. - * @param options Tone playing attribute. - * @return Promise used to return the tone player instance. - * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Tone - */ - function createTonePlayer(options: AudioRendererInfo, callback: AsyncCallback): void; - - /** - * Obtains a TonePlayer instance. This method uses a promise to return the renderer instance. - * @param options Tone playing attribute. - * @return Promise used to return the tone player instance. - * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Tone - */ - function createTonePlayer(options: AudioRendererInfo): Promise; + /** + * Obtains a TonePlayer instance. This method uses an asynchronous callback to return the renderer instance. + * @param options Tone playing attribute. + * @return Promise used to return the tone player instance. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + */ + function createTonePlayer(options: AudioRendererInfo, callback: AsyncCallback): void; + + /** + * Obtains a TonePlayer instance. This method uses a promise to return the renderer instance. + * @param options Tone playing attribute. + * @return Promise used to return the tone player instance. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + */ + function createTonePlayer(options: AudioRendererInfo): Promise; /** * Enumerates the audio states. @@ -325,22 +392,40 @@ declare namespace audio { * Enumerates the active device types. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.CommunicationDeviceType */ - enum ActiveDeviceType { + enum ActiveDeviceType { /** * Speaker. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @deprecated since 9 */ SPEAKER = 2, /** * Bluetooth device using the SCO link. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @deprecated since 9 */ BLUETOOTH_SCO = 7, } + /** + * Enumerates the available device types for communication. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Communication + */ + enum CommunicationDeviceType { + /** + * Speaker. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Communication + */ + SPEAKER = 2 + } + /** * Enumerates ringer modes. * @since 7 @@ -598,7 +683,7 @@ declare namespace audio { * @since 9 * @syscap SystemCapability.Multimedia.Audio.Core */ - STREAM_USAGE_VOICE_ASSISTANT = 3, + STREAM_USAGE_VOICE_ASSISTANT = 3, /** * Notification or ringtone usage. * @since 7 @@ -608,19 +693,19 @@ declare namespace audio { } /** - * Enumerates the focus type. + * Enumerates the audio interrupt request type. * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Core + * @syscap SystemCapability.Multimedia.Audio.Interrupt * @systemapi */ - enum FocusType { + enum InterruptRequestType { /** - * Recording type. + * Default type to request audio interrupt. * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Core + * @syscap SystemCapability.Multimedia.Audio.Interrupt * @systemapi */ - FOCUS_TYPE_RECORDING = 0, + INTERRUPT_REQUEST_TYPE_DEFAULT = 0, } /** @@ -681,7 +766,8 @@ declare namespace audio { rendererFlags: number; } - /** Describes audio renderer filter. + /** + * Describes audio renderer filter. * @since 9 * @syscap SystemCapability.Multimedia.Audio.Core * @systemapi @@ -733,19 +819,19 @@ declare namespace audio { /** * Enumerates the interrupt modes. * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Core + * @syscap SystemCapability.Multimedia.Audio.Interrupt */ enum InterruptMode { /** * Mode that different stream share one interrupt unit. * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Core + * @syscap SystemCapability.Multimedia.Audio.Interrupt */ SHARE_MODE = 0, /** * Mode that each stream has independent interrupt unit. * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Core + * @syscap SystemCapability.Multimedia.Audio.Interrupt */ INDEPENDENT_MODE = 1 } @@ -897,6 +983,7 @@ declare namespace audio { * Enumerates interrupt action types. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @deprecated since 9 */ enum InterruptActionType { @@ -904,6 +991,7 @@ declare namespace audio { * Focus gain event. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @deprecated since 9 */ TYPE_ACTIVATED = 0, @@ -911,6 +999,7 @@ declare namespace audio { * Audio interruption event. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @deprecated since 9 */ TYPE_INTERRUPT = 1 } @@ -984,6 +1073,8 @@ declare namespace audio { * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#setVolume */ setVolume(volumeType: AudioVolumeType, volume: number, callback: AsyncCallback): void; /** @@ -994,6 +1085,8 @@ declare namespace audio { * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#setVolume */ setVolume(volumeType: AudioVolumeType, volume: number): Promise; /** @@ -1002,6 +1095,8 @@ declare namespace audio { * @param callback Callback used to return the volume. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#getVolume */ getVolume(volumeType: AudioVolumeType, callback: AsyncCallback): void; /** @@ -1010,6 +1105,8 @@ declare namespace audio { * @return Promise used to return the volume. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#getVolume */ getVolume(volumeType: AudioVolumeType): Promise; /** @@ -1018,6 +1115,8 @@ declare namespace audio { * @param callback Callback used to return the minimum volume. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#getMinVolume */ getMinVolume(volumeType: AudioVolumeType, callback: AsyncCallback): void; /** @@ -1026,6 +1125,8 @@ declare namespace audio { * @return Promise used to return the minimum volume. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#getMinVolume */ getMinVolume(volumeType: AudioVolumeType): Promise; /** @@ -1034,6 +1135,8 @@ declare namespace audio { * @param callback Callback used to return the maximum volume. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#getMaxVolume */ getMaxVolume(volumeType: AudioVolumeType, callback: AsyncCallback): void; /** @@ -1042,6 +1145,8 @@ declare namespace audio { * @return Promise used to return the maximum volume. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#getMaxVolume */ getMaxVolume(volumeType: AudioVolumeType): Promise; /** @@ -1050,6 +1155,8 @@ declare namespace audio { * @param callback Callback used to return the device list. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioRoutingManager#getDevices */ getDevices(deviceFlag: DeviceFlag, callback: AsyncCallback): void; /** @@ -1058,42 +1165,10 @@ declare namespace audio { * @return Promise used to return the device list. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioRoutingManager#getDevices */ getDevices(deviceFlag: DeviceFlag): Promise; - /** - * Get the volume group list for a networkId. This method uses an asynchronous callback to return the result. - * @param networkId Device network id - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Volume - * @systemapi - */ - getVolumeGroups(networkId: string, callback: AsyncCallback): void; - /** - * Get the volume group list for a networkId. This method uses a promise to return the result. - * @param networkId Device network id - * @return Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Volume - * @systemapi - */ - getVolumeGroups(networkId: string): Promise; - /** - * Obtains an AudioGroupManager instance. This method uses an asynchronous callback to return the result. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Volume - * @systemapi - */ - getGroupManager(groupId: number, callback: AsyncCallback): void; - /** - * Obtains an AudioGroupManager instance. This method uses a promise to return the result. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Volume - * @systemapi - */ - getGroupManager(groupId: number): Promise; /** * Mutes a stream. This method uses an asynchronous callback to return the result. * @param volumeType Audio stream type. @@ -1101,6 +1176,8 @@ declare namespace audio { * @param callback Callback used to return the result. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#mute */ mute(volumeType: AudioVolumeType, mute: boolean, callback: AsyncCallback): void; /** @@ -1110,6 +1187,8 @@ declare namespace audio { * @return Promise used to return the result. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#mute */ mute(volumeType: AudioVolumeType, mute: boolean): Promise; /** @@ -1119,6 +1198,8 @@ declare namespace audio { * muted, and false means the opposite. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#isMute */ isMute(volumeType: AudioVolumeType, callback: AsyncCallback): void; /** @@ -1128,6 +1209,8 @@ declare namespace audio { * and false means the opposite. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#isMute */ isMute(volumeType: AudioVolumeType): Promise; /** @@ -1137,6 +1220,8 @@ declare namespace audio { * active, and false means the opposite. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioStreamManager#isActive */ isActive(volumeType: AudioVolumeType, callback: AsyncCallback): void; /** @@ -1146,6 +1231,8 @@ declare namespace audio { * and false means the opposite. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Volume + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioStreamManager#isActive */ isActive(volumeType: AudioVolumeType): Promise; /** @@ -1155,6 +1242,8 @@ declare namespace audio { * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device * @permission ohos.permission.MICROPHONE + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#setMicrophoneMute */ setMicrophoneMute(mute: boolean, callback: AsyncCallback): void; /** @@ -1164,6 +1253,8 @@ declare namespace audio { * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device * @permission ohos.permission.MICROPHONE + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#setMicrophoneMute */ setMicrophoneMute(mute: boolean): Promise; /** @@ -1173,6 +1264,8 @@ declare namespace audio { * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device * @permission ohos.permission.MICROPHONE + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#isMicrophoneMute */ isMicrophoneMute(callback: AsyncCallback): void; /** @@ -1182,6 +1275,8 @@ declare namespace audio { * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device * @permission ohos.permission.MICROPHONE + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#isMicrophoneMute */ isMicrophoneMute(): Promise; /** @@ -1191,6 +1286,8 @@ declare namespace audio { * @since 7 * @syscap SystemCapability.Multimedia.Audio.Communication * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#setRingerMode */ setRingerMode(mode: AudioRingMode, callback: AsyncCallback): void; /** @@ -1200,6 +1297,8 @@ declare namespace audio { * @since 7 * @syscap SystemCapability.Multimedia.Audio.Communication * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#setRingerMode */ setRingerMode(mode: AudioRingMode): Promise; /** @@ -1207,6 +1306,8 @@ declare namespace audio { * @param callback Callback used to return the ringer mode. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Communication + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#getRingerMode */ getRingerMode(callback: AsyncCallback): void; /** @@ -1214,6 +1315,8 @@ declare namespace audio { * @return Promise used to return the ringer mode. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Communication + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#getRingerMode */ getRingerMode(): Promise; /** @@ -1260,6 +1363,8 @@ declare namespace audio { * @param callback Callback used to return the result. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioRoutingManager#setCommunicationDevice */ setDeviceActive(deviceType: ActiveDeviceType, active: boolean, callback: AsyncCallback): void; /** @@ -1270,6 +1375,8 @@ declare namespace audio { * @return Promise used to return the result. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioRoutingManager#setCommunicationDevice */ setDeviceActive(deviceType: ActiveDeviceType, active: boolean): Promise; /** @@ -1278,6 +1385,8 @@ declare namespace audio { * @param callback Callback used to return the active status of the device. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioRoutingManager#isCommunicationDeviceActive */ isDeviceActive(deviceType: ActiveDeviceType, callback: AsyncCallback): void; /** @@ -1286,6 +1395,8 @@ declare namespace audio { * @return Promise used to return the active status of the device. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioRoutingManager#isCommunicationDeviceActive */ isDeviceActive(deviceType: ActiveDeviceType): Promise; /** @@ -1294,6 +1405,8 @@ declare namespace audio { * @since 8 * @syscap SystemCapability.Multimedia.Audio.Volume * @systemapi + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioVolumeManager#event:volumeChange */ on(type: 'volumeChange', callback: Callback): void; /** @@ -1302,6 +1415,8 @@ declare namespace audio { * @since 8 * @syscap SystemCapability.Multimedia.Audio.Communication * @systemapi + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioVolumeGroupManager#event:ringerModeChange */ on(type: 'ringerModeChange', callback: Callback): void; /** @@ -1343,6 +1458,8 @@ declare namespace audio { * @param callback Callback used to obtain the device update details. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioRoutingManager#event:deviceChange */ on(type: 'deviceChange', callback: Callback): void; @@ -1351,6 +1468,8 @@ declare namespace audio { * @param callback Callback used to obtain the device update details. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.AudioRoutingManager#event:deviceChange */ off(type: 'deviceChange', callback?: Callback): void; @@ -1376,97 +1495,74 @@ declare namespace audio { off(type: 'interrupt', interrupt: AudioInterrupt, callback?: Callback): void; /** - * Request independent interrupt event. - * @param focusType The focus type. - * @param callback Callback used to return the result. + * Obtains an AudioVolumeManager instance. + * @return AudioVolumeManager instance. * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Renderer - * @systemapi + * @syscap SystemCapability.Multimedia.Audio.Volume */ - requestIndependentInterrupt(focusType: FocusType, callback: AsyncCallback): void; + getVolumeManager(): AudioVolumeManager; /** - * Request independent interrupt event. - * @param focusType The focus type. - * @return Promise used to return the result. + * Obtains an AudioStreamManager instance. This method uses an asynchronous callback to return the result. + * @return AudioStreamManager instance. * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Renderer - * @systemapi + * @syscap SystemCapability.Multimedia.Audio.Core */ - requestIndependentInterrupt(focusType: FocusType): Promise; + getStreamManager(): AudioStreamManager; /** - * Abandon the requested independent interrupt event. - * @param focusType The focus type. - * @param callback Callback used to return the result. + * Obtains an AudioRoutingManager instance. + * @return AudioRoutingManager instance. * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Renderer - * @systemapi + * @syscap SystemCapability.Multimedia.Audio.Device */ - abandonIndependentInterrupt(focusType: FocusType, callback: AsyncCallback): void; + getRoutingManager(): AudioRoutingManager; + } + /** + * Enumerates audio interrupt request result type. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Interrupt + * @systemapi + */ + enum InterruptRequestResultType { /** - * Abandon the requested independent interrupt event. - * @param focusType The focus type. - * @return Promise used to return the result. + * Request audio interrupt success * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Renderer + * @syscap SystemCapability.Multimedia.Audio.Interrupt * @systemapi */ - abandonIndependentInterrupt(focusType: FocusType): Promise; - + INTERRUPT_REQUEST_GRANT = 0, /** - * Listens for independent interruption events. When the audio of an application is interrupted by another application, - * the callback is invoked to notify the former application. - * @param type Type of the event to listen for. Only the independentInterrupt event is supported. - * @param callback Callback invoked for the independent interruption event. + * Request audio interrupt fail, may have higher priority type * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Renderer + * @syscap SystemCapability.Multimedia.Audio.Interrupt * @systemapi */ - on(type: 'independentInterrupt', callback: Callback): void; + INTERRUPT_REQUEST_REJECT = 1 + } + /** + * Describes audio interrupt operation results. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Interrupt + * @systemapi + */ + interface InterruptResult { /** - * Cancels the listening of independent interruption events. - * @param type Type of the event to listen for. Only the independentInterrupt event is supported. - * @param callback Callback invoked for the independent interruption event. + * Interrupt request or abandon result. * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Renderer + * @syscap SystemCapability.Multimedia.Audio.Interrupt * @systemapi */ - off(type: 'independentInterrupt', callback?: Callback): void; - - /** - * Obtains an AudioStreamManager instance. This method uses an asynchronous callback to return the result. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Core - */ - getStreamManager(callback: AsyncCallback): void; - - /** - * Obtains an AudioStreamManager instance. This method uses a promise to return the result. - * @return Promise used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Core - */ - getStreamManager(): Promise; - + requestResult: InterruptRequestResultType; /** - * Obtains an AudioRoutingManager instance. This method uses an asynchronous callback to return the result. - * @param callback Callback used to return the result. + * Interrupt node as a unit to receive interrupt change event. * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Device - */ - getRoutingManager(callback: AsyncCallback): void; - - /** - * Obtains an AudioRoutingManager instance. This method uses a promise to return the result. - * @param callback Callback used to return the result. - * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Device + * @syscap SystemCapability.Multimedia.Audio.Interrupt + * @systemapi */ - getRoutingManager(): Promise; + interruptNode: number; } /** @@ -1491,22 +1587,67 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Device */ getDevices(deviceFlag: DeviceFlag): Promise; + /** * Subscribes to device change events. When a device is connected/disconnected, registered clients will receive * the callback. * @param deviceFlag Audio device flag. * @param callback Callback used to obtain the device update details. + * @throws { BusinessError } 401 - if input parameter type or number mismatch + * @throws { BusinessError } 6800101 - if input parameter value error * @since 9 * @syscap SystemCapability.Multimedia.Audio.Device */ on(type: 'deviceChange', deviceFlag: DeviceFlag, callback: Callback): void; + /** * UnSubscribes to device change events. * @param callback Callback used to obtain the device update details. + * @throws { BusinessError } 401 - if input parameter type or number mismatch + * @throws { BusinessError } 6800101 - if input parameter value error * @since 9 * @syscap SystemCapability.Multimedia.Audio.Device */ off(type: 'deviceChange', callback?: Callback): void; + + /** + * Sets a device to the active state. This method uses an asynchronous callback to return the result. + * @param deviceType Audio device type. + * @param active Active status to set. The value true means to set the device to the active status, and false + * means the opposite. + * @param callback Callback used to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Communication + */ + setCommunicationDevice(deviceType: CommunicationDeviceType, active: boolean, callback: AsyncCallback): void; + /** + * Sets a device to the active state. This method uses a promise to return the result. + * @param deviceType Audio device type. + * @param active Active status to set. The value true means to set the device to the active status, and false + * means the opposite. + * @return Promise used to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Communication + */ + setCommunicationDevice(deviceType: CommunicationDeviceType, active: boolean): Promise; + + /** + * Checks whether a device is active. This method uses an asynchronous callback to return the query result. + * @param deviceType Audio device type. + * @param callback Callback used to return the active status of the device. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Communication + */ + isCommunicationDeviceActive(deviceType: CommunicationDeviceType, callback: AsyncCallback): void; + /** + * Checks whether a device is active. This method uses a promise to return the query result. + * @param deviceType Audio device type. + * @return Promise used to return the active status of the device. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Communication + */ + isCommunicationDeviceActive(deviceType: CommunicationDeviceType): Promise; + /** * Select the output device. This method uses an asynchronous callback to return the result. * @param outputAudioDevices Audio device description @@ -1525,6 +1666,7 @@ declare namespace audio { * @systemapi */ selectOutputDevice(outputAudioDevices: AudioDeviceDescriptors): Promise; + /** * Select the output device with desired AudioRenderer. This method uses an asynchronous callback to return the result. * @param filter Filter for AudioRenderer. @@ -1545,6 +1687,7 @@ declare namespace audio { * @systemapi */ selectOutputDeviceByFilter(filter: AudioRendererFilter, outputAudioDevices: AudioDeviceDescriptors): Promise; + /** * Select the input device. This method uses an asynchronous callback to return the result. * @param inputAudioDevices Audio device description @@ -1563,13 +1706,6 @@ declare namespace audio { * @systemapi */ selectInputDevice(inputAudioDevices: AudioDeviceDescriptors): Promise; - /** - * Listens for system microphone state change events. This method uses a callback to get microphone change events. - * @param callback Callback used to get the system microphone state change event. - * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Device - */ - on(type: 'micStateChange', callback: Callback): void; } /** @@ -1585,7 +1721,6 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Renderer */ getCurrentAudioRendererInfoArray(callback: AsyncCallback): void; - /** * Get information of current existing audio renderers. * @return Promise used to return the information of current existing audio renderers. @@ -1601,7 +1736,6 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Renderer */ getCurrentAudioCapturerInfoArray(callback: AsyncCallback): void; - /** * Get information of current existing audio capturers. * @return Promise used to return the information of current existing audio capturers. @@ -1615,6 +1749,8 @@ declare namespace audio { * registered clients will receive the callback. * @param type Type of the event to listen for. Only the audioRendererChange event is supported. * @param callback Callback invoked for the audio renderer change event. + * @throws { BusinessError } 401 - if input parameter type or number mismatch + * @throws { BusinessError } 6800101 - if input parameter value error * @since 9 * @syscap SystemCapability.Multimedia.Audio.Renderer */ @@ -1622,16 +1758,20 @@ declare namespace audio { /** * UnSubscribes to audio renderer change events. + * @throws { BusinessError } 401 - if input parameter type or number mismatch + * @throws { BusinessError } 6800101 - if input parameter value error * @since 9 * @syscap SystemCapability.Multimedia.Audio.Renderer */ - off(type: "audioRendererChange"); + off(type: "audioRendererChange"): void; /** * Listens for audio capturer change events. When there is any audio capturer change, * registered clients will receive the callback. * @param type Type of the event to listen for. Only the audioCapturerChange event is supported. * @param callback Callback invoked for the audio capturer change event. + * @throws { BusinessError } 401 - if input parameter type or number mismatch + * @throws { BusinessError } 6800101 - if input parameter value error * @since 9 * @syscap SystemCapability.Multimedia.Audio.Capturer */ @@ -1639,19 +1779,92 @@ declare namespace audio { /** * UnSubscribes to audio capturer change events. + * @throws { BusinessError } 401 - if input parameter type or number mismatch + * @throws { BusinessError } 6800101 - if input parameter value error * @since 9 * @syscap SystemCapability.Multimedia.Audio.Capturer */ - off(type: "audioCapturerChange"); + off(type: "audioCapturerChange"): void; + + /** + * Checks whether a stream is active. This method uses an asynchronous callback to return the query result. + * @param volumeType Audio stream type. + * @param callback Callback used to return the active status of the stream. The value true means that the stream is + * active, and false means the opposite. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Renderer + */ + isActive(volumeType: AudioVolumeType, callback: AsyncCallback): void; + /** + * Checks whether a stream is active. This method uses a promise to return the query result. + * @param volumeType Audio stream type. + * @return Promise used to return the active status of the stream. The value true means that the stream is active, + * and false means the opposite. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Renderer + */ + isActive(volumeType: AudioVolumeType): Promise; + } + + /** + * Implements audio volume management. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Volume + */ + interface AudioVolumeManager { + /** + * Get the volume group list for a networkId. This method uses an asynchronous callback to return the result. + * @param networkId Distributed deice net work id + * @param callback Callback used to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Volume + * @systemapi + */ + getVolumeGroupInfos(networkId: string, callback: AsyncCallback): void; + /** + * Get the volume group list for a networkId. This method uses a promise to return the result. + * @param networkId Distributed deice net work id + * @return Promise used to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Volume + * @systemapi + */ + getVolumeGroupInfos(networkId: string): Promise; + + /** + * Obtains an AudioVolumeGroupManager instance. This method uses an asynchronous callback to return the result. + * @param groupId volume group id, use LOCAL_VOLUME_GROUP_ID in default + * @param callback Callback used to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Volume + */ + getVolumeGroupManager(groupId: number, callback: AsyncCallback): void; + /** + * Obtains an AudioVolumeGroupManager instance. This method uses a promise to return the result. + * @param groupId volume group id, use LOCAL_VOLUME_GROUP_ID in default + * @param callback Callback used to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Volume + */ + getVolumeGroupManager(groupId: number): Promise; + + /** + * Listens for system volume change events. This method uses a callback to get volume change events. + * @param callback Callback used to get the system volume change event. + * @throws { BusinessError } 401 - if input parameter type or number mismatch + * @throws { BusinessError } 6800101 - if input parameter value error + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Volume + */ + on(type: 'volumeChange', callback: Callback): void; } /** * Implements audio volume group management. * @since 9 * @syscap SystemCapability.Multimedia.Audio.Volume - * @systemapi */ - interface AudioGroupManager { + interface AudioVolumeGroupManager { /** * Sets the volume for a stream. This method uses an asynchronous callback to return the result. * @param volumeType Audio stream type. @@ -1660,6 +1873,7 @@ declare namespace audio { * @since 9 * @syscap SystemCapability.Multimedia.Audio.Volume * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY + * @systemapi */ setVolume(volumeType: AudioVolumeType, volume: number, callback: AsyncCallback): void; /** @@ -1670,8 +1884,10 @@ declare namespace audio { * @since 9 * @syscap SystemCapability.Multimedia.Audio.Volume * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY + * @systemapi */ setVolume(volumeType: AudioVolumeType, volume: number): Promise; + /** * Obtains the volume of a stream. This method uses an asynchronous callback to return the query result. * @param volumeType Audio stream type. @@ -1681,13 +1897,14 @@ declare namespace audio { */ getVolume(volumeType: AudioVolumeType, callback: AsyncCallback): void; /** - * Obtains the volume of a stream. This method uses a promise to return the query result. - * @param volumeType Audio stream type. - * @return Promise used to return the volume. - * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Volume - */ + * Obtains the volume of a stream. This method uses a promise to return the query result. + * @param volumeType Audio stream type. + * @return Promise used to return the volume. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Volume + */ getVolume(volumeType: AudioVolumeType): Promise; + /** * Obtains the minimum volume allowed for a stream. This method uses an asynchronous callback to return the query result. * @param volumeType Audio stream type. @@ -1704,6 +1921,7 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Volume */ getMinVolume(volumeType: AudioVolumeType): Promise; + /** * Obtains the maximum volume allowed for a stream. This method uses an asynchronous callback to return the query result. * @param volumeType Audio stream type. @@ -1720,6 +1938,7 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Volume */ getMaxVolume(volumeType: AudioVolumeType): Promise; + /** * Mutes a stream. This method uses an asynchronous callback to return the result. * @param volumeType Audio stream type. @@ -1727,6 +1946,8 @@ declare namespace audio { * @param callback Callback used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Audio.Volume + * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY + * @systemapi */ mute(volumeType: AudioVolumeType, mute: boolean, callback: AsyncCallback): void; /** @@ -1736,8 +1957,11 @@ declare namespace audio { * @return Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Audio.Volume + * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY + * @systemapi */ mute(volumeType: AudioVolumeType, mute: boolean): Promise; + /** * Checks whether a stream is muted. This method uses an asynchronous callback to return the query result. * @param volumeType Audio stream type. @@ -1756,6 +1980,98 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Volume */ isMute(volumeType: AudioVolumeType): Promise; + + /** + * Sets the ringer mode. This method uses an asynchronous callback to return the result. + * @param mode Ringer mode. + * @param callback Callback used to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Volume + * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY + * @systemapi + */ + setRingerMode(mode: AudioRingMode, callback: AsyncCallback): void; + /** + * Sets the ringer mode. This method uses a promise to return the result. + * @param mode Ringer mode. + * @return Promise used to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Volume + * @permission ohos.permission.ACCESS_NOTIFICATION_POLICY + * @systemapi + */ + setRingerMode(mode: AudioRingMode): Promise; + + /** + * Obtains the ringer mode. This method uses an asynchronous callback to return the query result. + * @param callback Callback used to return the ringer mode. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Volume + */ + getRingerMode(callback: AsyncCallback): void; + /** + * Obtains the ringer mode. This method uses a promise to return the query result. + * @return Promise used to return the ringer mode. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Volume + */ + getRingerMode(): Promise; + + /** + * Listens for ringer mode change events. This method uses a callback to get ringer mode changes. + * @param callback Callback used to get the updated ringer mode. + * @throws { BusinessError } 401 - if input parameter type or number mismatch + * @throws { BusinessError } 6800101 - if input parameter value error + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Volume + */ + on(type: 'ringerModeChange', callback: Callback): void; + + /** + * Mutes or unmutes the microphone. This method uses an asynchronous callback to return the result. + * @param mute Mute status to set. The value true means to mute the microphone, and false means the opposite. + * @param callback Callback used to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Volume + * @permission ohos.permission.MANAGE_AUDIO_CONFIG + */ + setMicrophoneMute(mute: boolean, callback: AsyncCallback): void; + /** + * Mutes or unmutes the microphone. This method uses a promise to return the result. + * @param mute Mute status to set. The value true means to mute the microphone, and false means the opposite. + * @return Promise used to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Volume + * @permission ohos.permission.MANAGE_AUDIO_CONFIG + */ + setMicrophoneMute(mute: boolean): Promise; + + /** + * Checks whether the microphone is muted. This method uses an asynchronous callback to return the query result. + * @param Callback used to return the mute status of the microphone. The value true means that the microphone is + * muted, and false means the opposite. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Volume + */ + isMicrophoneMute(callback: AsyncCallback): void; + /** + * Checks whether the microphone is muted. This method uses a promise to return the query result. + * @return Promise used to return the mute status of the microphone. The value true means that the microphone is + * muted, and false means the opposite. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Volume + */ + isMicrophoneMute(): Promise; + + /** + * Listens for system microphone state change events. This method uses a callback to get microphone change events. + * @param callback Callback used to get the system microphone state change event. + * @throws { BusinessError } 401 - if input parameter type or number mismatch + * @throws { BusinessError } 6800101 - if input parameter value error + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Volume + */ + on(type: 'micStateChange', callback: Callback): void; } /** @@ -1768,13 +2084,14 @@ declare namespace audio { /** * Descript connect type for local device. * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Device + * @syscap SystemCapability.Multimedia.Audio.Volume */ CONNECT_TYPE_LOCAL = 1, + /** * Descript virtual type for local device. * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Device + * @syscap SystemCapability.Multimedia.Audio.Volume */ CONNECT_TYPE_DISTRIBUTED = 2 } @@ -1792,25 +2109,29 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Volume * @systemapi */ - readonly networkId: string; + readonly networkId: string; + /** * Volume group id. * @since 9 * @syscap SystemCapability.Multimedia.Audio.Volume */ readonly groupId: number; + /** * Volume mapping group id. * @since 9 * @syscap SystemCapability.Multimedia.Audio.Volume */ readonly mappingId: number; + /** * Volume group name. * @since 9 * @syscap SystemCapability.Multimedia.Audio.Volume */ readonly groupName: string; + /** * Connect type of device for this group. * @since 9 @@ -2064,6 +2385,8 @@ declare namespace audio { * is interrupted by another application, the callback is invoked to notify the former application. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @deprecated since 9 + * @useinstead ohos.multimedia.audio.InterruptEvent */ interface InterruptAction { @@ -2072,6 +2395,7 @@ declare namespace audio { * The value TYPE_ACTIVATED means the focus gain event, and TYPE_INTERRUPT means the audio interruption event. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @deprecated since 9 */ actionType: InterruptActionType; @@ -2079,6 +2403,7 @@ declare namespace audio { * Type of the audio interruption event. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @deprecated since 9 */ type?: InterruptType; @@ -2086,6 +2411,7 @@ declare namespace audio { * Hint for the audio interruption event. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @deprecated since 9 */ hint?: InterruptHint; @@ -2094,6 +2420,7 @@ declare namespace audio { * and false means that the focus fails to be gained or released. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @deprecated since 9 */ activated?: boolean; } @@ -2102,6 +2429,7 @@ declare namespace audio { * Describes input parameters of audio listening events. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @deprecated since 9 */ interface AudioInterrupt { @@ -2109,6 +2437,7 @@ declare namespace audio { * Audio stream usage type. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @deprecated since 9 */ streamUsage: StreamUsage; @@ -2116,6 +2445,7 @@ declare namespace audio { * Type of the media interrupted. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @deprecated since 9 */ contentType: ContentType; @@ -2124,6 +2454,7 @@ declare namespace audio { * The value true means that audio playback can be paused when it is interrupted, and false means the opposite. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Renderer + * @deprecated since 9 */ pauseWhenDucked: boolean; } @@ -2174,6 +2505,7 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Renderer */ readonly state: AudioState; + /** * Obtains the renderer information provided while creating a renderer instance. This method uses an asynchronous * callback to return the result. @@ -2190,6 +2522,7 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Renderer */ getRendererInfo(): Promise; + /** * Obtains the renderer stream information. This method uses an asynchronous callback to return the result. * @param callback Callback used to return the stream information. @@ -2204,6 +2537,22 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Renderer */ getStreamInfo(): Promise; + + /** + * Obtains the renderer stream id. This method uses an asynchronous callback to return the result. + * @param callback Callback used to return the stream id. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Renderer + */ + getAudioStreamId(callback: AsyncCallback): void; + /** + * Obtains the renderer stream id. This method uses a promise to return the result. + * @return Promise used to return the stream id. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Renderer + */ + getAudioStreamId(): Promise; + /** * Starts the renderer. This method uses an asynchronous callback to return the result. * @param callback Callback used to return the result. @@ -2218,6 +2567,7 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Renderer */ start(): Promise; + /** * Writes the buffer. This method uses an asynchronous callback to return the result. * @param buffer Buffer to be written. @@ -2235,6 +2585,7 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Renderer */ write(buffer: ArrayBuffer): Promise; + /** * Obtains the timestamp in Unix epoch time (starts from January 1, 1970), in nanoseconds. This method uses an * asynchronous callback to return the result. @@ -2251,6 +2602,7 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Renderer */ getAudioTime(): Promise; + /** * Drains the playback buffer. This method uses an asynchronous callback to return the result. * @param callback Callback used to return the result. @@ -2265,6 +2617,7 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Renderer */ drain(): Promise; + /** * Pauses rendering. This method uses an asynchronous callback to return the result. * @param callback Callback used to return the result. @@ -2279,6 +2632,7 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Renderer */ pause(): Promise; + /** * Stops rendering. This method uses an asynchronous callback to return the result. * @param callback Callback used to return the result. @@ -2293,6 +2647,7 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Renderer */ stop(): Promise; + /** * Releases the renderer. This method uses an asynchronous callback to return the result. * @param callback Callback used to return the result. @@ -2307,6 +2662,7 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Renderer */ release(): Promise; + /** * Obtains a reasonable minimum buffer size in bytes for rendering. This method uses an asynchronous callback to * return the result. @@ -2322,6 +2678,7 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Renderer */ getBufferSize(): Promise; + /** * Sets the render rate. This method uses an asynchronous callback to return the result. * @param rate Audio render rate. @@ -2338,6 +2695,7 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Renderer */ setRenderRate(rate: AudioRendererRate): Promise; + /** * Obtains the current render rate. This method uses an asynchronous callback to return the result. * @param callback Callback used to return the audio render rate. @@ -2352,12 +2710,13 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Renderer */ getRenderRate(): Promise; + /** * Set interrupt mode. * @param mode The interrupt mode. * @param callback Callback used to return the result. * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Renderer + * @syscap SystemCapability.Multimedia.Audio.Interrupt */ setInterruptMode(mode: InterruptMode, callback: AsyncCallback): void; /** @@ -2365,17 +2724,38 @@ declare namespace audio { * @param mode The interrupt mode. * @return Promise used to return the result. * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Renderer + * @syscap SystemCapability.Multimedia.Audio.Interrupt */ setInterruptMode(mode: InterruptMode): Promise; + + /** + * Sets the volume for this stream. This method uses an asynchronous callback to return the result. + * @param volume Volume to set. The value range can be obtained by calling getMinVolume and getMaxVolume. + * @param callback Callback used to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Renderer + */ + setVolume(volume: number, callback: AsyncCallback): void; + /** + * Sets the volume for a stream. This method uses a promise to return the result. + * @param volume Volume to set. The value range can be obtained by calling getMinVolume and getMaxVolume. + * @return Promise used to return the result. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Renderer + */ + setVolume(volume: number): Promise; + /** * Listens for audio interrupt events. This method uses a callback to get interrupt events. The interrupt event is * triggered when audio playback is interrupted. * @param callback Callback used to listen for interrupt callback. + * @throws { BusinessError } 401 - if input parameter type or number mismatch + * @throws { BusinessError } 6800101 - if input parameter value error * @since 9 - * @syscap SystemCapability.Multimedia.Audio.Renderer + * @syscap SystemCapability.Multimedia.Audio.Interrupt */ - on(type: 'interrupt', callback: Callback): void; + on(type: 'audioInterrupt', callback: Callback): void; + /** * Subscribes to mark reached events. When the number of frames rendered reaches the value of the frame parameter, * the callback is invoked. @@ -2391,6 +2771,7 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Renderer */ off(type: "markReach"): void; + /** * Subscribes to period reached events. When the period of frame rendering reaches the value of frame parameter, * the callback is invoked. @@ -2406,6 +2787,7 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Renderer */ off(type: "periodReach"): void; + /** * Subscribes audio state change event callback. * @param callback Callback invoked when state change. @@ -2438,7 +2820,7 @@ declare namespace audio { * @since 9 * @syscap SystemCapability.Multimedia.Audio.Core */ - SOURCE_TYPE_VOICE_RECOGNITION = 1, + SOURCE_TYPE_VOICE_RECOGNITION = 1, /** * Voice communication source type. * @since 8 @@ -2499,6 +2881,7 @@ declare namespace audio { * @syscap SystemCapability.Multimedia.Audio.Capturer */ readonly state: AudioState; + /** * Obtains the capturer information provided while creating a capturer instance. This method uses an asynchronous * callback to return the result. @@ -2531,6 +2914,21 @@ declare namespace audio { */ getStreamInfo(): Promise; + /** + * Obtains the capturer stream id. This method uses an asynchronous callback to return the result. + * @param callback Callback used to return the stream id. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Capturer + */ + getAudioStreamId(callback: AsyncCallback): void; + /** + * Obtains the capturer stream id. This method uses a promise to return the result. + * @return Promise used to return the stream id. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Capturer + */ + getAudioStreamId(): Promise; + /** * Starts capturing. This method uses an asynchronous callback to return the result. * @param callback Callback used to return the result. @@ -2668,6 +3066,13 @@ declare namespace audio { */ on(type: "stateChange", callback: Callback): void; } + + /** + * Enumerates tone types for player. + * @since 9 + * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi + */ enum ToneType { /** * Dial tone for key 0. @@ -2837,6 +3242,7 @@ declare namespace audio { * Provides APIs for tone playing. * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone + * @systemapi */ interface TonePlayer { /** @@ -2903,4 +3309,4 @@ declare namespace audio { } } -export default audio; +export default audio; \ No newline at end of file -- Gitee From 6f0b7fb0f103cf4660987c30d1c2696e74a04e89 Mon Sep 17 00:00:00 2001 From: "yanxiaotao@huawei.com" Date: Wed, 26 Oct 2022 21:01:31 +0800 Subject: [PATCH 255/438] add error code for wifi 1026 Signed-off-by: yanxiaotao@huawei.com --- api/@ohos.wifiManager.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/api/@ohos.wifiManager.d.ts b/api/@ohos.wifiManager.d.ts index 44160bc3e1..a35fadd2cf 100644 --- a/api/@ohos.wifiManager.d.ts +++ b/api/@ohos.wifiManager.d.ts @@ -1391,6 +1391,7 @@ declare namespace wifiManager { interface IpConfig { ipAddress: number; gateway: number; + netmask: number; dnsServers: number[]; domains: Array; } -- Gitee From 29addcfea205fd806da604e20105ca8ee489ea15 Mon Sep 17 00:00:00 2001 From: "yanxiaotao@huawei.com" Date: Wed, 26 Oct 2022 23:07:08 +0800 Subject: [PATCH 256/438] add error code for wifi 1026 Signed-off-by: yanxiaotao@huawei.com --- api/@ohos.wifiManager.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.wifiManager.d.ts b/api/@ohos.wifiManager.d.ts index a35fadd2cf..7cc1fb1ae5 100644 --- a/api/@ohos.wifiManager.d.ts +++ b/api/@ohos.wifiManager.d.ts @@ -1391,7 +1391,7 @@ declare namespace wifiManager { interface IpConfig { ipAddress: number; gateway: number; - netmask: number; + prefixLength: number; dnsServers: number[]; domains: Array; } -- Gitee From d28ce04491561d65f52f51cb839a64c8be1fcd7f Mon Sep 17 00:00:00 2001 From: SoftSquirrel Date: Thu, 27 Oct 2022 10:56:16 +0800 Subject: [PATCH 257/438] Issue:#I5XZ02 Description: delete unknown type Sig: SIG_ApplicaitonFramework Feature or Bugfix: Bugfix Binary Source: No Signed-off-by: SoftSquirrel --- api/@ohos.bundle.bundleManager.d.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/api/@ohos.bundle.bundleManager.d.ts b/api/@ohos.bundle.bundleManager.d.ts index 12f7b31f2b..5ce3e81086 100644 --- a/api/@ohos.bundle.bundleManager.d.ts +++ b/api/@ohos.bundle.bundleManager.d.ts @@ -422,36 +422,30 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * Indicates ability type * @enum {number} * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @FAModelOnly * @since 9 */ export enum AbilityType { - /** - * Indicates an unknown ability type - * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @since 9 - */ - UNKNOWN, - /** * Indicates that the ability has a UI * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ - PAGE, + PAGE = 1, /** * Indicates that the ability does not have a UI * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ - SERVICE, + SERVICE = 2, /** * Indicates that the ability is used to provide data access services * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ - DATA, + DATA = 3, } /** -- Gitee From f6676e39832610ba294cc42fcca971756c4b4d8d Mon Sep 17 00:00:00 2001 From: "yanxiaotao@huawei.com" Date: Thu, 27 Oct 2022 13:18:01 +0800 Subject: [PATCH 258/438] add error code for wif 1027 Signed-off-by: yanxiaotao@huawei.com --- api/@ohos.wifiManager.d.ts | 168 ++++++++++++++++++---------------- api/@ohos.wifiManagerExt.d.ts | 10 +- 2 files changed, 94 insertions(+), 84 deletions(-) diff --git a/api/@ohos.wifiManager.d.ts b/api/@ohos.wifiManager.d.ts index 7cc1fb1ae5..153385fa69 100644 --- a/api/@ohos.wifiManager.d.ts +++ b/api/@ohos.wifiManager.d.ts @@ -29,7 +29,8 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. + * @throws {BusinessError} 2501003 - Failed for wifi is closing. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. @@ -43,7 +44,8 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. + * @throws {BusinessError} 2501004 - Failed for wifi is opening. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. @@ -59,7 +61,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO */ @@ -75,7 +77,8 @@ declare namespace wifiManager { * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. + * @throws {BusinessError} 2501001 - Wifi is closed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.LOCATION */ @@ -90,7 +93,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or ohos.permission.LOCATION) */ @@ -106,7 +109,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or ohos.permission.LOCATION) */ @@ -125,7 +128,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG * @systemapi Hide this for inner system use. @@ -146,7 +149,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO */ @@ -165,7 +168,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO */ @@ -183,7 +186,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION */ @@ -200,7 +203,8 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. + * @throws {BusinessError} 2501001 - Wifi is closed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO */ @@ -216,7 +220,8 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. + * @throws {BusinessError} 2501001 - Wifi is closed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. @@ -233,7 +238,8 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. + * @throws {BusinessError} 2501001 - Wifi is closed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG and * ohos.permission.MANAGE_WIFI_CONNECTION @@ -248,7 +254,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. @@ -267,7 +273,8 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. + * @throws {BusinessError} 2501001 - Wifi is closed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO */ @@ -281,7 +288,8 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. + * @throws {BusinessError} 2501001 - Wifi is closed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO */ @@ -296,7 +304,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO */ @@ -312,7 +320,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2400001 - System exception. + * @throws {BusinessError} 2401000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.Core * @permission ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. @@ -328,7 +336,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2400001 - System exception. + * @throws {BusinessError} 2401000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.Core * @permission ohos.permission.GET_WIFI_INFO */ @@ -344,7 +352,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_LOCAL_MAC and ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. @@ -360,7 +368,7 @@ declare namespace wifiManager { * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO */ @@ -373,7 +381,7 @@ declare namespace wifiManager { * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2400001 - System exception. + * @throws {BusinessError} 2401000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.Core * @permission ohos.permission.GET_WIFI_INFO */ @@ -386,7 +394,8 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. + * @throws {BusinessError} 2501001 - Wifi is closed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. @@ -400,7 +409,8 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. + * @throws {BusinessError} 2501001 - Wifi is closed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. @@ -418,7 +428,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.GET_WIFI_CONFIG * @systemapi Hide this for inner system use. @@ -437,7 +447,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG * @systemapi Hide this for inner system use. @@ -454,7 +464,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. @@ -468,7 +478,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. @@ -489,7 +499,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. @@ -505,7 +515,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2600001 - System exception. + * @throws {BusinessError} 2601000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. @@ -522,7 +532,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2600001 - System exception. + * @throws {BusinessError} 2601000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. @@ -537,7 +547,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2600001 - System exception. + * @throws {BusinessError} 2601000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. @@ -552,7 +562,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2600001 - System exception. + * @throws {BusinessError} 2601000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. @@ -573,7 +583,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2600001 - System exception. + * @throws {BusinessError} 2601000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG * @systemapi Hide this for inner system use. @@ -588,7 +598,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2600001 - System exception. + * @throws {BusinessError} 2601000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG * @systemapi Hide this for inner system use. @@ -605,7 +615,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2600001 - System exception. + * @throws {BusinessError} 2601000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. @@ -619,7 +629,7 @@ declare namespace wifiManager { * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - System exception. + * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO */ @@ -633,7 +643,7 @@ declare namespace wifiManager { * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - System exception. + * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION */ @@ -648,7 +658,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - System exception. + * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION */ @@ -665,7 +675,7 @@ declare namespace wifiManager { * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - System exception. + * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG */ @@ -680,7 +690,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - System exception. + * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO */ @@ -693,7 +703,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - System exception. + * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO */ @@ -707,7 +717,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - System exception. + * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION */ @@ -720,7 +730,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - System exception. + * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO */ @@ -733,7 +743,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - System exception. + * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION */ @@ -745,7 +755,7 @@ declare namespace wifiManager { * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - System exception. + * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO */ @@ -760,7 +770,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - System exception. + * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. @@ -775,7 +785,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - System exception. + * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION * @systemapi Hide this for inner system use. @@ -792,7 +802,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - System exception. + * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. @@ -807,7 +817,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO */ @@ -822,7 +832,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO */ @@ -836,7 +846,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO */ @@ -851,7 +861,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO */ @@ -865,7 +875,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO */ @@ -880,7 +890,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO */ @@ -894,7 +904,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO */ @@ -909,7 +919,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO */ @@ -924,7 +934,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. @@ -941,7 +951,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.MANAGE_WIFI_CONNECTION * @systemapi Hide this for inner system use. @@ -957,7 +967,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. @@ -973,7 +983,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2500001 - System exception. + * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.GET_WIFI_INFO * @systemapi Hide this for inner system use. @@ -989,7 +999,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2600001 - System exception. + * @throws {BusinessError} 2601000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.GET_WIFI_INFO */ @@ -1005,7 +1015,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2600001 - System exception. + * @throws {BusinessError} 2601000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.GET_WIFI_INFO */ @@ -1020,7 +1030,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2600001 - System exception. + * @throws {BusinessError} 2601000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. @@ -1037,7 +1047,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2600001 - System exception. + * @throws {BusinessError} 2601000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. @@ -1053,7 +1063,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2600001 - System exception. + * @throws {BusinessError} 2601000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. @@ -1069,7 +1079,7 @@ declare namespace wifiManager { * @throws {BusinessError} 202 - System API is not allowed called by third HAP. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2600001 - System exception. + * @throws {BusinessError} 2601000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.AP.Core * @permission ohos.permission.MANAGE_WIFI_HOTSPOT * @systemapi Hide this for inner system use. @@ -1084,7 +1094,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - System exception. + * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO */ @@ -1097,7 +1107,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - System exception. + * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO */ @@ -1111,7 +1121,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - System exception. + * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO */ @@ -1124,7 +1134,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - System exception. + * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO */ @@ -1138,7 +1148,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - System exception. + * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION */ @@ -1152,7 +1162,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - System exception. + * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.LOCATION */ @@ -1166,7 +1176,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - System exception. + * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION */ @@ -1179,7 +1189,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - System exception. + * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.LOCATION */ @@ -1193,7 +1203,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - System exception. + * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO */ @@ -1206,7 +1216,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - System exception. + * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO */ @@ -1220,7 +1230,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - System exception. + * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO */ @@ -1233,7 +1243,7 @@ declare namespace wifiManager { * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2800001 - System exception. + * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P * @permission ohos.permission.GET_WIFI_INFO */ diff --git a/api/@ohos.wifiManagerExt.d.ts b/api/@ohos.wifiManagerExt.d.ts index 964cbdb073..cc4f43a272 100644 --- a/api/@ohos.wifiManagerExt.d.ts +++ b/api/@ohos.wifiManagerExt.d.ts @@ -32,7 +32,7 @@ declare namespace wifiManagerExt { * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2700001 - System exception. + * @throws {BusinessError} 2701000 - Operation failed. * @permission ohos.permission.MANAGE_WIFI_HOTSPOT_EXT * @syscap SystemCapability.Communication.WiFi.AP.Extension */ @@ -44,7 +44,7 @@ declare namespace wifiManagerExt { * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2700001 - System exception. + * @throws {BusinessError} 2701000 - Operation failed. * @permission ohos.permission.MANAGE_WIFI_HOTSPOT_EXT * @syscap SystemCapability.Communication.WiFi.AP.Extension */ @@ -58,7 +58,7 @@ declare namespace wifiManagerExt { * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2700001 - System exception. + * @throws {BusinessError} 2701000 - Operation failed. * @permission ohos.permission.GET_WIFI_INFO * @syscap SystemCapability.Communication.WiFi.AP.Extension */ @@ -73,7 +73,7 @@ declare namespace wifiManagerExt { * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2700001 - System exception. + * @throws {BusinessError} 2701000 - Operation failed. * @permission ohos.permission.GET_WIFI_INFO * @syscap SystemCapability.Communication.WiFi.AP.Extension */ @@ -86,7 +86,7 @@ declare namespace wifiManagerExt { * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 801 - Capability not supported. - * @throws {BusinessError} 2700001 - System exception. + * @throws {BusinessError} 2701000 - Operation failed. * @permission ohos.permission.MANAGE_WIFI_HOTSPOT_EXT * @syscap SystemCapability.Communication.WiFi.AP.Extension */ -- Gitee From 030acea319cc191dc851608b8444c6c5ed1dcd47 Mon Sep 17 00:00:00 2001 From: "yanxiaotao@huawei.com" Date: Thu, 27 Oct 2022 13:24:07 +0800 Subject: [PATCH 259/438] add error code for wif 1027 Signed-off-by: yanxiaotao@huawei.com --- api/@ohos.wifiManager.d.ts | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/api/@ohos.wifiManager.d.ts b/api/@ohos.wifiManager.d.ts index 153385fa69..5933037ef4 100644 --- a/api/@ohos.wifiManager.d.ts +++ b/api/@ohos.wifiManager.d.ts @@ -59,7 +59,6 @@ declare namespace wifiManager { * * @since 9 * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA @@ -91,7 +90,6 @@ declare namespace wifiManager { * * @since 9 * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA @@ -107,7 +105,6 @@ declare namespace wifiManager { * * @since 9 * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA @@ -184,7 +181,6 @@ declare namespace wifiManager { * * @since 9 * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA @@ -286,7 +282,6 @@ declare namespace wifiManager { * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. - * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2501000 - Operation failed. * @throws {BusinessError} 2501001 - Wifi is closed. @@ -426,7 +421,6 @@ declare namespace wifiManager { * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. - * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA @@ -463,6 +457,7 @@ declare namespace wifiManager { * @since 9 * @throws {BusinessError} 201 - Permission denied. * @throws {BusinessError} 202 - System API is not allowed called by third HAP. + * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2501000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.STA @@ -656,7 +651,6 @@ declare namespace wifiManager { * @return Returns the found devices list. * @since 9 * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P @@ -701,7 +695,6 @@ declare namespace wifiManager { * * @since 9 * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P @@ -728,7 +721,6 @@ declare namespace wifiManager { * * @since 9 * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P @@ -741,7 +733,6 @@ declare namespace wifiManager { * * @since 9 * @throws {BusinessError} 201 - Permission denied. - * @throws {BusinessError} 401 - Invalid parameters. * @throws {BusinessError} 801 - Capability not supported. * @throws {BusinessError} 2801000 - Operation failed. * @syscap SystemCapability.Communication.WiFi.P2P -- Gitee From b6e7990e0bc94d1e512a34cec39357e98d84424f Mon Sep 17 00:00:00 2001 From: yeyinglong Date: Sat, 3 Sep 2022 15:12:30 +0800 Subject: [PATCH 260/438] deprecated ListItem sticky API Signed-off-by: yeyinglong Change-Id: Icf6ea30bcc50545f614b83feef8c8932907fb1e7 --- api/@internal/component/ets/list_item.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/@internal/component/ets/list_item.d.ts b/api/@internal/component/ets/list_item.d.ts index edfea632c9..c6f104be32 100644 --- a/api/@internal/component/ets/list_item.d.ts +++ b/api/@internal/component/ets/list_item.d.ts @@ -17,6 +17,8 @@ /** * Declare item ceiling attribute. * @since 7 + * @deprecated since 9 + * @useinstead list/StickyStyle */ declare enum Sticky { /** @@ -128,6 +130,8 @@ declare class ListItemAttribute extends CommonMethod { /** * Called when setting whether item is ceiling effect. * @since 7 + * @deprecated since 9 + * @useinstead list/List#sticky */ sticky(value: Sticky): ListItemAttribute; -- Gitee From 15fdec5e1bc2cb7c30957b0075cff6f9f03dd0f5 Mon Sep 17 00:00:00 2001 From: fangyun Date: Thu, 27 Oct 2022 14:57:02 +0800 Subject: [PATCH 261/438] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=8E=A5=E5=8F=A3=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fangyun --- api/enterpriseDeviceManager/DeviceSettingsManager.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/enterpriseDeviceManager/DeviceSettingsManager.d.ts b/api/enterpriseDeviceManager/DeviceSettingsManager.d.ts index 4187a3f5f1..b8c6467071 100644 --- a/api/enterpriseDeviceManager/DeviceSettingsManager.d.ts +++ b/api/enterpriseDeviceManager/DeviceSettingsManager.d.ts @@ -26,7 +26,7 @@ export interface DeviceSettingsManager { /** * Sets the system time. * This function can be called by a super administrator. - * @permission ohos.permission.EDM_MANAGE_DATETIME + * @permission ohos.permission.ENTERPRISE_SET_DATETIME * @param { Want } admin - admin indicates the administrator ability information. * @param { number } time - time indicates rhe target time stamp (ms). * @returns { Promise } the promise returned by the setDateTime. -- Gitee From c34731f27df770384501b6bab061473e1f8d37e1 Mon Sep 17 00:00:00 2001 From: "yupeng74@huawei.com" Date: Thu, 27 Oct 2022 15:13:53 +0800 Subject: [PATCH 262/438] =?UTF-8?q?=E5=88=A0=E9=99=A4=E8=80=81=E7=89=88?= =?UTF-8?q?=E6=9C=ACdts=E6=96=87=E4=BB=B6=E4=B8=AD=E7=9A=84API9=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yupeng74@huawei.com --- api/@ohos.bundleState.d.ts | 298 ------------------------------------- 1 file changed, 298 deletions(-) diff --git a/api/@ohos.bundleState.d.ts b/api/@ohos.bundleState.d.ts index d58a582797..b2539343d2 100644 --- a/api/@ohos.bundleState.d.ts +++ b/api/@ohos.bundleState.d.ts @@ -92,122 +92,6 @@ declare namespace bundleState { merge(toMerge: BundleStateInfo): void; } - /** - * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App - * @systemapi Hide this for inner system use. - * @deprecated since 9 - * @useinstead ohos.resourceschedule.usageStatistics.HapFormInfo - */ - interface BundleActiveFormInfo { - /** - * The form name. - */ - formName: string; - /** - * The form dimension. - */ - formDimension: number; - /** - * The form id. - */ - formId: number; - /** - * The last time when the form was accessed, in milliseconds.. - */ - formLastUsedTime: number; - /** - * The click count of module. - */ - count: number; - } - - /** - * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App - * @systemapi Hide this for inner system use. - * @deprecated since 9 - * @useinstead ohos.resourceschedule.usageStatistics.HapModuleInfo - */ - interface BundleActiveModuleInfo { - /** - * The device id of module. - */ - deviceId?: string; - /** - * The bundle name. - */ - bundleName: string; - /** - * The module name. - */ - moduleName: string; - /** - * The main ability name of module. - */ - abilityName?: string; - /** - * The label id of application. - */ - appLabelId?: number; - /** - * The label id of module. - */ - labelId?: number; - /** - * The description id of application. - */ - descriptionId?: number; - /** - * The ability id of main ability. - */ - abilityLableId?: number; - /** - * The description id of main ability. - */ - abilityDescriptionId?: number; - /** - * The icon id of main ability. - */ - abilityIconId?: number; - /** - * The launch count of module. - */ - launchedCount: number; - /** - * The last time when the module was accessed, in milliseconds. - */ - lastModuleUsedTime: number; - /** - * The form usage record list of current module. - */ - formRecords: Array; - } - - /** - * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App - * @systemapi Hide this for inner system use. - * @deprecated since 9 - * @useinstead ohos.resourceschedule.usageStatistics.DeviceEventStats - */ - interface BundleActiveEventState { - /** - * The bundle name or system event name. - */ - name: string; - - /** - * The event id. - */ - eventId: number; - - /** - * The the event occurrence number. - */ - count: number; - } - /** * @since 7 * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App @@ -240,35 +124,6 @@ declare namespace bundleState { */ stateType?: number; } - /** - * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup - * @systemapi Hide this for inner system use. - * @deprecated since 9 - * @useinstead ohos.resourceschedule.usageStatistics.AppGroupCallbackInfo - */ - interface BundleActiveGroupCallbackInfo { - /* - * The usage old group of the application - */ - appUsageOldGroup: number; - /* - * The usage new group of the application - */ - appUsageNewGroup: number; - /* - * The use id - */ - userId: number; - /* - * The change reason - */ - changeReason: number; - /* - * The bundle name - */ - bundleName: string; - } /** * Checks whether the application with a specified bundle name is in the idle state. @@ -411,159 +266,6 @@ declare namespace bundleState { */ function queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void; function queryCurrentBundleActiveStates(begin: number, end: number): Promise>; - - /** - * Queries recently module usage records. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App - * @permission ohos.permission.BUNDLE_ACTIVE_INFO - * @systemapi Hide this for inner system use. - * @param maxNum Indicates max record number in result, max value is 1000, default value is 1000. - * @return Returns the {@link BundleActiveModuleInfo} object Array containing the usage data of the modules. - * @deprecated since 9 - * @useinstead ohos.resourceschedule.usageStatistics.queryModuleUsageRecords - */ - function getRecentlyUsedModules(callback: AsyncCallback>): void; - function getRecentlyUsedModules(maxNum: number, callback: AsyncCallback>): void; - function getRecentlyUsedModules(maxNum?: number): Promise>; - - /** - * Queries the usage priority group of the calling application. - * - *

The priority defined in a priority group restricts the resource usage of an application, - * for example, restricting the running of background tasks.

- * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup - * @permission ohos.permission.BUNDLE_ACTIVE_INFO - * @systemapi Hide this for inner system use. - * @param bundleName, name of the application. - * @return Returns the usage priority group of the calling application. - * @deprecated since 9 - * @useinstead ohos.resourceschedule.usageStatistics.queryAppGroup - */ - function queryAppUsagePriorityGroup(callback: AsyncCallback): void; - function queryAppUsagePriorityGroup(bundleName: string, callback: AsyncCallback): void; - function queryAppUsagePriorityGroup(bundleName?: string): Promise; - - /** - * Declares group type. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup - * @systemapi Hide this for inner system use. - * @deprecated since 9 - * @useinstead ohos.resourceschedule.usageStatistics.GroupType - */ - export enum GroupType { - /** - * Indicates the alive group. - */ - ACTIVE_GROUP_ALIVE = 10, - - /** - * Indicates the daily group. - */ - ACTIVE_GROUP_DAILY = 20, - - /** - * Indicates the fixed group. - */ - ACTIVE_GROUP_FIXED = 30, - - /** - * Indicates the rare group. - */ - ACTIVE_GROUP_RARE = 40, - - /** - * Indicates the limit group. - */ - ACTIVE_GROUP_LIMIT = 50, - - /** - * Indicates the never group. - */ - ACTIVE_GROUP_NEVER = 60 - } - - /** - * Set bundle group by bundleName and number. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup - * @permission ohos.permission.BUNDLE_ACTIVE_INFO - * @systemapi Hide this for inner system use. - * @param bundleName, name of the application. - * @param newGroup,the group of the application whose name is bundleName. - * @return Returns the result of setBundleGroup, true of false. - * @deprecated since 9 - * @useinstead ohos.resourceschedule.usageStatistics.setAppGroup - */ - function setBundleGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void; - function setBundleGroup(bundleName: string, newGroup: GroupType): Promise; - - /** - * Register callback to service. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup - * @permission ohos.permission.BUNDLE_ACTIVE_INFO - * @systemapi Hide this for inner system use. - * @param Callback, callback when application group change,return the BundleActiveGroupCallbackInfo. - * @return Returns BundleActiveGroupCallbackInfo when the group of bundle changed. the result of AsyncCallback is true or false. - * @deprecated since 9 - * @useinstead ohos.resourceschedule.usageStatistics.registerAppGroupCallBack - */ - function registerGroupCallBack(groupCallback: Callback, callback: AsyncCallback): void; - function registerGroupCallBack(groupCallback: Callback): Promise; - - /** - * Unregister callback from service. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup - * @permission ohos.permission.BUNDLE_ACTIVE_INFO - * @systemapi Hide this for inner system use. - * @return Returns the result of unregisterGroupCallBack, true of false. - * @deprecated since 9 - * @useinstead ohos.resourceschedule.usageStatistics.unregisterAppGroupCallBack - */ - function unregisterGroupCallBack(callback: AsyncCallback): void; - function unregisterGroupCallBack(): Promise; - - /* - * Queries system event states data within a specified period identified by the start and end time. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App - * @permission ohos.permission.BUNDLE_ACTIVE_INFO - * @systemapi Hide this for inner system use. - * @param begin Indicates the start time of the query period, in milliseconds. - * @param end Indicates the end time of the query period, in milliseconds. - * @return Returns the {@link BundleActiveEventState} object Array containing the event states data. - * @deprecated since 9 - * @useinstead ohos.resourceschedule.usageStatistics.queryDeviceEventStats - */ - function queryBundleActiveEventStates(begin: number, end: number, callback: AsyncCallback>): void; - function queryBundleActiveEventStates(begin: number, end: number): Promise>; - - /** - * Queries app notification number within a specified period identified by the start and end time. - * - * @since 9 - * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App - * @permission ohos.permission.BUNDLE_ACTIVE_INFO - * @systemapi Hide this for inner system use. - * @param begin Indicates the start time of the query period, in milliseconds. - * @param end Indicates the end time of the query period, in milliseconds. - * @return Returns the {@link BundleActiveEventState} object Array containing the event states data. - * @deprecated since 9 - * @useinstead ohos.resourceschedule.usageStatistics.queryNotificationEventStats - */ - function queryAppNotificationNumber(begin: number, end: number, callback: AsyncCallback>): void; - function queryAppNotificationNumber(begin: number, end: number): Promise>; } export default bundleState; -- Gitee From 2521a4b87479b8edffe29a0d4317d5ef0f6f466f Mon Sep 17 00:00:00 2001 From: xxb-wzy Date: Thu, 27 Oct 2022 15:26:31 +0800 Subject: [PATCH 263/438] Signed-off-by: xxb-wzy Change-Id: I57d9fcd37d21129d58cd3cf794e0dd05be485bc0 --- api/@ohos.multimedia.media.d.ts | 48 +++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/api/@ohos.multimedia.media.d.ts b/api/@ohos.multimedia.media.d.ts index 5bfba741bb..c6ab1c2835 100644 --- a/api/@ohos.multimedia.media.d.ts +++ b/api/@ohos.multimedia.media.d.ts @@ -63,6 +63,7 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @import import media from '@ohos.multimedia.media' * @param callback Callback used to return AudioPlayer instance if the operation is successful; returns null otherwise. + * @throws { BusinessError } 5400101 - No memory. Return by callback. * @systemapi */ function createVideoRecorder(callback: AsyncCallback): void; @@ -72,6 +73,7 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @import import media from '@ohos.multimedia.media' * @return A Promise instance used to return VideoRecorder instance if the operation is successful; returns null otherwise. + * @throws { BusinessError } 5400101 - No memory. Return by promise. * @systemapi */ function createVideoRecorder(): Promise; @@ -683,6 +685,10 @@ declare namespace media { * @param config Recording parameters. * @param callback A callback instance used to return when prepare completed. * @permission ohos.permission.MICROPHONE + * @throws { BusinessError } 201 - Permission denied. Return by callback. + * @throws { BusinessError } 401 - Parameter error. Return by callback. + * @throws { BusinessError } 5400102 - Operate not permit. Return by callback. + * @throws { BusinessError } 5400105 - Service died. Return by callback. * @systemapi */ prepare(config: VideoRecorderConfig, callback: AsyncCallback): void; @@ -693,6 +699,10 @@ declare namespace media { * @param config Recording parameters. * @return A Promise instance used to return when prepare completed. * @permission ohos.permission.MICROPHONE + * @throws { BusinessError } 201 - Permission denied. Return by promise. + * @throws { BusinessError } 401 - Parameter error. Return by promise. + * @throws { BusinessError } 5400102 - Operate not permit. Return by promise. + * @throws { BusinessError } 5400105 - Service died. Return by promise. * @systemapi */ prepare(config: VideoRecorderConfig): Promise; @@ -701,6 +711,9 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @param callback Callback used to return the input surface id in string. + * @throws { BusinessError } 5400102 - Operate not permit. Return by callback. + * @throws { BusinessError } 5400103 - IO error. Return by callback. + * @throws { BusinessError } 5400105 - Service died. Return by callback. * @systemapi */ getInputSurface(callback: AsyncCallback): void; @@ -709,6 +722,9 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @return A Promise instance used to return the input surface id in string. + * @throws { BusinessError } 5400102 - Operate not permit. Return by promise. + * @throws { BusinessError } 5400103 - IO error. Return by promise. + * @throws { BusinessError } 5400105 - Service died. Return by promise. * @systemapi */ getInputSurface(): Promise; @@ -717,6 +733,9 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @param callback A callback instance used to return when start completed. + * @throws { BusinessError } 5400102 - Operate not permit. Return by callback. + * @throws { BusinessError } 5400103 - IO error. Return by callback. + * @throws { BusinessError } 5400105 - Service died. Return by callback. * @systemapi */ start(callback: AsyncCallback): void; @@ -725,6 +744,9 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @return A Promise instance used to return when start completed. + * @throws { BusinessError } 5400102 - Operate not permit. Return by promise. + * @throws { BusinessError } 5400103 - IO error. Return by promise. + * @throws { BusinessError } 5400105 - Service died. Return by promise. * @systemapi */ start(): Promise; @@ -733,6 +755,9 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @param callback A callback instance used to return when pause completed. + * @throws { BusinessError } 5400102 - Operate not permit. Return by callback. + * @throws { BusinessError } 5400103 - IO error. Return by callback. + * @throws { BusinessError } 5400105 - Service died. Return by callback. * @systemapi */ pause(callback: AsyncCallback): void; @@ -741,6 +766,9 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @return A Promise instance used to return when pause completed. + * @throws { BusinessError } 5400102 - Operate not permit. Return by promise. + * @throws { BusinessError } 5400103 - IO error. Return by promise. + * @throws { BusinessError } 5400105 - Service died. Return by promise. * @systemapi */ pause(): Promise; @@ -749,6 +777,9 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @param callback A callback instance used to return when resume completed. + * @throws { BusinessError } 5400102 - Operate not permit. Return by callback. + * @throws { BusinessError } 5400103 - IO error. Return by callback. + * @throws { BusinessError } 5400105 - Service died. Return by callback. * @systemapi */ resume(callback: AsyncCallback): void; @@ -757,6 +788,9 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @return A Promise instance used to return when resume completed. + * @throws { BusinessError } 5400102 - Operate not permit. Return by promise. + * @throws { BusinessError } 5400103 - IO error. Return by promise. + * @throws { BusinessError } 5400105 - Service died. Return by promise. * @systemapi */ resume(): Promise; @@ -765,6 +799,9 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @param callback A callback instance used to return when stop completed. + * @throws { BusinessError } 5400102 - Operate not permit. Return by callback. + * @throws { BusinessError } 5400103 - IO error. Return by callback. + * @throws { BusinessError } 5400105 - Service died. Return by callback. * @systemapi */ stop(callback: AsyncCallback): void; @@ -773,6 +810,9 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @return A Promise instance used to return when stop completed. + * @throws { BusinessError } 5400102 - Operate not permit. Return by promise. + * @throws { BusinessError } 5400103 - IO error. Return by promise. + * @throws { BusinessError } 5400105 - Service died. Return by promise. * @systemapi */ stop(): Promise; @@ -781,6 +821,7 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @param callback A callback instance used to return when release completed. + * @throws { BusinessError } 5400105 - Service died. Return by callback. * @systemapi */ release(callback: AsyncCallback): void; @@ -789,6 +830,7 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @return A Promise instance used to return when release completed. + * @throws { BusinessError } 5400105 - Service died. Return by callback. * @systemapi */ release(): Promise; @@ -799,6 +841,8 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @param callback A callback instance used to return when reset completed. + * @throws { BusinessError } 5400103 - IO error. Return by callback. + * @throws { BusinessError } 5400105 - Service died. Return by callback. * @systemapi */ reset(callback: AsyncCallback): void; @@ -809,6 +853,8 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @return A Promise instance used to return when reset completed. + * @throws { BusinessError } 5400103 - IO error. Return by promise. + * @throws { BusinessError } 5400105 - Service died. Return by promise. * @systemapi */ reset(): Promise; @@ -818,6 +864,8 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @param type Type of the video recording error event to listen for. * @param callback Callback used to listen for the video recording error event. + * @throws { BusinessError } 5400103 - IO error. Return by callback. + * @throws { BusinessError } 5400105 - Service died. Return by callback. * @systemapi */ on(type: 'error', callback: ErrorCallback): void; -- Gitee From 801ebbf6edbab515d96ab39baa8209b59ff72852 Mon Sep 17 00:00:00 2001 From: dboy190 Date: Thu, 27 Oct 2022 16:00:54 +0800 Subject: [PATCH 264/438] fix fieldnode error code Signed-off-by: dboy190 --- api/@ohos.data.distributedKVStore.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/@ohos.data.distributedKVStore.d.ts b/api/@ohos.data.distributedKVStore.d.ts index cc55042a39..7eb0434464 100644 --- a/api/@ohos.data.distributedKVStore.d.ts +++ b/api/@ohos.data.distributedKVStore.d.ts @@ -466,6 +466,7 @@ declare namespace distributedKVStore { * A constructor used to create a FieldNode instance with the specified field. * name Indicates the field node name. * + * @throws {BusinessError} 401 - if parameter check failed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ @@ -477,6 +478,7 @@ declare namespace distributedKVStore { * * @param {FieldNode} child - The field node to append. * @returns Returns true if the child node is successfully added to this {@code FieldNode} and false otherwise. + * @throws {BusinessError} 401 - if parameter check failed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ -- Gitee From 83b6453b4e03dcecfcb5613abeb36cd1f1918a99 Mon Sep 17 00:00:00 2001 From: zhang-daiyue Date: Thu, 27 Oct 2022 16:05:12 +0800 Subject: [PATCH 265/438] add UserFileManager Signed-off-by: zhang-daiyue Change-Id: Ic41677dec74bbdd9688126b66cb87ea8e7fb06dc --- api/device-define/car.json | 1 + api/device-define/default.json | 1 + api/device-define/tablet.json | 1 + api/device-define/tv.json | 1 + api/device-define/wearable.json | 1 + build-tools/api_check_plugin/code_style_rule.json | 3 ++- 6 files changed, 7 insertions(+), 1 deletion(-) diff --git a/api/device-define/car.json b/api/device-define/car.json index 4d0c0427b7..d9f3255d02 100644 --- a/api/device-define/car.json +++ b/api/device-define/car.json @@ -107,6 +107,7 @@ "SystemCapability.FileManagement.File.DistributedFile", "SystemCapability.FileManagement.AppFileService", "SystemCapability.FileManagement.UserFileService", + "SystemCapability.FileManagement.UserFileManager.Core", "SystemCapability.USB.USBManager", "SystemCapability.Startup.SystemInfo", "SystemCapability.DistributedDataManager.RelationalStore.Core", diff --git a/api/device-define/default.json b/api/device-define/default.json index bd9d537417..bc91123441 100644 --- a/api/device-define/default.json +++ b/api/device-define/default.json @@ -134,6 +134,7 @@ "SystemCapability.FileManagement.File.DistributedFile", "SystemCapability.FileManagement.AppFileService", "SystemCapability.FileManagement.UserFileService", + "SystemCapability.FileManagement.UserFileManager.Core", "SystemCapability.USB.USBManager", "SystemCapability.Sensors.Sensor", "SystemCapability.Sensors.MiscDevice", diff --git a/api/device-define/tablet.json b/api/device-define/tablet.json index 495e9fa6bb..73bf456d67 100644 --- a/api/device-define/tablet.json +++ b/api/device-define/tablet.json @@ -133,6 +133,7 @@ "SystemCapability.FileManagement.File.DistributedFile", "SystemCapability.FileManagement.AppFileService", "SystemCapability.FileManagement.UserFileService", + "SystemCapability.FileManagement.UserFileManager.Core", "SystemCapability.USB.USBManager", "SystemCapability.Sensors.Sensor", "SystemCapability.Sensors.MiscDevice", diff --git a/api/device-define/tv.json b/api/device-define/tv.json index 4a200b0979..509d24e0c5 100644 --- a/api/device-define/tv.json +++ b/api/device-define/tv.json @@ -113,6 +113,7 @@ "SystemCapability.FileManagement.File.DistributedFile", "SystemCapability.FileManagement.AppFileService", "SystemCapability.FileManagement.UserFileService", + "SystemCapability.FileManagement.UserFileManager.Core", "SystemCapability.USB.USBManager", "SystemCapability.Startup.SystemInfo", "SystemCapability.DistributedDataManager.RelationalStore.Core", diff --git a/api/device-define/wearable.json b/api/device-define/wearable.json index 7844c45225..8a5d948549 100644 --- a/api/device-define/wearable.json +++ b/api/device-define/wearable.json @@ -113,6 +113,7 @@ "SystemCapability.FileManagement.File.FileIO", "SystemCapability.FileManagement.File.Environment", "SystemCapability.FileManagement.UserFileService", + "SystemCapability.FileManagement.UserFileManager.Core", "SystemCapability.Sensors.Sensor", "SystemCapability.Sensors.MiscDevice", "SystemCapability.Startup.SystemInfo", diff --git a/build-tools/api_check_plugin/code_style_rule.json b/build-tools/api_check_plugin/code_style_rule.json index c0e992d06a..a638432928 100644 --- a/build-tools/api_check_plugin/code_style_rule.json +++ b/build-tools/api_check_plugin/code_style_rule.json @@ -439,7 +439,8 @@ "File.Environment", "File.DistributedFile", "AppFileService", - "UserFileService" + "UserFileService", + "UserFileManager" ], "USB":[ "USBManager" -- Gitee From e7f82cdfe894bd3e8dce5a3e800a26be8ca50cc2 Mon Sep 17 00:00:00 2001 From: zhaogan Date: Wed, 26 Oct 2022 10:15:30 +0800 Subject: [PATCH 266/438] Issue: #I5XPYI Description: add @systemapi for bundleManager.getLaunchWantForBundle Sig: SIG_ApplicaitonFramework Feature or Bugfix: Bugfix Binary Source: No Signed-off-by: zhaogan --- api/@ohos.bundle.bundleManager.d.ts | 13 +++++++------ api/@ohos.bundle.launcherBundleManager.d.ts | 17 ++++++++++++++++- api/bundleManager/abilityInfo.d.ts | 8 ++++---- api/bundleManager/applicationInfo.d.ts | 2 -- api/bundleManager/hapModuleInfo.d.ts | 1 - 5 files changed, 27 insertions(+), 14 deletions(-) diff --git a/api/@ohos.bundle.bundleManager.d.ts b/api/@ohos.bundle.bundleManager.d.ts index 12f7b31f2b..3bc39d1c14 100644 --- a/api/@ohos.bundle.bundleManager.d.ts +++ b/api/@ohos.bundle.bundleManager.d.ts @@ -256,7 +256,6 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; /** * Indicates extension info with type of service * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @systemapi * @since 9 */ SERVICE = 3, @@ -271,7 +270,6 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; /** * Indicates extension info with type of dataShare * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @systemapi * @since 9 */ DATA_SHARE = 5, @@ -892,7 +890,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @systemapi * @since 9 */ - function setApplicationEnabled(bundleName: string, isEnable: boolean, callback: AsyncCallback): void; + function setApplicationEnabled(bundleName: string, isEnabled: boolean, callback: AsyncCallback): void; /** * Sets whether to enable a specified application. @@ -907,7 +905,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @systemapi * @since 9 */ - function setApplicationEnabled(bundleName: string, isEnable: boolean): Promise; + function setApplicationEnabled(bundleName: string, isEnabled: boolean): Promise; /** * Sets whether to enable a specified ability. @@ -923,7 +921,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @systemapi * @since 9 */ - function setAbilityEnabled(info: AbilityInfo, isEnable: boolean, callback: AsyncCallback): void; + function setAbilityEnabled(info: AbilityInfo, isEnabled: boolean, callback: AsyncCallback): void; /** * Sets whether to enable a specified ability. @@ -939,7 +937,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @systemapi * @since 9 */ - function setAbilityEnabled(info: AbilityInfo, isEnable: boolean): Promise; + function setAbilityEnabled(info: AbilityInfo, isEnabled: boolean): Promise; /** * Checks whether a specified application is enabled. @@ -1005,6 +1003,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @throws { BusinessError } 17700004 - The specified userId is not found. * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi * @since 9 */ function getLaunchWantForBundle(bundleName: string, userId: number, callback: AsyncCallback): void; @@ -1022,6 +1021,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @throws { BusinessError } 17700004 - The specified userId is not found. * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi * @since 9 */ function getLaunchWantForBundle(bundleName: string, callback: AsyncCallback): void; @@ -1039,6 +1039,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @throws { BusinessError } 17700001 - The specified bundleName is not found. * @throws { BusinessError } 17700004 - The specified userId is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Core + * @systemapi * @since 9 */ function getLaunchWantForBundle(bundleName: string, userId?: number): Promise; diff --git a/api/@ohos.bundle.launcherBundleManager.d.ts b/api/@ohos.bundle.launcherBundleManager.d.ts index 6eb6137c7b..11759af3a6 100644 --- a/api/@ohos.bundle.launcherBundleManager.d.ts +++ b/api/@ohos.bundle.launcherBundleManager.d.ts @@ -112,7 +112,7 @@ declare namespace launcherBundleManager { * @returns { Promise> } the LauncherShortcutInfo object. * @throws {BusinessError} 201 - Verify permission denied. * @throws {BusinessError} 401 - The parameter check failed. - * @throws {BusinessError} 801 - Capability not support. + * @throws {BusinessError} 801 - Capability not support. * @throws {BusinessError} 17700001 - The specified bundle name is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Launcher * @systemapi @@ -127,6 +127,21 @@ declare namespace launcherBundleManager { * @since 9 */ export type LauncherAbilityInfo = _LauncherAbilityInfo; + + /** + * Provides information about a shortcut, including the shortcut ID and label. + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 9 + */ + export type ShortcutInfo = _ShortcutInfo; + /** + * Obtains information about the ability that a shortcut will start. + * @syscap SystemCapability.BundleManager.BundleFramework.Launcher + * @systemapi + * @since 9 + */ + export type ShortcutWant = _ShortcutWant; } export default launcherBundleManager; diff --git a/api/bundleManager/abilityInfo.d.ts b/api/bundleManager/abilityInfo.d.ts index d4ec20138c..5fe7f0a7be 100644 --- a/api/bundleManager/abilityInfo.d.ts +++ b/api/bundleManager/abilityInfo.d.ts @@ -115,7 +115,7 @@ export interface AbilityInfo { /** * Enumerates types of templates that can be used by an ability * @type {bundleManager.AbilityType} - * @syscap SystemCapability.BundleManager.BundleFramework + * @syscap SystemCapability.BundleManager.BundleFramework.Core * @FAModelOnly * @since 9 */ @@ -148,7 +148,7 @@ export interface AbilityInfo { /** * Indicates the permission required for reading ability data * @type {string} - * @syscap SystemCapability.BundleManager.BundleFramework + * @syscap SystemCapability.BundleManager.BundleFramework.Core * @FAModelOnly * @since 9 */ @@ -157,7 +157,7 @@ export interface AbilityInfo { /** * Indicates the permission required for writing data to the ability * @type {string} - * @syscap SystemCapability.BundleManager.BundleFramework + * @syscap SystemCapability.BundleManager.BundleFramework.Core * @FAModelOnly * @since 9 */ @@ -166,7 +166,7 @@ export interface AbilityInfo { /** * Uri of ability * @type {string} - * @syscap SystemCapability.BundleManager.BundleFramework + * @syscap SystemCapability.BundleManager.BundleFramework.Core * @FAModelOnly * @since 9 */ diff --git a/api/bundleManager/applicationInfo.d.ts b/api/bundleManager/applicationInfo.d.ts index d4a4e78242..881fb3c9aa 100644 --- a/api/bundleManager/applicationInfo.d.ts +++ b/api/bundleManager/applicationInfo.d.ts @@ -179,7 +179,6 @@ export interface ApplicationInfo { * Indicates the appDistributionType of the application * @type {string} * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @systemapi * @since 9 */ readonly appDistributionType: string; @@ -188,7 +187,6 @@ export interface ApplicationInfo { * Indicates the appProvisionType of the application * @type {string} * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @systemapi * @since 9 */ readonly appProvisionType: string; diff --git a/api/bundleManager/hapModuleInfo.d.ts b/api/bundleManager/hapModuleInfo.d.ts index 4fc11edabe..6d54b51102 100644 --- a/api/bundleManager/hapModuleInfo.d.ts +++ b/api/bundleManager/hapModuleInfo.d.ts @@ -132,7 +132,6 @@ export interface HapModuleInfo { * Indicates the hash value of the hap module * @type {string} * @syscap SystemCapability.BundleManager.BundleFramework.Core - * @systemapi * @since 9 */ readonly hashValue: string; -- Gitee From 0cefb30d515721b30a6aed31f092dae6af16c444 Mon Sep 17 00:00:00 2001 From: panqiangbiao Date: Fri, 21 Oct 2022 14:29:24 +0800 Subject: [PATCH 267/438] add system api Signed-off-by: panqiangbiao --- api/@ohos.filemanagement.userFileManager.d.ts | 97 +++++++ api/@ohos.multimedia.mediaLibrary.d.ts | 250 +----------------- 2 files changed, 101 insertions(+), 246 deletions(-) diff --git a/api/@ohos.filemanagement.userFileManager.d.ts b/api/@ohos.filemanagement.userFileManager.d.ts index ebadef5a84..2789f87741 100644 --- a/api/@ohos.filemanagement.userFileManager.d.ts +++ b/api/@ohos.filemanagement.userFileManager.d.ts @@ -21,6 +21,7 @@ import dataSharePredicates from './@ohos.data.dataSharePredicates'; /** * @name userFileManager * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @import Import userFileManager from '@ohos.filemanagement.userFileManager' */ @@ -28,6 +29,7 @@ declare namespace userFileManager { /** * Returns an instance of UserFileManager * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @StageModelOnly * @param context Hap context information @@ -38,24 +40,28 @@ declare namespace userFileManager { /** * Enumeration types for different kinds of Files * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ enum FileType { /** * Image file type * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ IMAGE = 1, /** * Video file type * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ VIDEO, /** * Audio file type * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ AUDIO @@ -63,17 +69,22 @@ declare namespace userFileManager { /** * Indicates the type of file asset member. + * @since 9 + * @systemapi */ type MemberType = number | string | boolean; /** * Indicates the type of notify event. + * @since 9 + * @systemapi */ type ChangeEvent = 'deviceChange' | 'albumChange' | 'imageChange' | 'audioChange' | 'videoChange' | 'remoteFileChange'; /** * Provides methods to encapsulate file attributes. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @import Import userFileManager from '@ohos.filemanagement.userFileManager' */ @@ -81,24 +92,28 @@ declare namespace userFileManager { /** * URI of the file. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ readonly uri: string; /** * File type, for example, IMAGE, VIDEO, AUDIO * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ readonly fileType: FileType; /** * Display name (with a file name extension) of the file. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ displayName: string; /** * Return the fileasset member parameter. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @param member the name of the parameter. for example : get(ImageVideoKey.URI) */ @@ -106,6 +121,7 @@ declare namespace userFileManager { /** * Set the fileasset member parameter. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @param member The name of the parameter. only TITLE can be changed * @param string The value of the parameter. @@ -115,6 +131,7 @@ declare namespace userFileManager { /** * Modify meta data where the file is located. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.WRITE_IMAGEVIDEO or ohos.permission.WRITE_AUDIO * @param callback No value will be returned. @@ -123,6 +140,7 @@ declare namespace userFileManager { /** * Modify meta data where the file is located. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.WRITE_IMAGEVIDEO or ohos.permission.WRITE_AUDIO */ @@ -130,6 +148,7 @@ declare namespace userFileManager { /** * Open the file is located. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.READ_IMAGEVIDEO or ohos.permission.READ_AUDIO or ohos.permission.WRITE_IMAGEVIDEO or ohos.permission.WRITE_AUDIO * @param mode Mode for open, for example: rw, r, w. @@ -139,6 +158,7 @@ declare namespace userFileManager { /** * Open the file is located. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.READ_IMAGEVIDEO or ohos.permission.READ_AUDIO or ohos.permission.WRITE_IMAGEVIDEO or ohos.permission.WRITE_AUDIO * @param mode Mode for open, for example: rw, r, w. @@ -147,6 +167,7 @@ declare namespace userFileManager { /** * Close the file is located. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @param fd Fd of the file which had been opened * @param callback No value will be returned. @@ -155,6 +176,7 @@ declare namespace userFileManager { /** * Close the file is located. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @param fd Fd of the file which had been opened */ @@ -162,6 +184,7 @@ declare namespace userFileManager { /** * Get thumbnail of the file when the file is located. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.READ_IMAGEVIDEO or ohos.permission.READ_AUDIO * @param callback Callback used to return the thumbnail's pixelmap. @@ -170,6 +193,7 @@ declare namespace userFileManager { /** * Get thumbnail of the file when the file is located. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.READ_IMAGEVIDEO or ohos.permission.READ_AUDIO * @param size Thumbnail's size @@ -179,6 +203,7 @@ declare namespace userFileManager { /** * Get thumbnail of the file when the file is located. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.READ_IMAGEVIDEO or ohos.permission.READ_AUDIO * @param size Thumbnail's size @@ -187,6 +212,7 @@ declare namespace userFileManager { /** * Set favorite for the file when the file is located. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.WRITE_IMAGEVIDEO or ohos.permission.WRITE_AUDIO * @param isFavorite True is favorite file, false is not favorite file @@ -196,6 +222,7 @@ declare namespace userFileManager { /** * Set favorite for the file when the file is located. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core ** @permission ohos.permission.WRITE_IMAGEVIDEO or ohos.permission.WRITE_AUDIO * @param isFavorite True is favorite file, false is not favorite file @@ -206,60 +233,70 @@ declare namespace userFileManager { /** * Describes AUDIO TYPE FetchOptions's predicate * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ enum AudioKey { /** * File uri * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ URI, /** * File name * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ DISPLAY_NAME, /** * Date of the file creation * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ DATE_ADDED, /** * Modify date of the file * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ DATE_MODIFIED, /** * Title of the file * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ TITLE, /** * Artist of the audio file * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ ARTIST, /** * Audio album of the audio file * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ AUDIOALBUM, /** * Duration of the audio file * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ DURATION, /** * Favorite state of the file * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ FAVORITE, @@ -268,78 +305,91 @@ declare namespace userFileManager { /** * Describes Image, Video TYPE FetchOptions's predicate * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ enum ImageVideoKey { /** * File uri * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ URI, /** * File type of the Asset * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ FILE_TYPE, /** * File name * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ DISPLAY_NAME, /** * Date of the file creation * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ DATE_ADDED, /** * Modify date of the file * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ DATE_MODIFIED, /** * Title of the file * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ TITLE, /** * Duration of the audio and video file * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ DURATION, /** * Width of the image file * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ WIDTH, /** * Height of the image file * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ HEIGHT, /** * Date taken of the file * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ DATE_TAKEN, /** * Orientation of the image file * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ ORIENTATION, /** * Favorite state of the file * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ FAVORITE, @@ -348,36 +398,42 @@ declare namespace userFileManager { /** * Describes Album TYPE predicate * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ enum AlbumKey { /** * Album uri * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ URI, /** * File type of the Album * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ FILE_TYPE, /** * Album name * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ ALBUM_NAME, /** * Date of the Album creation * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ DATE_ADDED, /** * Modify date of the Album * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ DATE_MODIFIED, @@ -385,6 +441,7 @@ declare namespace userFileManager { /** * Fetch parameters + * @systemapi * @since 9 * @syscap SystemCapability.FileManagement.UserFileManager.Core */ @@ -392,6 +449,7 @@ declare namespace userFileManager { /** * Indicates the columns to query. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @param fetchColumns Indicates the columns to query. If this parameter is null, only uri, name, fileType will query. */ @@ -399,6 +457,7 @@ declare namespace userFileManager { /** * Predicate to query * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @param predicates Indicates filter criteria. */ @@ -408,12 +467,14 @@ declare namespace userFileManager { /** * Fetch parameters * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ interface AlbumFetchOptions { /** * Predicate to query * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @param predicates Indicates filter criteria. */ @@ -423,6 +484,7 @@ declare namespace userFileManager { /** * Implements file retrieval. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @import Import userFileManager from '@ohos.filemanagement.userFileManager' */ @@ -430,6 +492,7 @@ declare namespace userFileManager { /** * Obtains the total number of files in the file retrieval result. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @return Total number of files. */ @@ -437,6 +500,7 @@ declare namespace userFileManager { /** * Checks whether the result set points to the last row. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @return Whether the file is the last one. * You need to check whether the file is the last one before calling getNextObject, @@ -446,12 +510,14 @@ declare namespace userFileManager { /** * Releases the FetchResult instance and invalidates it. Other methods cannot be called. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ close(): void; /** * Obtains the first FileAsset in the file retrieval result. This method uses a callback to return the file. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @param callback Callback used to return the file in the format of a FileAsset instance. */ @@ -459,6 +525,7 @@ declare namespace userFileManager { /** * Obtains the first T in the file retrieval result. This method uses a promise to return the file. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @return A Promise instance used to return the file in the format of a T instance. */ @@ -469,6 +536,7 @@ declare namespace userFileManager { * Before calling this method, you must use isAfterLast() to check whether the result set points to the last row. * This method returns the next file only when True is returned for isAfterLast(). * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @param callback Callback used to return the file in the format of a T instance. */ @@ -479,6 +547,7 @@ declare namespace userFileManager { * Before calling this method, you must use isAfterLast() to check whether the result set points to the last row. * This method returns the next file only when True is returned for isAfterLast(). * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @return A Promise instance used to return the file in the format of a T instance. */ @@ -486,6 +555,7 @@ declare namespace userFileManager { /** * Obtains the last T in the file retrieval result. This method uses a callback to return the file. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @param callback Callback used to return the file in the format of a T instance. */ @@ -493,6 +563,7 @@ declare namespace userFileManager { /** * Obtains the last T in the file retrieval result. This method uses a promise to return the file. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @return A Promise instance used to return the file in the format of a T instance. */ @@ -501,6 +572,7 @@ declare namespace userFileManager { * Obtains the T with the specified index in the file retrieval result. * This method uses a callback to return the file. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @param index Index of the file to obtain. * @throws {BusinessError} 13900020 - if type index is not number @@ -511,6 +583,7 @@ declare namespace userFileManager { * Obtains the T with the specified index in the file retrieval result. * This method uses a promise to return the file. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @param index Index of the file to obtain. * @throws {BusinessError} 13900020 - if type index is not number @@ -524,41 +597,48 @@ declare namespace userFileManager { * * @syscap SystemCapability.FileManagement.UserFileManager.Core * @since 9 + * @systemapi */ interface AbsAlbum { /** * Album name. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ albumName: string; /** * Album uri. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ readonly albumUri: string; /** * Date (timestamp) when the album was last modified. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ readonly dateModified: number; /** * File count for the album * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ readonly count: number; /** * CoverUri for the album * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ readonly coverUri: string; /** * Obtains files in an album. This method uses an asynchronous callback to return the files. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.READ_IMAGEVIDEO * @param type Detemined which kinds of asset to retrive. @@ -570,6 +650,7 @@ declare namespace userFileManager { /** * Obtains files in an album. This method uses a promise to return the files. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.READ_IMAGEVIDEO * @param type Detemined which kinds of asset to retrive. @@ -585,11 +666,13 @@ declare namespace userFileManager { * * @syscap SystemCapability.FileManagement.UserFileManager.Core * @since 9 + * @systemapi */ interface Album extends AbsAlbum { /** * Modify the meta data for the album * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.WRITE_IMAGEVIDEO * @param callback No value will be returned. @@ -598,6 +681,7 @@ declare namespace userFileManager { /** * Modify the meta data for the album * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.WRITE_IMAGEVIDEO */ @@ -609,11 +693,13 @@ declare namespace userFileManager { * * @syscap SystemCapability.FileManagement.UserFileManager.Core * @since 9 + * @systemapi */ interface UserFileManager { /** * Query photo, video assets * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.READ_IMAGEVIDEO * @param options retrieval options. @@ -624,6 +710,7 @@ declare namespace userFileManager { /** * Query photo, video assets * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.READ_IMAGEVIDEO * @param type Detemined which kinds of asset to retrive. @@ -672,6 +759,7 @@ declare namespace userFileManager { /** * Obtains albums based on the retrieval options. This method uses an asynchronous callback to return. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.READ_IMAGEVIDEO * @param options Retrieval options. @@ -682,6 +770,7 @@ declare namespace userFileManager { /** * Obtains albums based on the retrieval options. This method uses a promise to return the albums. * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.READ_IMAGEVIDEO * @param options Retrieval options. @@ -714,6 +803,7 @@ declare namespace userFileManager { /** * Query audio assets * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.READ_AUDIO * @param options Retrieval options. @@ -724,6 +814,7 @@ declare namespace userFileManager { /** * Query audio assets * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.READ_AUDIO * @param type Detemined which kinds of asset to retrive. @@ -735,6 +826,7 @@ declare namespace userFileManager { /** * Delete Asset * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.READ_IMAGEVIDEO and ohos.permission.WRITE_IMAGEVIDEO or ohos.permission.READ_AUDIO and ohos.permission.WRITE_AUDIO * @param uri Uri of asset @@ -745,6 +837,7 @@ declare namespace userFileManager { /** * Delete Asset * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.READ_IMAGEVIDEO and ohos.permission.WRITE_IMAGEVIDEO or ohos.permission.READ_AUDIO and ohos.permission.WRITE_AUDIO * @param uri Uri of asset @@ -755,6 +848,7 @@ declare namespace userFileManager { /** * Turn on mornitor the data changes * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @param type One of 'deviceChange','albumChange','imageChange','audioChange','videoChange','remoteFileChange' * @param callback No value returned @@ -763,6 +857,7 @@ declare namespace userFileManager { /** * Turn off mornitor the data changes * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @param type One of 'deviceChange','albumChange','imageChange','audioChange','videoChange','remoteFileChange' * @param callback No value returned @@ -803,6 +898,7 @@ declare namespace userFileManager { /** * Release UserFileManager instance * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @param callback no value returned */ @@ -810,6 +906,7 @@ declare namespace userFileManager { /** * Release UserFileManager instance * @since 9 + * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core */ release(): Promise; diff --git a/api/@ohos.multimedia.mediaLibrary.d.ts b/api/@ohos.multimedia.mediaLibrary.d.ts index bc5b5a6102..18699d7b45 100644 --- a/api/@ohos.multimedia.mediaLibrary.d.ts +++ b/api/@ohos.multimedia.mediaLibrary.d.ts @@ -22,8 +22,6 @@ import image from './@ohos.multimedia.image'; * @since 6 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @import import media from '@ohos.multimedia.mediaLibrary' - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager */ declare namespace mediaLibrary { /** @@ -33,8 +31,6 @@ declare namespace mediaLibrary { * @import import mediaLibrary from '@ohos.multimedia.mediaLibrary' * @FAModelOnly * @return Returns a MediaLibrary instance if the operation is successful; returns null otherwise. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.getUserFileMgr */ function getMediaLibrary(): MediaLibrary; /** @@ -44,8 +40,6 @@ declare namespace mediaLibrary { * @StageModelOnly * @param context hap context information * @return Instance of MediaLibrary - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.getUserFileMgr */ function getMediaLibrary(context: Context): MediaLibrary; @@ -53,40 +47,30 @@ declare namespace mediaLibrary { * Enumeration types for different kind of Media Files * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.MediaType */ enum MediaType { /** * File media type * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.MediaType.FILE */ FILE = 0, /** * Image media type * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.MediaType.IMAGE */ IMAGE, /** * Video media type * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.MediaType.VIDEO */ VIDEO, /** * Audio media type * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.MediaType.AUDIO */ AUDIO } @@ -151,123 +135,102 @@ declare namespace mediaLibrary { * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @import import mediaLibrary from '@ohos.multimedia.mediaLibrary' - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileAsset */ interface FileAsset { /** * File ID. * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ readonly id: number; /** * URI of the file. * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileAsset.uri */ readonly uri: string; /** * MIME type, for example, video/mp4, audio/mp4, or audio/amr-wb. * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileAsset.mimeType */ readonly mimeType: string; /** - * Media type, for example, IMAGE, VIDEO, FILE, AUDIO + * Media type, for example, IMAGE, VIDEO, FILE, AUDIO * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ readonly mediaType: MediaType; /** * Display name (with a file name extension) of the file. * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileAsset.displayName */ displayName: string; /** * File name title (without the file name extension). * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ title: string; /** * Relative Path of the file. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ relativePath: string; /** * Parent folder's file_id of the file. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ readonly parent: number; /** * Data size of the file. * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ readonly size: number; /** * Date (timestamp) when the file was added. * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ readonly dateAdded: number; /** * Date (timestamp) when the file was modified. * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ readonly dateModified: number; /** * Date (timestamp) when the file was taken. * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ readonly dateTaken: number; /** * Artist of the audio file. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ readonly artist: string; /** * audioAlbum of the audio file. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ readonly audioAlbum: string; /** * Display width of the file. This is valid only for videos and images. * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ readonly width: number; /** * Display height of the file. This is valid only for videos and images. * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ readonly height: number; /** @@ -275,35 +238,30 @@ declare namespace mediaLibrary { * The rotation angle can be 0, 90, 180, or 270 degrees. This is valid only for videos. * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ orientation: number; /** * duration of the audio and video file. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ readonly duration: number; /** * ID of the album where the file is located. * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ readonly albumId: number; /** * URI of the album where the file is located. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ readonly albumUri: string; /** * Name of the album where the file is located. * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ readonly albumName: string; @@ -313,8 +271,6 @@ declare namespace mediaLibrary { * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @permission ohos.permission.READ_MEDIA * @param callback Callback return the result of isDerectory. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileAsset.isDirectory */ isDirectory(callback: AsyncCallback): void; /** @@ -322,8 +278,6 @@ declare namespace mediaLibrary { * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @permission ohos.permission.READ_MEDIA - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileAsset.isDirectory */ isDirectory():Promise; /** @@ -332,8 +286,6 @@ declare namespace mediaLibrary { * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @permission ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA * @param callback no value will be returned. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileAsset.commitModify */ commitModify(callback: AsyncCallback): void; /** @@ -341,8 +293,6 @@ declare namespace mediaLibrary { * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @permission ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileAsset.commitModify */ commitModify(): Promise; /** @@ -352,8 +302,6 @@ declare namespace mediaLibrary { * @permission ohos.permission.READ_MEDIA or ohos.permission.WRITE_MEDIA * @param mode mode for open, for example: rw, r, w. * @param callback Callback return the fd of the file. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileAsset.open */ open(mode: string, callback: AsyncCallback): void; /** @@ -362,8 +310,6 @@ declare namespace mediaLibrary { * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @permission ohos.permission.READ_MEDIA or ohos.permission.WRITE_MEDIA * @param mode mode for open, for example: rw, r, w. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileAsset.open */ open(mode: string): Promise; /** @@ -373,8 +319,6 @@ declare namespace mediaLibrary { * @permission ohos.permission.READ_MEDIA or ohos.permission.WRITE_MEDIA * @param fd fd of the file which had been opened * @param callback no value will be returned. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileAsset.close */ close(fd: number, callback: AsyncCallback): void; /** @@ -383,8 +327,6 @@ declare namespace mediaLibrary { * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @permission ohos.permission.READ_MEDIA or ohos.permission.WRITE_MEDIA * @param fd fd of the file which had been opened - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileAsset.close */ close(fd: number): Promise; /** @@ -393,8 +335,6 @@ declare namespace mediaLibrary { * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @permission ohos.permission.READ_MEDIA * @param callback Callback used to return the thumbnail's pixelmap. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileAsset.getThumbnail */ getThumbnail(callback: AsyncCallback): void; /** @@ -404,8 +344,6 @@ declare namespace mediaLibrary { * @permission ohos.permission.READ_MEDIA * @param size thumbnail's size * @param callback Callback used to return the thumbnail's pixelmap. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileAsset.getThumbnail */ getThumbnail(size: Size, callback: AsyncCallback): void; /** @@ -414,8 +352,6 @@ declare namespace mediaLibrary { * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @permission ohos.permission.READ_MEDIA * @param size thumbnail's size - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileAsset.getThumbnail */ getThumbnail(size?: Size): Promise; /** @@ -425,8 +361,6 @@ declare namespace mediaLibrary { * @permission ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA * @param isFavorite ture is favorite file, false is not favorite file * @param callback Callback used to return, No value is returned. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileAsset.favorite */ favorite(isFavorite: boolean, callback: AsyncCallback): void; /** @@ -435,8 +369,6 @@ declare namespace mediaLibrary { * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @permission ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA * @param isFavorite ture is favorite file, false is not favorite file - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileAsset.favorite */ favorite(isFavorite: boolean): Promise; /** @@ -445,8 +377,6 @@ declare namespace mediaLibrary { * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @permission ohos.permission.READ_MEDIA * @param callback Callback used to return true or false. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileAsset.isFavorite */ isFavorite(callback: AsyncCallback): void; /** @@ -454,8 +384,6 @@ declare namespace mediaLibrary { * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @permission ohos.permission.READ_MEDIA - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileAsset.isFavorite */ isFavorite():Promise; /** @@ -465,8 +393,6 @@ declare namespace mediaLibrary { * @permission ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA * @param isTrash true is trashed file, false is not trashed file * @param callback Callback used to return, No value is returned. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileAsset.trash */ trash(isTrash: boolean, callback: AsyncCallback): void; /** @@ -475,8 +401,6 @@ declare namespace mediaLibrary { * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @permission ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA * @param isTrash true is trashed file, false is not trashed file - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileAsset.trash */ trash(isTrash: boolean): Promise; /** @@ -485,8 +409,6 @@ declare namespace mediaLibrary { * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @permission ohos.permission.READ_MEDIA * @param callback Callback used to return true or false. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileAsset.isTrash */ isTrash(callback: AsyncCallback): void; /** @@ -494,8 +416,6 @@ declare namespace mediaLibrary { * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @permission ohos.permission.READ_MEDIA - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileAsset.isTrash */ isTrash():Promise; } @@ -504,146 +424,120 @@ declare namespace mediaLibrary { * Describes MediaFetchOptions's selection * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileKey */ enum FileKey { /** * File ID * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ ID = "file_id", /** * Relative Path * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileKey.RELATIVE_PATH */ RELATIVE_PATH = "relative_path", /** * File name * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileKey.DISPLAY_NAME */ DISPLAY_NAME = "display_name", /** * Parent folder file id * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ PARENT = "parent", /** * Mime type of the file * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ MIME_TYPE = "mime_type", /** * Media type of the file * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ MEDIA_TYPE = "media_type", /** * Size of the file * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ SIZE = "size", /** * Date of the file creation * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileKey.DATE_ADDED */ DATE_ADDED = "date_added", /** * Modify date of the file * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileKey.DATE_MODIFIED */ DATE_MODIFIED = "date_modified", /** * Date taken of the file * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ DATE_TAKEN = "date_taken", /** * Title of the file * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FileKey.TITLE */ TITLE = "title", /** * Artist of the audio file * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ ARTIST = "artist", /** * Audio album of the audio file * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ AUDIOALBUM = "audio_album", /** * Duration of the audio and video file * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ DURATION = "duration", /** * Width of the image file * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ WIDTH = "width", /** * Height of the image file * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ HEIGHT = "height", /** * Orientation of the image file * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ ORIENTATION = "orientation", /** * Album id of the file * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ ALBUM_ID = "bucket_id", /** * Album name of the file * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ ALBUM_NAME = "bucket_display_name", } @@ -652,52 +546,42 @@ declare namespace mediaLibrary { * Fetch parameters applicable on images, videos, audios, albums and other media * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.MediaFetchOptions */ interface MediaFetchOptions { /** * Fields to retrieve, for example, selections: "media_type =? OR media_type =?". * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.MediaFetchOptions.selections */ selections: string; /** * Conditions for retrieval, for example, selectionArgs: [IMAGE, VIDEO]. * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.MediaFetchOptions.selectionArgs */ selectionArgs: Array; /** * Sorting criterion of the retrieval results, for example, order: "datetaken DESC,display_name DESC, file_id DESC". * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ order?: string; /** * uri for retrieval * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ uri?: string; /** * networkId for retrieval * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ networkId?: string; /** * extendArgs for retrieval * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ extendArgs?: string; } @@ -707,8 +591,6 @@ declare namespace mediaLibrary { * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @import import mediaLibrary from '@ohos.multimedia.mediaLibrary' - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FetchFileResult */ interface FetchFileResult { /** @@ -716,8 +598,6 @@ declare namespace mediaLibrary { * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @return Total number of files. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FetchFileResult.getCount */ getCount(): number; /** @@ -725,8 +605,6 @@ declare namespace mediaLibrary { * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @return Whether the file is the last one. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FetchFileResult.isAfterLast * You need to check whether the file is the last one before calling getNextObject, * which returns the next file only when True is returned for this method. */ @@ -735,8 +613,6 @@ declare namespace mediaLibrary { * Releases the FetchFileResult instance and invalidates it. Other methods cannot be called. * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FetchFileResult.close */ close(): void; /** @@ -744,8 +620,6 @@ declare namespace mediaLibrary { * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @param callback Callback used to return the file in the format of a FileAsset instance. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FetchFileResult.getFirstObject */ getFirstObject(callback: AsyncCallback): void; /** @@ -753,8 +627,6 @@ declare namespace mediaLibrary { * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @return A Promise instance used to return the file in the format of a FileAsset instance. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FetchFileResult.getFirstObject */ getFirstObject(): Promise; /** @@ -765,8 +637,6 @@ declare namespace mediaLibrary { * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @param callback Callback used to return the file in the format of a FileAsset instance. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FetchFileResult.getNextObject */ getNextObject(callback: AsyncCallback): void; /** @@ -777,8 +647,6 @@ declare namespace mediaLibrary { * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @return A Promise instance used to return the file in the format of a FileAsset instance. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FetchFileResult.getNextObject */ getNextObject(): Promise; /** @@ -786,8 +654,6 @@ declare namespace mediaLibrary { * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @param callback Callback used to return the file in the format of a FileAsset instance. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FetchFileResult.getLastObject */ getLastObject(callback: AsyncCallback): void; /** @@ -795,8 +661,6 @@ declare namespace mediaLibrary { * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @return A Promise instance used to return the file in the format of a FileAsset instance. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FetchFileResult.getLastObject */ getLastObject(): Promise; /** @@ -806,8 +670,6 @@ declare namespace mediaLibrary { * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @param index Index of the file to obtain. * @param callback Callback used to return the file in the format of a FileAsset instance. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FetchFileResult.getPositionObject */ getPositionObject(index: number, callback: AsyncCallback): void; /** @@ -817,19 +679,16 @@ declare namespace mediaLibrary { * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @param index Index of the file to obtain. * @return A Promise instance used to return the file in the format of a FileAsset instance. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.FetchFileResult.getPositionObject */ getPositionObject(index: number): Promise; /** * Obtains all FileAssets in the file retrieval result. - * This method uses a callback to return the result. After this method is called, + * This method uses a callback to return the result. After this method is called, * close() is automatically called to release the FetchFileResult instance and invalidate it. * In this case, other methods cannot be called. * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @param callback Callback used to return a FileAsset array. - * @deprecated since 9 */ getAllObject(callback: AsyncCallback>): void; /** @@ -840,7 +699,6 @@ declare namespace mediaLibrary { * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @return A Promise instance used to return a FileAsset array. - * @deprecated since 9 */ getAllObject(): Promise>; } @@ -850,63 +708,48 @@ declare namespace mediaLibrary { * * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @since 7 - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.Album */ interface Album { /** * Album ID. * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 */ readonly albumId: number; /** * Album name. * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.Album.albumName */ albumName: string; /** * Album uri. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.Album.albumUri */ readonly albumUri: string; /** * Date (timestamp) when the album was last modified. * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.Album.dateModified */ readonly dateModified: number; /** * File count for the album * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.Album.count */ readonly count: number; /** * Relative path for the album * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.Album.relativePath */ readonly relativePath: string; /** * coverUri for the album * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.Album.coverUri */ readonly coverUri: string; @@ -916,8 +759,6 @@ declare namespace mediaLibrary { * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @permission ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA * @param callback, no value will be returned. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.Album.commitModify */ commitModify(callback: AsyncCallback): void; /** @@ -925,8 +766,6 @@ declare namespace mediaLibrary { * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @permission ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.Album.commitModify */ commitModify(): Promise; /** @@ -935,8 +774,6 @@ declare namespace mediaLibrary { * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @permission ohos.permission.READ_MEDIA * @param callback Callback used to return the files in the format of a FetchFileResult instance. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.Album.getFileAssets */ getFileAssets(callback: AsyncCallback): void; /** @@ -946,8 +783,6 @@ declare namespace mediaLibrary { * @permission ohos.permission.READ_MEDIA * @param option Media retrieval options. * @param callback Callback used to return the files in the format of a FetchFileResult instance. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.Album.getFileAssets */ getFileAssets(options: MediaFetchOptions, callback: AsyncCallback): void; /** @@ -957,8 +792,6 @@ declare namespace mediaLibrary { * @permission ohos.permission.READ_MEDIA * @param option Media retrieval options. * @return A Promise instance used to return the files in the format of a FetchFileResult instance. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.Album.getFileAssets */ getFileAssets(options?: MediaFetchOptions): Promise; } @@ -967,56 +800,42 @@ declare namespace mediaLibrary { * Enumeration public directory that predefined * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.DirectoryType */ enum DirectoryType { /** * predefined public directory for files token by Camera. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.DirectoryType.DIR_CAMERA */ DIR_CAMERA = 0, /** * predefined public directory for VIDEO files. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.DirectoryType.DIR_VIDEO */ DIR_VIDEO, /** * predefined public directory for IMAGE files. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.DirectoryType.DIR_IMAGE */ DIR_IMAGE, /** * predefined public directory for AUDIO files. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.DirectoryType.DIR_AUDIO */ DIR_AUDIO, /** * predefined public directory for DOCUMENTS files. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.DirectoryType.DIR_DOCUMENTS */ DIR_DOCUMENTS, /** * predefined public directory for DOWNLOAD files. * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.DirectoryType.DIR_DOWNLOAD */ DIR_DOWNLOAD } @@ -1026,8 +845,6 @@ declare namespace mediaLibrary { * * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @since 6 - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.UserFileManager */ interface MediaLibrary { /** @@ -1036,8 +853,6 @@ declare namespace mediaLibrary { * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @param type, public directory predefined in DirectoryType. * @param callback Callback return the FetchFileResult. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.UserFileManager.getPublicDirectory */ getPublicDirectory(type: DirectoryType, callback: AsyncCallback): void; /** @@ -1046,8 +861,6 @@ declare namespace mediaLibrary { * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @param type public directory predefined in DirectoryType. * @return A promise instance used to return the public directory in the format of string - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.UserFileManager.getPublicDirectory */ getPublicDirectory(type: DirectoryType): Promise; /** @@ -1058,8 +871,6 @@ declare namespace mediaLibrary { * @permission ohos.permission.READ_MEDIA * @param options, Media retrieval options. * @param callback, Callback return the FetchFileResult. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.UserFileManager.getFileAssets */ getFileAssets(options: MediaFetchOptions, callback: AsyncCallback): void; /** @@ -1070,8 +881,6 @@ declare namespace mediaLibrary { * @permission ohos.permission.READ_MEDIA * @param options Media retrieval options. * @return A promise instance used to return the files in the format of a FetchFileResult instance - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.UserFileManager.getFileAssets */ getFileAssets(options: MediaFetchOptions): Promise; /** @@ -1080,8 +889,6 @@ declare namespace mediaLibrary { * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @param type one of 'deviceChange','albumChange','imageChange','audioChange','videoChange','fileChange','remoteFileChange' * @param callback no value returned - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.UserFileManager.on */ on(type: 'deviceChange'|'albumChange'|'imageChange'|'audioChange'|'videoChange'|'fileChange'|'remoteFileChange', callback: Callback): void; /** @@ -1090,8 +897,6 @@ declare namespace mediaLibrary { * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @param type one of 'deviceChange','albumChange','imageChange','audioChange','videoChange','fileChange','remoteFileChange' * @param callback no value returned - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.UserFileManager.off */ off(type: 'deviceChange'|'albumChange'|'imageChange'|'audioChange'|'videoChange'|'fileChange'|'remoteFileChange', callback?: Callback): void; /** @@ -1103,8 +908,6 @@ declare namespace mediaLibrary { * @param displayName file name * @param relativePath relative path * @param callback Callback used to return the FileAsset - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.UserFileManager.createAsset */ createAsset(mediaType: MediaType, displayName: string, relativePath: string, callback: AsyncCallback): void; /** @@ -1116,8 +919,6 @@ declare namespace mediaLibrary { * @param displayName file name * @param relativePath relative path * @return A Promise instance used to return the FileAsset - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.UserFileManager.createAsset */ createAsset(mediaType: MediaType, displayName: string, relativePath: string): Promise; /** @@ -1128,8 +929,6 @@ declare namespace mediaLibrary { * @param uri FileAsset's URI * @param callback no value returned * @systemapi - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.UserFileManager.deleteAsset */ deleteAsset(uri: string, callback: AsyncCallback): void; /** @@ -1140,8 +939,6 @@ declare namespace mediaLibrary { * @param uri, FileAsset's URI * @return A Promise instance, no value returned * @systemapi - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.UserFileManager.deleteAsset */ deleteAsset(uri: string): Promise; /** @@ -1151,8 +948,6 @@ declare namespace mediaLibrary { * @permission ohos.permission.READ_MEDIA * @param option Media retrieval options. * @param callback Callback used to return an album array. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.UserFileManager.getAlbums */ getAlbums(options: MediaFetchOptions, callback: AsyncCallback>): void; /** @@ -1162,8 +957,6 @@ declare namespace mediaLibrary { * @permission ohos.permission.READ_MEDIA * @param option Media retrieval options. * @return A Promise instance used to return an album array. - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.UserFileManager.getAlbums */ getAlbums(options: MediaFetchOptions): Promise>; /** @@ -1243,8 +1036,6 @@ declare namespace mediaLibrary { * @permission ohos.permission.READ_MEDIA * @systemapi * @param callback, Callback return the list of the active peer devices' information - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.UserFileManager.getActivePeers */ getActivePeers(callback: AsyncCallback>): void; /** @@ -1254,8 +1045,6 @@ declare namespace mediaLibrary { * @permission ohos.permission.READ_MEDIA * @systemapi * @return Promise used to return the list of the active peer devices' information - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.UserFileManager.getActivePeers */ getActivePeers(): Promise>; /** @@ -1265,8 +1054,6 @@ declare namespace mediaLibrary { * @permission ohos.permission.READ_MEDIA * @systemapi * @param callback Callback return the list of the all the peer devices' information - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.UserFileManager.getAllPeers */ getAllPeers(callback: AsyncCallback>): void; /** @@ -1276,8 +1063,6 @@ declare namespace mediaLibrary { * @permission ohos.permission.READ_MEDIA * @systemapi * @return Promise used to return the list of the all the peer devices' information - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.UserFileManager.getAllPeers */ getAllPeers(): Promise>; /** @@ -1285,16 +1070,12 @@ declare namespace mediaLibrary { * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @param callback no value returned - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.UserFileManager.release */ release(callback: AsyncCallback): void; /** * Release MediaLibrary instance * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.UserFileManager.release */ release(): Promise; } @@ -1303,43 +1084,33 @@ declare namespace mediaLibrary { * thumbnail's size which have width and heigh * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @since 8 - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.Size */ interface Size { /** * Width of image file * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.Size.width */ width: number; /** * Height of image file * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.Size.height */ height: number; } - + /** * peer devices' information * @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore * @systemapi * @since 8 - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.PeerInfo */ interface PeerInfo { /** * Peer device name * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.PeerInfo.deviceName * @systemapi */ readonly deviceName: string; @@ -1347,8 +1118,6 @@ declare namespace mediaLibrary { * Peer device network id * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.PeerInfo.networkId * @systemapi */ readonly networkId: string; @@ -1356,7 +1125,6 @@ declare namespace mediaLibrary { * Peer device type * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore - * @deprecated since 9 * @systemapi */ readonly deviceType: DeviceType; @@ -1365,8 +1133,6 @@ declare namespace mediaLibrary { * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore * @systemapi - * @deprecated since 9 - * @useinstead ohos.filemanagement.UserFileManager.PeerInfo.isOnline */ readonly isOnline: boolean; } @@ -1376,7 +1142,6 @@ declare namespace mediaLibrary { * @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore * @systemapi * @since 8 - * @deprecated since 9 */ enum DeviceType { /** @@ -1384,7 +1149,6 @@ declare namespace mediaLibrary { * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore * @systemapi - * @deprecated since 9 */ TYPE_UNKNOWN = 0, /** @@ -1392,7 +1156,6 @@ declare namespace mediaLibrary { * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore * @systemapi - * @deprecated since 9 */ TYPE_LAPTOP, /** @@ -1400,7 +1163,6 @@ declare namespace mediaLibrary { * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore * @systemapi - * @deprecated since 9 */ TYPE_PHONE, /** @@ -1408,7 +1170,6 @@ declare namespace mediaLibrary { * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore * @systemapi - * @deprecated since 9 */ TYPE_TABLET, /** @@ -1416,7 +1177,6 @@ declare namespace mediaLibrary { * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore * @systemapi - * @deprecated since 9 */ TYPE_WATCH, /** @@ -1424,7 +1184,6 @@ declare namespace mediaLibrary { * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore * @systemapi - * @deprecated since 9 */ TYPE_CAR, /** @@ -1432,10 +1191,9 @@ declare namespace mediaLibrary { * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore * @systemapi - * @deprecated since 9 */ TYPE_TV } } -export default mediaLibrary; +export default mediaLibrary; \ No newline at end of file -- Gitee From a65b2e5022c3a485f9c40d567280447ce0acfe92 Mon Sep 17 00:00:00 2001 From: ltdong Date: Thu, 27 Oct 2022 12:26:57 +0000 Subject: [PATCH 268/438] update api/@ohos.data.rdb.d.ts. add @useinstead keys Signed-off-by: ltdong --- api/@ohos.data.rdb.d.ts | 65 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index 63e0cf4803..36d9d72ea0 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -41,6 +41,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.getRdbStoreV9 */ function getRdbStore(context: Context, config: StoreConfig, version: number, callback: AsyncCallback): void; @@ -57,6 +58,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.getRdbStoreV9 */ function getRdbStore(context: Context, config: StoreConfig, version: number): Promise; @@ -105,6 +107,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.deleteRdbStoreV9 */ function deleteRdbStore(context: Context, name: string, callback: AsyncCallback): void; /** @@ -116,6 +119,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.deleteRdbStoreV9 */ function deleteRdbStore(context: Context, name: string): Promise; @@ -247,6 +251,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbStoreV9 */ interface RdbStore { /** @@ -258,6 +263,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbStoreV9.insert */ insert(table: string, values: ValuesBucket, callback: AsyncCallback): void; @@ -270,6 +276,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbStoreV9.insert */ insert(table: string, values: ValuesBucket): Promise; @@ -282,6 +289,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbStoreV9.batchInsert */ batchInsert(table: string, values: Array, callback: AsyncCallback): void; @@ -294,6 +302,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbStoreV9.batchInsert */ batchInsert(table: string, values: Array): Promise; @@ -306,6 +315,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbStoreV9.update */ update(values: ValuesBucket, predicates: RdbPredicates, callback: AsyncCallback): void; @@ -318,6 +328,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbStoreV9.update */ update(values: ValuesBucket, predicates: RdbPredicates): Promise; @@ -329,6 +340,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbStoreV9.delete */ delete (predicates: RdbPredicates, callback: AsyncCallback): void; @@ -340,6 +352,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbStoreV9.delete */ delete (predicates: RdbPredicates): Promise; @@ -352,6 +365,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbStoreV9.query */ query(predicates: RdbPredicates, columns: Array, callback: AsyncCallback): void; @@ -364,6 +378,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbStoreV9.query */ query(predicates: RdbPredicates, columns ?: Array): Promise; @@ -376,6 +391,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbStoreV9.querySql */ querySql(sql: string, bindArgs: Array, callback: AsyncCallback): void; @@ -388,6 +404,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbStoreV9.querySql */ querySql(sql: string, bindArgs ?: Array): Promise; @@ -400,6 +417,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbStoreV9.executeSql */ executeSql(sql: string, bindArgs: Array, callback: AsyncCallback): void; @@ -412,6 +430,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbStoreV9.executeSql */ executeSql(sql: string, bindArgs ?: Array): Promise; @@ -421,6 +440,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbStoreV9.beginTransaction */ beginTransaction(): void; @@ -430,6 +450,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbStoreV9.commit */ commit(): void; @@ -439,6 +460,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbStoreV9.rollBack */ rollBack(): void; @@ -451,6 +473,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbStoreV9.setDistributedTables */ setDistributedTables(tables: Array, callback: AsyncCallback): void; @@ -463,6 +486,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbStoreV9.setDistributedTables */ setDistributedTables(tables: Array): Promise; @@ -476,6 +500,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbStoreV9.obtainDistributedTableName */ obtainDistributedTableName(device: string, table: string, callback: AsyncCallback): void; @@ -489,6 +514,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbStoreV9.obtainDistributedTableName */ obtainDistributedTableName(device: string, table: string): Promise; @@ -501,6 +527,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbStoreV9.sync */ sync(mode: SyncMode, predicates: RdbPredicates, callback: AsyncCallback>): void; @@ -513,6 +540,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbStoreV9.sync */ sync(mode: SyncMode, predicates: RdbPredicates): Promise>; @@ -526,6 +554,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbStoreV9.on */ on(event: 'dataChange', type: SubscribeType, observer: Callback>): void; @@ -538,6 +567,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbStoreV9.off */ off(event: 'dataChange', type: SubscribeType, observer: Callback>): void; } @@ -1019,6 +1049,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.StoreConfigV9 */ interface StoreConfig { name: string; @@ -1067,6 +1098,7 @@ interface StoreConfigV9 { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9 */ class RdbPredicates { /** @@ -1076,6 +1108,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.constructor */ constructor(name: string) @@ -1088,8 +1121,9 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.inDevices */ - inDevices(devices: Array): RdbPredicates; + inDevices(devices: Array): RdbPredicates; /** * Specify all remote devices which connect to local device when syncing distributed database. @@ -1099,6 +1133,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.inAllDevices */ inAllDevices(): RdbPredicates; @@ -1113,6 +1148,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.equalTo */ equalTo(field: string, value: ValueType): RdbPredicates; @@ -1127,6 +1163,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.notEqualTo */ notEqualTo(field: string, value: ValueType): RdbPredicates; @@ -1138,6 +1175,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.beginWrap */ beginWrap(): RdbPredicates; @@ -1150,6 +1188,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.endWrap */ endWrap(): RdbPredicates; @@ -1161,6 +1200,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.or */ or (): RdbPredicates; @@ -1172,6 +1212,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.and */ and(): RdbPredicates; @@ -1186,6 +1227,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.contains */ contains(field: string, value: string): RdbPredicates; @@ -1200,6 +1242,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.beginsWith */ beginsWith(field: string, value: string): RdbPredicates; @@ -1214,6 +1257,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.endsWith */ endsWith(field: string, value: string): RdbPredicates; @@ -1226,6 +1270,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.isNull */ isNull(field: string): RdbPredicates; @@ -1239,6 +1284,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.isNotNull */ isNotNull(field: string): RdbPredicates; @@ -1253,6 +1299,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.like */ like(field: string, value: string): RdbPredicates; @@ -1267,6 +1314,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.glob */ glob(field: string, value: string): RdbPredicates; @@ -1281,6 +1329,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.between */ between(field: string, low: ValueType, high: ValueType): RdbPredicates; @@ -1295,6 +1344,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.notBetween */ notBetween(field: string, low: ValueType, high: ValueType): RdbPredicates; @@ -1307,6 +1357,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.greaterThan */ greaterThan(field: string, value: ValueType): RdbPredicates; @@ -1319,6 +1370,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.lessThan */ lessThan(field: string, value: ValueType): RdbPredicates; @@ -1331,6 +1383,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.greaterThanOrEqualTo */ greaterThanOrEqualTo(field: string, value: ValueType): RdbPredicates; @@ -1343,6 +1396,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.lessThanOrEqualTo */ lessThanOrEqualTo(field: string, value: ValueType): RdbPredicates; @@ -1355,6 +1409,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.orderByAsc */ orderByAsc(field: string): RdbPredicates; @@ -1367,6 +1422,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.orderByDesc */ orderByDesc(field: string): RdbPredicates; @@ -1377,6 +1433,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.distinct */ distinct(): RdbPredicates; @@ -1388,6 +1445,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.limitAs */ limitAs(value: number): RdbPredicates; @@ -1400,6 +1458,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.offsetAs */ offsetAs(rowOffset: number): RdbPredicates; @@ -1411,6 +1470,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.groupBy */ groupBy(fields: Array): RdbPredicates; @@ -1423,6 +1483,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.indexedBy */ indexedBy(field: string): RdbPredicates; @@ -1436,6 +1497,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.in */ in(field: string, value: Array): RdbPredicates; @@ -1449,6 +1511,7 @@ class RdbPredicates { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.RdbPredicatesV9.notIn */ notIn(field: string, value: Array): RdbPredicates; } -- Gitee From ee5f53bcfd340bcbc0b89d774cd251fddc87b778 Mon Sep 17 00:00:00 2001 From: ltdong Date: Thu, 27 Oct 2022 12:38:44 +0000 Subject: [PATCH 269/438] update api/data/rdb/resultSet.d.ts. add @useinstead keys Signed-off-by: ltdong --- api/data/rdb/resultSet.d.ts | 47 +++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/api/data/rdb/resultSet.d.ts b/api/data/rdb/resultSet.d.ts index 19e8fac574..cf163c84d4 100755 --- a/api/data/rdb/resultSet.d.ts +++ b/api/data/rdb/resultSet.d.ts @@ -22,6 +22,7 @@ import { AsyncCallback } from '../../basic' * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 + * @useinstead ohos.data.rdb.ResultSetV9 */ interface ResultSet { @@ -32,6 +33,8 @@ import { AsyncCallback } from '../../basic' * as the columns in the result set. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.rdb.ResultSetV9.columnNames */ columnNames: Array; @@ -42,6 +45,8 @@ import { AsyncCallback } from '../../basic' * columnCount method. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.rdb.ResultSetV9.columnCount */ columnCount: number; @@ -51,6 +56,8 @@ import { AsyncCallback } from '../../basic' * @note N/A * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.rdb.ResultSetV9.rowCount */ rowCount: number; @@ -60,6 +67,8 @@ import { AsyncCallback } from '../../basic' * @note The result set index starts from 0. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.rdb.ResultSetV9.rowIndex */ rowIndex: number; @@ -69,6 +78,8 @@ import { AsyncCallback } from '../../basic' * @note N/A * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.rdb.ResultSetV9.isAtFirstRow */ isAtFirstRow: boolean; @@ -78,6 +89,8 @@ import { AsyncCallback } from '../../basic' * @note N/A * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.rdb.ResultSetV9.isAtLastRow */ isAtLastRow: boolean; @@ -87,6 +100,8 @@ import { AsyncCallback } from '../../basic' * @note N/A * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.rdb.ResultSetV9.isEnded */ isEnded: boolean; @@ -97,6 +112,8 @@ import { AsyncCallback } from '../../basic' * @note N/A * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.rdb.ResultSetV9.isStarted */ isStarted: boolean; @@ -108,6 +125,8 @@ import { AsyncCallback } from '../../basic' * @note N/A * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.rdb.ResultSetV9.isClosed */ isClosed: boolean; @@ -119,6 +138,8 @@ import { AsyncCallback } from '../../basic' * @returns {number} return the index of the specified column. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.rdb.ResultSetV9.getColumnIndex */ getColumnIndex(columnName: string): number; @@ -130,6 +151,8 @@ import { AsyncCallback } from '../../basic' * @returns {string} returns the name of the specified column. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.rdb.ResultSetV9.getColumnName */ getColumnName(columnIndex: number): string; @@ -143,6 +166,8 @@ import { AsyncCallback } from '../../basic' * returns false otherwise. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.rdb.ResultSetV9.goTo */ goTo(offset: number): boolean; @@ -154,6 +179,8 @@ import { AsyncCallback } from '../../basic' * @returns {boolean} returns true if the result set is moved successfully; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.rdb.ResultSetV9.goToRow */ goToRow(position: number): boolean; @@ -165,6 +192,8 @@ import { AsyncCallback } from '../../basic' * returns false otherwise, for example, if the result set is empty. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.rdb.ResultSetV9.goToFirstRow */ goToFirstRow(): boolean; @@ -176,6 +205,8 @@ import { AsyncCallback } from '../../basic' * returns false otherwise, for example, if the result set is empty. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.rdb.ResultSetV9.goToLastRow */ goToLastRow(): boolean; @@ -187,6 +218,8 @@ import { AsyncCallback } from '../../basic' * returns false otherwise, for example, if the result set is already in the last row. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.rdb.ResultSetV9.goToNextRow */ goToNextRow(): boolean; @@ -198,6 +231,8 @@ import { AsyncCallback } from '../../basic' * returns false otherwise, for example, if the result set is already in the first row. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.rdb.ResultSetV9.goToPreviousRow */ goToPreviousRow(): boolean; @@ -210,6 +245,8 @@ import { AsyncCallback } from '../../basic' * @returns {Uint8Array} returns the value of the specified column as a byte array. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.rdb.ResultSetV9.getBlob */ getBlob(columnIndex: number): Uint8Array; @@ -222,6 +259,8 @@ import { AsyncCallback } from '../../basic' * @returns {string} returns the value of the specified column as a string. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.rdb.ResultSetV9.getString */ getString(columnIndex: number): string; @@ -234,6 +273,8 @@ import { AsyncCallback } from '../../basic' * @returns {number} returns the value of the specified column as a long. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.rdb.ResultSetV9.getLong */ getLong(columnIndex: number): number; @@ -246,6 +287,8 @@ import { AsyncCallback } from '../../basic' * @returns {number} returns the value of the specified column as a double. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.rdb.ResultSetV9.getDouble */ getDouble(columnIndex: number): number; @@ -258,6 +301,8 @@ import { AsyncCallback } from '../../basic' * returns false otherwise. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.rdb.ResultSetV9.isColumnNull */ isColumnNull(columnIndex: number): boolean; @@ -267,6 +312,8 @@ import { AsyncCallback } from '../../basic' * @note Calling this method on the result set will release all of its resources and makes it ineffective. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 + * @deprecated since 9 + * @useinstead ohos.data.rdb.ResultSetV9.close */ close(): void; } -- Gitee From 8f73f56852204f7ba5ba41853a7a3dabab531290 Mon Sep 17 00:00:00 2001 From: ma-shaoyin Date: Fri, 28 Oct 2022 10:41:13 +0800 Subject: [PATCH 270/438] Signed-off-by: ma-shaoyin Changes to be committed: --- api/@ohos.inputmethod.d.ts | 4 ++-- api/@ohos.inputmethodengine.d.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/@ohos.inputmethod.d.ts b/api/@ohos.inputmethod.d.ts index 956e08c7ba..b576b7f2a7 100644 --- a/api/@ohos.inputmethod.d.ts +++ b/api/@ohos.inputmethod.d.ts @@ -498,7 +498,7 @@ declare namespace inputMethod { * @useinstead ohos.inputmethod.InputMethodProperty.name * @syscap SystemCapability.MiscServices.InputMethodFramework */ - readonly packageName: string; + readonly packageName?: string; /** * The id of input method @@ -507,7 +507,7 @@ declare namespace inputMethod { * @useinstead ohos.inputmethod.InputMethodProperty.id * @syscap SystemCapability.MiscServices.InputMethodFramework */ - readonly methodId: string; + readonly methodId?: string; /** * The name of input method diff --git a/api/@ohos.inputmethodengine.d.ts b/api/@ohos.inputmethodengine.d.ts index 04a3b592da..c5426577ba 100644 --- a/api/@ohos.inputmethodengine.d.ts +++ b/api/@ohos.inputmethodengine.d.ts @@ -255,7 +255,7 @@ declare namespace inputMethodEngine { /** * @since 9 - * @throws @throws {BusinessError} 12800003 - input method client error. + * @throws {BusinessError} 12800003 - input method client error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ hide(): Promise; -- Gitee From 9acbc632378dddca6222a4b1e268aee5ff40539c Mon Sep 17 00:00:00 2001 From: wangtiantian Date: Tue, 18 Oct 2022 14:55:14 +0800 Subject: [PATCH 271/438] IssueNo:#I5W4EA Description:delete bms old api9 Sig:SIG_ApplicaitonFramework Feature or Bugfix:Bugfix Binary Source:No Signed-off-by: wangtiantian --- api/@ohos.app.ability.abilityManager.d.ts | 2 +- api/@ohos.bundle.d.ts | 750 +--------------------- api/@ohos.bundle.innerBundleManager.d.ts | 44 +- api/@ohos.distributedBundle.d.ts | 39 +- api/application/ExtensionContext.d.ts | 4 +- api/application/ExtensionRunningInfo.d.ts | 6 +- api/bundle/abilityInfo.d.ts | 58 -- api/bundle/applicationInfo.d.ts | 64 -- api/bundle/bundleInfo.d.ts | 15 - api/bundle/bundleInstaller.d.ts | 37 -- api/bundle/dispatchInfo.d.ts | 36 -- api/bundle/elementName.d.ts | 9 - api/bundle/extensionAbilityInfo.d.ts | 126 ---- api/bundle/hapModuleInfo.d.ts | 29 - api/bundle/metadata.d.ts | 45 -- api/bundle/packInfo.d.ts | 389 ----------- api/bundle/shortcutInfo.d.ts | 13 - 17 files changed, 21 insertions(+), 1645 deletions(-) delete mode 100644 api/bundle/dispatchInfo.d.ts delete mode 100644 api/bundle/extensionAbilityInfo.d.ts delete mode 100644 api/bundle/metadata.d.ts delete mode 100644 api/bundle/packInfo.d.ts diff --git a/api/@ohos.app.ability.abilityManager.d.ts b/api/@ohos.app.ability.abilityManager.d.ts index fcf61cb6b2..b7775354d9 100644 --- a/api/@ohos.app.ability.abilityManager.d.ts +++ b/api/@ohos.app.ability.abilityManager.d.ts @@ -17,7 +17,7 @@ import { AsyncCallback } from './basic'; import { Configuration } from './@ohos.app.ability.Configuration'; import { AbilityRunningInfo as _AbilityRunningInfo } from './application/AbilityRunningInfo'; import { ExtensionRunningInfo as _ExtensionRunningInfo } from './application/ExtensionRunningInfo'; -import { ElementName } from './bundle/elementName'; +import { ElementName } from './bundleManager/elementName'; /** * The class of an ability manager. diff --git a/api/@ohos.bundle.d.ts b/api/@ohos.bundle.d.ts index 761db11e78..7279d03950 100644 --- a/api/@ohos.bundle.d.ts +++ b/api/@ohos.bundle.d.ts @@ -13,23 +13,14 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; -import { ApplicationInfo as _ApplicationInfo } from './bundle/applicationInfo'; -import { ModuleInfo as _ModuleInfo } from './bundle/moduleInfo'; -import { CustomizeData as _CustomizeData } from './bundle/customizeData'; -import { Metadata as _Metadata } from './bundle/metadata'; -import { HapModuleInfo as _HapModuleInfo } from './bundle/hapModuleInfo'; -import { AbilityInfo as _AbilityInfo } from './bundle/abilityInfo'; -import { ExtensionAbilityInfo as _ExtensionAbilityInfo } from './bundle/extensionAbilityInfo'; -import { PermissionDef as _PermissionDef } from './bundle/PermissionDef'; -import { ElementName as _ElementName } from './bundle/elementName'; -import { DispatchInfo as _DispatchInfo } from './bundle/dispatchInfo'; +import { AsyncCallback } from './basic'; +import { ApplicationInfo } from './bundle/applicationInfo'; +import { AbilityInfo } from './bundle/abilityInfo'; +import { PermissionDef } from './bundle/PermissionDef'; import Want from './@ohos.application.Want'; import image from './@ohos.multimedia.image'; -import pack from './bundle/packInfo'; -import * as _PackInfo from './bundle/packInfo'; -import * as _BundleInfo from './bundle/bundleInfo'; -import * as _BundleInstaller from './bundle/bundleInstaller'; +import { BundleInfo } from './bundle/bundleInfo'; +import { BundleInstaller } from './bundle/bundleInstaller'; /** * bundle. @@ -64,14 +55,6 @@ declare namespace bundle { * @since 8 */ GET_ABILITY_INFO_WITH_METADATA = 0x00000020, - /** - * @since 9 - */ - GET_BUNDLE_WITH_EXTENSION_ABILITY = 0x00000020, - /** - * @since 9 - */ - GET_BUNDLE_WITH_HASH_VALUE = 0x00000030, /** * @since 8 */ @@ -88,26 +71,6 @@ declare namespace bundle { * @since 8 */ GET_APPLICATION_INFO_WITH_DISABLE = 0x00000200, - /** - * @since 9 - */ - GET_APPLICATION_INFO_WITH_CERTIFICATE_FINGERPRINT = 0x00000400, - } - -/** - * @name ExtensionFlag - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @import NA - * @permission NA - * @deprecated since 9 - * @useinstead ohos.bundle.bundleManager.ExtensionAbilityFlag - */ - enum ExtensionFlag { - GET_EXTENSION_INFO_DEFAULT = 0x00000000, - GET_EXTENSION_INFO_WITH_PERMISSION = 0x00000002, - GET_EXTENSION_INFO_WITH_APPLICATION = 0x00000004, - GET_EXTENSION_INFO_WITH_METADATA = 0x00000020, } /** @@ -131,7 +94,7 @@ declare namespace bundle { * @import NA * @permission NA * @deprecated since 9 - * @useinstead bundleInfo.PermissionGrantStatus + * @useinstead ohos.bundle.bundleManager.PermissionGrantState */ export enum GrantStatus { PERMISSION_DENIED = -1, @@ -145,7 +108,7 @@ declare namespace bundle { * @import NA * @permission NA * @deprecated since 9 - * @useinstead abilityInfo.AbilityType + * @useinstead ohos.bundle.bundleManager.AbilityType */ export enum AbilityType { /** @@ -197,7 +160,7 @@ declare namespace bundle { * @import NA * @permission NA * @deprecated since 9 - * @useinstead abilityInfo.DisplayOrientation + * @useinstead ohos.bundle.bundleManager.DisplayOrientation */ export enum DisplayOrientation { /** @@ -227,69 +190,6 @@ declare namespace bundle { * @syscap SystemCapability.BundleManager.BundleFramework */ FOLLOW_RECENT, - - /** - * @default Indicates the inverted landscape orientation - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - LANDSCAPE_INVERTED, - - /** - * @default Indicates the inverted portrait orientation - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - PORTRAIT_INVERTED, - - /** - * @default Indicates the orientation can be auto-rotated - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - AUTO_ROTATION, - - /** - * @default Indicates the landscape orientation rotated with sensor - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - AUTO_ROTATION_LANDSCAPE, - - /** - * @default Indicates the portrait orientation rotated with sensor - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - AUTO_ROTATION_PORTRAIT, - - /** - * @default Indicates the sensor restricted mode - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - AUTO_ROTATION_RESTRICTED, - - /** - * @default Indicates the sensor landscape restricted mode - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - AUTO_ROTATION_LANDSCAPE_RESTRICTED, - - /** - * @default Indicates the sensor portrait restricted mode - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - AUTO_ROTATION_PORTRAIT_RESTRICTED, - - /** - * @default Indicates the locked orientation mode - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - LOCKED, } /** @@ -299,7 +199,7 @@ declare namespace bundle { * @import NA * @permission NA * @deprecated since 9 - * @useinstead bundleManager/AbilityInfo.LaunchType + * @useinstead ohos.bundle.bundleManager.LaunchType */ export enum LaunchMode { /** @@ -317,108 +217,6 @@ declare namespace bundle { STANDARD = 1, } - /** - * @name ExtensionAbilityType - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @import NA - * @permission NA - * @deprecated since 9 - * @useinstead bundleManager/ExtensionAbilityInfo.ExtensionAbilityType - */ - export enum ExtensionAbilityType { - /** - * @default Indicates extension info with type of form - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - FORM = 0, - /** - * @default Indicates extension info with type of work schedule - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - WORK_SCHEDULER = 1, - /** - * @default Indicates extension info with type of input method - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - INPUT_METHOD = 2, - /** - * @default Indicates extension info with type of service - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - SERVICE = 3, - /** - * @default Indicates extension info with type of accessibility - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - ACCESSIBILITY = 4, - /** - * @default Indicates extension info with type of datashare - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - DATA_SHARE = 5, - /** - * @default Indicates extension info with type of fileshare - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - FILE_SHARE = 6, - /** - * @default Indicates extension info with type of staticsubscriber - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - STATIC_SUBSCRIBER = 7, - /** - * @default Indicates extension info with type of wallpaper - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - WALLPAPER = 8, - /** - * @default Indicates extension info with type of backup - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - BACKUP = 9, - /** - * @default Indicates extension info with type of window - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - WINDOW = 10, - /** - * @default Indicates extension info with type of enterprise admin - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - ENTERPRISE_ADMIN = 11, - /** - * @default Indicates extension info with type of thumbnail - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - THUMBNAIL = 13, - /** - * @default Indicates extension info with type of preview - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - PREVIEW = 14, - /** - * @default Indicates extension info with type of unspecified - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - UNSPECIFIED = 255, - } - /** * @name BundleOptions * @since 7 @@ -488,65 +286,6 @@ declare namespace bundle { STATUS_UNINSTALL_PERMISSION_DENIED = 0x45, } - /** - * @name UpgradeFlag - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi Hide this for inner system use - * @deprecated since 9 - * @useinstead ohos.bundle.freeInstall#UpgradeFlag - */ - export enum UpgradeFlag { - /** - * @default Indicates module not need to be upgraded - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - NOT_UPGRADE = 0, - /** - * @default Indicates single module need to be upgraded - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - SINGLE_UPGRADE = 1, - /** - * @default Indicates relation module need to be upgraded - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - RELATION_UPGRADE = 2, - } - - /** - * @name SupportWindowMode - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @import NA - * @permission NA - * @deprecated since 9, use @ohos.bundle.AbilityInfo.SupportWindowMode - * @useinstead bundleManager/AbilityInfo.SupportWindowMode - */ - export enum SupportWindowMode { - /** - * @default Indicates supported window mode of full screen mode - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - FULL_SCREEN = 0, - /** - * @default Indicates supported window mode of split mode - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - SPLIT = 1, - /** - * @default Indicates supported window mode of floating mode - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - FLOATING = 2, - } - /** * Obtains bundleInfo based on bundleName, bundleFlags and options. * @@ -758,24 +497,6 @@ declare namespace bundle { function setAbilityEnabled(info: AbilityInfo, isEnable: boolean, callback: AsyncCallback): void; function setAbilityEnabled(info: AbilityInfo, isEnable: boolean): Promise; - /** - * Query extension info of by utilizing a Want. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param want Indicates the Want containing the application bundle name to be queried. - * @param extensionFlags Indicates the flag used to specify information contained in the ExtensionInfo objects that - * will be returned. - * @param userId Indicates the user ID. - * @return Returns a list of ExtensionInfo objects. - * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO - * @deprecated since 9 - * @useinstead ohos.bundle.bundleManager#queryExtensionAbilityInfo - */ - function queryExtensionAbilityInfos(want: Want, extensionType: number, extensionFlags: number, userId: number, callback: AsyncCallback>): void; - function queryExtensionAbilityInfos(want: Want, extensionType: number, extensionFlags: number, callback: AsyncCallback>): void; - function queryExtensionAbilityInfos(want: Want, extensionType: number, extensionFlags: number, userId?: number): Promise>; - /** * Get the permission details by permissionName. * @@ -846,457 +567,6 @@ declare namespace bundle { */ function isApplicationEnabled(bundleName: string, callback: AsyncCallback): void; function isApplicationEnabled(bundleName: string): Promise; - - /** - * Set the module wether need upgrade - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param bundleName Indicates the bundle name of the application. - * @param moduleName Indicates the module name of the application. - * @param upgradeFlag Indicates upgradeFlag of the application. - * @systemapi Hide this for inner system use - * @deprecated since 9 - * @useinstead ohos.bundle.freeInstall#setHapModuleUpgradeFlag - */ - function setModuleUpgradeFlag(bundleName: string, moduleName: string, upgradeFlag: UpgradeFlag, callback: AsyncCallback):void; - function setModuleUpgradeFlag(bundleName: string, moduleName: string, upgradeFlag: UpgradeFlag): Promise; - - /** - * Checks whether a specified module is removable. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param bundleName Indicates the bundle name of the application. - * @param moduleName Indicates the module name of the application. - * @returns Returns true if the module is removable; returns false otherwise. - * @systemapi Hide this for inner system use - * @deprecated since 9 - * @useinstead ohos.bundle.freeInstall#isHapModuleRemovable - */ - function isModuleRemovable(bundleName: string, moduleName: string, callback: AsyncCallback): void; - function isModuleRemovable(bundleName: string, moduleName: string): Promise; - - /** - * Obtains bundlePackInfo based on bundleName and bundleFlags. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param bundleName Indicates the application bundle name to be queried. - * @param bundlePackFlag Indicates the application bundle pack flag to be queried. - * @return Returns the BundlePackInfo object. - * @systemapi hide this for inner system use - * @deprecated since 9 - * @useinstead ohos.bundle.freeInstall#getBundlePackInfo - */ - function getBundlePackInfo(bundleName: string, bundlePackFlag : pack.BundlePackFlag, callback: AsyncCallback): void; - function getBundlePackInfo(bundleName: string, bundlePackFlag : pack.BundlePackFlag): Promise; - - /** - * Obtains information about the current ability. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param bundleName Indicates the application bundle name to be queried. - * @param moduleName Indicates the module name. - * @param abilityName Indicates the ability name. - * @return Returns the AbilityInfo object for the current ability. - * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO - * @deprecated since 9 - * @useinstead ohos.bundle.bundleManager#getAbilityInfo - */ - function getAbilityInfo(bundleName: string, moduleName: string, abilityName: string, callback: AsyncCallback): void; - function getAbilityInfo(bundleName: string, moduleName: string, abilityName: string): Promise; - - /** - * Obtains information about the dispatcher version. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @return Returns the DispatchInfo object for the current ability. - * @systemapi hide this for inner system use - * @deprecated since 9 - * @useinstead ohos.bundle.freeInstall#getDispatchInfo - */ - function getDispatcherVersion(callback: AsyncCallback): void; - function getDispatcherVersion(): Promise; - - /** - * Obtains the label of a specified ability. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param bundleName Indicates the bundle name of the application to which the ability belongs. - * @param moduleName Indicates the module name. - * @param abilityName Indicates the ability name. - * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO - * @return Returns the label representing the label of the specified ability. - * @deprecated since 9 - * @useinstead ohos.bundle.bundleManager#getAbilityLabel - */ - function getAbilityLabel(bundleName: string, moduleName: string, abilityName: string, callback: AsyncCallback): void; - function getAbilityLabel(bundleName: string, moduleName: string, abilityName: string): Promise; - - /** - * Obtains the icon of a specified ability. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param bundleName Indicates the bundle name of the application to which the ability belongs. - * @param moduleName Indicates the module name. - * @param abilityName Indicates the ability name. - * @return Returns the PixelMap object representing the icon of the specified ability. - * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO - * @deprecated since 9 - * @useinstead ohos.bundle.bundleManager#getAbilityIcon - */ - function getAbilityIcon(bundleName: string, moduleName: string, abilityName: string, callback: AsyncCallback): void; - function getAbilityIcon(bundleName: string, moduleName: string, abilityName: string): Promise; - - /** - * Obtains the profile designated by metadata name, abilityName and moduleName from the current application. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param moduleName Indicates the moduleName of the application. - * @param abilityName Indicates the abilityName of the application. - * @param metadataName Indicates the name of metadata in ability. - * @return Returns string in json-format of the corresponding config file. - * @deprecated since 9 - * @useinstead ohos.bundle.bundleManager#getProfileByAbility - */ - function getProfileByAbility(moduleName: string, abilityName: string, metadataName: string, callback: AsyncCallback>): void; - function getProfileByAbility(moduleName: string, abilityName: string, metadataName?: string): Promise>; - - /** - * Obtains the profile designated by metadata name, extensionAbilityName and moduleName from the current application. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param moduleName Indicates the moduleName of the application. - * @param extensionAbilityName Indicates the extensionAbilityName of the application. - * @param metadataName Indicates the name of metadata in ability. - * @return Returns string in json-format of the corresponding config file. - * @deprecated since 9 - * @useinstead ohos.bundle.bundleManager#getProfileByExtensionAbility - */ - function getProfileByExtensionAbility(moduleName: string, extensionAbilityName: string, metadataName: string, callback: AsyncCallback>): void; - function getProfileByExtensionAbility(moduleName: string, extensionAbilityName: string, metadataName?: string): Promise>; - - /** - * Set the disposed status of a specified bundle. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param bundleName Indicates the bundle name of the application. - * @param status Indicates the disposed status. - * @return Returns the disposed status of a specified bundle. - * @permission ohos.permission.MANAGE_DISPOSED_APP_STATUS - * @systemapi Hide this for inner system use - * @deprecated since 9 - * @useinstead ohos.bundle.appControl#setDisposedStatus - */ - function setDisposedStatus(bundleName: string, status: number, callback: AsyncCallback): void; - function setDisposedStatus(bundleName: string, status: number): Promise; - - /** - * Obtains the disposed status of a specified bundle. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param bundleName Indicates the bundle name of the application. - * @return Returns the disposed status of a specified bundle. - * @permission ohos.permission.MANAGE_DISPOSED_APP_STATUS - * @systemapi Hide this for inner system use - * @deprecated since 9 - * @useinstead ohos.bundle.appControl#getDisposedStatus - */ - function getDisposedStatus(bundleName: string, callback: AsyncCallback): void; - function getDisposedStatus(bundleName: string): Promise; - - /** - * Obtains based on a given bundleName and bundleFlags. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param bundleName Indicates the application bundle name to be queried. - * @param bundleFlags Indicates the flag used to specify information contained in the ApplicationInfo object - * that will be returned. - * @param userId Indicates the user ID or do not pass user ID. - * @return Returns the ApplicationInfo object. - * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO - * @deprecated since 9 - * @useinstead ohos.bundle.appControl#getApplicationInfoSync - */ - function getApplicationInfoSync(bundleName: string, bundleFlags: number, userId: number) : ApplicationInfo; - function getApplicationInfoSync(bundleName: string, bundleFlags: number) : ApplicationInfo; - - /** - * Obtains bundleInfo based on bundleName, bundleFlags and options. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param bundleName Indicates the application bundle name to be queried. - * @param bundleFlags Indicates the flag used to specify information contained in the BundleInfo object - * that will be returned. - * @param options Indicates the bundle options object. - * @return Returns the BundleInfo object. - * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO - * @deprecated since 9 - * @useinstead ohos.bundle.appControl#getApplicationInfoSync - */ - function getBundleInfoSync(bundleName: string, bundleFlags: number, options: BundleOptions): BundleInfo; - function getBundleInfoSync(bundleName: string, bundleFlags: number): BundleInfo; - - /** - * Obtains configuration information about an application. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - export type ApplicationInfo = _ApplicationInfo; - - /** - * Stores module information about an application. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - export type ModuleInfo = _ModuleInfo; - - /** - * Indicates the custom metadata. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - export type CustomizeData = _CustomizeData; - - /** - * Indicates the Metadata. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - export type Metadata = _Metadata; - - /** - * Obtains configuration information about a bundle. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - export type BundleInfo = _BundleInfo.BundleInfo; - - /** - * The scene which is used. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - export type UsedScene = _BundleInfo.UsedScene; - - /** - * Indicates the required permissions details defined in file config.json. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - export type ReqPermissionDetail = _BundleInfo.ReqPermissionDetail; - - /** - * Obtains configuration information about an module. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - export type HapModuleInfo = _HapModuleInfo; - - /** - * Obtains configuration information about an ability. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - export type AbilityInfo = _AbilityInfo; - - /** - * Obtains extension information about a bundle. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - export type ExtensionAbilityInfo = _ExtensionAbilityInfo; - - /** - * Offers install, upgrade, and remove bundles on the devices. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ - export type BundleInstaller = _BundleInstaller.BundleInstaller; - - /** - * Provides parameters required for hashParam. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ - export type HashParam = _BundleInstaller.HashParam; - - /** - * Provides parameters required for installing or uninstalling an application. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ - export type InstallParam = _BundleInstaller.InstallParam; - - /** - * Indicates the install or uninstall status. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ - export type InstallStatus = _BundleInstaller.InstallStatus; - - /** - * Indicates the defined permission details in file config.json. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ - export type PermissionDef = _PermissionDef; - - /** - * Contains basic Ability information, which uniquely identifies an ability. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - export type ElementName = _ElementName; - - /** - * The dispatch info class. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ - export type DispatchInfo = _DispatchInfo; - - /** - * The bundle pack info class. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ - export type BundlePackInfo = _PackInfo.BundlePackInfo; - - /** - * The package info class. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ - export type PackageConfig = _PackInfo.PackageConfig; - - /** - * The package summary class. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ - export type PackageSummary = _PackInfo.PackageSummary; - - /** - * The bundle summary class. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ - export type BundleConfigInfo = _PackInfo.BundleConfigInfo; - - /** - * The extension ability forms class. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ - export type ExtensionAbilities = _PackInfo.ExtensionAbilities; - - /** - * The module summary of a bundle. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ - export type ModuleConfigInfo = _PackInfo.ModuleConfigInfo; - - /** - * The bundle info summary class. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ - export type ModuleDistroInfo = _PackInfo.ModuleDistroInfo; - - /** - * The ability info of a module. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ - export type ModuleAbilityInfo = _PackInfo.ModuleAbilityInfo; - - /** - * The form info of an ability. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ - export type AbilityFormInfo = _PackInfo.AbilityFormInfo; - - /** - * The bundle version class. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ - export type Version = _PackInfo.Version; - - /** - * The bundle Api version class. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ - export type ApiVersion = _PackInfo.ApiVersion; - - /** - * Flags which are used to indicate bundle pack. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ - export type BundlePackFlag = _PackInfo.BundlePackFlag; } export default bundle; diff --git a/api/@ohos.bundle.innerBundleManager.d.ts b/api/@ohos.bundle.innerBundleManager.d.ts index eabbae5479..30264f6278 100644 --- a/api/@ohos.bundle.innerBundleManager.d.ts +++ b/api/@ohos.bundle.innerBundleManager.d.ts @@ -13,10 +13,10 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; -import { BundleStatusCallback as _BundleStatusCallback } from './bundle/bundleStatusCallback'; -import { LauncherAbilityInfo as _LauncherAbilityInfo } from './bundle/launcherAbilityInfo'; -import * as _ShortCutInfo from './bundle/shortcutInfo'; +import { AsyncCallback } from './basic'; +import { BundleStatusCallback } from './bundle/bundleStatusCallback'; +import { LauncherAbilityInfo } from './bundle/launcherAbilityInfo'; +import { ShortcutInfo } from './bundle/shortcutInfo'; /** * inner bundle manager. @@ -104,42 +104,6 @@ declare namespace innerBundleManager { */ function getShortcutInfos(bundleName :string, callback: AsyncCallback>) : void; function getShortcutInfos(bundleName : string) : Promise>; - - /** - * Contains basic launcher Ability information, which uniquely identifies an LauncherAbilityInfo. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ - export type LauncherAbilityInfo = _LauncherAbilityInfo; - - /** - * Contains basic launcher Ability information, which uniquely identifies a launcher StatusCallback. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ - export type BundleStatusCallback = _BundleStatusCallback; - - /** - * Provides information about a shortcut, including the shortcut ID and label. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - export type ShortcutInfo = _ShortCutInfo.ShortcutInfo; - - /** - * Provides methods for obtaining information about the ability that a shortcut will start, including the target - * bundle name, target module name and ability class name. - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ - export type ShortcutWant = _ShortCutInfo.ShortcutWant; } export default innerBundleManager; diff --git a/api/@ohos.distributedBundle.d.ts b/api/@ohos.distributedBundle.d.ts index 619ab50a1a..a00959bcb3 100644 --- a/api/@ohos.distributedBundle.d.ts +++ b/api/@ohos.distributedBundle.d.ts @@ -15,7 +15,7 @@ import { AsyncCallback } from './basic'; import { ElementName } from './bundle/elementName'; -import { RemoteAbilityInfo as _RemoteAbilityInfo } from './bundle/remoteAbilityInfo'; +import { RemoteAbilityInfo } from './bundle/remoteAbilityInfo'; /** * distributedBundle. @@ -57,42 +57,5 @@ import { RemoteAbilityInfo as _RemoteAbilityInfo } from './bundle/remoteAbilityI */ function getRemoteAbilityInfos(elementNames: Array, callback: AsyncCallback>): void; function getRemoteAbilityInfos(elementNames: Array): Promise>; - - /** - * Obtains information about the ability info of the remote device. - * - * @since 9 - * @syscap SystemCapability.BundleManager.DistributedBundleFramework - * @param elementName Indicates the elementName. - * @param locale Indicates the locale info - * @return Returns the ability info of the remote device. - * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED - * @systemapi - */ - function getRemoteAbilityInfo(elementName: ElementName, locale: string, callback: AsyncCallback): void; - function getRemoteAbilityInfo(elementName: ElementName, locale: string): Promise; - - /** - * Obtains information about the ability infos of the remote device. - * - * @since 9 - * @syscap SystemCapability.BundleManager.DistributedBundleFramework - * @param elementNames Indicates the elementNames, Maximum array length ten. - * @param locale Indicates the locale info - * @return Returns the ability infos of the remote device. - * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED - * @systemapi - */ - function getRemoteAbilityInfos(elementNames: Array, locale: string, callback: AsyncCallback>): void; - function getRemoteAbilityInfos(elementNames: Array, locale: string): Promise>; - - /** - * Contains basic remote ability information. - * - * @since 9 - * @syscap SystemCapability.BundleManager.DistributedBundleFramework - * @systemapi hide this for inner system use - */ - export type RemoteAbilityInfo = _RemoteAbilityInfo; } export default distributedBundle; \ No newline at end of file diff --git a/api/application/ExtensionContext.d.ts b/api/application/ExtensionContext.d.ts index 3e20d41b8e..7f7c100221 100644 --- a/api/application/ExtensionContext.d.ts +++ b/api/application/ExtensionContext.d.ts @@ -13,10 +13,10 @@ * limitations under the License. */ -import { HapModuleInfo } from "../bundle/hapModuleInfo"; +import { HapModuleInfo } from "../bundleManager/hapModuleInfo"; import { Configuration } from '../@ohos.application.Configuration'; import Context from "./Context"; -import { ExtensionAbilityInfo } from "../bundle/extensionAbilityInfo"; +import { ExtensionAbilityInfo } from "../bundleManager/extensionAbilityInfo"; /** * The context of an extension. It allows access to extension-specific resources. diff --git a/api/application/ExtensionRunningInfo.d.ts b/api/application/ExtensionRunningInfo.d.ts index 32abe9c264..7a4ef741fa 100644 --- a/api/application/ExtensionRunningInfo.d.ts +++ b/api/application/ExtensionRunningInfo.d.ts @@ -13,8 +13,8 @@ * limitations under the License. */ -import { ElementName } from '../bundle/elementName'; -import bundle from '../@ohos.bundle'; +import { ElementName } from '../bundleManager/elementName'; +import bundle from '../@ohos.bundle.bundleManager'; /** * The class of an extension running information. @@ -74,7 +74,7 @@ export interface ExtensionRunningInfo { clientPackage: Array; /** - * @default Enumerates types of the entension info + * @default Enumerates types of the extension info * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi hide this for inner system use diff --git a/api/bundle/abilityInfo.d.ts b/api/bundle/abilityInfo.d.ts index fea1af4095..582105fe21 100644 --- a/api/bundle/abilityInfo.d.ts +++ b/api/bundle/abilityInfo.d.ts @@ -15,7 +15,6 @@ import { ApplicationInfo } from './applicationInfo'; import { CustomizeData } from './customizeData' -import { Metadata } from './metadata' import bundle from './../@ohos.bundle'; /** @@ -217,67 +216,10 @@ export interface AbilityInfo { */ readonly metaData: Array; - /** - * @default Indicates the metadata of ability - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * - */ - readonly metadata: Array; - /** * @default Indicates whether the ability is enabled * @since 8 * @syscap SystemCapability.BundleManager.BundleFramework */ readonly enabled: boolean; - - /** - * @default Indicates which window mode is supported - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly supportWindowMode: Array; - - /** - * @default Indicates maximum ratio of width over height of window under free window status. - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly maxWindowRatio: number; - - /** - * @default Indicates minimum ratio of width over height of window under free window status. - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly minWindowRatio: number; - - /** - * @default Indicates maximum width of window under free window status. - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly maxWindowWidth: number; - - /** - * @default Indicates minimum width of window under free window status. - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly minWindowWidth: number; - - /** - * @default Indicates maximum height of window under free window status. - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly maxWindowHeight: number; - - /** - * @default Indicates minimum height of window under free window status. - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly minWindowHeight: number; } diff --git a/api/bundle/applicationInfo.d.ts b/api/bundle/applicationInfo.d.ts index 1d43226bc4..6b24191948 100644 --- a/api/bundle/applicationInfo.d.ts +++ b/api/bundle/applicationInfo.d.ts @@ -15,8 +15,6 @@ import { ModuleInfo } from './moduleInfo'; import { CustomizeData } from './customizeData'; -import { Metadata } from './metadata'; -import { Resource } from './../global/resource'; /** * @name Obtains configuration information about an application @@ -77,13 +75,6 @@ export interface ApplicationInfo { */ readonly labelId: string; - /** - * @default Indicates the label index of the application - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly labelIndex: number; - /** * @default Indicates the icon of the application * @since 7 @@ -99,13 +90,6 @@ export interface ApplicationInfo { */ readonly iconId: string; - /** - * @default Indicates the icon index of the application - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly iconIndex: number; - /** * @default Process of application, if user do not set it ,the value equal bundleName * @since 7 @@ -162,13 +146,6 @@ export interface ApplicationInfo { */ readonly metaData: Map>; - /** - * @default Indicates the metadata of module - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly metadata: Map>; - /** * @default Indicates whether or not this application may be removable * @since 8 @@ -196,45 +173,4 @@ export interface ApplicationInfo { * @syscap SystemCapability.BundleManager.BundleFramework */ readonly entityType: string; - - /** - * @default Indicates fingerprint of the certificate - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly fingerprint: string; - - /** - * @default Indicates icon resource of the application - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly iconResource: Resource; - - /** - * @default Indicates label resource of the application - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly labelResource: Resource; - /** - * @default Indicates description resource of the application - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly descriptionResource: Resource; - - /** - * @default Indicates the appDistributionType of the application - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly appDistributionType: string; - - /** - * @default Indicates the appProvisionType of the application - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly appProvisionType: string; } diff --git a/api/bundle/bundleInfo.d.ts b/api/bundle/bundleInfo.d.ts index 9f614035ee..fe6cf36753 100644 --- a/api/bundle/bundleInfo.d.ts +++ b/api/bundle/bundleInfo.d.ts @@ -15,7 +15,6 @@ import { AbilityInfo } from './abilityInfo'; import { ApplicationInfo } from './applicationInfo'; -import { ExtensionAbilityInfo } from './extensionAbilityInfo'; import { HapModuleInfo } from './hapModuleInfo'; /** @@ -66,13 +65,6 @@ export interface ReqPermissionDetail { */ reason: string; - /** - * @default Indicates the reason id of this required permissions - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - reasonId: number; - /** * @default Indicates the used scene of this required permissions * @since 7 @@ -253,11 +245,4 @@ export interface BundleInfo { * @syscap SystemCapability.BundleManager.BundleFramework */ readonly reqPermissionStates: Array; - - /** - * @default Obtains configuration information about an ability - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly extensionAbilityInfo: Array; } diff --git a/api/bundle/bundleInstaller.d.ts b/api/bundle/bundleInstaller.d.ts index 3aee486769..337ad6bd27 100644 --- a/api/bundle/bundleInstaller.d.ts +++ b/api/bundle/bundleInstaller.d.ts @@ -16,29 +16,6 @@ import { AsyncCallback } from './../basic'; import bundle from './../@ohos.bundle'; -/** - * @name Provides parameters required for hashParam. - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * @systemapi Hide this for inner system use - */ - export interface HashParam { - /** - * @default Indicates the moduleName - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - moduleName: string; - - /** - * @default Indicates the hash value - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - hashValue: string; -} - /** * @name Provides parameters required for installing or uninstalling an application. * @since 7 @@ -75,20 +52,6 @@ export interface InstallParam { * @useinstead ohos.bundle.installer.InstallParam#isKeepData */ isKeepData: boolean; - - /** - * @default Indicates the hash params - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - hashParams?: Array; - - /** - * @default Indicates the deadline of the crowdtesting bundle - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - crowdtestDeadline?: number; } /** diff --git a/api/bundle/dispatchInfo.d.ts b/api/bundle/dispatchInfo.d.ts deleted file mode 100644 index 2538eb4c83..0000000000 --- a/api/bundle/dispatchInfo.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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. - */ - -/** - * @name The dispatch info class. - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ - export interface DispatchInfo { - /** - * @default Indicates the dispatchInfo version - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly version: string; - - /** - * @default Indicates the free install interface version number - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly dispatchAPI: string; -} \ No newline at end of file diff --git a/api/bundle/elementName.d.ts b/api/bundle/elementName.d.ts index c03c120ec3..605f8e19ef 100644 --- a/api/bundle/elementName.d.ts +++ b/api/bundle/elementName.d.ts @@ -70,13 +70,4 @@ * @syscap SystemCapability.BundleManager.BundleFramework */ shortName?: string; - - /** - * module name - * @default - - * - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - moduleName?: string; } diff --git a/api/bundle/extensionAbilityInfo.d.ts b/api/bundle/extensionAbilityInfo.d.ts deleted file mode 100644 index d8bf7564c7..0000000000 --- a/api/bundle/extensionAbilityInfo.d.ts +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (c) 2021 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 { ApplicationInfo } from './applicationInfo'; -import { Metadata } from './metadata' -import bundle from './../@ohos.bundle'; - -/** - * @name Obtains extension information about a bundle - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * @deprecated since 9 - * @useinstead ohos.bundle.bundleManager.ExtensionAbilityInfo - */ -export interface ExtensionAbilityInfo { - /** - * @default Indicates the name of the bundle - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly bundleName: string; - - /** - * @default Indicates the name of the module - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly moduleName: string; - - /** - * @default Indicates the name of the extension info - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly name: string; - - /** - * @default Indicates the label id of the entension info - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly labelId: number; - - /** - * @default Indicates the description id of the entension info - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly descriptionId: number; - - /** - * @default Indicates the icon id of the entension info - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly iconId: number; - - /** - * @default Indicates whether the entensionInfo can be visible or not - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly isVisible: boolean; - - /** - * @default Enumerates types of the entension info - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly extensionAbilityType: bundle.ExtensionAbilityType; - - /** - * @default The permissions that others need to use this extension info - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly permissions: Array; - - /** - * @default Obtains configuration information about an application - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly applicationInfo: ApplicationInfo; - - /** - * @default Indicates the metadata of bundle - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly metadata: Array; - - /** - * @default Indicates the src language to express extension info - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly enabled: boolean; - - /** - * @default Indicates the read permission extension ability info - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly readPermission: string; - - /** - * @default Indicates the write permission of extension ability info - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly writePermission: string; -} diff --git a/api/bundle/hapModuleInfo.d.ts b/api/bundle/hapModuleInfo.d.ts index c9662744a4..cf1c3282e5 100644 --- a/api/bundle/hapModuleInfo.d.ts +++ b/api/bundle/hapModuleInfo.d.ts @@ -14,8 +14,6 @@ */ import { AbilityInfo } from "./abilityInfo"; -import { ExtensionAbilityInfo } from "./extensionAbilityInfo"; -import { Metadata } from './metadata' /** * @name Obtains configuration information about an module. @@ -116,31 +114,4 @@ export interface HapModuleInfo { * @syscap SystemCapability.BundleManager.BundleFramework */ readonly installationFree: boolean; - - /** - * @default Indicates main elementName of the module - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly mainElementName: string; - - /** - * @default Obtains configuration information about extension ability - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly extensionAbilityInfo: Array; - /** - * @default Indicates the metadata of ability - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * - */ - readonly metadata: Array; - /** - * @default Indicates the hash value of the module - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly hashValue: string; } \ No newline at end of file diff --git a/api/bundle/metadata.d.ts b/api/bundle/metadata.d.ts deleted file mode 100644 index de2c7533d9..0000000000 --- a/api/bundle/metadata.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2021 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. - */ - - /** - * @name Indicates the Metadata - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * @deprecated since 9 - * @useinstead ohos.bundle.bundleManager.Metadata - */ - export interface Metadata { - /** - * @default Indicates the metadata name - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - name: string; - - /** - * @default Indicates the metadata value - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - value: string; - - /** - * @default Indicates the metadata resource - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - resource: string; - } \ No newline at end of file diff --git a/api/bundle/packInfo.d.ts b/api/bundle/packInfo.d.ts deleted file mode 100644 index 1c4a45903d..0000000000 --- a/api/bundle/packInfo.d.ts +++ /dev/null @@ -1,389 +0,0 @@ -/* - * 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. - */ - -/** - * @name The bundle pack info class. - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ -export interface BundlePackInfo { - /** - * @default This contains package information in pack.info - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly packages: Array; - - /** - * @default This contains bundle summary information in pack.info - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly summary: PackageSummary; -} - -/** - * @name PackageConfig: the package info class. - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ -export interface PackageConfig { - /** - * @default Indicates the device type of this package - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly deviceType: Array; - - /** - * @default Indicates the name of this package - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly name: string; - - /** - * @default Indicates the module type of this package - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly moduleType: string; - - /** - * @default Indicates whether this package is delivery and install - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly deliveryWithInstall: boolean; -} - -/** - * @name PackageSummary: the package summary class. - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ -export interface PackageSummary { - /** - * @default Indicates the bundle config info of this package - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly app: BundleConfigInfo; - - /** - * @default Indicates the modules config info of this package - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly modules: Array; -} - -/** - * @name BundleConfigInfo: the bundle summary class. - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ -export interface BundleConfigInfo { - /** - * @default Indicates the name of this bundle - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly bundleName: string; - - /** - * @default Indicates the bundle version - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly version: Version; -} - -/** - * @name ExtensionAbilities: the extension ability forms class. - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ - export interface ExtensionAbilities { - /** - * @default Indicates the name of this extension ability - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly name: string; - - /** - * @default Indicates the ability forms info - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly forms: Array; -} - -/** - * @name ModuleConfigInfo: the module summary of a bundle. - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ -export interface ModuleConfigInfo { - /** - * @default Indicates the api version - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly apiVersion: ApiVersion; - - /** - * @default Indicates the devices type - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly deviceType: Array; - - /** - * @default Indicates the module distro info - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly distro: ModuleDistroInfo; - - /** - * @default Indicates the abilities info of this module - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly abilities: Array; - - /** - * @default Indicates extension abilities info of this module - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly extensionAbilities: Array; -} - -/** - * @name ModuleDistroInfo: the bundle info summary class. - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ -export interface ModuleDistroInfo { - /** - * @default Indicates the name of main ability - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly mainAbility: string; - - /** - * @default Indicates is delivery with install - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly deliveryWithInstall: boolean; - - /** - * @default Indicates is free install - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly installationFree: boolean; - - /** - * @default Indicates the module name - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly moduleName: string; - - /** - * @default Indicates the module type - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly moduleType: string; -} - -/** - * @name ModuleAbilityInfo: the ability info of a module. - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ -export interface ModuleAbilityInfo { - /** - * @default Indicates the name of this module ability - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly name: string; - - /** - * @default Indicates the label of this module ability - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly label: string; - - /** - * @default Indicates is visible - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly visible: boolean; - - /** - * @default Indicates the ability forms info - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly forms: Array; -} - -/** - * @name AbilityFormInfo: the form info of an ability. - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ -export interface AbilityFormInfo { - /** - * @default Indicates the name of this ability - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly name: string; - - /** - * @default Indicates the type of this ability - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly type: string; - - /** - * @default Indicates is enabled update - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly updateEnabled: boolean; - - /** - * @default Indicates the scheduled update time - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly scheduledUpdateTime: string; - - /** - * @default Indicates the update duration - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly updateDuration: number; - - /** - * @default Indicates the ability support dimensions - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly supportDimensions: Array; - - /** - * @default Indicates the ability default dimension - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly defaultDimension: number; -} - -/** - * @name Version: the bundle version class. - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ -export interface Version { - /** - * @default Indicates the min compatible code of this version - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly minCompatibleVersionCode: number; - - /** - * @default Indicates the name of this version - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly name: string; - - /** - * @default Indicates the code of this version - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly code: number; -} - -/** - * @name ApiVersion: the bundle Api version class. - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - * @systemapi hide this for inner system use - */ -export interface ApiVersion { - /** - * @default Indicates the min compatible code of this version - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly releaseType: string; - - /** - * @default Indicates the name of this version - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly compatible: number; - - /** - * @default Indicates the code of this version - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly target: number; -} - -/** -* @name BundlePackFlag -* @since 9 -* @syscap SystemCapability.BundleManager.BundleFramework -* @import NA -* @systemapi hide this for inner system use -*/ -export enum BundlePackFlag { - GET_PACK_INFO_ALL = 0x00000000, - GET_PACKAGES = 0x00000001, - GET_BUNDLE_SUMMARY = 0x00000002, - GET_MODULE_SUMMARY = 0x00000004, -} \ No newline at end of file diff --git a/api/bundle/shortcutInfo.d.ts b/api/bundle/shortcutInfo.d.ts index 7b931ae799..353a5241a9 100644 --- a/api/bundle/shortcutInfo.d.ts +++ b/api/bundle/shortcutInfo.d.ts @@ -30,12 +30,6 @@ * @syscap SystemCapability.BundleManager.BundleFramework */ readonly targetBundle: string; - /** - * @default Indicates the target module of the shortcut want - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly targetModule: string; /** * @default Indicates the target class of the shortcut want * @since 7 @@ -126,11 +120,4 @@ * @syscap SystemCapability.BundleManager.BundleFramework */ readonly isEnabled?: boolean; - - /** - * @default Indicates the moduleName of the shortcut - * @since 9 - * @syscap SystemCapability.BundleManager.BundleFramework - */ - readonly moduleName?: string; } \ No newline at end of file -- Gitee From 918050239509012537416cfca45662cc60215810 Mon Sep 17 00:00:00 2001 From: wangtiantian Date: Fri, 28 Oct 2022 11:20:37 +0800 Subject: [PATCH 272/438] IssueNo:#I5W4EA Description:delete bms old api9 Sig:SIG_ApplicaitonFramework Feature or Bugfix:Bugfix Binary Source:No Signed-off-by: wangtiantian --- api/@ohos.bundle.innerBundleManager.d.ts | 2 ++ api/@ohos.multimedia.avsession.d.ts | 2 +- api/application/AbilityContext.d.ts | 6 +++--- api/application/AbilityStageContext.d.ts | 4 ++-- api/application/Context.d.ts | 2 +- api/application/ExtensionContext.d.ts | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/api/@ohos.bundle.innerBundleManager.d.ts b/api/@ohos.bundle.innerBundleManager.d.ts index 30264f6278..f9d0bb358e 100644 --- a/api/@ohos.bundle.innerBundleManager.d.ts +++ b/api/@ohos.bundle.innerBundleManager.d.ts @@ -25,6 +25,8 @@ import { ShortcutInfo } from './bundle/shortcutInfo'; * @syscap SystemCapability.BundleManager.BundleFramework * @permission NA * @systemapi Hide this for inner system use + * @deprecated since 9 + * @useinstead ohos.bundle.launcherBundleManager */ declare namespace innerBundleManager { diff --git a/api/@ohos.multimedia.avsession.d.ts b/api/@ohos.multimedia.avsession.d.ts index ef501b18ea..060f6b6ed0 100644 --- a/api/@ohos.multimedia.avsession.d.ts +++ b/api/@ohos.multimedia.avsession.d.ts @@ -16,7 +16,7 @@ import { AsyncCallback } from './basic'; import { WantAgent } from '@ohos.wantAgent'; import KeyEvent from './@ohos.multimodalInput.keyEvent'; -import { ElementName } from './bundle/elementName'; +import { ElementName } from './bundleManager/elementName'; import image from './@ohos.multimedia.image'; import audio from './@ohos.multimedia.audio'; diff --git a/api/application/AbilityContext.d.ts b/api/application/AbilityContext.d.ts index ffa23b2ef0..a0a0452916 100755 --- a/api/application/AbilityContext.d.ts +++ b/api/application/AbilityContext.d.ts @@ -15,16 +15,16 @@ /// -import { AbilityInfo } from "../bundle/abilityInfo"; +import { AbilityInfo } from "../bundleManager/abilityInfo"; import { AbilityResult } from "../ability/abilityResult"; import { AsyncCallback } from "../basic"; import { ConnectOptions } from "../ability/connectOptions"; -import { HapModuleInfo } from "../bundle/hapModuleInfo"; +import { HapModuleInfo } from "../bundleManager/hapModuleInfo"; import Context from "./Context"; import Want from "../@ohos.application.Want"; import StartOptions from "../@ohos.app.ability.StartOptions"; import PermissionRequestResult from "./PermissionRequestResult"; -import { Configuration } from '../@ohos.application.Configuration'; +import { Configuration } from '../@ohos.app.ability.Configuration'; import { Caller } from '../@ohos.app.ability.Ability'; import { LocalStorage } from 'StateManagement'; import image from '../@ohos.multimedia.image'; diff --git a/api/application/AbilityStageContext.d.ts b/api/application/AbilityStageContext.d.ts index 4b2777b37d..d5feff64cf 100644 --- a/api/application/AbilityStageContext.d.ts +++ b/api/application/AbilityStageContext.d.ts @@ -13,8 +13,8 @@ * limitations under the License. */ -import { HapModuleInfo } from "../bundle/hapModuleInfo"; -import { Configuration } from '../@ohos.application.Configuration'; +import { HapModuleInfo } from "../bundleManager/hapModuleInfo"; +import { Configuration } from '../@ohos.app.ability.Configuration'; import Context from "./Context"; /** diff --git a/api/application/Context.d.ts b/api/application/Context.d.ts index 32aeb23e08..67b1316ac0 100755 --- a/api/application/Context.d.ts +++ b/api/application/Context.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { ApplicationInfo } from "../bundle/applicationInfo"; +import { ApplicationInfo } from "../bundleManager/applicationInfo"; import resmgr from "../@ohos.resourceManager"; import BaseContext from "./BaseContext"; import EventHub from "./EventHub"; diff --git a/api/application/ExtensionContext.d.ts b/api/application/ExtensionContext.d.ts index 7f7c100221..472c447193 100644 --- a/api/application/ExtensionContext.d.ts +++ b/api/application/ExtensionContext.d.ts @@ -14,7 +14,7 @@ */ import { HapModuleInfo } from "../bundleManager/hapModuleInfo"; -import { Configuration } from '../@ohos.application.Configuration'; +import { Configuration } from '../@ohos.app.ability.Configuration'; import Context from "./Context"; import { ExtensionAbilityInfo } from "../bundleManager/extensionAbilityInfo"; -- Gitee From d13dafa57caf9c380b484eceeb355ef17ace1d33 Mon Sep 17 00:00:00 2001 From: ma-shaoyin Date: Fri, 28 Oct 2022 11:45:08 +0800 Subject: [PATCH 273/438] Signed-off-by: ma-shaoyin Changes to be committed: --- api/@ohos.inputmethod.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.inputmethod.d.ts b/api/@ohos.inputmethod.d.ts index b576b7f2a7..956e08c7ba 100644 --- a/api/@ohos.inputmethod.d.ts +++ b/api/@ohos.inputmethod.d.ts @@ -498,7 +498,7 @@ declare namespace inputMethod { * @useinstead ohos.inputmethod.InputMethodProperty.name * @syscap SystemCapability.MiscServices.InputMethodFramework */ - readonly packageName?: string; + readonly packageName: string; /** * The id of input method @@ -507,7 +507,7 @@ declare namespace inputMethod { * @useinstead ohos.inputmethod.InputMethodProperty.id * @syscap SystemCapability.MiscServices.InputMethodFramework */ - readonly methodId?: string; + readonly methodId: string; /** * The name of input method -- Gitee From a295d78fd6f0fd611e2ffcc9e2d55f099da6d371 Mon Sep 17 00:00:00 2001 From: m00512953 Date: Fri, 28 Oct 2022 11:45:42 +0800 Subject: [PATCH 274/438] mingxihua@huawei.com.cn Signed-off-by: m00512953 --- api/@ohos.app.ability.contextConstant.d.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/@ohos.app.ability.contextConstant.d.ts b/api/@ohos.app.ability.contextConstant.d.ts index 96b8f12a60..9ee3babb81 100644 --- a/api/@ohos.app.ability.contextConstant.d.ts +++ b/api/@ohos.app.ability.contextConstant.d.ts @@ -31,10 +31,13 @@ */ export enum AreaMode { /** + * system level device encryption area * @syscap SystemCapability.Ability.AbilityRuntime.Core */ EL1 = 0, + /** + * user credential encryption area * @syscap SystemCapability.Ability.AbilityRuntime.Core */ EL2 = 1 -- Gitee From f156cdfecad4f25e8225363897c93a472ac0d673 Mon Sep 17 00:00:00 2001 From: m00512953 Date: Fri, 28 Oct 2022 11:47:22 +0800 Subject: [PATCH 275/438] mingxihua@huawei.com.cn Signed-off-by: m00512953 --- api/@ohos.app.ability.contextConstant.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.app.ability.contextConstant.d.ts b/api/@ohos.app.ability.contextConstant.d.ts index 9ee3babb81..fef30c2581 100644 --- a/api/@ohos.app.ability.contextConstant.d.ts +++ b/api/@ohos.app.ability.contextConstant.d.ts @@ -31,13 +31,13 @@ */ export enum AreaMode { /** - * system level device encryption area + * System level device encryption area * @syscap SystemCapability.Ability.AbilityRuntime.Core */ EL1 = 0, /** - * user credential encryption area + * User credential encryption area * @syscap SystemCapability.Ability.AbilityRuntime.Core */ EL2 = 1 -- Gitee From fc4a91f0d1bce56aa9b2f38e89c629a778248383 Mon Sep 17 00:00:00 2001 From: shilei Date: Fri, 28 Oct 2022 12:58:12 +0800 Subject: [PATCH 276/438] add Signed-off-by: shilei Change-Id: I3aa205c21107ddd3245c34f78bf2f3d617a4bfd9 --- api/@ohos.bundle.bundleManager.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/api/@ohos.bundle.bundleManager.d.ts b/api/@ohos.bundle.bundleManager.d.ts index 9e92b72cd3..531c720dc2 100644 --- a/api/@ohos.bundle.bundleManager.d.ts +++ b/api/@ohos.bundle.bundleManager.d.ts @@ -1032,6 +1032,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @throws { BusinessError } 401 - Input parameters check failed. * @throws { BusinessError } 17700001 - The specified bundleName is not found. * @throws { BusinessError } 17700004 - The specified userId is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi * @since 9 -- Gitee From 1acbc61991ebac05f5e4fb08d6e4cd26aa4d259a Mon Sep 17 00:00:00 2001 From: liukaii Date: Fri, 28 Oct 2022 15:00:14 +0800 Subject: [PATCH 277/438] delete uiAppearance.d.ts Signed-off-by: liukaii --- api/@ohos.uiAppearance.d.ts | 57 ------------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 api/@ohos.uiAppearance.d.ts diff --git a/api/@ohos.uiAppearance.d.ts b/api/@ohos.uiAppearance.d.ts deleted file mode 100644 index 5a65a569d5..0000000000 --- a/api/@ohos.uiAppearance.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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 { AsyncCallback, Callback } from './basic'; - -/** - * Provide APIs to set system uiAppearance. - * @syscap SystemCapability.ArkUI.UiAppearance - * @import import uiAppearance from '@ohos.uiAppearance'; - * @since 9 - */ -declare namespace uiAppearance { - /** - * Enumerates dark-mode. - */ - enum DarkMode { - /** - * Always display with dark mode. - */ - ALWAYS_DARK = 0, - - /** - * Always display with light mode. - */ - ALWAYS_LIGHT = 1 - } - - /** - * Set the system dark-mode. - * @param mode Indicates the dark-mode to set - * @permission ohos.permission.UPDATE_CONFIGURATION - * @systemapi Hide this for inner system use - */ - function setDarkMode(mode: DarkMode, callback: AsyncCallback): void; - function setDarkMode(mode: DarkMode): Promise; - - /** - * Acquire the current dark-mode. - * @return current dark-mode. - * @permission ohos.permission.UPDATE_CONFIGURATION - * @systemapi Hide this for inner system use - */ - function getDarkMode(): DarkMode; -} -export default uiAppearance; \ No newline at end of file -- Gitee From ed96992afe38c66e345d2ab367fa3b5665c81a6d Mon Sep 17 00:00:00 2001 From: keerecles Date: Thu, 27 Oct 2022 09:51:51 +0800 Subject: [PATCH 278/438] eTSCard Post action to FMS Signed-off-by: keerecles Change-Id: I69dc4aee9cb2682ec48907dbaafd8bd5d04388d8 --- api/@internal/component/ets/common.d.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index 41a3f75c96..12e733e207 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -146,7 +146,17 @@ declare function getContext(component?: Object): Context; * @since 9 */ declare type Context = import('../api/application/Context').default; - + +/** + * Post Card Action. + * @param { Object } component - indicate the card entry component. + * @param { Object } action - indicate the router or message event. + * @StageModelOnly + * @systemapi + * @since 9 + */ + declare function postCardAction(component: Object, action: Object): void; + /** * Defines the data type of the interface restriction. * @since 7 -- Gitee From 5cdac23fcb7bdf98684160e0f4dab366c2141302 Mon Sep 17 00:00:00 2001 From: dingxiaochen Date: Fri, 28 Oct 2022 17:03:24 +0800 Subject: [PATCH 279/438] fix interface. Signed-off-by: dingxiaochen --- api/@ohos.telephony.data.d.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/api/@ohos.telephony.data.d.ts b/api/@ohos.telephony.data.d.ts index 1ca3ce823f..a562d69080 100644 --- a/api/@ohos.telephony.data.d.ts +++ b/api/@ohos.telephony.data.d.ts @@ -26,7 +26,6 @@ declare namespace data { * Checks whether cellular data services are enabled. * * @return Returns {@code true} if cellular data services are enabled; returns {@code false} otherwise. - * @permission ohos.permission.GET_NETWORK_INFO */ function getDefaultCellularDataSlotId(callback: AsyncCallback): void; function getDefaultCellularDataSlotId(): Promise; @@ -34,10 +33,7 @@ declare namespace data { /** * Checks whether cellular data services are enabled. * - *

Requires Permission: {@code ohos.permission.GET_NETWORK_INFO}. - * * @return Returns default cellular data slot id. - * @permission ohos.permission.GET_NETWORK_INFO * @since 9 */ function getDefaultCellularDataSlotIdSync(): number; @@ -199,4 +195,4 @@ declare namespace data { } } -export default data; \ No newline at end of file +export default data; -- Gitee From 41e60a0063a19a2b071d5f3dfbda224585fd2a1f Mon Sep 17 00:00:00 2001 From: ltdong Date: Fri, 28 Oct 2022 09:19:41 +0000 Subject: [PATCH 280/438] update api/@ohos.data.rdb.d.ts. Signed-off-by: ltdong --- api/@ohos.data.rdb.d.ts | 87 ++++++++++++++++++----------------------- 1 file changed, 39 insertions(+), 48 deletions(-) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index 36d9d72ea0..f6930f6737 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -196,15 +196,6 @@ declare namespace rdb * @since 9 */ enum SecurityLevel { - /** - * S0: mains the db is public. - * There is no impact even if the data is leaked. - * - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - S0 = 1, - /** * S1: mains the db is low level security * There are some low impact, when the data is leaked. @@ -212,34 +203,34 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ - S1 = 2, - - /** - * S2: mains the db is middle level security - * There are some major impact, when the data is leaked. - * - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - S2 = 3, - - /** - * S3: mains the db is high level security - * There are some severity impact, when the data is leaked. - * - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - S3 = 5, - - /** - * S4: mains the db is critical level security - * There are some critical impact, when the data is leaked. - * - * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core - * @since 9 - */ - S4 = 6, + S1 = 1, + + /** + * S2: mains the db is middle level security + * There are some major impact, when the data is leaked. + * + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + S2 = 2, + + /** + * S3: mains the db is high level security + * There are some severity impact, when the data is leaked. + * + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + S3 = 3, + + /** + * S4: mains the db is critical level security + * There are some critical impact, when the data is leaked. + * + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @since 9 + */ + S4 = 4, } /** @@ -342,7 +333,7 @@ declare namespace rdb * @deprecated since 9 * @useinstead ohos.data.rdb.RdbStoreV9.delete */ - delete (predicates: RdbPredicates, callback: AsyncCallback): void; + delete(predicates: RdbPredicates, callback: AsyncCallback): void; /** * Deletes data from the database based on a specified instance object of RdbPredicates. @@ -354,7 +345,7 @@ declare namespace rdb * @deprecated since 9 * @useinstead ohos.data.rdb.RdbStoreV9.delete */ - delete (predicates: RdbPredicates): Promise; + delete(predicates: RdbPredicates): Promise; /** * Queries data in the database based on specified conditions. @@ -435,7 +426,7 @@ declare namespace rdb executeSql(sql: string, bindArgs ?: Array): Promise; /** - * beginTransaction before excute your sql. + * Begin Transaction before excute your sql. * * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 @@ -445,7 +436,7 @@ declare namespace rdb beginTransaction(): void; /** - * commit the the sql you have excuted. + * Commit the the sql you have excuted. * * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 @@ -455,7 +446,7 @@ declare namespace rdb commit(): void; /** - * roll back the sql you have already excuted. + * Roll back the sql you have already excuted. * * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 @@ -689,7 +680,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ - delete (predicates: RdbPredicatesV9, callback: AsyncCallback): void; + delete(predicates: RdbPredicatesV9, callback: AsyncCallback): void; /** * Deletes data from the database based on a specified instance object of RdbPredicatesV9. @@ -700,7 +691,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ - delete (predicates: RdbPredicatesV9): Promise; + delete(predicates: RdbPredicatesV9): Promise; /** * Deletes data from the database based on a specified instance object of RdbPredicatesV9. @@ -712,7 +703,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ - delete (table: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; + delete(table: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; /** * Deletes data from the database based on a specified instance object of RdbPredicatesV9. @@ -724,7 +715,7 @@ declare namespace rdb * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ - delete (table: string, predicates: dataSharePredicates.DataSharePredicates): Promise; + delete(table: string, predicates: dataSharePredicates.DataSharePredicates): Promise; /** * Queries data in the database based on specified conditions. @@ -1202,7 +1193,7 @@ class RdbPredicates { * @deprecated since 9 * @useinstead ohos.data.rdb.RdbPredicatesV9.or */ - or (): RdbPredicates; + or(): RdbPredicates; /** * Adds an and condition to the RdbPredicates. @@ -1613,7 +1604,7 @@ class RdbPredicatesV9 { * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ - or (): RdbPredicatesV9; + or(): RdbPredicatesV9; /** * Adds an and condition to the RdbPredicatesV9. -- Gitee From 42b4b51a7e8ed8134d61766784e3d254c64fc5ba Mon Sep 17 00:00:00 2001 From: ltdong Date: Fri, 28 Oct 2022 09:26:08 +0000 Subject: [PATCH 281/438] update api/@ohos.data.rdb.d.ts. Signed-off-by: ltdong --- api/@ohos.data.rdb.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index f6930f6737..28762906aa 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -1144,7 +1144,7 @@ class RdbPredicates { equalTo(field: string, value: ValueType): RdbPredicates; /** - * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is unequal to + * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is not equal to * a specified value. * * @note This method is similar to != of the SQL statement. @@ -1562,7 +1562,7 @@ class RdbPredicatesV9 { equalTo(field: string, value: ValueType): RdbPredicatesV9; /** - * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is unequal to + * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is not equal to * a specified value. * * @note This method is similar to != of the SQL statement. -- Gitee From 94f8d9b72c24025db1ab5ada3be4ef9d33c761c0 Mon Sep 17 00:00:00 2001 From: ltdong Date: Fri, 28 Oct 2022 09:29:44 +0000 Subject: [PATCH 282/438] update api/data/rdb/resultSet.d.ts. Signed-off-by: ltdong --- api/data/rdb/resultSet.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api/data/rdb/resultSet.d.ts b/api/data/rdb/resultSet.d.ts index cf163c84d4..8b080538ff 100755 --- a/api/data/rdb/resultSet.d.ts +++ b/api/data/rdb/resultSet.d.ts @@ -393,8 +393,7 @@ import { AsyncCallback } from '../../basic' isEnded: boolean; /** - * returns whether the cursor is pointing to the position before the first - * row. + * Returns whether the cursor is pointing to the position before the first row. * * @note N/A * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core -- Gitee From 122fe618783796a4c8dea36408442be164670639 Mon Sep 17 00:00:00 2001 From: yangzk Date: Fri, 28 Oct 2022 10:39:13 +0800 Subject: [PATCH 283/438] =?UTF-8?q?IssueNo:=20#I5Y6PR=20Description:=20?= =?UTF-8?q?=E4=BD=BF=E7=94=A8UIAbility=20Sig:=20SIG=5FApplicationFramework?= =?UTF-8?q?=20Feature=20or=20Bugfix:=20Feature=20Binary=20Source:=20No?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangzk Change-Id: I301000336a001c2b99c96b077654015c85933cb6 --- api/@ohos.app.ability.Ability.d.ts | 267 -------- api/@ohos.app.ability.AbilityConstant.d.ts | 2 +- ....app.ability.AbilityLifecycleCallback.d.ts | 20 +- api/@ohos.app.ability.ExtensionAbility.d.ts | 25 +- api/@ohos.app.ability.UIAbility.d.ts | 292 +++++++++ api/@ohos.app.ability.common.d.ts | 4 +- api/application/AbilityContext.d.ts | 4 +- api/application/ServiceExtensionContext.d.ts | 2 +- api/application/UIAbilityContext.d.ts | 572 ++++++++++++++++++ api/application/abilityDelegator.d.ts | 42 +- api/application/abilityMonitor.d.ts | 16 +- 11 files changed, 913 insertions(+), 333 deletions(-) create mode 100755 api/@ohos.app.ability.UIAbility.d.ts create mode 100755 api/application/UIAbilityContext.d.ts diff --git a/api/@ohos.app.ability.Ability.d.ts b/api/@ohos.app.ability.Ability.d.ts index a3efd8a404..a29250be37 100644 --- a/api/@ohos.app.ability.Ability.d.ts +++ b/api/@ohos.app.ability.Ability.d.ts @@ -14,147 +14,8 @@ */ import AbilityConstant from "./@ohos.app.ability.AbilityConstant"; -import AbilityContext from "./application/AbilityContext"; -import rpc from './@ohos.rpc'; -import Want from './@ohos.app.ability.Want'; -import window from './@ohos.window'; import { Configuration } from './@ohos.app.ability.Configuration'; -/** - * The prototype of the listener function interface registered by the Caller. - * @typedef OnReleaseCallback - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @since 9 - */ -export interface OnReleaseCallback { - (msg: string): void; -} - -/** - * The prototype of the message listener function interface registered by the Callee. - * @typedef CalleeCallback - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @since 9 - */ -export interface CalleeCallback { - (indata: rpc.MessageParcel): rpc.Sequenceable; -} - -/** - * The interface of a Caller. - * @interface - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @since 9 - */ -export interface Caller { - /** - * Notify the server of Sequenceable type data. - * @param { string } method - The notification event string listened to by the callee. - * @param { rpc.Sequenceable } data - Notification data to the callee. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @since 9 - */ - call(method: string, data: rpc.Sequenceable): Promise; - - /** - * Notify the server of Sequenceable type data and return the notification result. - * @param { string } method - The notification event string listened to by the callee. - * @param { rpc.Sequenceable } data - Notification data to the callee. - * @returns { Promise } Returns the callee's notification result data. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @since 9 - */ - callWithResult(method: string, data: rpc.Sequenceable): Promise; - - /** - * Clear service records. - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @since 9 - */ - release(): void; - - /** - * Register death listener notification callback. - * @param { OnReleaseCallback } callback - Register a callback function for listening for notifications. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @since 9 - */ - onRelease(callback: OnReleaseCallback): void; - - /** - * Register death listener notification callback. - * @param { string } type - release. - * @param { OnReleaseCallback } callback - Register a callback function for listening for notifications. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @since 9 - */ - on(type: "release", callback: OnReleaseCallback): void; - - /** - * Unregister death listener notification callback. - * @param { string } type - release. - * @param { OnReleaseCallback } callback - Unregister a callback function for listening for notifications. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @since 9 - */ - off(type: "release", callback: OnReleaseCallback): void; - - /** - * Unregister all death listener notification callback. - * @param { string } type - release. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @since 9 - */ - off(type: "release"): void; -} - -/** - * The interface of a Callee. - * @interface - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @since 9 - */ -export interface Callee { - /** - * Register data listener callback. - * @param { string } method - A string registered to listen for notification events. - * @param { CalleeCallback } callback - Register a callback function that listens for notification events. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @since 9 - */ - on(method: string, callback: CalleeCallback): void; - - /** - * Unregister data listener callback. - * @param { string } method - A string registered to listen for notification events. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @since 9 - */ - off(method: string): void; -} - /** * The class of an ability. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore @@ -162,123 +23,6 @@ export interface Callee { * @since 9 */ export default class Ability { - /** - * Indicates configuration information about an ability context. - * @type { AbilityContext } - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @since 9 - */ - context: AbilityContext; - - /** - * Indicates ability launch want. - * @type { Want } - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @since 9 - */ - launchWant: Want; - - /** - * Indicates ability last request want. - * @type { Want } - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @since 9 - */ - lastRequestWant: Want; - - /** - * Call Service Stub Object. - * @type { Callee } - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @since 9 - */ - callee: Callee; - - /** - * Called back when an ability is started for initialization. - * @param { Want } want - Indicates the want info of the created ability. - * @param { AbilityConstant.LaunchParam } param - Indicates the launch param. - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @since 9 - */ - onCreate(want: Want, param: AbilityConstant.LaunchParam): void; - - /** - * Called back when an ability window stage is created. - * @param { window.WindowStage } windowStage - Indicates the created WindowStage. - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @since 9 - */ - onWindowStageCreate(windowStage: window.WindowStage): void; - - /** - * Called back when an ability window stage is destroyed. - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @since 9 - */ - onWindowStageDestroy(): void; - - /** - * Called back when an ability window stage is restored. - * @param { window.WindowStage } windowStage - window stage to restore - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @since 9 - */ - onWindowStageRestore(windowStage: window.WindowStage): void; - - /** - * Called back before an ability is destroyed. - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @since 9 - */ - onDestroy(): void; - - /** - * Called back when the state of an ability changes to foreground. - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @since 9 - */ - onForeground(): void; - - /** - * Called back when the state of an ability changes to background. - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @since 9 - */ - onBackground(): void; - - /** - * Called back when an ability prepares to continue. - * @param { {[key: string]: any} } wantParam - Indicates the want parameter. - * @returns { AbilityConstant.OnContinueResult } Return the result of onContinue. - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @since 9 - */ - onContinue(wantParam: { [key: string]: any }): AbilityConstant.OnContinueResult; - - /** - * Called when the launch mode of an ability is set to singleton. - * This happens when you re-launch an ability that has been at the top of the ability stack. - * @param { Want } want - Indicates the want info of ability. - * @param { AbilityConstant.LaunchParam } launchParams - Indicates the launch parameters. - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @since 9 - */ - onNewWant(want: Want, launchParams: AbilityConstant.LaunchParam): void; - /** * Called when the system configuration is updated. * @param { Configuration } newConfig - Indicates the updated configuration. @@ -288,17 +32,6 @@ export default class Ability { */ onConfigurationUpdate(newConfig: Configuration): void; - /** - * Called when dump client information is required. - * It is recommended that developers don't DUMP sensitive information. - * @param { Array } params - Indicates the params from command. - * @returns { Array } Return the dump info array. - * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly - * @since 9 - */ - onDump(params: Array): Array; - /** * Called when the system has determined to trim the memory, for example, when the ability is running in the * background and there is no enough memory for running as many background processes as possible. diff --git a/api/@ohos.app.ability.AbilityConstant.d.ts b/api/@ohos.app.ability.AbilityConstant.d.ts index b02c97e86e..3709949ca5 100644 --- a/api/@ohos.app.ability.AbilityConstant.d.ts +++ b/api/@ohos.app.ability.AbilityConstant.d.ts @@ -144,4 +144,4 @@ declare namespace AbilityConstant { } } -export default AbilityConstant +export default AbilityConstant; diff --git a/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts b/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts index a94e3e71d4..7f62e30fea 100644 --- a/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts +++ b/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import Ability from "./@ohos.app.ability.Ability"; +import UIAbility from "./@ohos.app.ability.UIAbility"; import dataAbility from "./@ohos.data.dataAbility"; import window from './@ohos.window'; @@ -31,7 +31,7 @@ export default class AbilityLifecycleCallback { * @stagemodelonly * @since 9 */ - onAbilityCreate(ability: Ability): void; + onAbilityCreate(ability: UIAbility): void; /** * Called back when a window stage is created. @@ -41,7 +41,7 @@ export default class AbilityLifecycleCallback { * @stagemodelonly * @since 9 */ - onWindowStageCreate(ability: Ability, windowStage: window.WindowStage): void; + onWindowStageCreate(ability: UIAbility, windowStage: window.WindowStage): void; /** * Called back when a window stage is actived. @@ -51,7 +51,7 @@ export default class AbilityLifecycleCallback { * @stagemodelonly * @since 9 */ - onWindowStageActive(ability: Ability, windowStage: window.WindowStage): void; + onWindowStageActive(ability: UIAbility, windowStage: window.WindowStage): void; /** * Called back when a window stage is inactived. @@ -61,7 +61,7 @@ export default class AbilityLifecycleCallback { * @stagemodelonly * @since 9 */ - onWindowStageInactive(ability: Ability, windowStage: window.WindowStage): void; + onWindowStageInactive(ability: UIAbility, windowStage: window.WindowStage): void; /** * Called back when a window stage is destroyed. @@ -71,7 +71,7 @@ export default class AbilityLifecycleCallback { * @stagemodelonly * @since 9 */ - onWindowStageDestroy(ability: Ability, windowStage: window.WindowStage): void; + onWindowStageDestroy(ability: UIAbility, windowStage: window.WindowStage): void; /** * Called back when an ability is destroyed. @@ -80,7 +80,7 @@ export default class AbilityLifecycleCallback { * @stagemodelonly * @since 9 */ - onAbilityDestroy(ability: Ability): void; + onAbilityDestroy(ability: UIAbility): void; /** * Called back when the state of an ability changes to foreground. @@ -89,7 +89,7 @@ export default class AbilityLifecycleCallback { * @stagemodelonly * @since 9 */ - onAbilityForeground(ability: Ability): void; + onAbilityForeground(ability: UIAbility): void; /** * Called back when the state of an ability changes to background. @@ -98,7 +98,7 @@ export default class AbilityLifecycleCallback { * @stagemodelonly * @since 9 */ - onAbilityBackground(ability: Ability): void; + onAbilityBackground(ability: UIAbility): void; /** * Called back when an ability prepares to continue. @@ -107,5 +107,5 @@ export default class AbilityLifecycleCallback { * @stagemodelonly * @since 9 */ - onAbilityContinue(ability: Ability): void; + onAbilityContinue(ability: UIAbility): void; } \ No newline at end of file diff --git a/api/@ohos.app.ability.ExtensionAbility.d.ts b/api/@ohos.app.ability.ExtensionAbility.d.ts index 6f27489e3f..a64ecb161e 100644 --- a/api/@ohos.app.ability.ExtensionAbility.d.ts +++ b/api/@ohos.app.ability.ExtensionAbility.d.ts @@ -13,8 +13,7 @@ * limitations under the License. */ -import AbilityConstant from "./@ohos.app.ability.AbilityConstant"; -import { Configuration } from './@ohos.app.ability.Configuration'; +import Ability from "./@ohos.app.ability.Ability"; /** * class of extension. @@ -22,23 +21,5 @@ import { Configuration } from './@ohos.app.ability.Configuration'; * @stagemodelonly * @since 9 */ -export default class ExtensionAbility { - /** - * Called when the system configuration is updated. - * @param { Configuration } newConfig - Indicates the updated configuration. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - onConfigurationUpdate(newConfig: Configuration): void; - - /** - * Called when the system has determined to trim the memory, for example, when the ability is running in the - * background and there is no enough memory for running as many background processes as possible. - * @param { AbilityConstant.MemoryLevel } level - Indicates the memory trim level, which shows the current memory usage status. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly - * @since 9 - */ - onMemoryLevel(level: AbilityConstant.MemoryLevel): void; -} \ No newline at end of file +export default class ExtensionAbility extends Ability { +} diff --git a/api/@ohos.app.ability.UIAbility.d.ts b/api/@ohos.app.ability.UIAbility.d.ts new file mode 100755 index 0000000000..2f1612dc5c --- /dev/null +++ b/api/@ohos.app.ability.UIAbility.d.ts @@ -0,0 +1,292 @@ +/* + * 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 Ability from "./@ohos.app.ability.Ability"; +import AbilityConstant from "./@ohos.app.ability.AbilityConstant"; +import UIAbilityContext from "./application/UIAbilityContext"; +import rpc from './@ohos.rpc'; +import Want from './@ohos.app.ability.Want'; +import window from './@ohos.window'; + +/** + * The prototype of the listener function interface registered by the Caller. + * @typedef OnReleaseCallback + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ +export interface OnReleaseCallback { + (msg: string): void; +} + +/** + * The prototype of the message listener function interface registered by the Callee. + * @typedef CalleeCallback + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ +export interface CalleeCallback { + (indata: rpc.MessageParcel): rpc.Sequenceable; +} + +/** + * The interface of a Caller. + * @interface + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ +export interface Caller { + /** + * Notify the server of Sequenceable type data. + * @param { string } method - The notification event string listened to by the callee. + * @param { rpc.Sequenceable } data - Notification data to the callee. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ + call(method: string, data: rpc.Sequenceable): Promise; + + /** + * Notify the server of Sequenceable type data and return the notification result. + * @param { string } method - The notification event string listened to by the callee. + * @param { rpc.Sequenceable } data - Notification data to the callee. + * @returns { Promise } Returns the callee's notification result data. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ + callWithResult(method: string, data: rpc.Sequenceable): Promise; + + /** + * Clear service records. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ + release(): void; + + /** + * Register death listener notification callback. + * @param { OnReleaseCallback } callback - Register a callback function for listening for notifications. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ + onRelease(callback: OnReleaseCallback): void; + + /** + * Register death listener notification callback. + * @param { string } type - release. + * @param { OnReleaseCallback } callback - Register a callback function for listening for notifications. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ + on(type: "release", callback: OnReleaseCallback): void; + + /** + * Unregister death listener notification callback. + * @param { string } type - release. + * @param { OnReleaseCallback } callback - Unregister a callback function for listening for notifications. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ + off(type: "release", callback: OnReleaseCallback): void; + + /** + * Unregister all death listener notification callback. + * @param { string } type - release. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ + off(type: "release"): void; +} + +/** + * The interface of a Callee. + * @interface + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ +export interface Callee { + /** + * Register data listener callback. + * @param { string } method - A string registered to listen for notification events. + * @param { CalleeCallback } callback - Register a callback function that listens for notification events. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ + on(method: string, callback: CalleeCallback): void; + + /** + * Unregister data listener callback. + * @param { string } method - A string registered to listen for notification events. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ + off(method: string): void; +} + +/** + * The class of a UI ability. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ +export default class UIAbility extends Ability { + /** + * Indicates configuration information about an ability context. + * @type { UIAbilityContext } + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ + context: UIAbilityContext; + + /** + * Indicates ability launch want. + * @type { Want } + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ + launchWant: Want; + + /** + * Indicates ability last request want. + * @type { Want } + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ + lastRequestWant: Want; + + /** + * Call Service Stub Object. + * @type { Callee } + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ + callee: Callee; + + /** + * Called back when an ability is started for initialization. + * @param { Want } want - Indicates the want info of the created ability. + * @param { AbilityConstant.LaunchParam } param - Indicates the launch param. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ + onCreate(want: Want, param: AbilityConstant.LaunchParam): void; + + /** + * Called back when an ability window stage is created. + * @param { window.WindowStage } windowStage - Indicates the created WindowStage. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ + onWindowStageCreate(windowStage: window.WindowStage): void; + + /** + * Called back when an ability window stage is destroyed. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ + onWindowStageDestroy(): void; + + /** + * Called back when an ability window stage is restored. + * @param { window.WindowStage } windowStage - window stage to restore + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ + onWindowStageRestore(windowStage: window.WindowStage): void; + + /** + * Called back before an ability is destroyed. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ + onDestroy(): void; + + /** + * Called back when the state of an ability changes to foreground. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ + onForeground(): void; + + /** + * Called back when the state of an ability changes to background. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ + onBackground(): void; + + /** + * Called back when an ability prepares to continue. + * @param { {[key: string]: any} } wantParam - Indicates the want parameter. + * @returns { AbilityConstant.OnContinueResult } Return the result of onContinue. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ + onContinue(wantParam: { [key: string]: any }): AbilityConstant.OnContinueResult; + + /** + * Called when the launch mode of an ability is set to singleton. + * This happens when you re-launch an ability that has been at the top of the ability stack. + * @param { Want } want - Indicates the want info of ability. + * @param { AbilityConstant.LaunchParam } launchParams - Indicates the launch parameters. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ + onNewWant(want: Want, launchParams: AbilityConstant.LaunchParam): void; + + /** + * Called when dump client information is required. + * It is recommended that developers don't DUMP sensitive information. + * @param { Array } params - Indicates the params from command. + * @returns { Array } Return the dump info array. + * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore + * @stagemodelonly + * @since 9 + */ + onDump(params: Array): Array; +} diff --git a/api/@ohos.app.ability.common.d.ts b/api/@ohos.app.ability.common.d.ts index 1716916ce8..cd0a1046cb 100755 --- a/api/@ohos.app.ability.common.d.ts +++ b/api/@ohos.app.ability.common.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import * as _AbilityContext from './application/AbilityContext'; +import * as _UIAbilityContext from './application/UIAbilityContext'; import * as _AbilityStageContext from './application/AbilityStageContext'; import * as _ApplicationContext from './application/ApplicationContext'; import * as _BaseContext from './application/BaseContext'; @@ -40,7 +40,7 @@ declare namespace common { * @stagemodelonly * @since 9 */ - export type AbilityContext = _AbilityContext.default + export type UIAbilityContext = _UIAbilityContext.default /** * The context of an abilityStage. It allows access to abilityStage-specific resources. diff --git a/api/application/AbilityContext.d.ts b/api/application/AbilityContext.d.ts index a0a0452916..ac3b1f1f12 100755 --- a/api/application/AbilityContext.d.ts +++ b/api/application/AbilityContext.d.ts @@ -25,7 +25,7 @@ import Want from "../@ohos.application.Want"; import StartOptions from "../@ohos.app.ability.StartOptions"; import PermissionRequestResult from "./PermissionRequestResult"; import { Configuration } from '../@ohos.app.ability.Configuration'; -import { Caller } from '../@ohos.app.ability.Ability'; +import { Caller } from '../@ohos.app.ability.UIAbility'; import { LocalStorage } from 'StateManagement'; import image from '../@ohos.multimedia.image'; @@ -34,6 +34,8 @@ import image from '../@ohos.multimedia.image'; * @syscap SystemCapability.Ability.AbilityRuntime.Core * @stagemodelonly * @since 9 + * @deprecated since 9 + * @useinstead UIAbilityContext */ export default class AbilityContext extends Context { /** diff --git a/api/application/ServiceExtensionContext.d.ts b/api/application/ServiceExtensionContext.d.ts index e6326f414e..acc02d4176 100644 --- a/api/application/ServiceExtensionContext.d.ts +++ b/api/application/ServiceExtensionContext.d.ts @@ -15,7 +15,7 @@ import { AsyncCallback } from "../basic"; import { ConnectOptions } from "../ability/connectOptions"; -import { Caller } from '../@ohos.app.ability.Ability'; +import { Caller } from '../@ohos.app.ability.UIAbility'; import ExtensionContext from "./ExtensionContext"; import Want from "../@ohos.application.Want"; import StartOptions from "../@ohos.app.ability.StartOptions"; diff --git a/api/application/UIAbilityContext.d.ts b/api/application/UIAbilityContext.d.ts new file mode 100755 index 0000000000..1f49caaba1 --- /dev/null +++ b/api/application/UIAbilityContext.d.ts @@ -0,0 +1,572 @@ +/* + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"), + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/// + +import { AbilityInfo } from "../bundle/abilityInfo"; +import { AbilityResult } from "../ability/abilityResult"; +import { AsyncCallback } from "../basic"; +import { ConnectOptions } from "../ability/connectOptions"; +import { HapModuleInfo } from "../bundle/hapModuleInfo"; +import Context from "./Context"; +import Want from "../@ohos.application.Want"; +import StartOptions from "../@ohos.app.ability.StartOptions"; +import PermissionRequestResult from "./PermissionRequestResult"; +import { Configuration } from '../@ohos.app.ability.Configuration'; +import { Caller } from '../@ohos.app.ability.UIAbility'; +import { LocalStorage } from 'StateManagement'; +import image from '../@ohos.multimedia.image'; + +/** + * The context of an ability. It allows access to ability-specific resources. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ +export default class UIAbilityContext extends Context { + /** + * Indicates configuration information about an ability. + * @type { AbilityInfo } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + abilityInfo: AbilityInfo; + + /** + * Indicates configuration information about the module. + * @type { HapModuleInfo } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + currentHapModuleInfo: HapModuleInfo; + + /** + * Indicates configuration information. + * @type { Configuration } + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + config: Configuration; + + /** + * Starts a new ability. + * @param want { Want } - Indicates the ability to start. + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + startAbility(want: Want, callback: AsyncCallback): void; + + /** + * Starts a new ability. + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; + + /** + * Starts a new ability. + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } options - Indicates the start options. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + startAbility(want: Want, options?: StartOptions): Promise; + + /** + * Get the caller object of the startup capability + * @param { Want } want - Indicates the ability to start. + * @returns { Promise } Returns the Caller interface. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ + startAbilityByCall(want: Want): Promise; + + /** + * Starts a new ability with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { AsyncCallback } callback - The callback of startAbilityWithAccount. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ + startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + + /** + * Starts a new ability with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback of startAbilityWithAccount. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ + startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; + + /** + * Starts a new ability with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { StartOptions } options - Indicates the start options. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ + startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; + + /** + * Starts an ability and returns the execution result when the ability is destroyed. + * @param { Want } want - Indicates the ability to start. + * @param { AsyncCallback } callback - The callback is used to return the result of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + startAbilityForResult(want: Want, callback: AsyncCallback): void; + + /** + * Starts an ability and returns the execution result when the ability is destroyed. + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback is used to return the result of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback): void; + + /** + * Starts an ability and returns the execution result when the ability is destroyed. + * @param { Want } want - Indicates the ability to start. + * @param { StartOptions } options - Indicates the start options. + * @returns { Promise } Returns the result of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + startAbilityForResult(want: Want, options?: StartOptions): Promise; + + /** + * Starts an ability and returns the execution result when the ability is destroyed with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { AsyncCallback } callback - The callback is used to return the result of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ + startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + + /** + * Starts an ability and returns the execution result when the ability is destroyed with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { StartOptions } options - Indicates the start options. + * @param { AsyncCallback } callback - The callback is used to return the result of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ + startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; + + /** + * Starts an ability and returns the execution result when the ability is destroyed with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { StartOptions } options - Indicates the start options. + * @returns { Promise } Returns the result of startAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ + startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; + + /** + * Starts a new service extension ability. + * @param { Want } want - Indicates the want info to start. + * @param { AsyncCallback } callback - The callback of startServiceExtensionAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ + startServiceExtensionAbility(want: Want, callback: AsyncCallback): void; + + /** + * Starts a new service extension ability. + * @param { Want } want - Indicates the want info to start. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ + startServiceExtensionAbility(want: Want): Promise; + + /** + * Starts a new service extension ability with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @param { AsyncCallback } callback - The callback of startServiceExtensionAbilityWithAccount. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ + startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + + /** + * Starts a new service extension ability with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the account to start. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ + startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; + + /** + * Stops a service within the same application. + * @param { Want } want - Indicates the want info to start. + * @param { AsyncCallback } callback - The callback of stopServiceExtensionAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ + stopServiceExtensionAbility(want: Want, callback: AsyncCallback): void; + + /** + * Stops a service within the same application. + * @param { Want } want - Indicates the want info to start. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ + stopServiceExtensionAbility(want: Want): Promise; + + /** + * Stops a service within the same application with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the accountId to start. + * @param { AsyncCallback } callback - The callback of stopServiceExtensionAbilityWithAccount. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ + stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; + + /** + * Stops a service within the same application with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @param { Want } want - Indicates the want info to start. + * @param { number } accountId - Indicates the accountId to start. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ + stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; + + /** + * Destroys this Page ability. + * @param { AsyncCallback } callback - The callback of terminateSelf. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + terminateSelf(callback: AsyncCallback): void; + + /** + * Destroys this Page ability. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + terminateSelf(): Promise; + + /** + * Sets the result code and data to be returned by this Page ability to the caller + * and destroys this Page ability. + * @param { AbilityResult } parameter - Indicates the result to return. + * @param { AsyncCallback } callback - The callback of terminateSelfWithResult. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback): void; + + /** + * Sets the result code and data to be returned by this Page ability to the caller + * and destroys this Page ability. + * @param { AbilityResult } parameter - Indicates the result to return. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + terminateSelfWithResult(parameter: AbilityResult): Promise; + + /** + * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want The element name of the service ability + * @param options The remote object instance + * @systemapi Hide this for inner system use. + * @return Returns the number code of the ability connected + * @StageModelOnly + * @deprecated since 9 + * @useinstead connectServiceExtensionAbility + */ + connectAbility(want: Want, options: ConnectOptions): number; + + /** + * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template with account. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param want The element name of the service ability + * @param accountId The account to connect + * @param options The remote object instance + * @systemapi hide for inner use. + * @return Returns the number code of the ability connected + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @StageModelOnly + * @deprecated since 9 + * @useinstead connectServiceExtensionAbilityWithAccount + */ + connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; + + /** + * The callback interface was connect successfully. + * + * @since 9 + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @param connection The number code of the ability connected + * @systemapi Hide this for inner system use. + * @StageModelOnly + * @deprecated since 9 + * @useinstead disconnectServiceExtensionAbility + */ + disconnectAbility(connection: number, callback:AsyncCallback): void; + disconnectAbility(connection: number): Promise; + + /** + * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template. + * @param { Want } want - The element name of the service ability + * @param { ConnectOptions } options - The remote object instance + * @returns { number } Returns the number code of the ability connected + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + connectServiceExtensionAbility(want: Want, options: ConnectOptions): number; + + /** + * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template with account. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + * @param { Want } want - The element name of the service ability + * @param { number } accountId - The account to connect + * @param { ConnectOptions } options - The remote object instance + * @returns { number } Returns the number code of the ability connected + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ + connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; + + /** + * The callback interface was connect successfully. + * @param { number } connection - The number code of the ability connected + * @param { AsyncCallback } callback - The callback of disconnectAbility. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + disconnectServiceExtensionAbility(connection: number, callback: AsyncCallback): void; + + /** + * The callback interface was connect successfully. + * @param { number } connection - The number code of the ability connected + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + disconnectServiceExtensionAbility(connection: number): Promise; + + /** + * Set mission label of current ability. + * @param { string } label - The label of ability that showed in recent missions. + * @param { AsyncCallback } callback - The callback of setMissionLabel. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + setMissionLabel(label: string, callback: AsyncCallback): void; + + /** + * Set mission label of current ability. + * @param { string } label - The label of ability that showed in recent missions. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @stagemodelonly + * @since 9 + */ + setMissionLabel(label: string): Promise; + + /** + * Set mission icon of current ability. + * @param { image.PixelMap } icon - The icon of ability that showed in recent missions. + * @param { AsyncCallback } callback - The callback of setMissionIcon. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ + setMissionIcon(icon: image.PixelMap, callback: AsyncCallback): void; + + /** + * Set mission icon of current ability. + * @param { image.PixelMap } icon - The icon of ability that showed in recent missions. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ + setMissionIcon(icon: image.PixelMap): Promise; + + /** + * Requests certain permissions from the system. + * @param { Array } permissions - Indicates the list of permissions to be requested. This parameter + * cannot be null or empty. + * @param { AsyncCallback } requestCallback - The callback is used to return the permission + * request result. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ + requestPermissionsFromUser(permissions: Array, requestCallback: AsyncCallback): void; + + /** + * Requests certain permissions from the system. + * @param { Array } permissions - Indicates the list of permissions to be requested. This parameter + * cannot be null or empty. + * @returns { Promise } Returns the permission request result. + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ + requestPermissionsFromUser(permissions: Array): Promise; + + /** + * Restore window stage data in ability continuation + * @param { LocalStorage } localStorage - the storage data used to restore window stage + * @throws { BusinessError } 401 - If the input parameter is not valid parameter. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ + restoreWindowStage(localStorage: LocalStorage): void; + + /** + * check to see ability is in terminating state. + * @returns { boolean } Returns true when ability is in terminating state, else returns false. + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @systemapi + * @stagemodelonly + * @since 9 + */ + isTerminating(): boolean; +} diff --git a/api/application/abilityDelegator.d.ts b/api/application/abilityDelegator.d.ts index 72ac4c9d98..e6b90885dd 100644 --- a/api/application/abilityDelegator.d.ts +++ b/api/application/abilityDelegator.d.ts @@ -14,7 +14,7 @@ */ import { AsyncCallback } from '../basic'; -import Ability from '../@ohos.app.ability.Ability'; +import UIAbility from '../@ohos.app.ability.UIAbility'; import AbilityStage from '../@ohos.app.ability.AbilityStage'; import { AbilityMonitor } from './abilityMonitor'; import { AbilityStageMonitor } from './abilityStageMonitor'; @@ -112,34 +112,34 @@ export interface AbilityDelegator { /** * Wait for and returns the Ability object that matches the conditions set in the given AbilityMonitor. * @param { AbilityMonitor } monitor - AbilityMonitor object. - * @param { AsyncCallback } callback - The callback is used to return the Ability object. + * @param { AsyncCallback } callback - The callback is used to return the Ability object. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 */ - waitAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback): void; + waitAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback): void; /** * Wait for and returns the Ability object that matches the conditions set in the given AbilityMonitor. * @param { AbilityMonitor } monitor - AbilityMonitor object. * @param { number } timeout - Maximum wait time, in milliseconds. - * @param { AsyncCallback } callback - The callback is used to return the Ability object. + * @param { AsyncCallback } callback - The callback is used to return the Ability object. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 */ - waitAbilityMonitor(monitor: AbilityMonitor, timeout: number, callback: AsyncCallback): void; + waitAbilityMonitor(monitor: AbilityMonitor, timeout: number, callback: AsyncCallback): void; /** * Wait for and returns the Ability object that matches the conditions set in the given AbilityMonitor. * @param { AbilityMonitor } monitor - AbilityMonitor object. * @param { number } timeout - Maximum wait time, in milliseconds. - * @returns { Promise } Returns the Ability object. + * @returns { Promise } Returns the Ability object. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 */ - waitAbilityMonitor(monitor: AbilityMonitor, timeout?: number): Promise; + waitAbilityMonitor(monitor: AbilityMonitor, timeout?: number): Promise; /** * Wait for and returns the AbilityStage object that matches the conditions set in the given AbilityStageMonitor. @@ -183,30 +183,30 @@ export interface AbilityDelegator { /** * Obtain the lifecycle state of a specified ability. - * @param { Ability } ability - The Ability object. + * @param { UIAbility } ability - The Ability object. * @returns { number } Returns the state of the Ability object. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 */ - getAbilityState(ability: Ability): number; + getAbilityState(ability: UIAbility): number; /** * Obtain the ability that is currently being displayed. - * @param { AsyncCallback } callback - The callback is used to return the Ability object. + * @param { AsyncCallback } callback - The callback is used to return the Ability object. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 */ - getCurrentTopAbility(callback: AsyncCallback): void; + getCurrentTopAbility(callback: AsyncCallback): void; /** * Obtain the ability that is currently being displayed. - * @returns { Promise } Returns the Ability object. + * @returns { Promise } Returns the Ability object. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 */ - getCurrentTopAbility(): Promise + getCurrentTopAbility(): Promise /** * Start a new ability. @@ -230,43 +230,43 @@ export interface AbilityDelegator { /** * Invoke the Ability.onForeground() callback of a specified ability without changing its lifecycle state. - * @param { Ability } ability - The ability object. + * @param { UIAbility } ability - The ability object. * @param { AsyncCallback } callback - The callback of doAbilityForeground. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 */ - doAbilityForeground(ability: Ability, callback: AsyncCallback): void; + doAbilityForeground(ability: UIAbility, callback: AsyncCallback): void; /** * Invoke the Ability.onForeground() callback of a specified ability without changing its lifecycle state. - * @param { Ability } ability - The ability object. + * @param { UIAbility } ability - The ability object. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 */ - doAbilityForeground(ability: Ability): Promise; + doAbilityForeground(ability: UIAbility): Promise; /** * Invoke the Ability.onBackground() callback of a specified ability without changing its lifecycle state. - * @param { Ability } ability - The ability object. + * @param { UIAbility } ability - The ability object. * @param { AsyncCallback } callback - The callback of doAbilityBackground. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 */ - doAbilityBackground(ability: Ability, callback: AsyncCallback): void; + doAbilityBackground(ability: UIAbility, callback: AsyncCallback): void; /** * Invoke the Ability.onBackground() callback of a specified ability without changing its lifecycle state. - * @param { Ability } ability - The ability object. + * @param { UIAbility } ability - The ability object. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 */ - doAbilityBackground(ability: Ability): Promise; + doAbilityBackground(ability: UIAbility): Promise; /** * Prints log information to the unit testing console. diff --git a/api/application/abilityMonitor.d.ts b/api/application/abilityMonitor.d.ts index dd0a1989f1..0e37ca308d 100644 --- a/api/application/abilityMonitor.d.ts +++ b/api/application/abilityMonitor.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import Ability from '../@ohos.app.ability.Ability'; +import UIAbility from '../@ohos.app.ability.UIAbility'; /** * Provide methods for matching monitored Ability objects that meet specified conditions. @@ -47,7 +47,7 @@ export interface AbilityMonitor { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core */ - onAbilityCreate?:(ability: Ability) => void; + onAbilityCreate?:(ability: UIAbility) => void; /** * Called back when the state of the ability changes to foreground. @@ -55,7 +55,7 @@ export interface AbilityMonitor { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core */ - onAbilityForeground?:(ability: Ability) => void; + onAbilityForeground?:(ability: UIAbility) => void; /** * Called back when the state of the ability changes to background. @@ -63,7 +63,7 @@ export interface AbilityMonitor { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core */ - onAbilityBackground?:(ability: Ability) => void; + onAbilityBackground?:(ability: UIAbility) => void; /** * Called back before the ability is destroyed. @@ -71,7 +71,7 @@ export interface AbilityMonitor { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core */ - onAbilityDestroy?:(ability: Ability) => void; + onAbilityDestroy?:(ability: UIAbility) => void; /** * Called back when an ability window stage is created. @@ -79,7 +79,7 @@ export interface AbilityMonitor { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core */ - onWindowStageCreate?:(ability: Ability) => void; + onWindowStageCreate?:(ability: UIAbility) => void; /** * Called back when an ability window stage is restored. @@ -87,7 +87,7 @@ export interface AbilityMonitor { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core */ - onWindowStageRestore?:(ability: Ability) => void; + onWindowStageRestore?:(ability: UIAbility) => void; /** * Called back when an ability window stage is destroyed. @@ -95,7 +95,7 @@ export interface AbilityMonitor { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core */ - onWindowStageDestroy?:(ability: Ability) => void; + onWindowStageDestroy?:(ability: UIAbility) => void; } export default AbilityMonitor; \ No newline at end of file -- Gitee From 3fd65c0c45e94f663fac97d193f78714fe250755 Mon Sep 17 00:00:00 2001 From: "yanxiaotao@huawei.com" Date: Sat, 29 Oct 2022 11:04:09 +0800 Subject: [PATCH 284/438] bugfix for wifi d.ts 1029 Signed-off-by: yanxiaotao@huawei.com --- api/@ohos.wifiManager.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api/@ohos.wifiManager.d.ts b/api/@ohos.wifiManager.d.ts index 5933037ef4..ee9bdc6388 100644 --- a/api/@ohos.wifiManager.d.ts +++ b/api/@ohos.wifiManager.d.ts @@ -81,7 +81,7 @@ declare namespace wifiManager { * @syscap SystemCapability.Communication.WiFi.STA * @permission ohos.permission.SET_WIFI_INFO and ohos.permission.LOCATION */ - function scan(): boolean; + function scan(): void; /** * Obtains the hotspot information that scanned. @@ -1401,7 +1401,6 @@ declare namespace wifiManager { * Wi-Fi information elements. * * @since 9 - * @systemapi Hide this for inner system use. * @syscap SystemCapability.Communication.WiFi.STA */ interface WifiInfoElem { -- Gitee From af5dbac1732df3b030d4f5a9225b9df8331c8cec Mon Sep 17 00:00:00 2001 From: yangzk Date: Sat, 29 Oct 2022 09:53:56 +0800 Subject: [PATCH 285/438] =?UTF-8?q?IssueNo:=20#I5Y6PR=20Description:=20?= =?UTF-8?q?=E4=BD=BF=E7=94=A8UIAbility=20Sig:=20SIG=5FApplicationFramework?= =?UTF-8?q?=20Feature=20or=20Bugfix:=20Feature=20Binary=20Source:=20No?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangzk Change-Id: I301000336a001c2b99c96b077654015c85933cb6 --- api/@ohos.application.Ability.d.ts | 10 ++--- api/application/UIAbilityContext.d.ts | 4 +- api/application/abilityDelegator.d.ts | 54 --------------------------- 3 files changed, 7 insertions(+), 61 deletions(-) diff --git a/api/@ohos.application.Ability.d.ts b/api/@ohos.application.Ability.d.ts index 0ef980c484..2a7fd56303 100644 --- a/api/@ohos.application.Ability.d.ts +++ b/api/@ohos.application.Ability.d.ts @@ -30,7 +30,7 @@ import rpc from './@ohos.rpc'; * @return - * @StageModelOnly * @deprecated since 9 - * @useinstead ohos.app.ability.Ability + * @useinstead ohos.app.ability.UIAbility */ export interface OnReleaseCallBack { (msg: string): void; @@ -46,7 +46,7 @@ export interface OnReleaseCallBack { * @return rpc.Sequenceable * @StageModelOnly * @deprecated since 9 - * @useinstead ohos.app.ability.Ability + * @useinstead ohos.app.ability.UIAbility */ export interface CalleeCallBack { (indata: rpc.MessageParcel): rpc.Sequenceable; @@ -60,7 +60,7 @@ export interface CalleeCallBack { * @permission N/A * @StageModelOnly * @deprecated since 9 - * @useinstead ohos.app.ability.Ability + * @useinstead ohos.app.ability.UIAbility */ export interface Caller { /** @@ -117,7 +117,7 @@ export interface Caller { * @permission N/A * @StageModelOnly * @deprecated since 9 - * @useinstead ohos.app.ability.Ability + * @useinstead ohos.app.ability.UIAbility */ export interface Callee { @@ -153,7 +153,7 @@ export interface Callee { * @permission N/A * @StageModelOnly * @deprecated since 9 - * @useinstead ohos.app.ability.Ability + * @useinstead ohos.app.ability.UIAbility */ export default class Ability { /** diff --git a/api/application/UIAbilityContext.d.ts b/api/application/UIAbilityContext.d.ts index 1f49caaba1..01b04d70e3 100755 --- a/api/application/UIAbilityContext.d.ts +++ b/api/application/UIAbilityContext.d.ts @@ -15,11 +15,11 @@ /// -import { AbilityInfo } from "../bundle/abilityInfo"; +import { AbilityInfo } from "../bundleManager/abilityInfo"; import { AbilityResult } from "../ability/abilityResult"; import { AsyncCallback } from "../basic"; import { ConnectOptions } from "../ability/connectOptions"; -import { HapModuleInfo } from "../bundle/hapModuleInfo"; +import { HapModuleInfo } from "../bundleManager/hapModuleInfo"; import Context from "./Context"; import Want from "../@ohos.application.Want"; import StartOptions from "../@ohos.app.ability.StartOptions"; diff --git a/api/application/abilityDelegator.d.ts b/api/application/abilityDelegator.d.ts index e6b90885dd..0cabc49f03 100644 --- a/api/application/abilityDelegator.d.ts +++ b/api/application/abilityDelegator.d.ts @@ -279,28 +279,6 @@ export interface AbilityDelegator { print(msg: string, callback: AsyncCallback): void; print(msg: string): Promise; - /** - * Prints log information to the unit testing console. - * The total length of the log information to be printed cannot exceed 1000 characters. - * @param { string } msg - Log information. - * @param { AsyncCallback } callback - The callback of printMsg. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - printMsg(msg: string, callback: AsyncCallback): void; - - /** - * Prints log information to the unit testing console. - * The total length of the log information to be printed cannot exceed 1000 characters. - * @param { string } msg - Log information. - * @returns { Promise } The promise returned by the function. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - printMsg(msg: string): Promise; - /** * Prints log information to the unit testing console. * The total length of the log information to be printed cannot exceed 1000 characters. @@ -324,38 +302,6 @@ export interface AbilityDelegator { executeShellCommand(cmd: string, timeoutSecs: number, callback: AsyncCallback): void; executeShellCommand(cmd: string, timeoutSecs?: number): Promise; - /** - * Execute the given command in the aa tools side. - * @param { string } cmd - The shell command. - * @param { AsyncCallback } callback - The callback is used to return the ShellCmdResult object. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - executeShellCmd(cmd: string, callback: AsyncCallback): void; - - /** - * Execute the given command in the aa tools side. - * @param { string } cmd - Shell command. - * @param { number } timeoutSecs - Timeout, in seconds. - * @param { AsyncCallback } callback - The callback is used to return the ShellCmdResult object. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - executeShellCmd(cmd: string, timeoutSecs: number, callback: AsyncCallback): void; - - /** - * Execute the given command in the aa tools side. - * @param { string } cmd - Shell command. - * @param { number } timeoutSecs - Timeout, in seconds. - * @returns { Promise } Returns the ShellCmdResult object. - * @throws { BusinessError } 401 - If the input parameter is not valid parameter. - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @since 9 - */ - executeShellCmd(cmd: string, timeoutSecs?: number): Promise; - /** * Finish the test and print log information to the unit testing console. * The total length of the log information to be printed cannot exceed 1000 characters. -- Gitee From 026d8c968f5ff78602fdfd31e4bb6e1db5a3e92a Mon Sep 17 00:00:00 2001 From: yangzk Date: Sat, 29 Oct 2022 17:28:58 +0800 Subject: [PATCH 286/438] =?UTF-8?q?IssueNo:=20#I5Y6PR=20Description:=20?= =?UTF-8?q?=E4=BD=BF=E7=94=A8UIAbility=20Sig:=20SIG=5FApplicationFramework?= =?UTF-8?q?=20Feature=20or=20Bugfix:=20Feature=20Binary=20Source:=20No?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangzk Change-Id: I301000336a001c2b99c96b077654015c85933cb6 --- api/application/AbilityContext.d.ts | 2 -- api/application/UIAbilityContext.d.ts | 52 ++------------------------- 2 files changed, 3 insertions(+), 51 deletions(-) diff --git a/api/application/AbilityContext.d.ts b/api/application/AbilityContext.d.ts index ac3b1f1f12..6aee674669 100755 --- a/api/application/AbilityContext.d.ts +++ b/api/application/AbilityContext.d.ts @@ -34,8 +34,6 @@ import image from '../@ohos.multimedia.image'; * @syscap SystemCapability.Ability.AbilityRuntime.Core * @stagemodelonly * @since 9 - * @deprecated since 9 - * @useinstead UIAbilityContext */ export default class AbilityContext extends Context { /** diff --git a/api/application/UIAbilityContext.d.ts b/api/application/UIAbilityContext.d.ts index 01b04d70e3..b7efdaf278 100755 --- a/api/application/UIAbilityContext.d.ts +++ b/api/application/UIAbilityContext.d.ts @@ -381,52 +381,6 @@ export default class UIAbilityContext extends Context { */ terminateSelfWithResult(parameter: AbilityResult): Promise; - /** - * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want The element name of the service ability - * @param options The remote object instance - * @systemapi Hide this for inner system use. - * @return Returns the number code of the ability connected - * @StageModelOnly - * @deprecated since 9 - * @useinstead connectServiceExtensionAbility - */ - connectAbility(want: Want, options: ConnectOptions): number; - - /** - * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template with account. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want The element name of the service ability - * @param accountId The account to connect - * @param options The remote object instance - * @systemapi hide for inner use. - * @return Returns the number code of the ability connected - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS - * @StageModelOnly - * @deprecated since 9 - * @useinstead connectServiceExtensionAbilityWithAccount - */ - connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; - - /** - * The callback interface was connect successfully. - * - * @since 9 - * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param connection The number code of the ability connected - * @systemapi Hide this for inner system use. - * @StageModelOnly - * @deprecated since 9 - * @useinstead disconnectServiceExtensionAbility - */ - disconnectAbility(connection: number, callback:AsyncCallback): void; - disconnectAbility(connection: number): Promise; - /** * Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template. * @param { Want } want - The element name of the service ability @@ -455,7 +409,7 @@ export default class UIAbilityContext extends Context { connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; /** - * The callback interface was connect successfully. + * The callback interface is connected successfully. * @param { number } connection - The number code of the ability connected * @param { AsyncCallback } callback - The callback of disconnectAbility. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. @@ -466,7 +420,7 @@ export default class UIAbilityContext extends Context { disconnectServiceExtensionAbility(connection: number, callback: AsyncCallback): void; /** - * The callback interface was connect successfully. + * The callback interface is connected successfully. * @param { number } connection - The number code of the ability connected * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. @@ -561,7 +515,7 @@ export default class UIAbilityContext extends Context { restoreWindowStage(localStorage: LocalStorage): void; /** - * check to see ability is in terminating state. + * Check to see ability is in terminating state. * @returns { boolean } Returns true when ability is in terminating state, else returns false. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi -- Gitee From 9944914d527f318b4c5a773fdb27b45128f8b1e6 Mon Sep 17 00:00:00 2001 From: wangqing Date: Sat, 29 Oct 2022 18:47:49 +0800 Subject: [PATCH 287/438] =?UTF-8?q?api=5Fcheck=E8=81=94=E8=B0=83=E9=AA=8C?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangqing --- build-tools/api_check_plugin/entry.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build-tools/api_check_plugin/entry.js b/build-tools/api_check_plugin/entry.js index f97227165b..fde4be4bdc 100644 --- a/build-tools/api_check_plugin/entry.js +++ b/build-tools/api_check_plugin/entry.js @@ -19,6 +19,7 @@ const { writeResultFile } = require('./src/utils'); function checkEntry(url) { let result = ""; + result += 'line:22,first:::::::::' fs.access(url, fs.constants.R_OK | fs.constants.W_OK, (err) => { const checkResult1 = err ? 'no access!' : 'can read/write'; result += `checkResult1 = ${checkResult1} ||| ${url} ||| \n`; @@ -29,14 +30,16 @@ function checkEntry(url) { const execSync = require("child_process").execSync; execSync("cd interface/sdk-js/build-tools/api_check_plugin && npm install"); const path2 = path.resolve(sourceDirname, '../../../../', "ci_tool/ci_build/readme_file.txt"); + result += 'line:33,second:::::::::' fs.access(path2, fs.constants.R_OK | fs.constants.W_OK, (err) => { const checkResult2 = err ? 'no access!' : 'can read/write'; result += `checkResult2 = ${checkResult2} ||| ${path2} ||| \n`; }); const path3 = path.resolve(__dirname, '../../../../', "ci_tool/ci_build/readme_file.txt"); + result += 'line:40,third::::::::::' fs.access(path3, fs.constants.R_OK | fs.constants.W_OK, (err) => { const checkResult3 = err ? 'no access!' : 'can read/write'; - result += `checkResult2 = ${checkResult3} ||| ${path3} ||| \n`; + result += `checkResult3 = ${checkResult3} ||| ${path3} ||| \n`; }); const { scanEntry } = require(path.resolve(__dirname, "./src/api_check_plugin")); result += scanEntry(url); -- Gitee From 3e86b61ddb6107bf562f878480001e2b0017365f Mon Sep 17 00:00:00 2001 From: yinchuang Date: Sat, 29 Oct 2022 15:58:40 +0800 Subject: [PATCH 288/438] add inputs for ohos_declaration_template Signed-off-by: yinchuang --- BUILD.gn | 1 + 1 file changed, 1 insertion(+) diff --git a/BUILD.gn b/BUILD.gn index 3f503cae75..2109f48749 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -68,6 +68,7 @@ template("ohos_declaration_template") { action_with_pydeps(target_name) { script = "//interface/sdk-js/remove_internal.py" input_api_dir = "//interface/sdk-js/api" + inputs = [ "//interface/sdk-js/api" ] outputs = [ root_out_dir + "/ohos_declaration/$target_name" ] if (sdk_build_public) { script = "//out/sdk-public/public_interface/sdk-js/remove_internal.py" -- Gitee From dba7c3c638124687ec7f64f85e1d4a34e2139b96 Mon Sep 17 00:00:00 2001 From: zhang-hai-feng Date: Fri, 28 Oct 2022 21:09:33 +0800 Subject: [PATCH 289/438] =?UTF-8?q?=E8=A1=A5=E5=85=85js=20api9=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhang-hai-feng --- api/@ohos.telephony.call.d.ts | 32 ++++++++++++++++++++-------- api/@ohos.telephony.radio.d.ts | 27 +++++++++++++++++++++--- api/@ohos.telephony.sim.d.ts | 38 ++++++++++++++++++++++++---------- 3 files changed, 74 insertions(+), 23 deletions(-) diff --git a/api/@ohos.telephony.call.d.ts b/api/@ohos.telephony.call.d.ts index 60ef25c819..4a5bb01d2f 100644 --- a/api/@ohos.telephony.call.d.ts +++ b/api/@ohos.telephony.call.d.ts @@ -331,20 +331,34 @@ declare namespace call { * @param type Indicates the observer type. * @param callback Return the result of MMI code. * @permission ohos.permission.SET_TELEPHONY_STATE + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Parameter error. + * @throws {BusinessError} 8300001 - Invalid parameter value. + * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. + * @throws {BusinessError} 8300003 - System internal error. + * @throws {BusinessError} 8300004 - Do not have sim card. + * @throws {BusinessError} 8300999 - Unknown error code. * @systemapi Hide this for inner system use. * @since 9 */ function on(type: 'mmiCodeResult', callback: Callback): void; - /** - * Unobserve the result of MMI code - * - * @param type Indicates the observer type. - * @param callback Return the result of MMI code. - * @permission ohos.permission.SET_TELEPHONY_STATE - * @systemapi Hide this for inner system use. - * @since 9 - */ + /** + * Unobserve the result of MMI code + * + * @param type Indicates the observer type. + * @param callback Return the result of MMI code. + * @permission ohos.permission.SET_TELEPHONY_STATE + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Parameter error. + * @throws {BusinessError} 8300001 - Invalid parameter value. + * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. + * @throws {BusinessError} 8300003 - System internal error. + * @throws {BusinessError} 8300004 - Do not have sim card. + * @throws {BusinessError} 8300999 - Unknown error code. + * @systemapi Hide this for inner system use. + * @since 9 + */ function off(type: 'mmiCodeResult', callback?: Callback): void; /** diff --git a/api/@ohos.telephony.radio.d.ts b/api/@ohos.telephony.radio.d.ts index 9f6d97f33a..75098eb1d8 100644 --- a/api/@ohos.telephony.radio.d.ts +++ b/api/@ohos.telephony.radio.d.ts @@ -307,6 +307,13 @@ declare namespace radio { * @param imsType Indicates the ims service type of the {@link ImsServiceType}. * @param callback including an instance of the {@link ImsRegInfo} class. * @permission ohos.permission.GET_TELEPHONY_STATE + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Parameter error. + * @throws {BusinessError} 8300001 - Invalid parameter value. + * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. + * @throws {BusinessError} 8300003 - System internal error. + * @throws {BusinessError} 8300004 - Do not have sim card. + * @throws {BusinessError} 8300999 - Unknown error code. * @systemapi Hide this for inner system use. * @since 9 */ @@ -322,6 +329,13 @@ declare namespace radio { * @param imsType Indicates the ims service type of the {@link ImsServiceType}. * @param callback including an instance of the {@link ImsRegInfo} class. * @permission ohos.permission.GET_TELEPHONY_STATE + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Parameter error. + * @throws {BusinessError} 8300001 - Invalid parameter value. + * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. + * @throws {BusinessError} 8300003 - System internal error. + * @throws {BusinessError} 8300004 - Do not have sim card. + * @throws {BusinessError} 8300999 - Unknown error code. * @systemapi Hide this for inner system use. * @since 9 */ @@ -330,6 +344,13 @@ declare namespace radio { /** * @permission ohos.permission.GET_TELEPHONY_STATE + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Parameter error. + * @throws {BusinessError} 8300001 - Invalid parameter value. + * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. + * @throws {BusinessError} 8300003 - System internal error. + * @throws {BusinessError} 8300004 - Do not have sim card. + * @throws {BusinessError} 8300999 - Unknown error code. * @systemapi Hide this for inner system use. * @since 9 */ @@ -837,7 +858,7 @@ declare namespace radio { IMS_UNREGISTERED, IMS_REGISTERED, } - + /** * @systemapi Hide this for inner system use. * @since 9 @@ -848,7 +869,7 @@ declare namespace radio { REGISTRATION_TECH_IWLAN, REGISTRATION_TECH_NR, } - + /** * @systemapi Hide this for inner system use. * @since 9 @@ -857,7 +878,7 @@ declare namespace radio { imsRegState: ImsRegState; imsRegTech: ImsRegTech; } - + /** * @systemapi Hide this for inner system use. * @since 9 diff --git a/api/@ohos.telephony.sim.d.ts b/api/@ohos.telephony.sim.d.ts index 8112beffed..0b269cb7ea 100644 --- a/api/@ohos.telephony.sim.d.ts +++ b/api/@ohos.telephony.sim.d.ts @@ -435,6 +435,14 @@ declare namespace sim { * * @param slotId Indicates the card slot index number, * ranging from 0 to the maximum card slot index number supported by the device. + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Parameter error. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 8300001 - Invalid parameter value. + * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. + * @throws {BusinessError} 8300003 - System internal error. + * @throws {BusinessError} 8300004 - Do not have sim card. + * @throws {BusinessError} 8300999 - Unknown error code. * @return Returns the opkey; returns an empty string if no SIM card is inserted or * no opkey matched. * @since 9 @@ -442,17 +450,25 @@ declare namespace sim { function getOpKey(slotId: number, callback: AsyncCallback): void; function getOpKey(slotId: number): Promise; - /** - * Obtains the opname of the SIM card in a specified slot. - * - * @param slotId Indicates the card slot index number, - * ranging from 0 to the maximum card slot index number supported by the device. - * @return Returns the opname; returns an empty string if no SIM card is inserted or - * no opname matched. - * @since 9 - */ - function getOpName(slotId: number, callback: AsyncCallback): void; - function getOpName(slotId: number): Promise; + /** + * Obtains the opname of the SIM card in a specified slot. + * + * @param slotId Indicates the card slot index number, + * ranging from 0 to the maximum card slot index number supported by the device. + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 401 - Parameter error. + * @throws {BusinessError} 801 - Capability not supported. + * @throws {BusinessError} 8300001 - Invalid parameter value. + * @throws {BusinessError} 8300002 - Operation failed. Cannot connect to service. + * @throws {BusinessError} 8300003 - System internal error. + * @throws {BusinessError} 8300004 - Do not have sim card. + * @throws {BusinessError} 8300999 - Unknown error code. + * @return Returns the opname; returns an empty string if no SIM card is inserted or + * no opname matched. + * @since 9 + */ + function getOpName(slotId: number, callback: AsyncCallback): void; + function getOpName(slotId: number): Promise; /** * @systemapi Hide this for inner system use. -- Gitee From b14d8d0cb5e533e28bffd99f83cba31f0d5436ad Mon Sep 17 00:00:00 2001 From: wangqing Date: Mon, 31 Oct 2022 09:50:58 +0800 Subject: [PATCH 290/438] =?UTF-8?q?README=E6=96=87=E4=BB=B6=E6=95=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangqing --- README_zh.md | 31 +++++++++++++--- .../collect_application_api/README_EN.md | 16 --------- .../collect_application_api/README_zh.md | 36 +++++++++++++++++++ 3 files changed, 63 insertions(+), 20 deletions(-) delete mode 100644 build-tools/collect_application_api/README_EN.md create mode 100644 build-tools/collect_application_api/README_zh.md diff --git a/README_zh.md b/README_zh.md index 21846d91b8..07a08fd8e2 100644 --- a/README_zh.md +++ b/README_zh.md @@ -1,8 +1,31 @@ -# API声明文件公共仓 +# API声明文件公共仓 -- [简介](#section11660541593) +## 简介 -## 简介 +JS/TS API 公共仓,用来提交 API d.ts 声明文件以及API相关工具。 -JavaScript API 公共仓,用来提交 API d.ts 声明文件。 +## 目录 + +``` +├─api +| ├─@internal +│ | ├─component +│ | | └─ets #基于TS扩展的声明式开发范式组件声明文件 +| | └─ets +| ├─config #基于JS扩展的类Web范式 +| ├─form #JS服务卡片 +| ├─@ohos.×××.d.ts #API声明文件 +| └─@system.×××.d.ts #标记为停止维护的接口 +├─build-tools + ├─api_check_plugin #检查API规范的工具 + | ├─plugin + | ├─src + | └─test + └─collect_application_api #解析应用到的API的工具 + └─src +``` + +## 相关仓 + +[interface-sdk_js](https://gitee.com/openharmony/interface_sdk-js/tree/master) diff --git a/build-tools/collect_application_api/README_EN.md b/build-tools/collect_application_api/README_EN.md deleted file mode 100644 index da16a6f70e..0000000000 --- a/build-tools/collect_application_api/README_EN.md +++ /dev/null @@ -1,16 +0,0 @@ -COLLECT_APPLICATION_API - -Usage -1.Install - Install the npm dependencies(You must have node&npm installed): - $npm install - -2.Quick Start - In the src directory - $node format - -3.Directory Structure - ./sdk--- directory path of API files - ./application--- directory path of application - ./deps--- directory path of source code - ./src--- directory path of result \ No newline at end of file diff --git a/build-tools/collect_application_api/README_zh.md b/build-tools/collect_application_api/README_zh.md new file mode 100644 index 0000000000..ec7e2df2a4 --- /dev/null +++ b/build-tools/collect_application_api/README_zh.md @@ -0,0 +1,36 @@ +# 应用API解析工具 + +## 简介 + +该工具可用于解析应用中使用的API,并汇总成表格,提供给应用开发者 + +## 目录 + +``` +├─sdk #存放API文件的目录(sdk中,ets目录下的api文件夹和build-tools文件夹) +├─application #存放被解析的应用源码 +├─deps #存放typescript源码 +└─src #存放源码以及生成的表格 +``` + +## 使用方法 + +### 目录配置 + +新建sdk文件夹,放置api文件; + +新建application文件夹,放置被解析的应用源码; + +新建deps文件夹,放置[typescript源码](https://gitee.com/openharmony/third_party_typescript/tree/master/build_package)。 + +### 安装 + +需要安装npm依赖环境:$npm install。 + +### 使用工具 + +进入src目录下:$node format。 + +## 相关文件夹 + +[collect_application_api](https://gitee.com/openharmony/interface_sdk-js/tree/master/build-tools/collect_application_api) \ No newline at end of file -- Gitee From 18c0bd2e3dd5575a5245696f885dced57cb2eb23 Mon Sep 17 00:00:00 2001 From: bixuefeng Date: Mon, 31 Oct 2022 14:31:01 +0800 Subject: [PATCH 291/438] Bugfix: Remove duplicate 'declare' word Signed-off-by: bixuefeng Change-Id: I8101e8bd00b64fe7a155001633dca6867ad8ed74 --- api/@internal/component/ets/common.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index 0c71fd7f46..cc22cb327d 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -629,7 +629,7 @@ declare namespace focusControl { * Request focus to the specific component by param: 'id/key'. * @since 9 */ - declare function requestFocus(value: string): boolean; + function requestFocus(value: string): boolean; } /** -- Gitee From 278af60c354a1b676b3eef0bff37ecbb9e4dad65 Mon Sep 17 00:00:00 2001 From: fangJinliang1 Date: Mon, 31 Oct 2022 16:01:49 +0800 Subject: [PATCH 292/438] system api add sign Signed-off-by: fangJinliang1 Change-Id: I21cb37cb36c5ef8b84a50ac65e934aa46ce83357 --- api/@ohos.notification.d.ts | 2 +- api/@ohos.notificationManager.d.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/api/@ohos.notification.d.ts b/api/@ohos.notification.d.ts index 9f9beac74a..de8c1ae964 100644 --- a/api/@ohos.notification.d.ts +++ b/api/@ohos.notification.d.ts @@ -1135,7 +1135,7 @@ declare namespace notification { * Describes a NotificationFlags instance. * * @since 9 - * @permission N/A + * @systemapi Hide this for inner system use. * @syscap SystemCapability.Notification.Notification * @deprecated since 9 * @useinstead ohos.notificationManager.NotificationFlags diff --git a/api/@ohos.notificationManager.d.ts b/api/@ohos.notificationManager.d.ts index b7f53c6481..e35bfb4fcd 100644 --- a/api/@ohos.notificationManager.d.ts +++ b/api/@ohos.notificationManager.d.ts @@ -1341,6 +1341,7 @@ declare namespace notificationManager { /** * Describes a NotificationFlags instance. * @syscap SystemCapability.Notification.Notification + * @systemapi * @since 9 */ export type NotificationFlags = _NotificationFlags -- Gitee From 7e5adae6fbedcddae2c9fba9f29ad0097a779440 Mon Sep 17 00:00:00 2001 From: zhufenghao Date: Tue, 1 Nov 2022 11:07:54 +0800 Subject: [PATCH 293/438] =?UTF-8?q?=E3=80=90web=E5=AD=90=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E3=80=91=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhufenghao --- api/@ohos.web.webview.d.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/api/@ohos.web.webview.d.ts b/api/@ohos.web.webview.d.ts index 8dce175e29..17ef1e3769 100644 --- a/api/@ohos.web.webview.d.ts +++ b/api/@ohos.web.webview.d.ts @@ -525,7 +525,6 @@ declare namespace webview { * * @throws { BusinessError } 17100001 - Init error. * The WebviewController must be associted with a Web component. - * @throws { BusinessError } 17100007 - Invalid back or forward operation. * * @since 9 */ @@ -536,7 +535,6 @@ declare namespace webview { * * @throws { BusinessError } 17100001 - Init error. * The WebviewController must be associted with a Web component. - * @throws { BusinessError } 17100007 - Invalid back or forward operation. * * @since 9 */ @@ -656,7 +654,6 @@ declare namespace webview { * @throws { BusinessError } 17100001 - Init error. * The WebviewController must be associted with a Web component. * @throws { BusinessError } 17100004 - Function not enable. - * @throws { BusinessError } 17100009 - Cannot zoom in or zoom out. * * @since 9 */ @@ -668,7 +665,6 @@ declare namespace webview { * @throws { BusinessError } 17100001 - Init error. * The WebviewController must be associted with a Web component. * @throws { BusinessError } 17100004 - Function not enable. - * @throws { BusinessError } 17100009 - Cannot zoom in or zoom out. * * @since 9 */ @@ -680,7 +676,6 @@ declare namespace webview { * @throws { BusinessError } 17100001 - Init error. * The WebviewController must be associted with a Web component. * @throws { BusinessError } 17100004 - Function not enable. - * @throws { BusinessError } 17100009 - Cannot zoom in or zoom out. * * @since 9 */ @@ -748,7 +743,6 @@ declare namespace webview { * @throws { BusinessError } 401 - Invaild input parameter. * @throws { BusinessError } 17100001 - Init error. * The WebviewController must be associted with a Web component. - * @throws { BusinessError } 17100007 - Invalid back or forward operation. * * @since 9 */ -- Gitee From c87e928cd80c8d6e127d58b86e129f734c099b4d Mon Sep 17 00:00:00 2001 From: liu-binjun Date: Tue, 27 Sep 2022 09:16:06 +0800 Subject: [PATCH 294/438] bugfix:add new apis Signed-off-by: liu-binjun --- api/@ohos.geoLocationManager.d.ts | 980 ++++++++++++++++++++++++++++++ api/@ohos.geolocation.d.ts | 272 ++------- 2 files changed, 1018 insertions(+), 234 deletions(-) create mode 100644 api/@ohos.geoLocationManager.d.ts diff --git a/api/@ohos.geoLocationManager.d.ts b/api/@ohos.geoLocationManager.d.ts new file mode 100644 index 0000000000..a3aca12665 --- /dev/null +++ b/api/@ohos.geoLocationManager.d.ts @@ -0,0 +1,980 @@ +/* + * 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 { AsyncCallback, Callback } from './basic'; +import { WantAgent } from './@ohos.wantAgent'; + +/** + * Provides interfaces for acquiring location information, managing location switches, + * geocoding, reverse geocoding, country code, geofencing and other functions. + * + * @since 9 + * @import import geoLocationManager from '@ohos.geoLocationManager' + */ +declare namespace geoLocationManager { + /** + * Subscribe location changed + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION or ohos.permission.APPROXIMATELY_LOCATION + * @param request indicates the location request parameters. + * @param callback indicates the callback for reporting the location result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301100 - The location switch is off. + * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. + */ + function on(type: 'locationChange', request: LocationRequest, callback: Callback): void; + + /** + * Unsubscribe location changed + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION or ohos.permission.APPROXIMATELY_LOCATION + * @param callback indicates the callback for reporting the location result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301100 - The location switch is off. + * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. + */ + function off(type: 'locationChange', callback?: Callback): void; + + /** + * Subscribe location switch changed + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @param callback indicates the callback for reporting the location switch status. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + */ + function on(type: 'locationServiceStatusChange', callback: Callback): void; + + /** + * Unsubscribe location switch changed + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @param callback indicates the callback for reporting the location switch status. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + */ + function off(type: 'locationServiceStatusChange', callback?: Callback): void; + + /** + * Subscribe to cache GNSS locations update messages + * + * @since 9 + * @syscap SystemCapability.Location.Location.Gnss + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION or ohos.permission.APPROXIMATELY_LOCATION + * @param request indicates the cached GNSS locations request parameters. + * @param callback indicates the callback for reporting the cached GNSS locations. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301100 - The location switch is off. + * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. + */ + function on(type: 'cachedGnssLocationsChange', request: CachedGnssLocationsRequest, callback: Callback>): void; + + /** + * Unsubscribe to cache GNSS locations update messages + * + * @since 9 + * @syscap SystemCapability.Location.Location.Gnss + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION or ohos.permission.APPROXIMATELY_LOCATION + * @param callback indicates the callback for reporting the cached gnss locations. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301100 - The location switch is off. + * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. + */ + function off(type: 'cachedGnssLocationsChange', callback?: Callback>): void; + + /** + * Subscribe satellite status changed + * + * @since 9 + * @syscap SystemCapability.Location.Location.Gnss + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION or ohos.permission.APPROXIMATELY_LOCATION + * @param callback indicates the callback for reporting the satellite status. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301100 - The location switch is off. + */ + function on(type: 'satelliteStatusChange', callback: Callback): void; + + /** + * Unsubscribe satellite status changed + * + * @since 9 + * @syscap SystemCapability.Location.Location.Gnss + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION or ohos.permission.APPROXIMATELY_LOCATION + * @param callback indicates the callback for reporting the satellite status. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301100 - The location switch is off. + */ + function off(type: 'satelliteStatusChange', callback?: Callback): void; + + /** + * Subscribe nmea message changed + * + * @since 9 + * @syscap SystemCapability.Location.Location.Gnss + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION or ohos.permission.APPROXIMATELY_LOCATION + * @param callback indicates the callback for reporting the nmea message. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301100 - The location switch is off. + */ + function on(type: 'nmeaMessage', callback: Callback): void; + + /** + * Unsubscribe nmea message changed + * + * @since 9 + * @syscap SystemCapability.Location.Location.Gnss + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION or ohos.permission.APPROXIMATELY_LOCATION + * @param callback indicates the callback for reporting the nmea message. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301100 - The location switch is off. + */ + function off(type: 'nmeaMessage', callback?: Callback): void; + + /** + * Add a geofence and subscribe geo fence status changed + * + * @since 9 + * @syscap SystemCapability.Location.Location.Geofence + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION or ohos.permission.APPROXIMATELY_LOCATION + * @param request indicates the Geo-fence configuration parameters. + * @param want indicates which ability to start when the geofence event is triggered. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301100 - The location switch is off. + * @throws { BusinessError } 3301600 - Failed to operate the geofence. + */ + function on(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void; + + /** + * Remove a geofence and unsubscribe geo fence status changed + * + * @since 9 + * @syscap SystemCapability.Location.Location.Geofence + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION or ohos.permission.APPROXIMATELY_LOCATION + * @param request indicates the Geo-fence configuration parameters. + * @param want indicates which ability to start when the geofence event is triggered. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301100 - The location switch is off. + * @throws { BusinessError } 3301600 - Failed to operate the geofence. + */ + function off(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void; + + /** + * Registering the callback function for listening to country code changes. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @param callback indicates the callback for reporting country code changes. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301100 - The location switch is off. + * @throws { BusinessError } 3301500 - Failed to query the area information. + */ + function on(type: 'countryCodeChange', callback: Callback): void; + + /** + * Unregistering the callback function for listening to country code changes. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @param callback indicates the callback for reporting country code changes. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301100 - The location switch is off. + * @throws { BusinessError } 3301500 - Failed to query the area information. + */ + function off(type: 'countryCodeChange', callback?: Callback): void; + + /** + * Obtain current location + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION or ohos.permission.APPROXIMATELY_LOCATION + * @param request indicates the location request parameters. + * @param callback indicates the callback for reporting the location result. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301100 - The location switch is off. + * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. + */ + function getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback): void; + function getCurrentLocation(callback: AsyncCallback): void; + function getCurrentLocation(request?: CurrentLocationRequest): Promise; + + /** + * Obtain last known location + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION or ohos.permission.APPROXIMATELY_LOCATION + * @return Return the last known {@link Location} information. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301100 - The location switch is off. + * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. + */ + function getLastLocation(): Location; + + /** + * Obtain current location switch status + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @return Returns {@code true} if the location switch on, returns {@code false} otherwise. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + */ + function isLocationEnabled(): boolean; + + /** + * Request enable location + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION or ohos.permission.APPROXIMATELY_LOCATION + * @param callback indicates the callback for reporting the error message. + * If the function fails to execute, the error message will be carried in the first parameter err of AsyncCallback, + * If the function executes successfully, returns {@code true} if user agrees to open the location switch, returns {@code false} otherwise. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301700 - No response to the request. + */ + function requestEnableLocation(callback: AsyncCallback): void; + function requestEnableLocation(): Promise; + + /** + * Enable location switch + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + * @permission ohos.permission.MANAGE_SECURE_SETTINGS + * @return void. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - System API is not allowed called by third HAP. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + */ + function enableLocation(): void; + + /** + * Disable location switch + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + * @permission ohos.permission.MANAGE_SECURE_SETTINGS + * @return void. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - System API is not allowed called by third HAP. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + */ + function disableLocation(): void; + + /** + * Obtain address info from location + * + * @since 9 + * @syscap SystemCapability.Location.Location.Geocoder + * @param request indicates the reverse geocode query parameters. + * @param callback indicates the callback for reporting the address info. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301300 - Reverse geocoding query failed. + */ + function getAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback>): void; + function getAddressesFromLocation(request: ReverseGeoCodeRequest): Promise>; + + /** + * Obtain latitude and longitude info from location address + * + * @since 9 + * @syscap SystemCapability.Location.Location.Geocoder + * @param request indicates the geocode query parameters. + * @param callback indicates the callback for reporting the latitude and longitude result. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301400 - Geocoding query failed. + */ + function getAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback>): void; + function getAddressesFromLocationName(request: GeoCodeRequest): Promise>; + + /** + * Obtain geocode service status + * + * @since 9 + * @syscap SystemCapability.Location.Location.Geocoder + * @return Returns {@code true} if geocode service is available, returns {@code false} otherwise. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + */ + function isGeocodeServiceAvailable(): boolean; + + /** + * Obtain the number of cached GNSS locations reported at a time + * + * @since 9 + * @syscap SystemCapability.Location.Location.Gnss + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION or ohos.permission.APPROXIMATELY_LOCATION + * @param callback indicates the callback for reporting the cached GNSS locations size. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301100 - The location switch is off. + */ + function getCachedGnssLocationsSize(callback: AsyncCallback): void; + function getCachedGnssLocationsSize(): Promise; + + /** + * All prepared GNSS locations are returned to the application through the callback function, + * and the bottom-layer buffer is cleared. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Gnss + * @permission ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION or ohos.permission.APPROXIMATELY_LOCATION + * @param callback indicates the callback for reporting the error message. + * If the function fails to execute, the error message will be carried in the first parameter err of AsyncCallback, + * If the function executes successfully, execute the callback function only, no data will be returned. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301100 - The location switch is off. + * @throws { BusinessError } 3301200 - Failed to obtain the geographical location. + */ + function flushCachedGnssLocations(callback: AsyncCallback): void; + function flushCachedGnssLocations(): Promise; + + /** + * Send extended commands to location subsystem. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @param command indicates the extended command message body. + * @param callback indicates the callback for reporting the error message. + * If the function fails to execute, the error message will be carried in the first parameter err of AsyncCallback, + * If the function executes successfully, execute the callback function only, no data will be returned. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + */ + function sendCommand(command: LocationCommand, callback: AsyncCallback): void; + function sendCommand(command: LocationCommand): Promise; + + /** + * Obtain the current country code. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @param callback indicates the callback for reporting the country code. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301500 - Failed to query the area information. + */ + function getCountryCode(callback: AsyncCallback): void; + function getCountryCode(): Promise; + + /** + * Enable the geographical location simulation function. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + * @return void. + * @throws { BusinessError } 202 - System API is not allowed called by third HAP. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301100 - The location switch is off. + */ + function enableLocationMock(): void; + + /** + * Disable the geographical location simulation function. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + * @return void. + * @throws { BusinessError } 202 - System API is not allowed called by third HAP. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301100 - The location switch is off. + */ + function disableLocationMock(): void; + + /** + * Set the configuration parameters for location simulation. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + * @param config indicates the configuration parameters for location simulation. + * Contains the array of locations and reporting intervals that need to be simulated. + * @return void. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + * @throws { BusinessError } 3301100 - The location switch is off. + */ + function setMockedLocations(config: LocationMockConfig): void; + + /** + * Enable the reverse geocoding simulation function. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + * @return void. + * @throws { BusinessError } 202 - System API is not allowed called by third HAP. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + */ + function enableReverseGeocodingMock(): void; + + /** + * Disable the reverse geocoding simulation function. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + * @return void. + * @throws { BusinessError } 202 - System API is not allowed called by third HAP. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + */ + function disableReverseGeocodingMock(): void; + + /** + * Set the configuration parameters for simulating reverse geocoding. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + * @param mockInfos indicates the set of locations and place names to be simulated. + * @return void. + * @throws { BusinessError } 202 - System API is not allowed called by third HAP. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + */ + function setReverseGeocodingMockInfo(mockInfos: Array): void; + + /** + * Querying location privacy protocol confirmation status. + * + * @since 9 + * @systemapi + * @syscap SystemCapability.Location.Location.Core + * @param type indicates location privacy protocol type. + * @return Returns {@code true} if the location privacy protocol has been confirmed, returns {@code false} otherwise. + * @throws { BusinessError } 202 - System API is not allowed called by third HAP. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + */ + function isLocationPrivacyConfirmed(type: LocationPrivacyType): boolean; + + /** + * Set location privacy protocol confirmation status. + * + * @since 9 + * @systemapi + * @syscap SystemCapability.Location.Location.Core + * @permission ohos.permission.MANAGE_SECURE_SETTINGS + * @param type indicates location privacy protocol type. + * @param isConfirmed indicates whether the location privacy protocol has been confirmed. + * @return void. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - System API is not allowed called by third HAP. + * @throws { BusinessError } 401 - Parameter error. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 3301000 - Location service is unavailable. + */ + function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean): void; + + /** + * Configuration parameters for simulating reverse geocoding. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + */ + export interface ReverseGeocodingMockInfo { + location: ReverseGeoCodeRequest; + geoAddress: GeoAddress; + } + + /** + * Parameters for configuring the location simulation function. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + */ + export interface LocationMockConfig { + timeInterval: number; + locations: Array; + } + + /** + * Satellite status information + * + * @since 9 + * @syscap SystemCapability.Location.Location.Gnss + */ + export interface SatelliteStatusInfo { + satellitesNumber: number; + satelliteIds: Array; + carrierToNoiseDensitys: Array; + altitudes: Array; + azimuths: Array; + carrierFrequencies: Array; + } + + /** + * Parameters for requesting to report cache location information + * + * @since 9 + * @syscap SystemCapability.Location.Location.Gnss + */ + export interface CachedGnssLocationsRequest { + reportingPeriodSec: number; + wakeUpCacheQueueFull: boolean; + } + + /** + * Configuring parameters in geo fence requests + * + * @since 9 + * @syscap SystemCapability.Location.Location.Geofence + */ + export interface GeofenceRequest { + priority: LocationRequestPriority; + scenario: LocationRequestScenario; + geofence: Geofence; + } + + /** + * Configuring parameters in geo fence requests + * + * @since 9 + * @syscap SystemCapability.Location.Location.Geofence + */ + export interface Geofence { + latitude: number; + longitude: number; + radius: number; + expiration: number; + } + + /** + * Configuring parameters in reverse geocode requests + * + * @since 9 + * @syscap SystemCapability.Location.Location.Geocoder + */ + export interface ReverseGeoCodeRequest { + locale?: string; + latitude: number; + longitude: number; + maxItems?: number; + } + + /** + * Configuring parameters in geocode requests + * + * @since 9 + * @syscap SystemCapability.Location.Location.Geocoder + */ + export interface GeoCodeRequest { + locale?: string; + description: string; + maxItems?: number; + minLatitude?: number; + minLongitude?: number; + maxLatitude?: number; + maxLongitude?: number; + } + + /** + * Data struct describes geographic locations. + * + * @since 9 + * @syscap SystemCapability.Location.Location.Geocoder + */ + export interface GeoAddress { + /** + * Indicates latitude information. + * A positive value indicates north latitude, + * and a negative value indicates south latitude. + * @since 9 + */ + latitude?: number; + + /** + * Indicates longitude information. + * A positive value indicates east longitude , + * and a negative value indicates west longitude . + * @since 9 + */ + longitude?: number; + + /** + * Indicates language used for the location description. + * zh indicates Chinese, and en indicates English. + * @since 9 + */ + locale?: string; + + /** + * Indicates landmark of the location. + * @since 9 + */ + placeName?: string; + + /** + * Indicates country code. + * @since 9 + */ + countryCode?: string; + + /** + * Indicates country name. + * @since 9 + */ + countryName?: string; + + /** + * Indicates administrative region name. + * @since 9 + */ + administrativeArea?: string; + + /** + * Indicates sub-administrative region name. + * @since 9 + */ + subAdministrativeArea?: string; + + /** + * Indicates locality information. + * @since 9 + */ + locality?: string; + + /** + * Indicates sub-locality information. + * @since 9 + */ + subLocality?: string; + + /** + * Indicates road name. + * @since 9 + */ + roadName?: string; + + /** + * Indicates auxiliary road information. + * @since 9 + */ + subRoadName?: string; + + /** + * Indicates house information. + * @since 9 + */ + premises?: string; + + /** + * Indicates postal code. + * @since 9 + */ + postalCode?: string; + + /** + * Indicates phone number. + * @since 9 + */ + phoneNumber?: string; + + /** + * Indicates website URL. + * @since 9 + */ + addressUrl?: string; + + /** + * Indicates additional information. + * @since 9 + */ + descriptions?: Array; + + /** + * Indicates the amount of additional descriptive information. + * @since 9 + */ + descriptionsSize?: number; + + /** + * Indicates whether it is an mock GeoAddress + * @since 9 + * @systemapi + */ + isFromMock?: Boolean; + } + + /** + * Configuring parameters in location requests + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + */ + export interface LocationRequest { + priority?: LocationRequestPriority; + scenario?: LocationRequestScenario; + timeInterval?: number; + distanceInterval?: number; + maxAccuracy?: number; + } + + /** + * Configuring parameters in current location requests + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + */ + export interface CurrentLocationRequest { + priority?: LocationRequestPriority; + scenario?: LocationRequestScenario; + maxAccuracy?: number; + timeoutMs?: number; + } + + /** + * Provides information about geographic locations + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + */ + export interface Location { + /** + * Indicates latitude information. + * A positive value indicates north latitude, + * and a negative value indicates south latitude. + * @since 9 + */ + latitude: number; + + /** + * Indicates Longitude information. + * A positive value indicates east longitude , + * and a negative value indicates west longitude . + * @since 9 + */ + longitude: number; + + /** + * Indicates location altitude, in meters. + * @since 9 + */ + altitude: number; + + /** + * Indicates location accuracy, in meters. + * @since 9 + */ + accuracy: number; + + /** + * Indicates speed, in m/s. + * @since 9 + */ + speed: number; + + /** + * Indicates location timestamp in the UTC format. + * @since 9 + */ + timeStamp: number; + + /** + * Indicates direction information. + * @since 9 + */ + direction: number; + + /** + * Indicates location timestamp since boot. + * @since 9 + */ + timeSinceBoot: number; + + /** + * Indicates additional information. + * @since 9 + */ + additions?: Array; + + /** + * Indicates the amount of additional descriptive information. + * @since 9 + */ + additionSize?: number; + + /** + * Indicates whether it is an mock location. + * @since 9 + * @systemapi + */ + isFromMock?: Boolean; + } + + /** + * Enum for location priority + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + */ + export enum LocationRequestPriority { + UNSET = 0x200, + ACCURACY, + LOW_POWER, + FIRST_FIX, + } + + /** + * Enum for location scenario + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + */ + export enum LocationRequestScenario { + UNSET = 0x300, + NAVIGATION, + TRAJECTORY_TRACKING, + CAR_HAILING, + DAILY_LIFE_SERVICE, + NO_POWER, + } + + /** + * Enum for location privacy type + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + * @systemapi + */ + export enum LocationPrivacyType { + OTHERS = 0, + STARTUP, + CORE_LOCATION, + } + + /** + * Location subsystem command structure + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + */ + export interface LocationCommand { + scenario: LocationRequestScenario; + command: string; + } + + /** + * Country code structure + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + */ + export interface CountryCode { + country: string; + type: CountryCodeType; + } + + /** + * Enum for country code type + * + * @since 9 + * @syscap SystemCapability.Location.Location.Core + */ + export enum CountryCodeType { + COUNTRY_CODE_FROM_LOCALE = 1, + COUNTRY_CODE_FROM_SIM, + COUNTRY_CODE_FROM_LOCATION, + COUNTRY_CODE_FROM_NETWORK, + } +} + +export default geoLocationManager; diff --git a/api/@ohos.geolocation.d.ts b/api/@ohos.geolocation.d.ts index 0583a89385..099f2f870b 100644 --- a/api/@ohos.geolocation.d.ts +++ b/api/@ohos.geolocation.d.ts @@ -23,6 +23,7 @@ import { WantAgent } from './@ohos.wantAgent'; * @syscap SystemCapability.Location.Location.Core * @import import geolocation from '@ohos.geolocation' * @permission ohos.permission.LOCATION + * @deprecated since 9 */ declare namespace geolocation { /** @@ -33,6 +34,7 @@ declare namespace geolocation { * @permission ohos.permission.LOCATION * @param request Indicates the location request parameters. * @param callback Indicates the callback for reporting the location result. + * @deprecated since 9 */ function on(type: 'locationChange', request: LocationRequest, callback: Callback) : void; @@ -43,6 +45,7 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the location result. + * @deprecated since 9 */ function off(type: 'locationChange', callback?: Callback) : void; @@ -53,6 +56,7 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the location result. + * @deprecated since 9 */ function on(type: 'locationServiceState', callback: Callback) : void; @@ -63,6 +67,7 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the location result. + * @deprecated since 9 */ function off(type: 'locationServiceState', callback?: Callback) : void; @@ -74,6 +79,7 @@ declare namespace geolocation { * @permission ohos.permission.LOCATION * @param request Indicates the cached GNSS locations request parameters. * @param callback Indicates the callback for reporting the cached GNSS locations. + * @deprecated since 9 */ function on(type: 'cachedGnssLocationsReporting', request: CachedGnssLocationsRequest, callback: Callback>) : void; @@ -84,6 +90,7 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Gnss * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the cached gnss locations. + * @deprecated since 9 */ function off(type: 'cachedGnssLocationsReporting', callback?: Callback>) : void; @@ -94,6 +101,7 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Gnss * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the gnss status change. + * @deprecated since 9 */ function on(type: 'gnssStatusChange', callback: Callback) : void; @@ -104,6 +112,7 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Gnss * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the gnss status change. + * @deprecated since 9 */ function off(type: 'gnssStatusChange', callback?: Callback) : void; @@ -114,6 +123,7 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Gnss * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the nmea message. + * @deprecated since 9 */ function on(type: 'nmeaMessageChange', callback: Callback) : void; @@ -124,6 +134,7 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Gnss * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the nmea message. + * @deprecated since 9 */ function off(type: 'nmeaMessageChange', callback?: Callback) : void; @@ -135,6 +146,7 @@ declare namespace geolocation { * @permission ohos.permission.LOCATION * @param request Indicates the Geo-fence configuration parameters. * @param callback Indicates the callback for reporting the fence status. + * @deprecated since 9 */ function on(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent) : void; @@ -146,27 +158,10 @@ declare namespace geolocation { * @permission ohos.permission.LOCATION * @param request Indicates the Geo-fence configuration parameters. * @param callback Indicates the callback for reporting the remove fence result. + * @deprecated since 9 */ function off(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent) : void; - /** - * registering the callback function for listening to country code changes. - * - * @since 9 - * @syscap SystemCapability.Location.Location.Core - * @param callback Indicates the callback for reporting country code changes. - */ - function on(type: 'countryCodeChange', callback: Callback) : void; - - /** - * unregistering the callback function for listening to country code changes. - * - * @since 9 - * @syscap SystemCapability.Location.Location.Core - * @param callback Indicates the callback for reporting country code changes. - */ - function off(type: 'countryCodeChange', callback?: Callback) : void; - /** * obtain current location * @@ -174,6 +169,7 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the location result. + * @deprecated since 9 */ function getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback) : void; function getCurrentLocation(callback: AsyncCallback) : void; @@ -186,6 +182,7 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the location result. + * @deprecated since 9 */ function getLastLocation(callback: AsyncCallback) : void; function getLastLocation() : Promise; @@ -197,6 +194,7 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the location switch result. + * @deprecated since 9 */ function isLocationEnabled(callback: AsyncCallback) : void; function isLocationEnabled() : Promise; @@ -208,34 +206,11 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the location switch status. + * @deprecated since 9 */ function requestEnableLocation(callback: AsyncCallback) : void; function requestEnableLocation() : Promise; - /** - * enable location switch - * - * @since 7 - * @syscap SystemCapability.Location.Location.Core - * @systemapi - * @permission ohos.permission.MANAGE_SECURE_SETTINGS - * @param callback Indicates the callback for reporting the location switch result. - */ - function enableLocation(callback: AsyncCallback) : void; - function enableLocation() : Promise; - - /** - * disable location switch - * - * @since 7 - * @syscap SystemCapability.Location.Location.Core - * @systemapi - * @permission ohos.permission.MANAGE_SECURE_SETTINGS - * @param callback Indicates the callback for reporting the location switch result. - */ - function disableLocation(callback: AsyncCallback) : void; - function disableLocation() : Promise; - /** * obtain address info from location * @@ -243,6 +218,7 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Geocoder * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the address info. + * @deprecated since 9 */ function getAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback>) : void; function getAddressesFromLocation(request: ReverseGeoCodeRequest) : Promise>; @@ -254,6 +230,7 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Geocoder * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the latitude and longitude result. + * @deprecated since 9 */ function getAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback>) : void; function getAddressesFromLocationName(request: GeoCodeRequest) : Promise>; @@ -265,6 +242,7 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Geocoder * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the geocode service status. + * @deprecated since 9 */ function isGeoServiceAvailable(callback: AsyncCallback) : void; function isGeoServiceAvailable() : Promise; @@ -276,6 +254,7 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Gnss * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the cached GNSS locations size. + * @deprecated since 9 */ function getCachedGnssLocationsSize(callback: AsyncCallback) : void; function getCachedGnssLocationsSize() : Promise; @@ -288,6 +267,7 @@ declare namespace geolocation { * @syscap SystemCapability.Location.Location.Gnss * @permission ohos.permission.LOCATION * @param callback Indicates the callback for reporting the result. + * @deprecated since 9 */ function flushCachedGnssLocations(callback: AsyncCallback) : void; function flushCachedGnssLocations() : Promise; @@ -300,133 +280,18 @@ declare namespace geolocation { * @permission ohos.permission.LOCATION * @param command Indicates the extended Command Message Body. * @param callback Indicates the callback for reporting the send command result. + * @deprecated since 9 */ function sendCommand(command: LocationCommand, callback: AsyncCallback) : void; function sendCommand(command: LocationCommand) : Promise; - /** - * obtain the current country code. - * - * @since 9 - * @syscap SystemCapability.Location.Location.Core - * @param callback Indicates the callback for reporting the country code. - */ - function getCountryCode(callback: AsyncCallback) : void; - function getCountryCode() : Promise; - - /** - * enable 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 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; - - /** - * 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 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; - - /** - * set the configuration parameters for location simulation. - * - * @since 9 - * @syscap SystemCapability.Location.Location.Core - * @systemapi - * @param config Indicates the configuration parameters for location simulation. - * @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; - - /** - * enable the reverse geocoding simulation function. - * - * @since 9 - * @syscap SystemCapability.Location.Location.Core - * @systemapi - * @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; - - /** - * disable the reverse geocoding simulation function. - * - * @since 9 - * @syscap SystemCapability.Location.Location.Core - * @systemapi - * @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; - - /** - * set the configuration parameters for simulating reverse geocoding. - * - * @since 9 - * @syscap SystemCapability.Location.Location.Core - * @systemapi - * @param mockInfos Indicates the set of locations and place names to be simulated. - * @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; - - /** - * configuration parameters for simulating reverse geocoding. - * - * @since 9 - * @syscap SystemCapability.Location.Location.Core - * @systemapi - */ - export interface ReverseGeocodingMockInfo { - location: ReverseGeoCodeRequest; - geoAddress: GeoAddress; - } - - /** - * parameters for configuring the location simulation function. - * - * @since 9 - * @syscap SystemCapability.Location.Location.Core - * @systemapi - */ - export interface LocationMockConfig { - timeInterval: number; - locations: Array; - } - /** * satellite status information * * @since 8 * @syscap SystemCapability.Location.Location.Gnss * @permission ohos.permission.LOCATION + * @deprecated since 9 */ export interface SatelliteStatusInfo { satellitesNumber: number; @@ -443,6 +308,7 @@ declare namespace geolocation { * @since 8 * @syscap SystemCapability.Location.Location.Gnss * @permission ohos.permission.LOCATION + * @deprecated since 9 */ export interface CachedGnssLocationsRequest { reportingPeriodSec: number; @@ -455,6 +321,7 @@ declare namespace geolocation { * @since 8 * @syscap SystemCapability.Location.Location.Geofence * @permission ohos.permission.LOCATION + * @deprecated since 9 */ export interface GeofenceRequest { priority: LocationRequestPriority; @@ -468,6 +335,7 @@ declare namespace geolocation { * @since 8 * @syscap SystemCapability.Location.Location.Geofence * @permission ohos.permission.LOCATION + * @deprecated since 9 */ export interface Geofence { latitude: number; @@ -476,39 +344,13 @@ declare namespace geolocation { expiration: number; } - /** - * querying location privacy protocol confirmation status. - * - * @since 8 - * @systemapi - * @syscap SystemCapability.Location.Location.Core - * @permission ohos.permission.LOCATION - * @param type indicates location privacy protocol type. - * @param callback indicates the callback for reporting the location privacy protocol confirmation status. - */ - function isLocationPrivacyConfirmed(type : LocationPrivacyType, callback: AsyncCallback) : void; - function isLocationPrivacyConfirmed(type : LocationPrivacyType,) : Promise; - - /** - * set location privacy protocol confirmation status. - * - * @since 8 - * @systemapi - * @syscap SystemCapability.Location.Location.Core - * @permission ohos.permission.LOCATION - * @param type indicates location privacy protocol type. - * @param isConfirmed indicates whether the location privacy protocol has been confirmed. - * @param callback Indicates the callback for reporting whether the action is set successfully. - */ - function setLocationPrivacyConfirmStatus(type : LocationPrivacyType, isConfirmed : boolean, callback: AsyncCallback) : void; - function setLocationPrivacyConfirmStatus(type : LocationPrivacyType, isConfirmed : boolean) : Promise; - /** * configuring parameters in reverse geocode requests * * @since 7 * @syscap SystemCapability.Location.Location.Geocoder * @permission ohos.permission.LOCATION + * @deprecated since 9 */ export interface ReverseGeoCodeRequest { locale?: string; @@ -523,6 +365,7 @@ declare namespace geolocation { * @since 7 * @syscap SystemCapability.Location.Location.Geocoder * @permission ohos.permission.LOCATION + * @deprecated since 9 */ export interface GeoCodeRequest { locale?: string; @@ -540,6 +383,7 @@ declare namespace geolocation { * @since 7 * @syscap SystemCapability.Location.Location.Geocoder * @permission ohos.permission.LOCATION + * @deprecated since 9 */ export interface GeoAddress { /** @@ -654,12 +498,6 @@ declare namespace geolocation { * @since 7 */ descriptionsSize?: number; - - /** - * Indicates whether it is an mock GeoAddress - * @since 9 - */ - isFromMock?: Boolean; } /** @@ -668,6 +506,7 @@ declare namespace geolocation { * @since 7 * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION + * @deprecated since 9 */ export interface LocationRequest { priority?: LocationRequestPriority; @@ -683,6 +522,7 @@ declare namespace geolocation { * @since 7 * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION + * @deprecated since 9 */ export interface CurrentLocationRequest { priority?: LocationRequestPriority; @@ -697,6 +537,7 @@ declare namespace geolocation { * @since 7 * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION + * @deprecated since 9 */ export interface Location { /** @@ -762,12 +603,6 @@ declare namespace geolocation { * @since 7 */ additionSize?: number; - - /** - * Indicates whether it is an mock location. - * @since 9 - */ - isFromMock?: Boolean; } /** @@ -776,6 +611,7 @@ declare namespace geolocation { * @since 7 * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION + * @deprecated since 9 */ export enum LocationRequestPriority { UNSET = 0x200, @@ -790,6 +626,7 @@ declare namespace geolocation { * @since 7 * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION + * @deprecated since 9 */ export enum LocationRequestScenario { UNSET = 0x300, @@ -806,14 +643,9 @@ declare namespace geolocation { * @since 7 * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION + * @deprecated since 9 */ export enum GeoLocationErrorCode { - /** - * Indicates function not supported. - * @since 9 - */ - NOT_SUPPORTED = 100, - /** * Indicates input parameter error. * @since 7 @@ -855,12 +687,6 @@ declare namespace geolocation { * @since 7 */ LOCATION_REQUEST_TIMEOUT_ERROR, - - /** - * Indicates country code query failed. - * @since 9 - */ - QUERY_COUNTRY_CODE_ERROR, } /** @@ -869,6 +695,7 @@ declare namespace geolocation { * @since 8 * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION + * @deprecated since 9 */ export enum LocationPrivacyType { OTHERS = 0, @@ -882,35 +709,12 @@ declare namespace geolocation { * @since 8 * @syscap SystemCapability.Location.Location.Core * @permission ohos.permission.LOCATION + * @deprecated since 9 */ export interface LocationCommand { scenario: LocationRequestScenario; command: string; } - - /** - * country code structure - * - * @since 9 - * @syscap SystemCapability.Location.Location.Core - */ - export interface CountryCode { - country: string; - type: CountryCodeType; - } - - /** - * enum for country code type - * - * @since 9 - * @syscap SystemCapability.Location.Location.Core - */ - export enum CountryCodeType { - COUNTRY_CODE_FROM_LOCALE = 1, - COUNTRY_CODE_FROM_SIM, - COUNTRY_CODE_FROM_LOCATION, - COUNTRY_CODE_FROM_NETWORK, - } } export default geolocation; -- Gitee From c3ec023437c5227865b2daf99f597e604215ba27 Mon Sep 17 00:00:00 2001 From: shilei Date: Tue, 1 Nov 2022 21:23:58 +0800 Subject: [PATCH 295/438] add Signed-off-by: shilei Change-Id: Ib1b700868f072d4b978abb6e147985a2c54ed9a7 --- api/@ohos.bundle.installer.d.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/api/@ohos.bundle.installer.d.ts b/api/@ohos.bundle.installer.d.ts index 680468fa47..854e0b7d31 100644 --- a/api/@ohos.bundle.installer.d.ts +++ b/api/@ohos.bundle.installer.d.ts @@ -63,9 +63,7 @@ declare namespace installer { * @throws { BusinessError } 17700004 - The specified userId is not existed. * @throws { BusinessError } 17700010 - To parse file of config.json or module.json failed. * @throws { BusinessError } 17700011 - To verify signature failed. - * @throws { BusinessError } 17700012 - Invalid hapFilePaths since being lack of file or path. - * @throws { BusinessError } 17700013 - Too large size of hap file which exceeds the size limitation. - * @throws { BusinessError } 17700014 - The suffix of the hap name is not .hap. + * @throws { BusinessError } 17700012 - Invalid hap file path or too large file size. * @throws { BusinessError } 17700015 - Multiple haps have inconsistent configured information. * @throws { BusinessError } 17700016 - No disk space left for installation. * @throws { BusinessError } 17700017 - Downgrade installation is prohibited. -- Gitee From 956759991f81d5f1b593e62196f1b34e568b2a0a Mon Sep 17 00:00:00 2001 From: zhangxiuping Date: Wed, 2 Nov 2022 09:12:19 +0800 Subject: [PATCH 296/438] move the nfc ndef js apis outter to tag namespace. Signed-off-by: zhangxiuping --- api/@ohos.nfc.tag.d.ts | 114 +++++++++++++++++++++++++++++++++++------ api/tag/nfctech.d.ts | 106 ++++++-------------------------------- 2 files changed, 114 insertions(+), 106 deletions(-) diff --git a/api/@ohos.nfc.tag.d.ts b/api/@ohos.nfc.tag.d.ts index 761c31f24e..20ac89240b 100644 --- a/api/@ohos.nfc.tag.d.ts +++ b/api/@ohos.nfc.tag.d.ts @@ -56,18 +56,18 @@ declare namespace tag { /** Indicates an NDEF tag. */ const NDEF = 6; - /** Indicates a MifareClassic tag. */ - const MIFARE_CLASSIC = 8; - - /** Indicates a MifareUltralight tag. */ - const MIFARE_ULTRALIGHT = 9; - /** - * Indicates an NdefFormatable tag. + * Indicates an NDEF Formatable tag. * * @since 9 */ - const NDEF_FORMATABLE = 10; + const NDEF_FORMATABLE = 7; + + /** Indicates a MIFARE Classic tag. */ + const MIFARE_CLASSIC = 8; + + /** Indicates a MIFARE Ultralight tag. */ + const MIFARE_ULTRALIGHT = 9; /** * TNF types definitions, see NFCForum-TS-NDEF_1.0. @@ -253,7 +253,7 @@ declare namespace tag { * @param { TagInfo } tagInfo - Indicates the diapatched tag information. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. * @syscap SystemCapability.Communication.NFC.Core * @since 9 */ @@ -268,7 +268,7 @@ declare namespace tag { * @param { TagInfo } tagInfo - Indicates the diapatched tag information. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. * @syscap SystemCapability.Communication.NFC.Core * @since 9 */ @@ -277,13 +277,13 @@ declare namespace tag { /** * Obtains an {@link MifareClassicTag} object based on the tag information. * - * During tag reading, if the tag supports the MifareClassic technology, + * During tag reading, if the tag supports the MIFARE Classic technology, * an {@link MifareClassicTag} object will be created based on the tag information. * * @param { TagInfo } tagInfo - Indicates the diapatched tag information. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. * @syscap SystemCapability.Communication.NFC.Core * @since 9 */ @@ -292,13 +292,13 @@ declare namespace tag { /** * Obtains an {@link MifareUltralightTag} object based on the tag information. * - * During tag reading, if the tag supports the MifareUltralight technology, + * During tag reading, if the tag supports the MIFARE Ultralight technology, * an {@link MifareUltralightTag} object will be created based on the tag information. * * @param { TagInfo } tagInfo - Indicates the diapatched tag information. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. * @syscap SystemCapability.Communication.NFC.Core * @since 9 */ @@ -307,13 +307,13 @@ declare namespace tag { /** * Obtains an {@link NdefFormatableTag} object based on the tag information. * - * During tag reading, if the tag supports the NdefFormatable technology, + * During tag reading, if the tag supports the NDEF Formatable technology, * an {@link NdefFormatableTag} object will be created based on the tag information. * * @param { TagInfo } tagInfo - Indicates the diapatched tag information. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. * @syscap SystemCapability.Communication.NFC.Core * @since 9 */ @@ -408,6 +408,88 @@ declare namespace tag { payload: number[]; } + namespace ndef { + /** + * Creates an NDEF record with uri data. + * + * @param { string } uri - Uri data for new NDEF record. + * @return { NdefRecord } The instance of NdefRecord. + * @throws { BusinessError } 401 - The parameter check failed. + * @syscap SystemCapability.Communication.NFC.Core + * @since 9 + */ + function makeUriRecord(uri: string): NdefRecord; + + /** + * Creates an NDEF record with text data. + * + * @param { string } text - Text data for new an NDEF record. + * @param { string } locale - Language code for the NDEF record. if locale is null, use default locale. + * @return { NdefRecord } The instance of NdefRecord. + * @throws { BusinessError } 401 - The parameter check failed. + * @syscap SystemCapability.Communication.NFC.Core + * @since 9 + */ + function makeTextRecord(text: string, locale: string): NdefRecord; + + /** + * Creates an NDEF record with mime data. + * + * @param { string } mimeType type of mime data for new an NDEF record. + * @param { string } mimeData mime data for new an NDEF record. + * @return { NdefRecord } The instance of NdefRecord. + * @throws { BusinessError } 401 - The parameter check failed. + * @syscap SystemCapability.Communication.NFC.Core + * @since 9 + */ + function makeMimeRecord(mimeType: string, mimeData: number[]): NdefRecord; + + /** + * Creates an NDEF record with external data. + * + * @param { string } domainName - Domain name of issuing organization for the external data. + * @param { string } type - Domain specific type of data for the external data. + * @param { number[] } externalData - Data payload of an NDEF record. + * @return { NdefRecord } The instance of NdefRecord. + * @throws { BusinessError } 401 - The parameter check failed. + * @syscap SystemCapability.Communication.NFC.Core + * @since 9 + */ + function makeExternalRecord(domainName: string, type: string, externalData: number[]): NdefRecord; + /** + * Creates an NDEF message with raw bytes. + * + * @param { number[] } data - The raw bytes to parse NDEF message. + * @return { NdefMessage } The instance of NdefMessage. + * @throws { BusinessError } 401 - The parameter check failed. + * @syscap SystemCapability.Communication.NFC.Core + * @since 9 + */ + function createNdefMessage(data: number[]): NdefMessage; + + /** + * Creates an NDEF message with record list. + * + * @param { NdefRecord[] } ndefRecords - The NDEF records to parse NDEF message. + * @return { NdefMessage } The instance of NdefMessage. + * @throws { BusinessError } 401 - The parameter check failed. + * @syscap SystemCapability.Communication.NFC.Core + * @since 9 + */ + function createNdefMessage(ndefRecords: NdefRecord[]): NdefMessage; + + /** + * Parses an NDEF message into raw bytes. + * + * @param { NdefMessage } ndefMessage - An NDEF message to parse. + * @return { number[] } Returns the raw bytes of an NDEF message. + * @throws { BusinessError } 401 - The parameter check failed. + * @syscap SystemCapability.Communication.NFC.Core + * @since 9 + */ + function messageToBytes(ndefMessage: NdefMessage): number[]; + } + export type NfcATag = _NfcATag export type NfcBTag = _NfcBTag export type NfcFTag = _NfcFTag diff --git a/api/tag/nfctech.d.ts b/api/tag/nfctech.d.ts index b7632d3029..7fa6ba118a 100644 --- a/api/tag/nfctech.d.ts +++ b/api/tag/nfctech.d.ts @@ -172,7 +172,7 @@ export interface IsoDepTag extends TagSession { * @permission ohos.permission.NFC_TAG * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. - * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. * @since 9 */ isExtendedApduSupported(): Promise; @@ -187,60 +187,6 @@ export interface NdefMessage { * @since 9 */ getNdefRecords(): tag.NdefRecord[]; - - /** - * Creates an NDEF record with uri data. - * - * @param { string } uri - Uri data for new NDEF record. - * @return { tag.NdefRecord } The instance of NdefRecord. - * @throws { BusinessError } 401 - The parameter check failed. - * @since 9 - */ - makeUriRecord(uri: string): tag.NdefRecord; - - /** - * Creates an NDEF record with text data. - * - * @param { string } text - Text data for new an NDEF record. - * @param { string } locale - Language code for the NDEF record. if locale is null, use default locale. - * @return { tag.NdefRecord } The instance of NdefRecord. - * @throws { BusinessError } 401 - The parameter check failed. - * @since 9 - */ - makeTextRecord(text: string, locale: string): tag.NdefRecord; - - /** - * Creates an NDEF record with mime data. - * - * @param { string } mimeType type of mime data for new an NDEF record. - * @param { string } mimeData mime data for new an NDEF record. - * @return { tag.NdefRecord } The instance of NdefRecord. - * @throws { BusinessError } 401 - The parameter check failed. - * @since 9 - */ - makeMimeRecord(mimeType: string, mimeData: number[]): tag.NdefRecord; - - /** - * Creates an NDEF record with external data. - * - * @param { string } domainName - Domain name of issuing organization for the external data. - * @param { string } serviceName - Domain specific type of data for the external data. - * @param { number[] } externalData - Data payload of an NDEF record. - * @return { tag.NdefRecord } The instance of NdefRecord. - * @throws { BusinessError } 401 - The parameter check failed. - * @since 9 - */ - makeExternalRecord(domainName: string, serviceName: string, externalData: number[]): tag.NdefRecord; - - /** - * Parses an NDEF message into raw bytes. - * - * @param { NdefMessage } ndefMessage - An NDEF message to parse. - * @return { number[] } Returns the raw bytes of an NDEF message. - * @throws { BusinessError } 401 - The parameter check failed. - * @since 9 - */ - messageToBytes(ndefMessage: NdefMessage): number[]; } /** @@ -250,26 +196,6 @@ export interface NdefMessage { * @syscap SystemCapability.Communication.NFC.Core */ export interface NdefTag extends TagSession { - /** - * Creates an NDEF message with raw bytes. - * - * @param { number[] } data - The raw bytes to parse NDEF message. - * @return { NdefMessage } The instance of NdefMessage. - * @throws { BusinessError } 401 - The parameter check failed. - * @since 9 - */ - createNdefMessage(data: number[]): NdefMessage; - - /** - * Creates an NDEF message with record list. - * - * @param { tag.NdefRecord[] } ndefRecords - The NDEF records to parse NDEF message. - * @return { NdefMessage } The instance of NdefMessage. - * @throws { BusinessError } 401 - The parameter check failed. - * @since 9 - */ - createNdefMessage(ndefRecords: tag.NdefRecord[]): NdefMessage; - /** * Gets the type of NDEF tag. * @@ -301,7 +227,7 @@ export interface NdefTag extends TagSession { * @permission ohos.permission.NFC_TAG * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. - * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. * @since 9 */ readNdef(): Promise; @@ -314,7 +240,7 @@ export interface NdefTag extends TagSession { * @permission ohos.permission.NFC_TAG * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. - * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. * @since 9 */ writeNdef(msg: NdefMessage): Promise; @@ -326,7 +252,7 @@ export interface NdefTag extends TagSession { * @return { boolean } Returns true if the tag can be set readonly, otherwise returns false. * @permission ohos.permission.NFC_TAG * @throws { BusinessError } 201 - Permission denied. - * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. * @since 9 */ canSetReadOnly(): boolean; @@ -337,7 +263,7 @@ export interface NdefTag extends TagSession { * @permission ohos.permission.NFC_TAG * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. - * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. * @since 9 */ setReadOnly(): Promise; @@ -370,7 +296,7 @@ export interface MifareClassicTag extends TagSession { * @permission ohos.permission.NFC_TAG * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. - * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. * @since 9 */ authenticateSector(sectorIndex: number, key: number[], isKeyA: boolean): Promise; @@ -384,7 +310,7 @@ export interface MifareClassicTag extends TagSession { * @permission ohos.permission.NFC_TAG * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. - * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. * @since 9 */ readSingleBlock(blockIndex: number): Promise; @@ -398,7 +324,7 @@ export interface MifareClassicTag extends TagSession { * @permission ohos.permission.NFC_TAG * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. - * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. * @since 9 */ writeSingleBlock(blockIndex: number, data: number[]): Promise; @@ -412,7 +338,7 @@ export interface MifareClassicTag extends TagSession { * @permission ohos.permission.NFC_TAG * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. - * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. * @since 9 */ incrementBlock(blockIndex: number, value: number): Promise; @@ -426,7 +352,7 @@ export interface MifareClassicTag extends TagSession { * @permission ohos.permission.NFC_TAG * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. - * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. * @since 9 */ decrementBlock(blockIndex: number, value: number): Promise; @@ -439,7 +365,7 @@ export interface MifareClassicTag extends TagSession { * @permission ohos.permission.NFC_TAG * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. - * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. * @since 9 */ transferToBlock(blockIndex: number): Promise; @@ -452,7 +378,7 @@ export interface MifareClassicTag extends TagSession { * @permission ohos.permission.NFC_TAG * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. - * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. * @since 9 */ restoreFromBlock(blockIndex: number): Promise; @@ -536,7 +462,7 @@ export interface MifareUltralightTag extends TagSession { * @permission ohos.permission.NFC_TAG * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. - * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. * @since 9 */ readMultiplePages(pageIndex: number): Promise; @@ -550,7 +476,7 @@ export interface MifareUltralightTag extends TagSession { * @permission ohos.permission.NFC_TAG * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. - * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. * @since 9 */ writeSinglePage(pageIndex: number, data: number[]): Promise; @@ -579,7 +505,7 @@ export interface NdefFormatableTag extends TagSession { * @permission ohos.permission.NFC_TAG * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. - * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. * @since 9 */ format(message: NdefMessage): Promise; @@ -592,7 +518,7 @@ export interface NdefFormatableTag extends TagSession { * @permission ohos.permission.NFC_TAG * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. - * @throws { BusinessError } 3100201 - Tag running state of service is abnormal. + * @throws { BusinessError } 3100201 - Tag running state is abnormal in service. * @since 9 */ formatReadOnly(message: NdefMessage): Promise; -- Gitee From afafe816cd7cac5ca65f7c093b01f55a500a494e Mon Sep 17 00:00:00 2001 From: wangqing Date: Wed, 2 Nov 2022 09:48:05 +0800 Subject: [PATCH 297/438] =?UTF-8?q?=E5=B7=A5=E5=85=B7=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangqing --- .../api_check_plugin/plugin/scan_entry.py | 42 ------------------- 1 file changed, 42 deletions(-) delete mode 100644 build-tools/api_check_plugin/plugin/scan_entry.py diff --git a/build-tools/api_check_plugin/plugin/scan_entry.py b/build-tools/api_check_plugin/plugin/scan_entry.py deleted file mode 100644 index bf1530c1f5..0000000000 --- a/build-tools/api_check_plugin/plugin/scan_entry.py +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright (c) 2021 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 os -import shutil -import execjs - -def run_scan(path): - result = [] - rootDir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(_file_)))) - entryDir = os.path.join(rootDir, "interface/sdk-js/build-tools/api_check_plugin/entry.js").replace("\\","/") - resultDir = os.path.join(rootDir, "interface/sdk-js/build-tools/api_check_plugin/Result.txt").replace("\\","/") - cmdDir = "node" + entryDir + " " + os.path.join(rootDir,path) - subprocess.check_output(cmdDir, shell=True) - file_object = open(resultDir,"r") - try: - result = file_object.read() - finally: - file_object.close() - - os.remove(os.path.abspath(resultDir)) - return True,result - -def js_from_file(file_name): - with open(file_name, "r", encoding="UTF-8") as file: - result = file.read() - return result - -if __name__ == "__main__": - run_scan("ci-tools/ci-build/mdFiles.txt") -- Gitee From 690142a35559d424d3bcfa96cb9cc6e5fbd0f92b Mon Sep 17 00:00:00 2001 From: wangqing Date: Wed, 2 Nov 2022 10:04:38 +0800 Subject: [PATCH 298/438] =?UTF-8?q?=E9=97=A8=E7=A6=81=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangqing --- build-tools/api_check_plugin/entry.js | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/build-tools/api_check_plugin/entry.js b/build-tools/api_check_plugin/entry.js index fde4be4bdc..8f8c77ddc6 100644 --- a/build-tools/api_check_plugin/entry.js +++ b/build-tools/api_check_plugin/entry.js @@ -19,28 +19,16 @@ const { writeResultFile } = require('./src/utils'); function checkEntry(url) { let result = ""; - result += 'line:22,first:::::::::' - fs.access(url, fs.constants.R_OK | fs.constants.W_OK, (err) => { - const checkResult1 = err ? 'no access!' : 'can read/write'; - result += `checkResult1 = ${checkResult1} ||| ${url} ||| \n`; - }); + result += `line:22,first:::::::::` const sourceDirname = __dirname; __dirname = "interface/sdk-js/build-tools/api_check_plugin"; try { const execSync = require("child_process").execSync; execSync("cd interface/sdk-js/build-tools/api_check_plugin && npm install"); const path2 = path.resolve(sourceDirname, '../../../../', "ci_tool/ci_build/readme_file.txt"); - result += 'line:33,second:::::::::' - fs.access(path2, fs.constants.R_OK | fs.constants.W_OK, (err) => { - const checkResult2 = err ? 'no access!' : 'can read/write'; - result += `checkResult2 = ${checkResult2} ||| ${path2} ||| \n`; - }); + result += `line:33,second:::::::::path2::${path2} is ${fs.existsSync(path2)}`; const path3 = path.resolve(__dirname, '../../../../', "ci_tool/ci_build/readme_file.txt"); - result += 'line:40,third::::::::::' - fs.access(path3, fs.constants.R_OK | fs.constants.W_OK, (err) => { - const checkResult3 = err ? 'no access!' : 'can read/write'; - result += `checkResult3 = ${checkResult3} ||| ${path3} ||| \n`; - }); + result += `line:40,third::::::::::path3::${path3} is ${fs.existsSync(path3)}`; const { scanEntry } = require(path.resolve(__dirname, "./src/api_check_plugin")); result += scanEntry(url); const content = fs.readFileSync(url, "utf-8"); -- Gitee From fd905ebaeff7a6e941f8e275746f24f04c1edebb Mon Sep 17 00:00:00 2001 From: zhuwenchao Date: Tue, 1 Nov 2022 21:54:53 +0800 Subject: [PATCH 299/438] update api of net Signed-off-by: zhuwenchao --- api/@ohos.net.connection.d.ts | 13 ++++ api/@ohos.net.socket.d.ts | 143 +++++++++++++++++++++++++++++++++- 2 files changed, 153 insertions(+), 3 deletions(-) diff --git a/api/@ohos.net.connection.d.ts b/api/@ohos.net.connection.d.ts index 84576eeee7..283d7bef59 100644 --- a/api/@ohos.net.connection.d.ts +++ b/api/@ohos.net.connection.d.ts @@ -56,6 +56,7 @@ declare namespace connection { * returns {@code null} if the default network is not activated. * @permission ohos.permission.GET_NETWORK_INFO * @since 9 + * @throws {BusinessError} 201 - Permission denied. */ function getDefaultNetSync(): NetHandle; @@ -88,6 +89,18 @@ declare namespace connection { function getNetCapabilities(netHandle: NetHandle, callback: AsyncCallback): void; function getNetCapabilities(netHandle: NetHandle): Promise; + /** + * Checks whether data traffic usage on the current network is metered. + * + * @param callback Returns {@code true} if data traffic usage on the current network is metered; + * returns {@code false} otherwise. + * @permission ohos.permission.GET_NETWORK_INFO + * @since 9 + * @throws {BusinessError} 201 - Permission denied. + */ + function isDefaultNetMetered(callback: AsyncCallback): void; + function isDefaultNetMetered(): Promise; + /** * Checks whether the default data network is activated. * diff --git a/api/@ohos.net.socket.d.ts b/api/@ohos.net.socket.d.ts index 3fcdd5c8f9..1f6d090abd 100644 --- a/api/@ohos.net.socket.d.ts +++ b/api/@ohos.net.socket.d.ts @@ -341,10 +341,100 @@ declare namespace socket { /** * @since 9 */ - export interface TLSSocket extends TCPSocket { + export interface TLSSocket { + + /** + * Binds the IP address and port number. The port number can be specified or randomly allocated by the system. + * + * @param address Destination address. {@link NetAddress} + * @permission ohos.permission.INTERNET + * @throws {BusinessError} 401 - Parameter error. + * @throws {BusinessError} 201 - Permission denied. + * @throws {BusinessError} 2303198 - Address already in use. + * @throws {BusinessError} 2300002 - System internal error. + */ + bind(address: NetAddress, callback: AsyncCallback): void; + bind(address: NetAddress): Promise; + + /** + * Obtains the peer address of a TLSSocket connection. + * + * @param callback Callback used to return the result. {@link NetAddress} + * @throws {BusinessError} 2303188 - Socket operation on non-socket. + * @throws {BusinessError} 2300002 - System internal error. + */ + getRemoteAddress(callback: AsyncCallback): void; + getRemoteAddress(): Promise; + + /** + * Obtains the status of the TLSSocket connection. + * + * @param callback Callback used to return the result. {@link SocketStateBase} + * @throws {BusinessError} 2303188 - Socket operation on non-socket. + * @throws {BusinessError} 2300002 - System internal error. + */ + getState(callback: AsyncCallback): void; + getState(): Promise; + + /** + * Sets other attributes of the TLSSocket connection. + * + * @param options Optional parameters {@link TCPExtraOptions}. + * @throws {BusinessError} 401 - Parameter error. + * @throws {BusinessError} 2303188 - Socket operation on non-socket. + * @throws {BusinessError} 2300002 - System internal error. + */ + setExtraOptions(options: TCPExtraOptions, callback: AsyncCallback): void; + setExtraOptions(options: TCPExtraOptions): Promise; + + /** + * Listens for message receiving events of the TLSSocket connection. + * + * @throws {BusinessError} 401 - Parameter error. + */ + on(type: 'message', callback: Callback<{message: ArrayBuffer, remoteInfo: SocketRemoteInfo}>): void; + + /** + * Cancels listening for message receiving events of the TLSSocket connection. + * + * @throws {BusinessError} 401 - Parameter error. + */ + off(type: 'message', callback?: Callback<{message: ArrayBuffer, remoteInfo: SocketRemoteInfo}>): void; + + /** + * Listens for connection or close events of the TLSSocket connection. + * + * @throws {BusinessError} 401 - Parameter error. + */ + on(type: 'connect' | 'close', callback: Callback): void; + + /** + * Cancels listening for connection or close events of the TLSSocket connection. + * + * @throws {BusinessError} 401 - Parameter error. + */ + off(type: 'connect' | 'close', callback?: Callback): void; + + /** + * Listens for error events of the TLSSocket connection. + * + * @throws {BusinessError} 401 - Parameter error. + */ + on(type: 'error', callback: ErrorCallback): void; + + /** + * Cancels listening for error events of the TLSSocket connection. + * + * @throws {BusinessError} 401 - Parameter error. + */ + off(type: 'error', callback?: ErrorCallback): void; /** * Returns an object representing a local certificate. + * + * @throws {BusinessError} 2303501 - SSL is null. + * @throws {BusinessError} 2303504 - Error looking up x509 + * @throws {BusinessError} 2300002 - System internal error. */ getCertificate(callback: AsyncCallback): void; getCertificate(): Promise; @@ -354,6 +444,9 @@ declare namespace socket { * an empty object will be returned. If the socket is destroyed, null is returned. * If needChain is true, it contains the complete certificate chain. Otherwise, * it only contains the peer's certificate. + * + * @throws {BusinessError} 2303501 - SSL is null. + * @throws {BusinessError} 2300002 - System internal error. */ getRemoteCertificate(callback: AsyncCallback): void; getRemoteCertificate(): Promise; @@ -362,6 +455,10 @@ declare namespace socket { * Returns a string containing the negotiated SSL/TLS protocol version of the current connection. * For connected sockets that have not completed the handshake process, the value 'unknown' will be returned. * Server sockets or disconnected client sockets will return a value of null. + * + * @throws {BusinessError} 2303501 - SSL is null. + * @throws {BusinessError} 2303505 - Error occurred in the tls system call. + * @throws {BusinessError} 2300002 - System internal error. */ getProtocol(callback: AsyncCallback): void; getProtocol(): Promise; @@ -369,6 +466,11 @@ declare namespace socket { /** * Returns an object containing the negotiated cipher suite information. * For example:{"name": "AES128-SHA256", "standardName": "TLS_RSA_WITH_AES_128_CBC_SHA256", "version": "TLSv1.2"} + * + * @throws {BusinessError} 2303501 - SSL is null. + * @throws {BusinessError} 2303502 - Error in tls reading. + * @throws {BusinessError} 2303505 - Error occurred in the tls system call. + * @throws {BusinessError} 2300002 - System internal error. */ getCipherSuite(callback: AsyncCallback>): void; getCipherSuite(): Promise>; @@ -376,12 +478,30 @@ declare namespace socket { /** * The list of signature algorithms shared between the server and the client, in descending order of priority. * @see https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html + * + * @throws {BusinessError} 2303501 - SSL is null. + * @throws {BusinessError} 2300002 - System internal error. */ getSignatureAlgorithms(callback: AsyncCallback>): void; getSignatureAlgorithms(): Promise>; /** - * @permission ohos.permission.INTERNET + * @throws {BusinessError} 401 - Parameter error. + * @throws {BusinessError} 2303104 - Interrupted system call. + * @throws {BusinessError} 2303109 - Bad file number. + * @throws {BusinessError} 2303111 - Resource temporarily unavailable try again. + * @throws {BusinessError} 2303113 - System permission denied. + * @throws {BusinessError} 2303188 - Socket operation on non-socket. + * @throws {BusinessError} 2303191 - Protocol wrong type for socket. + * @throws {BusinessError} 2303198 - Address already in use. + * @throws {BusinessError} 2303199 - Cannot assign requested address. + * @throws {BusinessError} 2303210 - Connection timed out. + * @throws {BusinessError} 2303501 - SSL is null. + * @throws {BusinessError} 2303502 - Error in tls reading. + * @throws {BusinessError} 2303503 - Error in tls writing + * @throws {BusinessError} 2303505 - Error occurred in the tls system call. + * @throws {BusinessError} 2303506 - Error clearing tls connection. + * @throws {BusinessError} 2300002 - System internal error. */ connect(options: TLSConnectOptions, callback: AsyncCallback): void; connect(options: TLSConnectOptions): Promise; @@ -390,10 +510,27 @@ declare namespace socket { * Sends data over a TLSSocket connection. * * @param data Optional parameters {@link string}. - * @permission ohos.permission.INTERNET + * @throws {BusinessError} 401 - Parameter error. + * @throws {BusinessError} 2303501 - SSL is null. + * @throws {BusinessError} 2303503 - Error in tls writing. + * @throws {BusinessError} 2303505 - Error occurred in the tls system call. + * @throws {BusinessError} 2303506 - Error clearing tls connection. + * @throws {BusinessError} 2300002 - System internal error. */ send(data: string, callback: AsyncCallback): void; send(data: string): Promise; + + /** + * Closes a TLSSocket connection + * + * @throws {BusinessError} 401 - Parameter error. + * @throws {BusinessError} 2303501 - SSL is null. + * @throws {BusinessError} 2303505 - Error occurred in the tls system call. + * @throws {BusinessError} 2303506 - Error clearing tls connection. + * @throws {BusinessError} 2300002 - System internal error. + */ + close(callback: AsyncCallback): void; + close(): Promise; } /** -- Gitee From acf80133a3ae8709d229ee44f6a80283d939cb44 Mon Sep 17 00:00:00 2001 From: longwei Date: Wed, 2 Nov 2022 11:55:47 +0800 Subject: [PATCH 300/438] delete 801 errcode for bundlemonitor Signed-off-by: longwei Change-Id: Ia2262eee28d544fe500ebce074d34e42a1039694 --- api/@ohos.bundle.bundleMonitor.d.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/api/@ohos.bundle.bundleMonitor.d.ts b/api/@ohos.bundle.bundleMonitor.d.ts index 0f08c1d940..7067c2299c 100644 --- a/api/@ohos.bundle.bundleMonitor.d.ts +++ b/api/@ohos.bundle.bundleMonitor.d.ts @@ -62,7 +62,6 @@ declare namespace bundleMonitor { * @param { Callback } callback - Indicates the callback to be register. * @throws {BusinessError} 201 - Verify permission denied. * @throws {BusinessError} 401 - The parameter check failed. - * @throws {BusinessError} 801 - Capability not support. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi * @since 9 @@ -76,7 +75,6 @@ declare namespace bundleMonitor { * @param { Callback } callback - Indicates the callback to be unregister. * @throws {BusinessError} 201 - Verify permission denied. * @throws {BusinessError} 401 - The parameter check failed. - * @throws {BusinessError} 801 - Capability not support. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi * @since 9 -- Gitee From 12f604665eb812a626f49896c8ac45ec8bfb57df Mon Sep 17 00:00:00 2001 From: wangqing Date: Wed, 2 Nov 2022 22:16:12 +0800 Subject: [PATCH 301/438] api check Signed-off-by: wangqing --- build-tools/api_check_plugin/entry.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/build-tools/api_check_plugin/entry.js b/build-tools/api_check_plugin/entry.js index 8f8c77ddc6..f1dcae64b6 100644 --- a/build-tools/api_check_plugin/entry.js +++ b/build-tools/api_check_plugin/entry.js @@ -19,20 +19,22 @@ const { writeResultFile } = require('./src/utils'); function checkEntry(url) { let result = ""; - result += `line:22,first:::::::::` + result += `line:22,__dirname:::::${__dirname}\n`; + const path1 = path.resolve(__dirname, "entry.js"); + result += `line:24,first:::::::::path1::${path1} is ${fs.existsSync(path1)}\n`; const sourceDirname = __dirname; __dirname = "interface/sdk-js/build-tools/api_check_plugin"; try { const execSync = require("child_process").execSync; execSync("cd interface/sdk-js/build-tools/api_check_plugin && npm install"); const path2 = path.resolve(sourceDirname, '../../../../', "ci_tool/ci_build/readme_file.txt"); - result += `line:33,second:::::::::path2::${path2} is ${fs.existsSync(path2)}`; + result += `line:31,second:::::::::path2::${path2} is ${fs.existsSync(path2)}\n`; const path3 = path.resolve(__dirname, '../../../../', "ci_tool/ci_build/readme_file.txt"); - result += `line:40,third::::::::::path3::${path3} is ${fs.existsSync(path3)}`; + result += `line:33,third::::::::::path3::${path3} is ${fs.existsSync(path3)}\n`; const { scanEntry } = require(path.resolve(__dirname, "./src/api_check_plugin")); result += scanEntry(url); const content = fs.readFileSync(url, "utf-8"); - result += `mdFilePath = ${url}, content = ${content}, __dirname = ${__dirname}, sourceDirname = ${sourceDirname}`; + result += `\nmdFilePath = ${url}, content = ${content}, __dirname = ${__dirname}, sourceDirname = ${sourceDirname}\n`; const { removeDir } = require(path.resolve(__dirname, "./src/utils")); removeDir(path.resolve(__dirname, "node_modules")); } catch (error) { -- Gitee From ff170c21182f9d1063ef026529ea1673f264c0cb Mon Sep 17 00:00:00 2001 From: wangqing Date: Thu, 3 Nov 2022 14:47:42 +0800 Subject: [PATCH 302/438] api check Signed-off-by: wangqing --- build-tools/api_check_plugin/entry.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/build-tools/api_check_plugin/entry.js b/build-tools/api_check_plugin/entry.js index f1dcae64b6..36b8006843 100644 --- a/build-tools/api_check_plugin/entry.js +++ b/build-tools/api_check_plugin/entry.js @@ -19,27 +19,21 @@ const { writeResultFile } = require('./src/utils'); function checkEntry(url) { let result = ""; - result += `line:22,__dirname:::::${__dirname}\n`; - const path1 = path.resolve(__dirname, "entry.js"); - result += `line:24,first:::::::::path1::${path1} is ${fs.existsSync(path1)}\n`; const sourceDirname = __dirname; __dirname = "interface/sdk-js/build-tools/api_check_plugin"; + const mdFilesPath = path.resolve(sourceDirname, '../../../../', "readme_file.txt"); + const content = fs.readFileSync(mdFilesPath, "utf-8"); try { const execSync = require("child_process").execSync; execSync("cd interface/sdk-js/build-tools/api_check_plugin && npm install"); - const path2 = path.resolve(sourceDirname, '../../../../', "ci_tool/ci_build/readme_file.txt"); - result += `line:31,second:::::::::path2::${path2} is ${fs.existsSync(path2)}\n`; - const path3 = path.resolve(__dirname, '../../../../', "ci_tool/ci_build/readme_file.txt"); - result += `line:33,third::::::::::path3::${path3} is ${fs.existsSync(path3)}\n`; const { scanEntry } = require(path.resolve(__dirname, "./src/api_check_plugin")); - result += scanEntry(url); - const content = fs.readFileSync(url, "utf-8"); - result += `\nmdFilePath = ${url}, content = ${content}, __dirname = ${__dirname}, sourceDirname = ${sourceDirname}\n`; + result += scanEntry(mdFilesPath); + result += `,,,mdFilePath = ${mdFilesPath}, content = ${content}`; const { removeDir } = require(path.resolve(__dirname, "./src/utils")); removeDir(path.resolve(__dirname, "node_modules")); } catch (error) { // catch error - result += `CATCHERROR : ${error}, mdFilePath = ${url}, __dirname = ${__dirname}, sourceDirname = ${sourceDirname}`; + result += `CATCHERROR : ${error}, mdFilePath = ${mdFilesPath}, content = ${content}`; } writeResultFile(result, path.resolve(__dirname, "./Result.txt"), {}); } -- Gitee From 6b3793303b781c2bfa8ba31473948c95f84baabf Mon Sep 17 00:00:00 2001 From: wangqing Date: Thu, 3 Nov 2022 17:47:13 +0800 Subject: [PATCH 303/438] api check Signed-off-by: wangqing --- build-tools/api_check_plugin/entry.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-tools/api_check_plugin/entry.js b/build-tools/api_check_plugin/entry.js index 36b8006843..95bf7557e3 100644 --- a/build-tools/api_check_plugin/entry.js +++ b/build-tools/api_check_plugin/entry.js @@ -21,7 +21,7 @@ function checkEntry(url) { let result = ""; const sourceDirname = __dirname; __dirname = "interface/sdk-js/build-tools/api_check_plugin"; - const mdFilesPath = path.resolve(sourceDirname, '../../../../', "readme_file.txt"); + const mdFilesPath = path.resolve(sourceDirname, '../../../../', "all_files.txt"); const content = fs.readFileSync(mdFilesPath, "utf-8"); try { const execSync = require("child_process").execSync; -- Gitee From 33fb430e5ef2c72f8439664c6f8f6b37d0e18374 Mon Sep 17 00:00:00 2001 From: wangqing Date: Thu, 3 Nov 2022 21:04:22 +0800 Subject: [PATCH 304/438] fix bug api_check_plugin Signed-off-by: wangqing --- build-tools/api_check_plugin/src/api_check_plugin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-tools/api_check_plugin/src/api_check_plugin.js b/build-tools/api_check_plugin/src/api_check_plugin.js index 43420ddf37..35328140ea 100644 --- a/build-tools/api_check_plugin/src/api_check_plugin.js +++ b/build-tools/api_check_plugin/src/api_check_plugin.js @@ -34,7 +34,7 @@ function checkAPICodeStyle(url) { function getMdFiles(url) { const content = fs.readFileSync(url, "utf-8"); - const mdFiles = content.split("\r\n"); + const mdFiles = content.split(/[(\r\n)\r\n]+/); return mdFiles; } -- Gitee From 02892ab08a91d619fdc75596588a0ea60ede1f68 Mon Sep 17 00:00:00 2001 From: wangqing Date: Thu, 3 Nov 2022 23:23:11 +0800 Subject: [PATCH 305/438] fix bug Signed-off-by: wangqing --- build-tools/delete_systemapi_plugin.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build-tools/delete_systemapi_plugin.js b/build-tools/delete_systemapi_plugin.js index 1eb44f5833..ac7a6d30ea 100644 --- a/build-tools/delete_systemapi_plugin.js +++ b/build-tools/delete_systemapi_plugin.js @@ -280,7 +280,9 @@ function deleteSystemApi(url) { exports.deleteSystemApi = deleteSystemApi; function isSystemapi(node) { - const notesStr = node.getFullText().replace(node.getText(), "").replace(/[\s]/g, ""); + const notesContent = node.getFullText().replace(node.getText(), "").replace(/[\s]/g, ""); + const notesArr = notesContent.split(/\/\*\*/); + const notesStr = notesArr[notesArr.length - 1]; if (notesStr.length !== 0) { if (ts.isFunctionDeclaration(node) || ts.isMethodSignature(node) || ts.isMethodDeclaration(node)) { lastNodeName = node.name && node.name.escapedText ? node.name.escapedText.toString() : ""; -- Gitee From fdaf1770b09048112d4039f339c480b163fcde2b Mon Sep 17 00:00:00 2001 From: yangzk Date: Fri, 4 Nov 2022 09:57:29 +0800 Subject: [PATCH 306/438] =?UTF-8?q?IssueNo:=20#I5ZEDV=20Description:=20?= =?UTF-8?q?=E5=88=A0=E9=99=A4FormParam=E4=B8=AD=E6=97=A0=E6=95=88=E7=9A=84?= =?UTF-8?q?jsdoc=20Sig:=20SIG=5FApplicationFramework=20Feature=20or=20Bugf?= =?UTF-8?q?ix:=20Feature=20Binary=20Source:=20No?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangzk Change-Id: Iff84948157f891b5517ebffa676ba96784a7d535 --- api/@ohos.app.form.formInfo.d.ts | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/api/@ohos.app.form.formInfo.d.ts b/api/@ohos.app.form.formInfo.d.ts index ee5c9648fe..d075eb7b89 100644 --- a/api/@ohos.app.form.formInfo.d.ts +++ b/api/@ohos.app.form.formInfo.d.ts @@ -265,18 +265,6 @@ declare namespace formInfo { * @since 9 */ enum FormParam { - /** - * Indicates the key specifying the ID of the form to be obtained, which is represented as - * want: { - * "parameters": { - * IDENTITY_KEY: 1L - * } - * }. - * - * @syscap SystemCapability.Ability.Form - * @systemapi - * @since 9 - */ /** * Indicates the key specifying the ID of the form to be obtained, which is represented as * want: { -- Gitee From 65701ed62e32ff0eafa6d7cf3ff5c3f8158e5dc9 Mon Sep 17 00:00:00 2001 From: yangzk Date: Fri, 4 Nov 2022 16:23:20 +0800 Subject: [PATCH 307/438] =?UTF-8?q?IssueNo:=20#I5ZIJ1=20Description:=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8Djsdoc=E9=94=99=E8=AF=AF=20Sig:=20SIG=5FApplic?= =?UTF-8?q?ationFramework=20Feature=20or=20Bugfix:=20Bugfix=20Binary=20Sou?= =?UTF-8?q?rce:=20No?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangzk Change-Id: I09ef59043a13d859b64f230e7314224c5285b364 --- api/application/AbilityContext.d.ts | 4 ---- api/application/UIAbilityContext.d.ts | 4 ---- 2 files changed, 8 deletions(-) diff --git a/api/application/AbilityContext.d.ts b/api/application/AbilityContext.d.ts index 6aee674669..64c9ea8ba9 100755 --- a/api/application/AbilityContext.d.ts +++ b/api/application/AbilityContext.d.ts @@ -530,7 +530,6 @@ export default class AbilityContext extends Context { * request result. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi * @stagemodelonly * @since 9 */ @@ -543,7 +542,6 @@ export default class AbilityContext extends Context { * @returns { Promise } Returns the permission request result. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi * @stagemodelonly * @since 9 */ @@ -554,7 +552,6 @@ export default class AbilityContext extends Context { * @param { LocalStorage } localStorage - the storage data used to restore window stage * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi * @stagemodelonly * @since 9 */ @@ -564,7 +561,6 @@ export default class AbilityContext extends Context { * check to see ability is in terminating state. * @returns { boolean } Returns true when ability is in terminating state, else returns false. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi * @stagemodelonly * @since 9 */ diff --git a/api/application/UIAbilityContext.d.ts b/api/application/UIAbilityContext.d.ts index b7efdaf278..0c5e2e0f64 100755 --- a/api/application/UIAbilityContext.d.ts +++ b/api/application/UIAbilityContext.d.ts @@ -484,7 +484,6 @@ export default class UIAbilityContext extends Context { * request result. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi * @stagemodelonly * @since 9 */ @@ -497,7 +496,6 @@ export default class UIAbilityContext extends Context { * @returns { Promise } Returns the permission request result. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi * @stagemodelonly * @since 9 */ @@ -508,7 +506,6 @@ export default class UIAbilityContext extends Context { * @param { LocalStorage } localStorage - the storage data used to restore window stage * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi * @stagemodelonly * @since 9 */ @@ -518,7 +515,6 @@ export default class UIAbilityContext extends Context { * Check to see ability is in terminating state. * @returns { boolean } Returns true when ability is in terminating state, else returns false. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @systemapi * @stagemodelonly * @since 9 */ -- Gitee From 745f0edb9ef690c2d71ebac0a826f85463347adf Mon Sep 17 00:00:00 2001 From: duanweiling Date: Mon, 7 Nov 2022 15:15:19 +0800 Subject: [PATCH 308/438] =?UTF-8?q?Context=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: duanweiling --- api/@ohos.data.preferences.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.data.preferences.d.ts b/api/@ohos.data.preferences.d.ts index 3129833c98..dabe5d7527 100644 --- a/api/@ohos.data.preferences.d.ts +++ b/api/@ohos.data.preferences.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ import {AsyncCallback, Callback} from './basic'; -import Context from "./application/Context"; +import Context from "./application/BaseContext"; /** * Provides interfaces to obtain and modify preferences data. -- Gitee From 7a654993243837961174f62c15b640afd73ca18d Mon Sep 17 00:00:00 2001 From: lijunru Date: Mon, 7 Nov 2022 17:06:46 +0800 Subject: [PATCH 309/438] Generate module info in the ninja phase Signed-off-by: lijunru Change-Id: I3e365e2477e9172de0d597af1ee8e1c6c5938d12 --- BUILD.gn | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BUILD.gn b/BUILD.gn index 3f503cae75..05e562c183 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -65,6 +65,7 @@ if (!sdk_build_public) { template("ohos_declaration_template") { forward_variables_from(invoker, "*") + _module_info_target = "/ohos_declaration/${target_name}_info" action_with_pydeps(target_name) { script = "//interface/sdk-js/remove_internal.py" input_api_dir = "//interface/sdk-js/api" @@ -80,8 +81,12 @@ template("ohos_declaration_template") { rebase_path(root_out_dir + "/ohos_declaration/$target_name/", root_build_dir), ] + if (defined(deps)) { + deps += [ ":$_module_info_target" ] + } else { + deps = [ ":$_module_info_target" ] + } } - _module_info_target = "/ohos_declaration/${target_name}_info" _target_name = target_name generate_module_info(_module_info_target) { module_type = "jsdoc" -- Gitee From ecabaeba9d83ff9b40c1e40aa4135c2da897bbff Mon Sep 17 00:00:00 2001 From: wanghang Date: Wed, 9 Nov 2022 07:33:07 +0000 Subject: [PATCH 310/438] IssueNo:#I60AMD Description:add errCode Sig:SIG_ApplicaitonFramework Feature or Bugfix:Feature Binary Source:No Signed-off-by: wanghang Change-Id: I985243c7585bf018e968e197038142f2ef6eb07f --- api/@ohos.bundle.bundleManager.d.ts | 6 ++++-- api/@ohos.bundle.bundleMonitor.d.ts | 4 ++-- api/bundleManager/permissionDef.d.ts | 8 ++++---- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/api/@ohos.bundle.bundleManager.d.ts b/api/@ohos.bundle.bundleManager.d.ts index 531c720dc2..49c47e6b98 100644 --- a/api/@ohos.bundle.bundleManager.d.ts +++ b/api/@ohos.bundle.bundleManager.d.ts @@ -1047,7 +1047,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @param { AsyncCallback> } callback - The callback of returning string in json-format of the corresponding config file. * @throws { BusinessError } 401 - Input parameters check failed. * @throws { BusinessError } 17700002 - The specified moduleName is not existed. - * @throws { BusinessError } 17700003 - The specified anilityName is not existed. + * @throws { BusinessError } 17700003 - The specified abilityName is not existed. * @throws { BusinessError } 17700024 - The specified metadataName is not existed or the profile is not json-format. * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @throws { BusinessError } 17700029 - The specified ability is disabled. @@ -1064,7 +1064,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @returns { Promise> } Returns string in json-format of the corresponding config file. * @throws { BusinessError } 401 - Input parameters check failed. * @throws { BusinessError } 17700002 - The specified moduleName is not existed. - * @throws { BusinessError } 17700003 - The specified anilityName is not existed. + * @throws { BusinessError } 17700003 - The specified abilityName is not existed. * @throws { BusinessError } 17700024 - The specified metadataName is not existed or the profile is not json-format. * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @throws { BusinessError } 17700029 - The specified ability is disabled. @@ -1228,6 +1228,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 17700001 - The specified bundleName is not found. * @throws { BusinessError } 17700004 - The specified userId is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi * @since 9 @@ -1246,6 +1247,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 17700001 - The specified bundleName is not found. * @throws { BusinessError } 17700004 - The specified userId is not found. + * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi * @since 9 diff --git a/api/@ohos.bundle.bundleMonitor.d.ts b/api/@ohos.bundle.bundleMonitor.d.ts index 7067c2299c..b56af8dda5 100644 --- a/api/@ohos.bundle.bundleMonitor.d.ts +++ b/api/@ohos.bundle.bundleMonitor.d.ts @@ -37,14 +37,14 @@ declare namespace bundleMonitor { * @systemapi * @since 9 */ - bundleName: string; + readonly bundleName: string; /** * The user id * @type {number} * @systemapi * @since 9 */ - userId: number; + readonly userId: number; } /** diff --git a/api/bundleManager/permissionDef.d.ts b/api/bundleManager/permissionDef.d.ts index 2d2cc327a2..56aa968b62 100644 --- a/api/bundleManager/permissionDef.d.ts +++ b/api/bundleManager/permissionDef.d.ts @@ -27,7 +27,7 @@ * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ - permissionName: string; + readonly permissionName: string; /** * Indicates the grant mode of this permission @@ -35,7 +35,7 @@ * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ - grantMode: number; + readonly grantMode: number; /** * Indicates the labelId of this permission @@ -43,7 +43,7 @@ * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ - labelId: number; + readonly labelId: number; /** * Indicates the descriptionId of this permission @@ -51,5 +51,5 @@ * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ - descriptionId: number; + readonly descriptionId: number; } \ No newline at end of file -- Gitee From 6edc9e792d7a1c06c5471901a6cc484a0d390ea0 Mon Sep 17 00:00:00 2001 From: wangtiantian Date: Thu, 10 Nov 2022 14:48:45 +0800 Subject: [PATCH 311/438] IssueNo:#I60HTO Description:deprecated hasInstalled Sig:SIG_ApplicaitonFramework Feature or Bugfix:Bugfix Binary Source:No Signed-off-by: wangtiantian --- api/@system.package.d.ts | 4 ++++ api/bundle/shortcutInfo.d.ts | 2 +- api/bundleManager/shortcutInfo.d.ts | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/api/@system.package.d.ts b/api/@system.package.d.ts index 7a667d63cc..548e4ec621 100644 --- a/api/@system.package.d.ts +++ b/api/@system.package.d.ts @@ -16,6 +16,7 @@ /** * @syscap SystemCapability.BundleManager.BundleFramework * @since 3 + * @deprecated since 9 */ export interface CheckPackageHasInstalledResponse { /** @@ -29,6 +30,7 @@ export interface CheckPackageHasInstalledResponse { /** * @syscap SystemCapability.BundleManager.BundleFramework * @since 3 + * @deprecated since 9 */ export interface CheckPackageHasInstalledOptions { /** @@ -64,12 +66,14 @@ export interface CheckPackageHasInstalledOptions { * @syscap SystemCapability.BundleManager.BundleFramework * @since 3 * @import package from '@system.package'; + * @deprecated since 9 */ export default class Package { /** * Checks whethers an application exists, or whether a native application has been installed. * @param options Options * @syscap SystemCapability.BundleManager.BundleFramework + * @deprecated since 9 */ static hasInstalled(options: CheckPackageHasInstalledOptions): void; } \ No newline at end of file diff --git a/api/bundle/shortcutInfo.d.ts b/api/bundle/shortcutInfo.d.ts index 353a5241a9..cc3bf43326 100644 --- a/api/bundle/shortcutInfo.d.ts +++ b/api/bundle/shortcutInfo.d.ts @@ -73,7 +73,7 @@ */ readonly icon: string; /** - * @default Indicate s the icon id of the shortcut + * @default Indicates the icon id of the shortcut * @since 8 * @syscap SystemCapability.BundleManager.BundleFramework */ diff --git a/api/bundleManager/shortcutInfo.d.ts b/api/bundleManager/shortcutInfo.d.ts index 615f46d1fc..85d95df447 100644 --- a/api/bundleManager/shortcutInfo.d.ts +++ b/api/bundleManager/shortcutInfo.d.ts @@ -62,7 +62,7 @@ readonly icon: string; /** - * Indicate s the icon id of the shortcut + * Indicates the icon id of the shortcut * @type {number} * @syscap SystemCapability.BundleManager.BundleFramework.Launcher * @since 9 -- Gitee From 74442631108222650a69cb811fb33256f794f3db Mon Sep 17 00:00:00 2001 From: caiminggang Date: Thu, 10 Nov 2022 19:19:37 +0800 Subject: [PATCH 312/438] =?UTF-8?q?=E9=87=8D=E5=91=BD=E5=90=8Denterprise?= =?UTF-8?q?=20device=20management=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: caiminggang --- ...rise.EnterpriseAdminExtensionAbility.d.ts} | 5 +- ....ts => @ohos.enterprise.adminManager.d.ts} | 78 +++++++++++-------- ... => @ohos.enterprise.datetimeManager.d.ts} | 41 +++++++--- api/@ohos.enterprise.deviceInfo.d.ts | 63 +++++++++++++++ 4 files changed, 145 insertions(+), 42 deletions(-) rename api/{@ohos.EnterpriseAdminExtensionAbility.d.ts => @ohos.enterprise.EnterpriseAdminExtensionAbility.d.ts} (97%) rename api/{@ohos.enterpriseDeviceManager.d.ts => @ohos.enterprise.adminManager.d.ts} (94%) rename api/{enterpriseDeviceManager/DeviceSettingsManager.d.ts => @ohos.enterprise.datetimeManager.d.ts} (50%) create mode 100644 api/@ohos.enterprise.deviceInfo.d.ts diff --git a/api/@ohos.EnterpriseAdminExtensionAbility.d.ts b/api/@ohos.enterprise.EnterpriseAdminExtensionAbility.d.ts similarity index 97% rename from api/@ohos.EnterpriseAdminExtensionAbility.d.ts rename to api/@ohos.enterprise.EnterpriseAdminExtensionAbility.d.ts index e968d3ff4b..6cd8d1a83f 100644 --- a/api/@ohos.EnterpriseAdminExtensionAbility.d.ts +++ b/api/@ohos.enterprise.EnterpriseAdminExtensionAbility.d.ts @@ -18,6 +18,7 @@ * * @since 9 * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi * @StageModelOnly */ export default class EnterpriseAdminExtensionAbility { @@ -26,15 +27,17 @@ export default class EnterpriseAdminExtensionAbility { * * @since 9 * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi * @StageModelOnly */ onAdminEnabled(): void; - + /** * Called back when an application is disabled. * * @since 9 * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi * @StageModelOnly */ onAdminDisabled(): void; diff --git a/api/@ohos.enterpriseDeviceManager.d.ts b/api/@ohos.enterprise.adminManager.d.ts similarity index 94% rename from api/@ohos.enterpriseDeviceManager.d.ts rename to api/@ohos.enterprise.adminManager.d.ts index 08f6c2cb53..52fded9d16 100644 --- a/api/@ohos.enterpriseDeviceManager.d.ts +++ b/api/@ohos.enterprise.adminManager.d.ts @@ -14,44 +14,70 @@ */ import { AsyncCallback, Callback } from "./basic"; -import { DeviceSettingsManager as _DeviceSettingsManager } from "./enterpriseDeviceManager/DeviceSettingsManager"; -import Want from "./@ohos.application.Want"; +import Want from "./@ohos.app.ability.Want"; /** - * enterprise device manager. - * @name enterpriseDeviceManager - * @since 9 + * This module provides the capability to manage the administrator of the enterprise devices. + * @namespace adminManager * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @since 9 */ -declare namespace enterpriseDeviceManager { +declare namespace adminManager { /** - * @name EnterpriseInfo - * @since 9 + * Provides the enterprise information. + * @typedef EnterpriseInfo * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @since 9 */ export interface EnterpriseInfo { + /** + * The name of enterprise. + * @type {string} + * @since 9 + */ name: string; + + /** + * The description of enterprise. + * @type {string} + * @since 9 + */ description: string; } /** - * @name DeviceSettingsManager - * @since 9 + * Enum for type of administrator. + * @enum {number} * @syscap SystemCapability.Customization.EnterpriseDeviceManager - */ - export type DeviceSettingsManager = _DeviceSettingsManager - - /** - * @name AdminType + * @systemapi * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager */ export enum AdminType { + /** + * The value of normal administrator. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ ADMIN_TYPE_NORMAL = 0x00, + + /** + * The value of super administrator. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @since 9 + */ ADMIN_TYPE_SUPER = 0x01 } + /** + * Enum for managed event + * @enum {number} + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @since 9 + */ export enum ManagedEvent { /** @@ -255,7 +281,7 @@ declare namespace enterpriseDeviceManager { * Get information of the administrator's enterprise. * @param { Want } admin - admin indicates the administrator ability information. * @param { AsyncCallback } callback - callback contained the enterprise info of administrator. - * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200001 - the application is not an administrator of the device. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -268,7 +294,7 @@ declare namespace enterpriseDeviceManager { * Get information of the administrator's enterprise. * @param { Want } admin - admin indicates the administrator ability information. * @returns { Promise } promise contained the enterprise info of administrator. - * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200001 - the application is not an administrator of the device. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi @@ -284,7 +310,7 @@ declare namespace enterpriseDeviceManager { * @param { Want } admin - admin indicates the administrator ability information. * @param { EnterpriseInfo } enterpriseInfo - enterpriseInfo indicates the enterprise information of the calling application. * @param { AsyncCallback } callback - the callback of setEnterpriseInfo. - * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200001 - the application is not an administrator of the device. * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager @@ -301,7 +327,7 @@ declare namespace enterpriseDeviceManager { * @param { Want } admin - admin indicates the administrator ability information. * @param { EnterpriseInfo } enterpriseInfo - enterpriseInfo indicates the enterprise information of the calling application. * @returns { Promise } the promise returned by the setEnterpriseInfo. - * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. + * @throws { BusinessError } 9200001 - the application is not an administrator of the device. * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager @@ -335,16 +361,6 @@ declare namespace enterpriseDeviceManager { */ function isSuperAdmin(bundleName: String): Promise; - /** - * Obtains the interface used to set device settings policy. - * - * @since 9 - * @syscap SystemCapability.Customization.EnterpriseDeviceManager - * @return Returns the DeviceSettingsManager interface. - */ - function getDeviceSettingsManager(callback: AsyncCallback): void; - function getDeviceSettingsManager(): Promise; - /** * Subscribes the managed event of admin. * @permission ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT @@ -414,4 +430,4 @@ declare namespace enterpriseDeviceManager { function unsubscribeManagedEvent(admin: Want, managedEvents: Array): Promise; } -export default enterpriseDeviceManager; \ No newline at end of file +export default adminManager; \ No newline at end of file diff --git a/api/enterpriseDeviceManager/DeviceSettingsManager.d.ts b/api/@ohos.enterprise.datetimeManager.d.ts similarity index 50% rename from api/enterpriseDeviceManager/DeviceSettingsManager.d.ts rename to api/@ohos.enterprise.datetimeManager.d.ts index b8c6467071..c9186257c5 100644 --- a/api/enterpriseDeviceManager/DeviceSettingsManager.d.ts +++ b/api/@ohos.enterprise.datetimeManager.d.ts @@ -13,15 +13,35 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from "./../basic"; -import Want from "./../@ohos.application.Want"; +import { AsyncCallback } from "./basic"; +import Want from "./@ohos.app.ability.Want"; /** - * @name Offers set settings policies on the devices. - * @since 9 + * This module provides the capability to manage the datetime of the enterprise devices. + * @namespace dateTimeManager. * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @since 9 */ -export interface DeviceSettingsManager { +declare namespace dateTimeManager { + + /** + * Sets the system time. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_SET_DATETIME + * @param { Want } admin - admin indicates the administrator ability information. + * @param { number } time - time indicates rhe target time stamp (ms). + * @param { AsyncCallback } callback - the callback of setDateTime. + * @throws { BusinessError } 9200001 - the application is not an administrator of the device. + * @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function setDateTime(admin: Want, time: number, callback: AsyncCallback): void; /** * Sets the system time. @@ -30,8 +50,8 @@ export interface DeviceSettingsManager { * @param { Want } admin - admin indicates the administrator ability information. * @param { number } time - time indicates rhe target time stamp (ms). * @returns { Promise } the promise returned by the setDateTime. - * @throws { BusinessError } 9200001 - the applicayion is not an administrator of the device. - * @throws { BusinessError } 9200002 - the administrator applicayion does not have permission to manage the device. + * @throws { BusinessError } 9200001 - the application is not an administrator of the device. + * @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device. * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager @@ -39,6 +59,7 @@ export interface DeviceSettingsManager { * @stagemodelonly * @since 9 */ - setDateTime(admin: Want, time: number, callback: AsyncCallback): void; - setDateTime(admin: Want, time: number): Promise; -} \ No newline at end of file + function setDateTime(admin: Want, time: number): Promise; +} + +export default dateTimeManager; \ No newline at end of file diff --git a/api/@ohos.enterprise.deviceInfo.d.ts b/api/@ohos.enterprise.deviceInfo.d.ts new file mode 100644 index 0000000000..b1ebb9170a --- /dev/null +++ b/api/@ohos.enterprise.deviceInfo.d.ts @@ -0,0 +1,63 @@ +/* + * 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 { AsyncCallback } from "./basic"; +import Want from "./@ohos.app.ability.Want"; + +/** + * This module provides the capability to manage the device info of the enterprise devices. + * @namespace deviceInfo. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @since 9 + */ +declare namespace deviceInfo { + + /** + * Gets the device serial. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_DEVICE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { AsyncCallback } callback - the callback of getDeviceSerial. + * @throws { BusinessError } 9200001 - the application is not an administrator of the device. + * @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getDeviceSerial(admin: Want, callback: AsyncCallback): void; + + /** + * Gets the device serial. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_DEVICE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @returns { Promise } the promise returned by the getDeviceSerial. + * @throws { BusinessError } 9200001 - the application is not an administrator of the device. + * @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @stagemodelonly + * @since 9 + */ + function getDeviceSerial(admin: Want): Promise; +} + +export default deviceInfo; \ No newline at end of file -- Gitee From ab5a24193fea9dd798e3d975b4c24d2d317b3235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=94=A1=E6=98=8E=E6=B8=AF?= Date: Fri, 11 Nov 2022 10:23:42 +0000 Subject: [PATCH 313/438] rename api/@ohos.enterprise.datetimeManager.d.ts to api/@ohos.enterprise.dateTimeManager.d.ts. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 蔡明港 --- ...datetimeManager.d.ts => @ohos.enterprise.dateTimeManager.d.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename api/{@ohos.enterprise.datetimeManager.d.ts => @ohos.enterprise.dateTimeManager.d.ts} (100%) diff --git a/api/@ohos.enterprise.datetimeManager.d.ts b/api/@ohos.enterprise.dateTimeManager.d.ts similarity index 100% rename from api/@ohos.enterprise.datetimeManager.d.ts rename to api/@ohos.enterprise.dateTimeManager.d.ts -- Gitee From 7570b108dd67d41ca2471a9d9ed6ebb60f35df1a Mon Sep 17 00:00:00 2001 From: yanmengzhao1 Date: Mon, 14 Nov 2022 19:40:05 +0800 Subject: [PATCH 314/438] fix faultlogger.d.ts spell error Signed-off-by: yanmengzhao1 --- api/@ohos.faultLogger.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.faultLogger.d.ts b/api/@ohos.faultLogger.d.ts index 5162e428f6..6012002f0f 100644 --- a/api/@ohos.faultLogger.d.ts +++ b/api/@ohos.faultLogger.d.ts @@ -1,5 +1,5 @@ /* -* Copyright (C) 2021 Huawei Device Co., Ltd. +* Copyright (C) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -48,7 +48,7 @@ declare namespace FaultLogger { */ JS_CRASH = 3, /** - * APP_FREEZE app feeeze log type. + * APP_FREEZE app freeze log type. * @syscap SystemCapability.HiviewDFX.Hiview.FaultLogger * @since 8 */ -- Gitee From fe83ba6c31123a61fdacc41866fe2be9c5b0e2a7 Mon Sep 17 00:00:00 2001 From: crazy_hu Date: Tue, 15 Nov 2022 03:11:51 +0000 Subject: [PATCH 315/438] update jsdoc returns Signed-off-by: crazy_hu --- api/@ohos.rpc.d.ts | 308 ++++++++++++++++++++++----------------------- 1 file changed, 154 insertions(+), 154 deletions(-) diff --git a/api/@ohos.rpc.d.ts b/api/@ohos.rpc.d.ts index a2fe2513a3..0a9049cdaf 100644 --- a/api/@ohos.rpc.d.ts +++ b/api/@ohos.rpc.d.ts @@ -90,7 +90,7 @@ declare namespace rpc { class MessageParcel { /** * Creates an empty {@link MessageParcel} object. - * @return Returns the object created. + * @returns Returns the object created. * @since 7 */ static create(): MessageParcel; @@ -104,14 +104,14 @@ declare namespace rpc { /** * Serializes a remote object and writes it to the {@link MessageParcel} object. * @param object Remote object to serialize. - * @return Returns true if it is successful; returns false otherwise. + * @returns Returns true if it is successful; returns false otherwise. * @since 7 */ writeRemoteObject(object: IRemoteObject): boolean; /** * Reads a remote object from {@link MessageParcel} object. - * @return Returns the remote object. + * @returns Returns the remote object. * @since 7 */ readRemoteObject(): IRemoteObject; @@ -119,7 +119,7 @@ declare namespace rpc { /** * Writes an interface token into the {@link MessageParcel} object. * @param token Interface descriptor to write. - * @return Returns {@code true} if the interface token has been written into the {@link MessageParcel}; + * @returns Returns {@code true} if the interface token has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @since 7 */ @@ -127,21 +127,21 @@ declare namespace rpc { /** * Reads an interface token from the {@link MessageParcel} object. - * @return Returns a string value. + * @returns Returns a string value. * @since 7 */ readInterfaceToken(): string; /** * Obtains the size of data (in bytes) contained in the {@link MessageParcel} object. - * @return Returns the size of data contained in the {@link MessageParcel} object. + * @returns Returns the size of data contained in the {@link MessageParcel} object. * @since 7 */ getSize(): number; /** * Obtains the storage capacity (in bytes) of the {@link MessageParcel} object. - * @return Returns the storage capacity of the {@link MessageParcel} object. + * @returns Returns the storage capacity of the {@link MessageParcel} object. * @since 7 */ getCapacity(): number; @@ -152,7 +152,7 @@ declare namespace rpc { * than the storage capacity of the {@link MessageParcel}. * * @param size Indicates the data size of the {@link MessageParcel} object. - * @return Returns {@code true} if the setting is successful; returns {@code false} otherwise. + * @returns Returns {@code true} if the setting is successful; returns {@code false} otherwise. * @since 7 */ setSize(size: number): boolean; @@ -163,7 +163,7 @@ declare namespace rpc { * the size of data contained in the {@link MessageParcel}. * * @param size Indicates the storage capacity of the {@link MessageParcel} object. - * @return Returns {@code true} if the setting is successful; returns {@code false} otherwise. + * @returns Returns {@code true} if the setting is successful; returns {@code false} otherwise. * @since 7 */ setCapacity(size: number): boolean; @@ -172,7 +172,7 @@ declare namespace rpc { * Obtains the writable data space (in bytes) in the {@link MessageParcel} object. *

Writable data space = Storage capacity of the {@link MessageParcel} – Size of data contained in the {@link MessageParcel}. * - * @return Returns the writable data space of the {@link MessageParcel} object. + * @returns Returns the writable data space of the {@link MessageParcel} object. * @since 7 */ getWritableBytes(): number; @@ -181,21 +181,21 @@ declare namespace rpc { * Obtains the readable data space (in bytes) in the {@link MessageParcel} object. *

Readable data space = Size of data contained in the {@link MessageParcel} – Size of data that has been read. * - * @return Returns the readable data space of the {@link MessageParcel} object. + * @returns Returns the readable data space of the {@link MessageParcel} object. * @since 7 */ getReadableBytes(): number; /** * Obtains the current read position in the {@link MessageParcel} object. - * @return Returns the current read position in the {@link MessageParcel} object. + * @returns Returns the current read position in the {@link MessageParcel} object. * @since 7 */ getReadPosition(): number; /** * Obtains the current write position in the {@link MessageParcel} object. - * @return Returns the current write position in the {@link MessageParcel} object. + * @returns Returns the current write position in the {@link MessageParcel} object. * @since 7 */ getWritePosition(): number; @@ -206,7 +206,7 @@ declare namespace rpc { * change it, change it to an accurate position. Otherwise, the read data may be incorrect. * * @param pos Indicates the target position to start data reading. - * @return Returns {@code true} if the read position is changed; returns {@code false} otherwise. + * @returns Returns {@code true} if the read position is changed; returns {@code false} otherwise. * @since 7 */ rewindRead(pos: number): boolean; @@ -217,7 +217,7 @@ declare namespace rpc { * change it, change it to an accurate position. Otherwise, the data to be read may be incorrect. * * @param pos Indicates the target position to start data writing. - * @return Returns {@code true} if the write position is changed; returns {@code false} otherwise. + * @returns Returns {@code true} if the write position is changed; returns {@code false} otherwise. * @since 7 */ rewindWrite(pos: number): boolean; @@ -242,7 +242,7 @@ declare namespace rpc { /** * Writes a byte value into the {@link MessageParcel} object. * @param val Indicates the byte value to write. - * @return Returns {@code true} if the value has been written into the {@link MessageParcel}; + * @returns Returns {@code true} if the value has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. @@ -253,7 +253,7 @@ declare namespace rpc { /** * Writes a short integer value into the {@link MessageParcel} object. * @param val Indicates the short integer value to write. - * @return Returns {@code true} if the value has been written into the {@link MessageParcel}; + * @returns Returns {@code true} if the value has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. @@ -264,7 +264,7 @@ declare namespace rpc { /** * Writes an integer value into the {@link MessageParcel} object. * @param val Indicates the integer value to write. - * @return Returns {@code true} if the value has been written into the {@link MessageParcel}; + * @returns Returns {@code true} if the value has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. @@ -275,7 +275,7 @@ declare namespace rpc { /** * Writes a long integer value into the {@link MessageParcel} object. * @param val Indicates the long integer value to write. - * @return Returns {@code true} if the value has been written into the {@link MessageParcel}; + * @returns Returns {@code true} if the value has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. @@ -286,7 +286,7 @@ declare namespace rpc { /** * Writes a floating point value into the {@link MessageParcel} object. * @param val Indicates the floating point value to write. - * @return Returns {@code true} if the value has been written into the {@link MessageParcel}; + * @returns Returns {@code true} if the value has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. @@ -297,7 +297,7 @@ declare namespace rpc { /** * Writes a double-precision floating point value into the {@link MessageParcel} object. * @param val Indicates the double-precision floating point value to write. - * @return Returns {@code true} if the value has been written into the {@link MessageParcel}; + * @returns Returns {@code true} if the value has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. @@ -308,7 +308,7 @@ declare namespace rpc { /** * Writes a boolean value into the {@link MessageParcel} object. * @param val Indicates the boolean value to write. - * @return Returns {@code true} if the value has been written into the {@link MessageParcel}; + * @returns Returns {@code true} if the value has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. @@ -319,7 +319,7 @@ declare namespace rpc { /** * Writes a single character value into the {@link MessageParcel} object. * @param val Indicates the single character value to write. - * @return Returns {@code true} if the value has been written into the {@link MessageParcel}; + * @returns Returns {@code true} if the value has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. @@ -330,7 +330,7 @@ declare namespace rpc { /** * Writes a string value into the {@link MessageParcel} object. * @param val Indicates the string value to write. - * @return Returns {@code true} if the value has been written into the {@link MessageParcel}; + * @returns Returns {@code true} if the value has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. @@ -350,7 +350,7 @@ declare namespace rpc { /** * Writes a byte array into the {@link MessageParcel} object. * @param byteArray Indicates the byte array to write. - * @return Returns {@code true} if the array has been written into the {@link MessageParcel}; + * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. @@ -361,7 +361,7 @@ declare namespace rpc { /** * Writes a short integer array into the {@link MessageParcel} object. * @param shortArray Indicates the short integer array to write. - * @return Returns {@code true} if the array has been written into the {@link MessageParcel}; + * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. @@ -374,7 +374,7 @@ declare namespace rpc { /** * Writes an integer array into the {@link MessageParcel} object. * @param intArray Indicates the integer array to write. - * @return Returns {@code true} if the array has been written into the {@link MessageParcel}; + * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. @@ -387,7 +387,7 @@ declare namespace rpc { /** * Writes a long integer array into the {@link MessageParcel} object. * @param longArray Indicates the long integer array to write. - * @return Returns {@code true} if the array has been written into the {@link MessageParcel}; + * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. @@ -400,7 +400,7 @@ declare namespace rpc { /** * Writes a floating point array into the {@link MessageParcel} object. * @param floatArray Indicates the floating point array to write. - * @return Returns {@code true} if the array has been written into the {@link MessageParcel}; + * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. @@ -413,7 +413,7 @@ declare namespace rpc { /** * Writes a double-precision floating point array into the {@link MessageParcel} object. * @param doubleArray Indicates the double-precision floating point array to write. - * @return Returns {@code true} if the array has been written into the {@link MessageParcel}; + * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. @@ -426,7 +426,7 @@ declare namespace rpc { /** * Writes a boolean array into the {@link MessageParcel} object. * @param booleanArray Indicates the boolean array to write. - * @return Returns {@code true} if the array has been written into the {@link MessageParcel}; + * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. @@ -439,7 +439,7 @@ declare namespace rpc { /** * Writes a single character array into the {@link MessageParcel} object. * @param charArray Indicates the single character array to write. - * @return Returns {@code true} if the array has been written into the {@link MessageParcel}; + * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. @@ -452,7 +452,7 @@ declare namespace rpc { /** * Writes a string array into the {@link MessageParcel} object. * @param stringArray Indicates the string array to write. - * @return Returns {@code true} if the array has been written into the {@link MessageParcel}; + * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. @@ -465,7 +465,7 @@ declare namespace rpc { /** * Writes a {@link Sequenceable} object array into the {@link MessageParcel} object. * @param sequenceableArray Indicates the {@link Sequenceable} object array to write. - * @return Returns {@code true} if the array has been written into the {@link MessageParcel}; + * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. @@ -476,7 +476,7 @@ declare namespace rpc { /** * Writes an array of {@link IRemoteObject} objects to this {@link MessageParcel} object. * @param objectArray Array of {@link IRemoteObject} objects to write. - * @return Returns {@code true} if the {@link IRemoteObject} array is successfully written to the {@link MessageParcel}; + * @returns Returns {@code true} if the {@link IRemoteObject} array is successfully written to the {@link MessageParcel}; * returns false if the {@link IRemoteObject} array is null or fails to be written to the {@lini MessageParcel}. * @since 8 */ @@ -484,63 +484,63 @@ declare namespace rpc { /** * Reads a byte value from the {@link MessageParcel} object. - * @return Returns a byte value. + * @returns Returns a byte value. * @since 7 */ readByte(): number; /** * Reads a short integer value from the {@link MessageParcel} object. - * @return Returns a short integer value. + * @returns Returns a short integer value. * @since 7 */ readShort(): number; /** * Reads an integer value from the {@link MessageParcel} object. - * @return Returns an integer value. + * @returns Returns an integer value. * @since 7 */ readInt(): number; /** * Reads a long integer value from the {@link MessageParcel} object. - * @return Returns a long integer value. + * @returns Returns a long integer value. * @since 7 */ readLong(): number; /** * Reads a floating point value from the {@link MessageParcel} object. - * @return Returns a floating point value. + * @returns Returns a floating point value. * @since 7 */ readFloat(): number; /** * Reads a double-precision floating point value from the {@link MessageParcel} object. - * @return Returns a double-precision floating point value. + * @returns Returns a double-precision floating point value. * @since 7 */ readDouble(): number; /** * Reads a boolean value from the {@link MessageParcel} object. - * @return Returns a boolean value. + * @returns Returns a boolean value. * @since 7 */ readBoolean(): boolean; /** * Reads a single character value from the {@link MessageParcel} object. - * @return Returns a single character value. + * @returns Returns a single character value. * @since 7 */ readChar(): number; /** * Reads a string value from the {@link MessageParcel} object. - * @return Returns a string value. + * @returns Returns a string value. * @since 7 */ readString(): string; @@ -549,7 +549,7 @@ declare namespace rpc { * Reads a {@link Sequenceable} object from the {@link MessageParcel} instance. * @param dataIn Indicates the {@link Sequenceable} object that needs to perform the {@code unmarshalling} operation * using the {@link MessageParcel}. - * @return Returns {@code true} if the unmarshalling is successful; returns {@code false} otherwise. + * @returns Returns {@code true} if the unmarshalling is successful; returns {@code false} otherwise. * @since 7 */ readSequenceable(dataIn: Sequenceable) : boolean; @@ -557,7 +557,7 @@ declare namespace rpc { /** * Writes a byte array into the {@link MessageParcel} object. * @param dataIn Indicates the byte array read from MessageParcel. - * @return Returns {@code true} if the array has been written into the {@link MessageParcel}; + * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this MessageParcel is insufficient, * exception message: {@link *MessageParcelException#NO_CAPACITY_ERROR}. @@ -567,7 +567,7 @@ declare namespace rpc { /** * Reads a byte array from the {@link MessageParcel} object. - * @return Returns a byte array. + * @returns Returns a byte array. * @since 7 */ readByteArray(): number[]; @@ -581,7 +581,7 @@ declare namespace rpc { /** * Reads a short integer array from the {@link MessageParcel} object. - * @return Returns a short integer array. + * @returns Returns a short integer array. * @since 7 */ readShortArray(): number[]; @@ -596,7 +596,7 @@ declare namespace rpc { /** * Reads an integer array from the {@link MessageParcel} object. - * @return Returns an integer array. + * @returns Returns an integer array. * @since 7 */ readIntArray(): number[]; @@ -611,7 +611,7 @@ declare namespace rpc { /** * Reads a long integer array from the {@link MessageParcel} object. - * @return Returns a long integer array. + * @returns Returns a long integer array. * @since 7 */ readLongArray(): number[]; @@ -626,7 +626,7 @@ declare namespace rpc { /** * Reads a floating point array from the {@link MessageParcel} object. - * @return Returns a floating point array. + * @returns Returns a floating point array. * @since 7 */ readFloatArray(): number[]; @@ -641,7 +641,7 @@ declare namespace rpc { /** * Reads a double-precision floating point array from the {@link MessageParcel} object. - * @return Returns a double-precision floating point array. + * @returns Returns a double-precision floating point array. * @since 7 */ readDoubleArray(): number[]; @@ -656,7 +656,7 @@ declare namespace rpc { /** * Reads a boolean array from the {@link MessageParcel} object. - * @return Returns a boolean array. + * @returns Returns a boolean array. * @since 7 */ readBooleanArray(): boolean[]; @@ -671,7 +671,7 @@ declare namespace rpc { /** * Reads a single character array from the {@link MessageParcel} object. - * @return Returns a single character array. + * @returns Returns a single character array. * @since 7 */ readCharArray(): number[]; @@ -686,7 +686,7 @@ declare namespace rpc { /** * Reads a string array from the {@link MessageParcel} object. - * @return Returns a string array. + * @returns Returns a string array. * @since 7 */ readStringArray(): string[]; @@ -707,7 +707,7 @@ declare namespace rpc { /** * Reads {@link IRemoteObject} objects from this {@link MessageParcel} object. - * @return An array of {@link IRemoteObject} objects obtained. + * @returns An array of {@link IRemoteObject} objects obtained. * @since 8 */ readRemoteObjectArray(): IRemoteObject[]; @@ -722,14 +722,14 @@ declare namespace rpc { /** * Duplicates the specified file descriptor. * @param fd File descriptor to be duplicated. - * @return A duplicated file descriptor. + * @returns A duplicated file descriptor. * @since 8 */ static dupFileDescriptor(fd: number) :number; /** * Checks whether this {@link MessageParcel} object contains a file descriptor. - * @return Returns true if the {@link MessageParcel} object contains a file descriptor; + * @returns Returns true if the {@link MessageParcel} object contains a file descriptor; * returns false otherwise. * @since 8 */ @@ -738,14 +738,14 @@ declare namespace rpc { /** * Writes a file descriptor to this {@link MessageParcel} object. * @param fd File descriptor to wrote. - * @return Returns true if the operation is successful; returns false otherwise. + * @returns Returns true if the operation is successful; returns false otherwise. * @since 8 */ writeFileDescriptor(fd: number): boolean; /** * Reads a file descriptor from this {@link MessageParcel} object. - * @return File descriptor obtained. + * @returns File descriptor obtained. * @since 8 */ readFileDescriptor(): number; @@ -753,21 +753,21 @@ declare namespace rpc { /** * Writes an anonymous shared memory object to this {@link MessageParcel} object. * @param ashmem Anonymous shared memory object to wrote. - * @return Returns true if the operation is successful; returns false otherwise. + * @returns Returns true if the operation is successful; returns false otherwise. * @since 8 */ writeAshmem(ashmem: Ashmem): boolean; /** * Reads the anonymous shared memory object from this {@link MessageParcel} object. - * @return Anonymous share object obtained. + * @returns Anonymous share object obtained. * @since 8 */ readAshmem(): Ashmem; /** * Obtains the maximum amount of raw data that can be sent in a time. - * @return 128 MB. + * @returns 128 MB. * @since 8 */ getRawDataCapacity(): number; @@ -776,7 +776,7 @@ declare namespace rpc { * Writes raw data to this {@link MessageParcel} object. * @param rawData Raw data to wrote. * @param size Size of the raw data, in bytes. - * @return Returns true if the operation is successful; returns false otherwise. + * @returns Returns true if the operation is successful; returns false otherwise. * @since 8 */ writeRawData(rawData: number[], size: number): boolean; @@ -784,7 +784,7 @@ declare namespace rpc { /** * Reads raw data from this {@link MessageParcel} object. * @param size Size of the raw data to read. - * @return Raw data obtained, in bytes. + * @returns Raw data obtained, in bytes. * @since 8 */ readRawData(size: number): number[]; @@ -813,7 +813,7 @@ declare namespace rpc { class MessageSequence { /** * Creates an empty {@link MessageSequence} object. - * @return Returns the object created. + * @returns Returns the object created. * @since 9 */ static create(): MessageSequence; @@ -836,7 +836,7 @@ declare namespace rpc { /** * Reads a remote object from {@link MessageSequence} object. - * @return Returns the remote object. + * @returns Returns the remote object. * @throws { BusinessError } 1900008 - proxy or remote object is invalid * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 @@ -854,7 +854,7 @@ declare namespace rpc { /** * Reads an interface token from the {@link MessageSequence} object. - * @return Returns a string value. + * @returns Returns a string value. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -862,14 +862,14 @@ declare namespace rpc { /** * Obtains the size of data (in bytes) contained in the {@link MessageSequence} object. - * @return Returns the size of data contained in the {@link MessageSequence} object. + * @returns Returns the size of data contained in the {@link MessageSequence} object. * @since 9 */ getSize(): number; /** * Obtains the storage capacity (in bytes) of the {@link MessageSequence} object. - * @return Returns the storage capacity of the {@link MessageSequence} object. + * @returns Returns the storage capacity of the {@link MessageSequence} object. * @since 9 */ getCapacity(): number; @@ -901,7 +901,7 @@ declare namespace rpc { * Obtains the writable data space (in bytes) in the {@link MessageSequence} object. *

Writable data space = Storage capacity of the {@link MessageSequence} – Size of data contained in the {@link MessageSequence}. * - * @return Returns the writable data space of the {@link MessageSequence} object. + * @returns Returns the writable data space of the {@link MessageSequence} object. * @since 9 */ getWritableBytes(): number; @@ -910,21 +910,21 @@ declare namespace rpc { * Obtains the readable data space (in bytes) in the {@link MessageSequence} object. *

Readable data space = Size of data contained in the {@link MessageSequence} – Size of data that has been read. * - * @return Returns the readable data space of the {@link MessageSequence} object. + * @returns Returns the readable data space of the {@link MessageSequence} object. * @since 9 */ getReadableBytes(): number; /** * Obtains the current read position in the {@link MessageSequence} object. - * @return Returns the current read position in the {@link MessageSequence} object. + * @returns Returns the current read position in the {@link MessageSequence} object. * @since 9 */ getReadPosition(): number; /** * Obtains the current write position in the {@link MessageSequence} object. - * @return Returns the current write position in the {@link MessageSequence} object. + * @returns Returns the current write position in the {@link MessageSequence} object. * @since 9 */ getWritePosition(): number; @@ -1176,7 +1176,7 @@ declare namespace rpc { /** * Reads a byte value from the {@link MessageParcel} object. - * @return Returns a byte value. + * @returns Returns a byte value. * @throws { BusinessError } 1900010 read data from message sequence failed * @since 9 */ @@ -1184,7 +1184,7 @@ declare namespace rpc { /** * Reads a short integer value from the {@link MessageSequence} object. - * @return Returns a short integer value. + * @returns Returns a short integer value. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1192,7 +1192,7 @@ declare namespace rpc { /** * Reads an integer value from the {@link MessageSequence} object. - * @return Returns an integer value. + * @returns Returns an integer value. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1200,7 +1200,7 @@ declare namespace rpc { /** * Reads a long integer value from the {@link MessageSequence} object. - * @return Returns a long integer value. + * @returns Returns a long integer value. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1208,7 +1208,7 @@ declare namespace rpc { /** * Reads a floating point value from the {@link MessageSequence} object. - * @return Returns a floating point value. + * @returns Returns a floating point value. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1216,7 +1216,7 @@ declare namespace rpc { /** * Reads a double-precision floating point value from the {@link MessageSequence} object. - * @return Returns a double-precision floating point value. + * @returns Returns a double-precision floating point value. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1224,7 +1224,7 @@ declare namespace rpc { /** * Reads a boolean value from the {@link MessageSequence} object. - * @return Returns a boolean value. + * @returns Returns a boolean value. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1232,7 +1232,7 @@ declare namespace rpc { /** * Reads a single character value from the {@link MessageSequence} object. - * @return Returns a single character value. + * @returns Returns a single character value. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1240,7 +1240,7 @@ declare namespace rpc { /** * Reads a string value from the {@link MessageSequence} object. - * @return Returns a string value. + * @returns Returns a string value. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1268,7 +1268,7 @@ declare namespace rpc { /** * Reads a byte array from the {@link MessageSequence} object. - * @return Returns a byte array. + * @returns Returns a byte array. * @throws { BusinessError } 401 - check param failed * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 @@ -1286,7 +1286,7 @@ declare namespace rpc { /** * Reads a short integer array from the {@link MessageSequence} object. - * @return Returns a short integer array. + * @returns Returns a short integer array. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1303,7 +1303,7 @@ declare namespace rpc { /** * Reads an integer array from the {@link MessageSequence} object. - * @return Returns an integer array. + * @returns Returns an integer array. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1320,7 +1320,7 @@ declare namespace rpc { /** * Reads a long integer array from the {@link MessageSequence} object. - * @return Returns a long integer array. + * @returns Returns a long integer array. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1337,7 +1337,7 @@ declare namespace rpc { /** * Reads a floating point array from the {@link MessageSequence} object. - * @return Returns a floating point array. + * @returns Returns a floating point array. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1354,7 +1354,7 @@ declare namespace rpc { /** * Reads a double-precision floating point array from the {@link MessageSequence} object. - * @return Returns a double-precision floating point array. + * @returns Returns a double-precision floating point array. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1371,7 +1371,7 @@ declare namespace rpc { /** * Reads a boolean array from the {@link MessageSequence} object. - * @return Returns a boolean array. + * @returns Returns a boolean array. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1388,7 +1388,7 @@ declare namespace rpc { /** * Reads a single character array from the {@link MessageSequence} object. - * @return Returns a single character array. + * @returns Returns a single character array. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1406,7 +1406,7 @@ declare namespace rpc { /** * Reads a string array from the {@link MessageSequence} object. - * @return Returns a string array. + * @returns Returns a string array. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1433,7 +1433,7 @@ declare namespace rpc { /** * Reads {@link IRemoteObject} objects from this {@link MessageSequence} object. - * @return An array of {@link IRemoteObject} objects obtained. + * @returns An array of {@link IRemoteObject} objects obtained. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1450,7 +1450,7 @@ declare namespace rpc { /** * Duplicates the specified file descriptor. * @param fd File descriptor to be duplicated. - * @return A duplicated file descriptor. + * @returns A duplicated file descriptor. * @throws { BusinessError } 401 - check param failed * @throws { BusinessError } 1900013 call os dup function failed * @since 9 @@ -1459,7 +1459,7 @@ declare namespace rpc { /** * Checks whether this {@link MessageSequence} object contains a file descriptor. - * @return Returns true if the {@link MessageSequence} object contains a file descriptor; + * @returns Returns true if the {@link MessageSequence} object contains a file descriptor; * returns false otherwise. * @since 9 */ @@ -1476,7 +1476,7 @@ declare namespace rpc { /** * Reads a file descriptor from this {@link MessageSequence} object. - * @return File descriptor obtained. + * @returns File descriptor obtained. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1493,7 +1493,7 @@ declare namespace rpc { /** * Reads the anonymous shared memory object from this {@link MessageSequence} object. - * @return Anonymous share object obtained. + * @returns Anonymous share object obtained. * @throws { BusinessError } 401 - check param failed * @throws { BusinessError } 1900004 - read from ashmem failed * @since 9 @@ -1502,7 +1502,7 @@ declare namespace rpc { /** * Obtains the maximum amount of raw data that can be sent in a time. - * @return 128 MB. + * @returns 128 MB. * @since 9 */ getRawDataCapacity(): number; @@ -1520,7 +1520,7 @@ declare namespace rpc { /** * Reads raw data from this {@link MessageSequence} object. * @param size Size of the raw data to read. - * @return Raw data obtained, in bytes. + * @returns Raw data obtained, in bytes. * @throws { BusinessError } 401 - check param failed * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 @@ -1541,7 +1541,7 @@ declare namespace rpc { * * @param dataOut Indicates the {@link MessageParcel} object to which the {@code Sequenceable} * object will be marshaled.. - * @return Returns {@code true} if the marshalling is successful; returns {@code false} otherwise. + * @returns Returns {@code true} if the marshalling is successful; returns {@code false} otherwise. * @throws ParcelException Throws this exception if the operation fails. * @since 7 */ @@ -1552,7 +1552,7 @@ declare namespace rpc { * * @param dataIn Indicates the {@link MessageParcel} object into which the {@code Sequenceable} * object has been marshaled. - * @return Returns {@code true} if the unmarshalling is successful; returns {@code false} otherwise. + * @returns Returns {@code true} if the unmarshalling is successful; returns {@code false} otherwise. * @throws ParcelException Throws this exception if the operation fails. * @since 7 */ @@ -1570,7 +1570,7 @@ declare namespace rpc { * * @param dataOut Indicates the {@link MessageSequence} object to which the {@code Parcelable} * object will be marshaled.. - * @return Returns {@code true} if the marshalling is successful; returns {@code false} otherwise. + * @returns Returns {@code true} if the marshalling is successful; returns {@code false} otherwise. * @throws ParcelException Throws this exception if the operation fails. * @since 9 */ @@ -1581,7 +1581,7 @@ declare namespace rpc { * * @param dataIn Indicates the {@link MessageSequence} object into which the {@code Parcelable} * object has been marshaled. - * @return Returns {@code true} if the unmarshalling is successful; returns {@code false} otherwise. + * @returns Returns {@code true} if the unmarshalling is successful; returns {@code false} otherwise. * @throws ParcelException Throws this exception if the operation fails. * @since 9 */ @@ -1678,7 +1678,7 @@ declare namespace rpc { * indicating that the interface is not a local one. * * @param descriptor Indicates the interface descriptor. - * @return Returns the {@link IRemoteBroker} object bound to the specified interface descriptor. + * @returns Returns the {@link IRemoteBroker} object bound to the specified interface descriptor. * @since 7 * @deprecated since 9 * @useinstead ohos.rpc.IRemoteObject#getLocalInterface @@ -1693,7 +1693,7 @@ declare namespace rpc { * indicating that the interface is not a local one. * * @param descriptor Indicates the interface descriptor. - * @return Returns the {@link IRemoteBroker} object bound to the specified interface descriptor. + * @returns Returns the {@link IRemoteBroker} object bound to the specified interface descriptor. * @throws { BusinessError } 401 - check param failed * @since 9 */ @@ -1712,7 +1712,7 @@ declare namespace rpc { * @param data Indicates the {@link MessageParcel} object sent to the peer process. * @param reply Indicates the {@link MessageParcel} object returned by the peer process. * @param options Indicates the synchronous or asynchronous mode to send messages. - * @return Returns {@code true} if the method is called successfully; returns {@code false} otherwise. + * @returns Returns {@code true} if the method is called successfully; returns {@code false} otherwise. * @throws RemoteException Throws this exception if the method fails to be called. * @since 7 * @deprecated since 9 @@ -1800,7 +1800,7 @@ declare namespace rpc { * * @param recipient Indicates the callback to be registered. * @param flags Indicates the flag of the death notification. - * @return Returns {@code true} if the callback is registered successfully; returns {@code false} otherwise. + * @returns Returns {@code true} if the callback is registered successfully; returns {@code false} otherwise. * @since 7 * @deprecated since 9 * @useinstead ohos.rpc.IRemoteObject#registerDeathRecipient @@ -1823,7 +1823,7 @@ declare namespace rpc { * * @param recipient Indicates the callback to be deregistered. * @param flags Indicates the flag of the death notification. - * @return Returns {@code true} if the callback is deregistered successfully; returns {@code false} otherwise. + * @returns Returns {@code true} if the callback is deregistered successfully; returns {@code false} otherwise. * @since 7 * @deprecated since 9 * @useinstead ohos.rpc.IRemoteObject#unregisterDeathRecipient @@ -1846,7 +1846,7 @@ declare namespace rpc { * *

The interface descriptor is a character string. * - * @return Returns the interface descriptor. + * @returns Returns the interface descriptor. * @since 7 * @deprecated since 9 * @useinstead ohos.rpc.IRemoteObject#getDescriptor @@ -1858,7 +1858,7 @@ declare namespace rpc { * *

The interface descriptor is a character string. * - * @return Returns the interface descriptor. + * @returns Returns the interface descriptor. * @throws { BusinessError } 1900008 - proxy or remote object is invalid * @since 9 */ @@ -1867,7 +1867,7 @@ declare namespace rpc { /** * Checks whether an object is dead. * - * @return Returns {@code true} if the object is dead; returns {@code false} otherwise. + * @returns Returns {@code true} if the object is dead; returns {@code false} otherwise. * @since 7 */ isObjectDead(): boolean; @@ -1882,7 +1882,7 @@ declare namespace rpc { /** * Obtains a proxy or remote object. This method must be implemented by its derived classes. * - * @return Returns the RemoteObject if the caller is a RemoteObject; returns the IRemoteObject, + * @returns Returns the RemoteObject if the caller is a RemoteObject; returns the IRemoteObject, * that is, the holder of this RemoteProxy object, if the caller is a RemoteProxy object. * @since 7 */ @@ -1966,7 +1966,7 @@ declare namespace rpc { /** * Obtains the SendRequest call flag, which can be synchronous or asynchronous. * - * @return Returns whether the SendRequest is called synchronously or asynchronously. + * @returns Returns whether the SendRequest is called synchronously or asynchronously. * @since 7 */ getFlags(): number; @@ -1982,7 +1982,7 @@ declare namespace rpc { /** * Obtains the SendRequest call flag, which can be synchronous or asynchronous. * - * @return Returns whether the SendRequest is called synchronously or asynchronously. + * @returns Returns whether the SendRequest is called synchronously or asynchronously. * @since 9 */ isAsync(): boolean; @@ -1998,7 +1998,7 @@ declare namespace rpc { /** * Obtains the maximum wait time for this RPC call. * - * @return Returns maximum wait time obtained. + * @returns Returns maximum wait time obtained. * @since 7 */ getWaitTime(): number; @@ -2030,7 +2030,7 @@ declare namespace rpc { * Queries a remote object using an interface descriptor. * * @param descriptor Indicates the interface descriptor used to query the remote object. - * @return Returns the remote object matching the interface descriptor; returns null + * @returns Returns the remote object matching the interface descriptor; returns null * if no such remote object is found. * @since 7 * @deprecated since 9 @@ -2042,7 +2042,7 @@ declare namespace rpc { * Queries a remote object using an interface descriptor. * * @param descriptor Indicates the interface descriptor used to query the remote object. - * @return Returns the remote object matching the interface descriptor; returns null + * @returns Returns the remote object matching the interface descriptor; returns null * if no such remote object is found. * @throws { BusinessError } 401 - check param failed * @since 9 @@ -2052,7 +2052,7 @@ declare namespace rpc { /** * Queries an interface descriptor. * - * @return Returns the interface descriptor. + * @returns Returns the interface descriptor. * @since 7 * @deprecated since 9 * @useinstead ohos.rpc.RemoteObject#getDescriptor @@ -2062,7 +2062,7 @@ declare namespace rpc { /** * Queries an interface descriptor. * - * @return Returns the interface descriptor. + * @returns Returns the interface descriptor. * @throws { BusinessError } 1900008 - proxy or remote object is invalid * @since 9 */ @@ -2079,7 +2079,7 @@ declare namespace rpc { * @param reply Indicates the response message object sent from the remote service. * The local service writes the response data to the {@link MessageParcel} object. * @param options Indicates whether the operation is synchronous or asynchronous. - * @return + * @returns * Returns a simple boolean which is {@code true} if the operation succeeds; {{@code false} otherwise} when the function call is synchronous. * Returns a promise object with a boolean when the function call is asynchronous. * @since 9 @@ -2097,7 +2097,7 @@ declare namespace rpc { * @param reply Indicates the response message object sent from the remote service. * The local service writes the response data to the {@link MessageParcel} object. * @param options Indicates whether the operation is synchronous or asynchronous. - * @return Returns {@code true} if the operation succeeds; returns {@code false} otherwise. + * @returns Returns {@code true} if the operation succeeds; returns {@code false} otherwise. * @throws RemoteException Throws this exception if a remote service error occurs. * @since 7 * @deprecated since 9 @@ -2114,7 +2114,7 @@ declare namespace rpc { * @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. + * @returns Returns {@code true} if the operation succeeds; returns {@code false} otherwise. * @deprecated since 8 * @since 7 */ @@ -2198,7 +2198,7 @@ declare namespace rpc { /** * Obtains the PID of the {@link RemoteProxy} object. * - * @return Returns the PID of the {@link RemoteProxy} object. + * @returns Returns the PID of the {@link RemoteProxy} object. * @since 7 */ getCallingPid(): number; @@ -2206,7 +2206,7 @@ declare namespace rpc { /** * Obtains the UID of the {@link RemoteProxy} object. * - * @return Returns the UID of the {@link RemoteProxy} object. + * @returns Returns the UID of the {@link RemoteProxy} object. * @since 7 */ getCallingUid(): number; @@ -2296,7 +2296,7 @@ declare namespace rpc { * Queries a local interface with a specified descriptor. * * @param descriptor Indicates the descriptor of the interface to query. - * @return Returns null by default, indicating a proxy interface. + * @returns Returns null by default, indicating a proxy interface. * @since 7 * @deprecated since 9 * @useinstead ohos.rpc.RemoteProxy#getLocalInterface @@ -2307,7 +2307,7 @@ declare namespace rpc { * Queries a local interface with a specified descriptor. * * @param descriptor Indicates the descriptor of the interface to query. - * @return Returns null by default, indicating a proxy interface. + * @returns Returns null by default, indicating a proxy interface. * @throws { BusinessError } 401 - check param failed * @throws { BusinessError } 1900006 - only remote object permitted * @since 9 @@ -2319,7 +2319,7 @@ declare namespace rpc { * * @param recipient Indicates the callback to be registered. * @param flags Indicates the flag of the death notification. This is a reserved parameter. Set it to {@code 0}. - * @return Returns {@code true} if the callback is registered successfully; returns {@code false} otherwise. + * @returns Returns {@code true} if the callback is registered successfully; returns {@code false} otherwise. * @since 7 * @deprecated since 9 * @useinstead ohos.rpc.RemoteProxy#registerDeathRecipient @@ -2342,7 +2342,7 @@ declare namespace rpc { * * @param recipient Indicates the callback to be deregistered. * @param flags Indicates the flag of the death notification. This is a reserved parameter. Set it to {@code 0}. - * @return Returns {@code true} if the callback is deregistered successfully; returns {@code false} otherwise. + * @returns Returns {@code true} if the callback is deregistered successfully; returns {@code false} otherwise. * @since 7 * @deprecated since 9 * @useinstead ohos.rpc.RemoteProxy#unregisterDeathRecipient @@ -2363,7 +2363,7 @@ declare namespace rpc { /** * Queries the interface descriptor of remote object. * - * @return Returns the interface descriptor. + * @returns Returns the interface descriptor. * @since 7 * @deprecated since 9 * @useinstead ohos.rpc.RemoteProxy#getDescriptor @@ -2373,7 +2373,7 @@ declare namespace rpc { /** * Queries the interface descriptor of remote object. * - * @return Returns the interface descriptor. + * @returns Returns the interface descriptor. * @throws { BusinessError } 1900007 - communication failed * @throws { BusinessError } 1900008 - proxy or remote object is invalid * @since 9 @@ -2390,7 +2390,7 @@ declare namespace rpc { * @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. + * @returns 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 @@ -2475,7 +2475,7 @@ declare namespace rpc { /** * Checks whether the {@code RemoteObject} corresponding to a {@code RemoteProxy} is dead. * - * @return Returns {@code true} if the {@code RemoteObject} is dead; returns {@code false} otherwise. + * @returns Returns {@code true} if the {@code RemoteObject} is dead; returns {@code false} otherwise. * @since 7 */ isObjectDead(): boolean; @@ -2492,7 +2492,7 @@ declare namespace rpc { * *

This method is static. * - * @return Returns an {@link IRemoteObject} reference of the registered service. + * @returns Returns an {@link IRemoteObject} reference of the registered service. * @since 7 */ static getContextObject(): IRemoteObject; @@ -2506,7 +2506,7 @@ declare namespace rpc { * {@code 0} is returned; if this method is called from the {@link RemoteObject} object, * the PID of the corresponding {@link RemoteProxy} object is returned. * - * @return Returns the PID of the proxy. + * @returns Returns the PID of the proxy. * @since 7 */ static getCallingPid(): number; @@ -2520,7 +2520,7 @@ declare namespace rpc { * {@code 0} is returned; if this method is called from the {@link RemoteObject} object, * the UID of the corresponding {@link RemoteProxy} object is returned. * - * @return Returns the UID of the proxy. + * @returns Returns the UID of the proxy. * @since 7 */ static getCallingUid(): number; @@ -2530,7 +2530,7 @@ declare namespace rpc { * *

This method is static. * - * @return Returns the TOKENID. + * @returns Returns the TOKENID. * @since 8 */ static getCallingTokenId(): number; @@ -2540,7 +2540,7 @@ declare namespace rpc { * *

This method is static. * - * @return Returns the ID of the device where the peer process resides. + * @returns Returns the ID of the device where the peer process resides. * @since 7 */ static getCallingDeviceID(): string; @@ -2550,7 +2550,7 @@ declare namespace rpc { * *

This method is static. * - * @return Returns the ID of the local device. + * @returns Returns the ID of the local device. * @since 7 */ static getLocalDeviceID(): string; @@ -2560,7 +2560,7 @@ declare namespace rpc { * *

This method is static. * - * @return Returns {@code true} if the call is made on the same device; returns {@code false} otherwise. + * @returns Returns {@code true} if the call is made on the same device; returns {@code false} otherwise. * @since 7 */ static isLocalCalling(): boolean; @@ -2571,7 +2571,7 @@ declare namespace rpc { *

This method is static. You are advised to call this method before performing any time-sensitive operations. * * @param object Indicates the specified {@link RemoteProxy}. - * @return Returns {@code 0} if the operation succeeds; returns an error code if the input object is empty + * @returns Returns {@code 0} if the operation succeeds; returns an error code if the input object is empty * or {@link RemoteObject}, or the operation fails. * @since 7 * @deprecated since 9 @@ -2595,7 +2595,7 @@ declare namespace rpc { * *

This method is static. It can be used in scenarios like authentication. * - * @return Returns a string containing the UID and PID of the remote user. + * @returns Returns a string containing the UID and PID of the remote user. * @since 7 */ static resetCallingIdentity(): string; @@ -2608,7 +2608,7 @@ declare namespace rpc { * * @param identity Indicates the string containing the UID and PID of the remote user, * which is returned by {@code resetCallingIdentity}. - * @return Returns {@code true} if the operation succeeds; returns {@code false} otherwise. + * @returns Returns {@code true} if the operation succeeds; returns {@code false} otherwise. * @since 7 * @deprecated since 9 * @useinstead ohos.rpc.IPCSkeleton#restoreCallingIdentity @@ -2679,7 +2679,7 @@ declare namespace rpc { * Creates an Ashmem object with the specified name and size. * @param name Name of the Ashmem object to create. * @param size Size (in bytes) of the Ashmem object to create. - * @return Returns the Ashmem object if it is created successfully; returns null otherwise. + * @returns Returns the Ashmem object if it is created successfully; returns null otherwise. * @since 8 * @deprecated since 9 * @useinstead ohos.rpc.Ashmem#create @@ -2690,7 +2690,7 @@ declare namespace rpc { * Creates an Ashmem object with the specified name and size. * @param name Name of the Ashmem object to create. * @param size Size (in bytes) of the Ashmem object to create. - * @return Returns the Ashmem object if it is created successfully; returns null otherwise. + * @returns Returns the Ashmem object if it is created successfully; returns null otherwise. * @throws { BusinessError } 401 - check param failed * @since 9 */ @@ -2700,7 +2700,7 @@ declare namespace rpc { * Creates an Ashmem object by copying the file descriptor (FD) of an existing Ashmem object. * The two Ashmem objects point to the same shared memory region. * @param ashmem Existing Ashmem object. - * @return Ashmem object created. + * @returns Ashmem object created. * @since 8 * @deprecated since 9 * @useinstead ohos.rpc.Ashmem#create @@ -2711,7 +2711,7 @@ declare namespace rpc { * Creates an Ashmem object by copying the file descriptor (FD) of an existing Ashmem object. * The two Ashmem objects point to the same shared memory region. * @param ashmem Existing Ashmem object. - * @return Ashmem object created. + * @returns Ashmem object created. * @throws { BusinessError } 401 - check param failed * @since 9 */ @@ -2731,7 +2731,7 @@ declare namespace rpc { /** * Obtains the mapped memory size of this Ashmem object. - * @return Memory size mapped. + * @returns Memory size mapped. * @since 8 */ getAshmemSize(): number; @@ -2740,7 +2740,7 @@ declare namespace rpc { * Creates the shared file mapping on the virtual address space of this process. * The size of the mapping region is specified by this Ashmem object. * @param mapType Protection level of the memory region to which the shared file is mapped. - * @return Returns true if the operation is successful; returns false otherwise. + * @returns Returns true if the operation is successful; returns false otherwise. * @since 8 * @deprecated since 9 * @useinstead ohos.rpc.Ashmem#mapTypedAshmem @@ -2759,7 +2759,7 @@ declare namespace rpc { /** * Maps the shared file to the readable and writable virtual address space of the process. - * @return Returns true if the operation is successful; returns false otherwise. + * @returns Returns true if the operation is successful; returns false otherwise. * @since 8 * @deprecated since 9 * @useinstead ohos.rpc.Ashmem#mapReadWriteAshmem @@ -2775,7 +2775,7 @@ declare namespace rpc { /** * Maps the shared file to the read-only virtual address space of the process. - * @return Returns true if the operation is successful; returns false otherwise. + * @returns Returns true if the operation is successful; returns false otherwise. * @since 8 * @deprecated since 9 * @useinstead ohos.rpc.Ashmem#mapReadonlyAshmem @@ -2792,7 +2792,7 @@ declare namespace rpc { /** * Sets the protection level of the memory region to which the shared file is mapped. * @param protectionType Protection type to set. - * @return Returns true if the operation is successful; returns false otherwise. + * @returns Returns true if the operation is successful; returns false otherwise. * @since 8 * @deprecated since 9 * @useinstead ohos.rpc.Ashmem#setProtectionType @@ -2813,7 +2813,7 @@ declare namespace rpc { * @param buf Data to write * @param size Size of the data to write * @param offset Start position of the data to write in the memory region associated with this Ashmem object. - * @return Returns true is the data is written successfully; returns false otherwise. + * @returns Returns true is the data is written successfully; returns false otherwise. * @since 8 * @deprecated since 9 * @useinstead ohos.rpc.Ashmem#writeAshmem @@ -2835,7 +2835,7 @@ declare namespace rpc { * Reads data from the shared file associated with this Ashmem object. * @param size Size of the data to read. * @param offset Start position of the data to read in the memory region associated with this Ashmem object. - * @return Data read. + * @returns Data read. * @since 8 * @deprecated since 9 * @useinstead ohos.rpc.Ashmem#readAshmem @@ -2846,7 +2846,7 @@ declare namespace rpc { * Reads data from the shared file associated with this Ashmem object. * @param size Size of the data to read. * @param offset Start position of the data to read in the memory region associated with this Ashmem object. - * @return Data read. + * @returns Data read. * @throws { BusinessError } 401 - check param failed * @throws { BusinessError } 1900004 - read from ashmem failed * @since 9 -- Gitee From 603bc02db4077cd7707bdf4b726d9d608a55a975 Mon Sep 17 00:00:00 2001 From: crazy_hu Date: Tue, 15 Nov 2022 03:15:47 +0000 Subject: [PATCH 316/438] uodate jsdoc delete import Signed-off-by: crazy_hu --- api/@ohos.rpc.d.ts | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/api/@ohos.rpc.d.ts b/api/@ohos.rpc.d.ts index 0a9049cdaf..6fc0126cda 100644 --- a/api/@ohos.rpc.d.ts +++ b/api/@ohos.rpc.d.ts @@ -85,7 +85,6 @@ declare namespace rpc { * @deprecated since 9 * @useinstead ohos.rpc.MessageSequence * @syscap SystemCapability.Communication.IPC.Core - * @import import rpc from '@ohos.rpc' */ class MessageParcel { /** @@ -808,7 +807,6 @@ declare namespace rpc { * * @since 9 * @syscap SystemCapability.Communication.IPC.Core - * @import import rpc from '@ohos.rpc' */ class MessageSequence { /** @@ -1530,7 +1528,6 @@ declare namespace rpc { /** * @syscap SystemCapability.Communication.IPC.Core - * @import import rpc from '@ohos.rpc' * @since 7 * @deprecated since 9 * @useinstead ohos.rpc.Parcelable @@ -1561,7 +1558,6 @@ declare namespace rpc { /** * @syscap SystemCapability.Communication.IPC.Core - * @import import rpc from '@ohos.rpc' * @since 9 */ interface Parcelable { @@ -1594,7 +1590,6 @@ declare namespace rpc { * namely error code of this operation, request code, data parcel * and reply parcel. * @syscap SystemCapability.Communication.IPC.Core - * @import import rpc from '@ohos.rpc' * @since 8 * @deprecated since 9 * @useinstead ohos.rpc.RequestResult @@ -1633,7 +1628,6 @@ declare namespace rpc { * namely error code of this operation, request code, data parcel * and reply parcel. * @syscap SystemCapability.Communication.IPC.Core - * @import import rpc from '@ohos.rpc' * @since 9 */ interface RequestResult { @@ -1666,7 +1660,6 @@ declare namespace rpc { /** * @syscap SystemCapability.Communication.IPC.Core - * @import import rpc from '@ohos.rpc' * @since 7 */ abstract class IRemoteObject { @@ -1875,7 +1868,6 @@ declare namespace rpc { /** * @syscap SystemCapability.Communication.IPC.Core - * @import import rpc from '@ohos.rpc' * @since 7 */ interface IRemoteBroker { @@ -1892,7 +1884,6 @@ declare namespace rpc { /** * @since 7 * @syscap SystemCapability.Communication.IPC.Core - * @import import rpc from '@ohos.rpc' */ interface DeathRecipient { /** @@ -1905,7 +1896,6 @@ declare namespace rpc { /** * @syscap SystemCapability.Communication.IPC.Core - * @import import rpc from '@ohos.rpc' * @since 7 */ class MessageOption { @@ -2014,7 +2004,6 @@ declare namespace rpc { /** * @syscap SystemCapability.Communication.IPC.Core - * @import import rpc from '@ohos.rpc' * @since 7 */ class RemoteObject extends IRemoteObject { @@ -2239,7 +2228,6 @@ declare namespace rpc { /** * @syscap SystemCapability.Communication.IPC.Core - * @import import rpc from '@ohos.rpc' * @since 7 */ class RemoteProxy implements IRemoteObject { @@ -2483,7 +2471,6 @@ declare namespace rpc { /** * @syscap SystemCapability.Communication.IPC.Core - * @import import rpc from '@ohos.rpc' * @since 7 */ class IPCSkeleton { @@ -2635,7 +2622,6 @@ declare namespace rpc { * reading data from and writing data to an Ashmem object, * obtaining the Ashmem size, and setting Ashmem protection. * @syscap SystemCapability.Communication.IPC.Core - * @import import rpc from '@ohos.rpc' * @since 8 */ class Ashmem { -- Gitee From f7a0cf2199d6e554a1d6aa154fb127e579826f6e Mon Sep 17 00:00:00 2001 From: crazy_hu Date: Tue, 15 Nov 2022 03:33:31 +0000 Subject: [PATCH 317/438] update jsdos note Signed-off-by: crazy_hu --- api/@ohos.rpc.d.ts | 64 +++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/api/@ohos.rpc.d.ts b/api/@ohos.rpc.d.ts index 6fc0126cda..fa2dfe2f23 100644 --- a/api/@ohos.rpc.d.ts +++ b/api/@ohos.rpc.d.ts @@ -359,104 +359,104 @@ declare namespace rpc { /** * Writes a short integer array into the {@link MessageParcel} object. + * Ensure that the data type and size comply with the interface definition. + * Otherwise,data may be truncated. * @param shortArray Indicates the short integer array to write. * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. - * @Note Ensure that the data type and size comply with the interface definition. - * Otherwise,data may be truncated. * @since 7 */ writeShortArray(shortArray: number[]): boolean; /** * Writes an integer array into the {@link MessageParcel} object. + * Ensure that the data type and size comply with the interface definition. + * Otherwise,data may be truncated. * @param intArray Indicates the integer array to write. * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. - * @Note Ensure that the data type and size comply with the interface definition. - * Otherwise,data may be truncated. * @since 7 */ writeIntArray(intArray: number[]): boolean; /** * Writes a long integer array into the {@link MessageParcel} object. + * Ensure that the data type and size comply with the interface definition. + * Otherwise,data may be truncated. * @param longArray Indicates the long integer array to write. * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. - * @Note Ensure that the data type and size comply with the interface definition. - * Otherwise,data may be truncated. * @since 7 */ writeLongArray(longArray: number[]): boolean; /** * Writes a floating point array into the {@link MessageParcel} object. + * Ensure that the data type and size comply with the interface definition. + * Otherwise,data may be truncated. * @param floatArray Indicates the floating point array to write. * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. - * @Note Ensure that the data type and size comply with the interface definition. - * Otherwise,data may be truncated. * @since 7 */ writeFloatArray(floatArray: number[]): boolean; /** * Writes a double-precision floating point array into the {@link MessageParcel} object. + * Ensure that the data type and size comply with the interface definition. + * Otherwise,data may be truncated. * @param doubleArray Indicates the double-precision floating point array to write. * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. - * @Note Ensure that the data type and size comply with the interface definition. - * Otherwise,data may be truncated. * @since 7 */ writeDoubleArray(doubleArray: number[]): boolean; /** * Writes a boolean array into the {@link MessageParcel} object. + * Ensure that the data type and size comply with the interface definition. + * Otherwise,data may be truncated. * @param booleanArray Indicates the boolean array to write. * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. - * @Note Ensure that the data type and size comply with the interface definition. - * Otherwise,data may be truncated. * @since 7 */ writeBooleanArray(booleanArray: boolean[]): boolean; /** * Writes a single character array into the {@link MessageParcel} object. + * Ensure that the data type and size comply with the interface definition. + * Otherwise,data may be truncated. * @param charArray Indicates the single character array to write. * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. - * @Note Ensure that the data type and size comply with the interface definition. - * Otherwise,data may be truncated. * @since 7 */ writeCharArray(charArray: number[]): boolean; /** * Writes a string array into the {@link MessageParcel} object. + * Ensure that the data type and size comply with the interface definition. + * Otherwise,data may be truncated. * @param stringArray Indicates the string array to write. * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; * returns {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. - * @Note Ensure that the data type and size comply with the interface definition. - * Otherwise,data may be truncated. * @since 7 */ writeStringArray(stringArray: string[]): boolean; @@ -1068,88 +1068,88 @@ declare namespace rpc { /** * Writes a short integer array into the {@link MessageSequence} object. + * Ensure that the data type and size comply with the interface definition. + * Otherwise,data may be truncated. * @param shortArray Indicates the short integer array to write. * @throws { BusinessError } 401 - check param failed * @throws { BusinessError } 1900009 - write data to message sequence failed - * @Note Ensure that the data type and size comply with the interface definition. - * Otherwise,data may be truncated. * @since 9 */ writeShortArray(shortArray: number[]): void; /** * Writes an integer array into the {@link MessageSequence} object. + * Ensure that the data type and size comply with the interface definition. + * Otherwise,data may be truncated. * @param intArray Indicates the integer array to write. * @throws { BusinessError } 401 - check param failed * @throws { BusinessError } 1900009 - write data to message sequence failed - * @Note Ensure that the data type and size comply with the interface definition. - * Otherwise,data may be truncated. * @since 9 */ writeIntArray(intArray: number[]): void; /** * Writes a long integer array into the {@link MessageSequence} object. + * Ensure that the data type and size comply with the interface definition. + * Otherwise,data may be truncated. * @param longArray Indicates the long integer array to write. * @throws { BusinessError } 401 - check param failed * @throws { BusinessError } 1900009 - write data to message sequence failed - * @Note Ensure that the data type and size comply with the interface definition. - * Otherwise,data may be truncated. * @since 9 */ writeLongArray(longArray: number[]): void; /** * Writes a floating point array into the {@link MessageSequence} object. + * Ensure that the data type and size comply with the interface definition. + * Otherwise,data may be truncated. * @param floatArray Indicates the floating point array to write. * @throws { BusinessError } 401 - check param failed * @throws { BusinessError } 1900009 - write data to message sequence failed - * @Note Ensure that the data type and size comply with the interface definition. - * Otherwise,data may be truncated. * @since 9 */ writeFloatArray(floatArray: number[]): void; /** * Writes a double-precision floating point array into the {@link MessageSequence} object. + * Ensure that the data type and size comply with the interface definition. + * Otherwise,data may be truncated. * @param doubleArray Indicates the double-precision floating point array to write. * @throws { BusinessError } 401 - check param failed * @throws { BusinessError } 1900009 - write data to message sequence failed - * @Note Ensure that the data type and size comply with the interface definition. - * Otherwise,data may be truncated. * @since 9 */ writeDoubleArray(doubleArray: number[]): void; /** * Writes a boolean array into the {@link MessageSequence} object. + * Ensure that the data type and size comply with the interface definition. + * Otherwise,data may be truncated. * @param booleanArray Indicates the boolean array to write. * @throws { BusinessError } 401 - check param failed * @throws { BusinessError } 1900009 - write data to message sequence failed - * @Note Ensure that the data type and size comply with the interface definition. - * Otherwise,data may be truncated. * @since 9 */ writeBooleanArray(booleanArray: boolean[]): void; /** * Writes a single character array into the {@link MessageSequence} object. + * Ensure that the data type and size comply with the interface definition. + * Otherwise,data may be truncated. * @param charArray Indicates the single character array to write. * @throws { BusinessError } 401 - check param failed * @throws { BusinessError } 1900009 - write data to message sequence failed - * @Note Ensure that the data type and size comply with the interface definition. - * Otherwise,data may be truncated. * @since 9 */ writeCharArray(charArray: number[]): void; /** * Writes a string array into the {@link MessageSequence} object. + * Ensure that the data type and size comply with the interface definition. + * Otherwise,data may be truncated. * @param stringArray Indicates the string array to write. * @throws { BusinessError } 401 - check param failed * @throws { BusinessError } 1900009 - write data to message sequence failed - * @Note Ensure that the data type and size comply with the interface definition. - * Otherwise,data may be truncated. * @since 9 */ writeStringArray(stringArray: string[]): void; -- Gitee From 9b169f6564720126f2cfad524a9a8976c3e54a72 Mon Sep 17 00:00:00 2001 From: crazy_hu Date: Tue, 15 Nov 2022 07:30:07 +0000 Subject: [PATCH 318/438] update jsdoc error word Signed-off-by: crazy_hu --- api/@ohos.rpc.d.ts | 66 +++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/api/@ohos.rpc.d.ts b/api/@ohos.rpc.d.ts index fa2dfe2f23..07d726a01d 100644 --- a/api/@ohos.rpc.d.ts +++ b/api/@ohos.rpc.d.ts @@ -66,7 +66,7 @@ declare namespace rpc { } /** - * A data object used for reomote procedure call (RPC). + * A data object used for remote procedure call (RPC). *

* During RPC, the sender can use the write methods provided by {@link MessageParcel} to * write the to-be-sent data into a {@link MessageParcel} object in a specific format, and the receiver can use the @@ -95,13 +95,13 @@ declare namespace rpc { static create(): MessageParcel; /** - * Reclaims the {@link MessageParcel} object. + * Reclaim the {@link MessageParcel} object. * @since 7 */ reclaim(): void; /** - * Serializes a remote object and writes it to the {@link MessageParcel} object. + * Serialize a remote object and writes it to the {@link MessageParcel} object. * @param object Remote object to serialize. * @returns Returns true if it is successful; returns false otherwise. * @since 7 @@ -476,7 +476,7 @@ declare namespace rpc { * Writes an array of {@link IRemoteObject} objects to this {@link MessageParcel} object. * @param objectArray Array of {@link IRemoteObject} objects to write. * @returns Returns {@code true} if the {@link IRemoteObject} array is successfully written to the {@link MessageParcel}; - * returns false if the {@link IRemoteObject} array is null or fails to be written to the {@lini MessageParcel}. + * returns false if the {@link IRemoteObject} array is null or fails to be written to the {@link MessageParcel}. * @since 8 */ writeRemoteObjectArray(objectArray: IRemoteObject[]): boolean; @@ -790,7 +790,7 @@ declare namespace rpc { } /** - * A data object used for reomote procedure call (RPC). + * A data object used for remote procedure call (RPC). *

* During RPC, the sender can use the write methods provided by {@link MessageSequence} to * write the to-be-sent data into a {@link MessageSequence} object in a specific format, and the receiver can use the @@ -817,13 +817,13 @@ declare namespace rpc { static create(): MessageSequence; /** - * Reclaims the {@link MessageSequence} object. + * Reclaim the {@link MessageSequence} object. * @since 9 */ reclaim(): void; /** - * Serializes a remote object and writes it to the {@link MessageSequence} object. + * Serialize a remote object and writes it to the {@link MessageSequence} object. * @param object Remote object to serialize. * @throws { BusinessError } 401 - check param failed * @throws { BusinessError } 1900008 - proxy or remote object is invalid @@ -1534,10 +1534,10 @@ declare namespace rpc { */ interface Sequenceable { /** - * Marshals this {@code Sequenceable} object into a {@link MessageParcel}. + * Marshal this {@code Sequenceable} object into a {@link MessageParcel}. * * @param dataOut Indicates the {@link MessageParcel} object to which the {@code Sequenceable} - * object will be marshaled.. + * object will be marshalled.. * @returns Returns {@code true} if the marshalling is successful; returns {@code false} otherwise. * @throws ParcelException Throws this exception if the operation fails. * @since 7 @@ -1545,10 +1545,10 @@ declare namespace rpc { marshalling(dataOut: MessageParcel): boolean; /** - * Unmarshals this {@code Sequenceable} object from a {@link MessageParcel}. + * Unmarshal this {@code Sequenceable} object from a {@link MessageParcel}. * * @param dataIn Indicates the {@link MessageParcel} object into which the {@code Sequenceable} - * object has been marshaled. + * object has been marshalled. * @returns Returns {@code true} if the unmarshalling is successful; returns {@code false} otherwise. * @throws ParcelException Throws this exception if the operation fails. * @since 7 @@ -1562,10 +1562,10 @@ declare namespace rpc { */ interface Parcelable { /** - * Marshals this {@code Parcelable} object into a {@link MessageSequence}. + * Marshal this {@code Parcelable} object into a {@link MessageSequence}. * * @param dataOut Indicates the {@link MessageSequence} object to which the {@code Parcelable} - * object will be marshaled.. + * object will be marshalled.. * @returns Returns {@code true} if the marshalling is successful; returns {@code false} otherwise. * @throws ParcelException Throws this exception if the operation fails. * @since 9 @@ -1573,10 +1573,10 @@ declare namespace rpc { marshalling(dataOut: MessageSequence): boolean; /** - * Unmarshals this {@code Parcelable} object from a {@link MessageSequence}. + * Unmarshal this {@code Parcelable} object from a {@link MessageSequence}. * * @param dataIn Indicates the {@link MessageSequence} object into which the {@code Parcelable} - * object has been marshaled. + * object has been marshalled. * @returns Returns {@code true} if the unmarshalling is successful; returns {@code false} otherwise. * @throws ParcelException Throws this exception if the operation fails. * @since 9 @@ -1789,7 +1789,7 @@ declare namespace rpc { sendMessageRequest(code: number, data: MessageSequence, reply: MessageSequence, options: MessageOption, callback: AsyncCallback): void; /** - * Registers a callback used to receive notifications of the death of a remote object. + * Register a callback used to receive notifications of the death of a remote object. * * @param recipient Indicates the callback to be registered. * @param flags Indicates the flag of the death notification. @@ -1801,7 +1801,7 @@ declare namespace rpc { addDeathRecipient(recipient: DeathRecipient, flags: number): boolean; /** - * Registers a callback used to receive notifications of the death of a remote object. + * Register a callback used to receive notifications of the death of a remote object. * * @param recipient Indicates the callback to be registered. * @param flags Indicates the flag of the death notification. @@ -1812,11 +1812,11 @@ declare namespace rpc { registerDeathRecipient(recipient: DeathRecipient, flags: number): void; /** - * Deregisters a callback used to receive notifications of the death of a remote object. + * . a callback used to receive notifications of the death of a remote object. * - * @param recipient Indicates the callback to be deregistered. + * @param recipient Indicates the callback to be deregister. * @param flags Indicates the flag of the death notification. - * @returns Returns {@code true} if the callback is deregistered successfully; returns {@code false} otherwise. + * @returns Returns {@code true} if the callback is deregister successfully; returns {@code false} otherwise. * @since 7 * @deprecated since 9 * @useinstead ohos.rpc.IRemoteObject#unregisterDeathRecipient @@ -1824,9 +1824,9 @@ declare namespace rpc { removeDeathRecipient(recipient: DeathRecipient, flags: number): boolean; /** - * Deregisters a callback used to receive notifications of the death of a remote object. + * Deregister a callback used to receive notifications of the death of a remote object. * - * @param recipient Indicates the callback to be deregistered. + * @param recipient Indicates the callback to be deregister. * @param flags Indicates the flag of the death notification. * @throws { BusinessError } 401 - check param failed * @throws { BusinessError } 1900008 - proxy or remote object is invalid @@ -2303,7 +2303,7 @@ declare namespace rpc { getLocalInterface(interface: string): IRemoteBroker; /** - * Registers a callback used to receive death notifications of a remote object. + * Register a callback used to receive death notifications of a remote object. * * @param recipient Indicates the callback to be registered. * @param flags Indicates the flag of the death notification. This is a reserved parameter. Set it to {@code 0}. @@ -2315,7 +2315,7 @@ declare namespace rpc { addDeathRecipient(recipient: DeathRecipient, flags: number): boolean; /** - * Registers a callback used to receive death notifications of a remote object. + * Register a callback used to receive death notifications of a remote object. * * @param recipient Indicates the callback to be registered. * @param flags Indicates the flag of the death notification. This is a reserved parameter. Set it to {@code 0}. @@ -2326,11 +2326,11 @@ declare namespace rpc { registerDeathRecipient(recipient: DeathRecipient, flags: number): void; /** - * Deregisters a callback used to receive death notifications of a remote object. + * Deregister a callback used to receive death notifications of a remote object. * - * @param recipient Indicates the callback to be deregistered. + * @param recipient Indicates the callback to be deregister. * @param flags Indicates the flag of the death notification. This is a reserved parameter. Set it to {@code 0}. - * @returns Returns {@code true} if the callback is deregistered successfully; returns {@code false} otherwise. + * @returns Returns {@code true} if the callback is deregister successfully; returns {@code false} otherwise. * @since 7 * @deprecated since 9 * @useinstead ohos.rpc.RemoteProxy#unregisterDeathRecipient @@ -2338,9 +2338,9 @@ declare namespace rpc { removeDeathRecipient(recipient: DeathRecipient, flags: number): boolean; /** - * Deregisters a callback used to receive death notifications of a remote object. + * Deregister a callback used to receive death notifications of a remote object. * - * @param recipient Indicates the callback to be deregistered. + * @param recipient Indicates the callback to be deregister. * @param flags Indicates the flag of the death notification. This is a reserved parameter. Set it to {@code 0}. * @throws { BusinessError } 401 - check param failed * @throws { BusinessError } 1900008 - proxy or remote object is invalid @@ -2553,7 +2553,7 @@ declare namespace rpc { static isLocalCalling(): boolean; /** - * Flushes all pending commands from a specified {@link RemoteProxy} to the corresponding {@link RemoteObject}. + * flush all pending commands from a specified {@link RemoteProxy} to the corresponding {@link RemoteObject}. * *

This method is static. You are advised to call this method before performing any time-sensitive operations. * @@ -2567,7 +2567,7 @@ declare namespace rpc { static flushCommands(object: IRemoteObject): number; /** - * Flushes all pending commands from a specified {@link RemoteProxy} to the corresponding {@link RemoteObject}. + * flush all pending commands from a specified {@link RemoteProxy} to the corresponding {@link RemoteObject}. * *

This method is static. You are advised to call this method before performing any time-sensitive operations. * @@ -2588,7 +2588,7 @@ declare namespace rpc { static resetCallingIdentity(): string; /** - * Restores the UID and PID to those of the remote user. + * Restore the UID and PID to those of the remote user. * *

This method is static. It is usually called after {@code resetCallingIdentity} is used * and requires the UID and PID of the remote user returned by {@code resetCallingIdentity}. @@ -2603,7 +2603,7 @@ declare namespace rpc { static setCallingIdentity(identity: string): boolean; /** - * Restores the UID and PID to those of the remote user. + * Restore the UID and PID to those of the remote user. * *

This method is static. It is usually called after {@code resetCallingIdentity} is used * and requires the UID and PID of the remote user returned by {@code resetCallingIdentity}. -- Gitee From 3eac6fb102404f03c16b43bdab93a461a4fdf7d8 Mon Sep 17 00:00:00 2001 From: crazy_hu Date: Tue, 15 Nov 2022 07:43:11 +0000 Subject: [PATCH 319/438] update jsdoc useinstead Signed-off-by: crazy_hu --- api/@ohos.rpc.d.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/api/@ohos.rpc.d.ts b/api/@ohos.rpc.d.ts index 07d726a01d..9dfb00a053 100644 --- a/api/@ohos.rpc.d.ts +++ b/api/@ohos.rpc.d.ts @@ -1709,6 +1709,7 @@ declare namespace rpc { * @throws RemoteException Throws this exception if the method fails to be called. * @since 7 * @deprecated since 9 + * @useinstead ohos.rpc.IRemoteObject#sendMessageRequest */ sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): boolean; @@ -2090,6 +2091,7 @@ declare namespace rpc { * @throws RemoteException Throws this exception if a remote service error occurs. * @since 7 * @deprecated since 9 + * @useinstead ohos.rpc.RemoteObject#onRemoteMessageRequest */ onRemoteRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): boolean; @@ -2104,8 +2106,9 @@ declare namespace rpc { * @param reply Indicates the {@link MessageParcel} object receiving the response data. * @param options Indicates a synchronous (default) or asynchronous request. * @returns Returns {@code true} if the operation succeeds; returns {@code false} otherwise. - * @deprecated since 8 * @since 7 + * @deprecated since 8 + * @useinstead ohos.rpc.RemoteObject#sendMessageRequest */ sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): boolean; @@ -2380,8 +2383,9 @@ declare namespace rpc { * @param options Indicates a synchronous (default) or asynchronous request. * @returns 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 + * @deprecated since 8 + * @useinstead ohos.rpc.RemoteProxy#sendMessageRequest */ sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): boolean; -- Gitee From 558b689a0545a19e6796bec019f8f7105756de2b Mon Sep 17 00:00:00 2001 From: crazy_hu Date: Tue, 15 Nov 2022 07:51:41 +0000 Subject: [PATCH 320/438] update jsdoc deprecated Signed-off-by: crazy_hu --- api/@ohos.rpc.d.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/api/@ohos.rpc.d.ts b/api/@ohos.rpc.d.ts index 9dfb00a053..7672e96e2a 100644 --- a/api/@ohos.rpc.d.ts +++ b/api/@ohos.rpc.d.ts @@ -1709,7 +1709,6 @@ declare namespace rpc { * @throws RemoteException Throws this exception if the method fails to be called. * @since 7 * @deprecated since 9 - * @useinstead ohos.rpc.IRemoteObject#sendMessageRequest */ sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): boolean; @@ -2108,7 +2107,6 @@ declare namespace rpc { * @returns Returns {@code true} if the operation succeeds; returns {@code false} otherwise. * @since 7 * @deprecated since 8 - * @useinstead ohos.rpc.RemoteObject#sendMessageRequest */ sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): boolean; @@ -2385,7 +2383,6 @@ declare namespace rpc { * @throws RemoteException Throws this exception if a remote object exception occurs. * @since 7 * @deprecated since 8 - * @useinstead ohos.rpc.RemoteProxy#sendMessageRequest */ sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): boolean; -- Gitee From 44a5c05bab98b572efe84e8085e5e5d995849aaa Mon Sep 17 00:00:00 2001 From: crazy_hu Date: Tue, 15 Nov 2022 08:20:53 +0000 Subject: [PATCH 321/438] update jsdoc flush Flush Signed-off-by: crazy_hu --- api/@ohos.rpc.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.rpc.d.ts b/api/@ohos.rpc.d.ts index 7672e96e2a..e920d370f9 100644 --- a/api/@ohos.rpc.d.ts +++ b/api/@ohos.rpc.d.ts @@ -2554,7 +2554,7 @@ declare namespace rpc { static isLocalCalling(): boolean; /** - * flush all pending commands from a specified {@link RemoteProxy} to the corresponding {@link RemoteObject}. + * Flush all pending commands from a specified {@link RemoteProxy} to the corresponding {@link RemoteObject}. * *

This method is static. You are advised to call this method before performing any time-sensitive operations. * @@ -2568,7 +2568,7 @@ declare namespace rpc { static flushCommands(object: IRemoteObject): number; /** - * flush all pending commands from a specified {@link RemoteProxy} to the corresponding {@link RemoteObject}. + * Flush all pending commands from a specified {@link RemoteProxy} to the corresponding {@link RemoteObject}. * *

This method is static. You are advised to call this method before performing any time-sensitive operations. * -- Gitee From 4f2c33a2ac0cbb139305381fd0fcb5a347f17d44 Mon Sep 17 00:00:00 2001 From: crazy_hu Date: Tue, 15 Nov 2022 08:26:12 +0000 Subject: [PATCH 322/438] update jsdoc . Deregister Signed-off-by: crazy_hu --- api/@ohos.rpc.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.rpc.d.ts b/api/@ohos.rpc.d.ts index e920d370f9..253dc3b0fd 100644 --- a/api/@ohos.rpc.d.ts +++ b/api/@ohos.rpc.d.ts @@ -1812,7 +1812,7 @@ declare namespace rpc { registerDeathRecipient(recipient: DeathRecipient, flags: number): void; /** - * . a callback used to receive notifications of the death of a remote object. + * Deregister a callback used to receive notifications of the death of a remote object. * * @param recipient Indicates the callback to be deregister. * @param flags Indicates the flag of the death notification. -- Gitee From 86c29db7691ee2be4efd82c9f66d566fae69e01d Mon Sep 17 00:00:00 2001 From: donglin Date: Tue, 15 Nov 2022 17:18:10 +0800 Subject: [PATCH 323/438] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: donglin Change-Id: I40b4325a85889290ab5c1c88edf00176b1944144 --- api/@ohos.notification.d.ts | 1 - api/@ohos.reminderAgentManager.d.ts | 1 - api/commonEvent/commonEventSubscriber.d.ts | 48 +++++++++++----------- 3 files changed, 24 insertions(+), 26 deletions(-) diff --git a/api/@ohos.notification.d.ts b/api/@ohos.notification.d.ts index de8c1ae964..2c3d321c3e 100644 --- a/api/@ohos.notification.d.ts +++ b/api/@ohos.notification.d.ts @@ -47,7 +47,6 @@ import { NotificationUserInput as _NotificationUserInput } from './notification/ * @name notification * @since 7 * @syscap SystemCapability.Notification.Notification - * @import import notification from '@ohos.notification'; * @permission N/A * @deprecated since 9 * @useinstead ohos.notificationManager and ohos.notificationSubscribe diff --git a/api/@ohos.reminderAgentManager.d.ts b/api/@ohos.reminderAgentManager.d.ts index b96875149f..b66b9fbac3 100644 --- a/api/@ohos.reminderAgentManager.d.ts +++ b/api/@ohos.reminderAgentManager.d.ts @@ -23,7 +23,6 @@ import { NotificationSlot } from './notification/notificationSlot'; * * @since 9 * @syscap SystemCapability.Notification.ReminderAgent - * @import reminderAgentManager from '@ohos.reminderAgentManager'; */ declare namespace reminderAgentManager { /** diff --git a/api/commonEvent/commonEventSubscriber.d.ts b/api/commonEvent/commonEventSubscriber.d.ts index c9e1beb8d7..128dfb42e8 100644 --- a/api/commonEvent/commonEventSubscriber.d.ts +++ b/api/commonEvent/commonEventSubscriber.d.ts @@ -28,7 +28,7 @@ export interface CommonEventSubscriber { * * @since 7 * @param callback Indicate the callback function to receive the common event. - * @return - + * @returns - */ getCode(callback: AsyncCallback): void; @@ -36,7 +36,7 @@ export interface CommonEventSubscriber { * Obtains the result code of the current ordered common event. * * @since 7 - * @return Returns code of this common event + * @returns Returns code of this common event */ getCode(): Promise; @@ -46,7 +46,7 @@ export interface CommonEventSubscriber { * @since 7 * @param code Indicates the custom result code to set. You can set it to any value. * @param callback Indicate the callback function to receive the common event. - * @return - + * @returns - */ setCode(code: number, callback: AsyncCallback): void; @@ -55,7 +55,7 @@ export interface CommonEventSubscriber { * * @since 7 * @param code Indicates the custom result code to set. You can set it to any value. - * @return - + * @returns - */ setCode(code: number): Promise; @@ -64,7 +64,7 @@ export interface CommonEventSubscriber { * * @since 7 * @param callback Indicate the callback function to receive the common event. - * @return - + * @returns - */ getData(callback: AsyncCallback): void; @@ -73,7 +73,7 @@ export interface CommonEventSubscriber { * * @since 7 * @return - * @return Returns data of this common event + * @returns Returns data of this common event */ getData(): Promise; @@ -83,7 +83,7 @@ export interface CommonEventSubscriber { * @since 7 * @param data Indicates the custom result data to set. You can set it to any character string. * @param callback Indicate the callback function to receive the common event. - * @return - + * @returns - */ setData(data: string, callback: AsyncCallback): void; @@ -92,7 +92,7 @@ export interface CommonEventSubscriber { * * @since 7 * @param data Indicates the custom result data to set. You can set it to any character string. - * @return - + * @returns - */ setData(data: string): Promise; @@ -103,7 +103,7 @@ export interface CommonEventSubscriber { * @param code Indicates the custom result code to set. You can set it to any value. * @param data Indicates the custom result data to set. You can set it to any character string. * @param callback Indicate the callback function to receive the common event. - * @return - + * @returns - */ setCodeAndData(code: number, data: string, callback: AsyncCallback): void; @@ -113,7 +113,7 @@ export interface CommonEventSubscriber { * @since 7 * @param code Indicates the custom result code to set. You can set it to any value. * @param data Indicates the custom result data to set. You can set it to any character string. - * @return - + * @returns - */ setCodeAndData(code: number, data: string): Promise; @@ -122,7 +122,7 @@ export interface CommonEventSubscriber { * * @since 7 * @param callback Indicate the callback function to receive the common event. - * @return - + * @returns - */ isOrderedCommonEvent(callback: AsyncCallback): void; @@ -130,7 +130,7 @@ export interface CommonEventSubscriber { * Checks whether the current common event is an ordered common event. * * @since 7 - * @return Returns true if this common event is ordered, false otherwise + * @returns Returns true if this common event is ordered, false otherwise */ isOrderedCommonEvent(): Promise; @@ -139,7 +139,7 @@ export interface CommonEventSubscriber { * * @since 7 * @param callback Indicate the callback function to receive the common event. - * @return - + * @returns - */ isStickyCommonEvent(callback: AsyncCallback): void; @@ -147,7 +147,7 @@ export interface CommonEventSubscriber { * Checks whether the current common event is a sticky common event. * * @since 7 - * @return Returns true if this common event is sticky, false otherwise + * @returns Returns true if this common event is sticky, false otherwise */ isStickyCommonEvent(): Promise; @@ -156,7 +156,7 @@ export interface CommonEventSubscriber { * * @since 7 * @param callback Indicate the callback function to receive the common event. - * @return - + * @returns - */ abortCommonEvent(callback: AsyncCallback): void; @@ -164,7 +164,7 @@ export interface CommonEventSubscriber { * Aborts the current ordered common event. * * @since 7 - * @return - + * @returns - */ abortCommonEvent(): Promise; @@ -173,7 +173,7 @@ export interface CommonEventSubscriber { * * @since 7 * @param callback Indicate the callback function to receive the common event. - * @return - + * @returns - */ clearAbortCommonEvent(callback: AsyncCallback): void; @@ -181,7 +181,7 @@ export interface CommonEventSubscriber { * Clears the abort state of the current ordered common event * * @since 7 - * @return - + * @returns - */ clearAbortCommonEvent(): Promise; @@ -190,7 +190,7 @@ export interface CommonEventSubscriber { * * @since 7 * @param callback Indicate the callback function to receive the common event. - * @return - + * @returns - */ getAbortCommonEvent(callback: AsyncCallback): void; @@ -198,7 +198,7 @@ export interface CommonEventSubscriber { * Checks whether the current ordered common event should be aborted. * * @since 7 - * @return Returns true if this common event is aborted, false otherwise + * @returns Returns true if this common event is aborted, false otherwise */ getAbortCommonEvent(): Promise; @@ -207,7 +207,7 @@ export interface CommonEventSubscriber { * * @since 7 * @param callback Indicate the callback function to receive the common event. - * @return - + * @returns - */ getSubscribeInfo(callback: AsyncCallback): void; @@ -215,7 +215,7 @@ export interface CommonEventSubscriber { * get the CommonEventSubscribeInfo of this CommonEventSubscriber. * * @since 7 - * @return Returns the commonEvent subscribe information + * @returns Returns the commonEvent subscribe information */ getSubscribeInfo(): Promise; @@ -224,7 +224,7 @@ export interface CommonEventSubscriber { * * @since 9 * @param callback Indicate the callback function after the ordered common event is finished. - * @return - + * @returns - */ finishCommonEvent(callback: AsyncCallback): void; @@ -232,7 +232,7 @@ export interface CommonEventSubscriber { * finish the current ordered common event. * * @since 9 - * @return - + * @returns - */ finishCommonEvent(): Promise; } -- Gitee From 5d66cb15cd19af539a93a907e6b590faddea5371 Mon Sep 17 00:00:00 2001 From: wangyihui Date: Tue, 15 Nov 2022 17:33:33 +0800 Subject: [PATCH 324/438] =?UTF-8?q?API=E9=94=99=E8=AF=AF=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangyihui Change-Id: Ia559131958c65c97ba646239d4efc4a0a4541bd8 --- api/@ohos.account.appAccount.d.ts | 40 ++++++------- api/@ohos.account.distributedAccount.d.ts | 6 +- api/@ohos.account.osAccount.d.ts | 68 +++++++++++------------ 3 files changed, 58 insertions(+), 56 deletions(-) diff --git a/api/@ohos.account.appAccount.d.ts b/api/@ohos.account.appAccount.d.ts index 7f20b3b89a..2d4f53cb36 100644 --- a/api/@ohos.account.appAccount.d.ts +++ b/api/@ohos.account.appAccount.d.ts @@ -168,7 +168,7 @@ declare namespace appAccount { * @returns void. * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. - * @throws {BusinessError} 12300002 - invalid name or bundlename. + * @throws {BusinessError} 12300002 - invalid name or bundle name. * @throws {BusinessError} 12300003 - the account indicated by localId dose not exist. * @throws {BusinessError} 12400001 - the application indicated by bundlename does not exist. * @since 9 @@ -184,7 +184,7 @@ declare namespace appAccount { * @returns void. * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. - * @throws {BusinessError} 12300002 - invalid name or bundlename. + * @throws {BusinessError} 12300002 - invalid name or bundle name. * @throws {BusinessError} 12300003 - the account indicated by localId dose not exist. * @since 9 */ @@ -198,7 +198,7 @@ declare namespace appAccount { * through the distributed networking. On the connected devices, you can call this method to check * whether application data can be synchronized. *

- * @permission ohos.permission.DISTRIBUTED_DATASYNC. + * @permission ohos.permission.DISTRIBUTED_DATASYNC * @param name Indicates the name of the application account. * @returns Returns {@code true} if application data synchronization is allowed; returns {@code false} otherwise. * @since 7 @@ -215,7 +215,7 @@ declare namespace appAccount { * through the distributed networking. On the connected devices, you can call this method to check * whether application data can be synchronized. *

- * @permission ohos.permission.DISTRIBUTED_DATASYNC. + * @permission ohos.permission.DISTRIBUTED_DATASYNC * @param name Indicates the name of the application account. * @returns Returns {@code true} if application data synchronization is allowed; returns {@code false} otherwise. * @throws {BusinessError} 201 - permission denied. @@ -268,6 +268,7 @@ declare namespace appAccount { * @returns void. * @since 7 * @deprecated since 9 + * @useinstead appAccount.AppAccountManager#setCustomData */ setAccountExtraInfo(name: string, extraInfo: string, callback: AsyncCallback): void; setAccountExtraInfo(name: string, extraInfo: string): Promise; @@ -276,7 +277,7 @@ declare namespace appAccount { * Sets whether a specified application account allows application data synchronization. *

* If the same OHOS account has logged in to multiple devices, these devices constitute a super device - * through the distributed networking. On the networked devices, you can call this method to set whether to + * through the distributed networking. On the connected devices, you can call this method to set whether to * allow cross-device data synchronization. If synchronization is allowed, application data can be synchronized * among these devices in the event of any changes related to the application account. * If synchronization is not allowed, the application data is stored only on the local device. @@ -287,7 +288,7 @@ declare namespace appAccount { * Application data that can be synchronized: application account name, token, * and data associated with this application account *

- * @permission ohos.permission.DISTRIBUTED_DATASYNC. + * @permission ohos.permission.DISTRIBUTED_DATASYNC * @param name Indicates the name of the application account. * @param isEnable Specifies whether to allow application data synchronization. * @returns void. @@ -302,7 +303,7 @@ declare namespace appAccount { * Sets whether a specified application account enables application data synchronization. *

* If the same OHOS account has logged in to multiple devices, these devices constitute a super device - * through the distributed networking. On the networked devices, you can call this method to set whether to + * through the distributed networking. On the connected devices, you can call this method to set whether to * enable cross-device data synchronization. If synchronization is enabled, application data can be synchronized * among these devices in the event of any changes related to the application account. * If synchronization is not enabled, the application data is stored only on the local device. @@ -313,7 +314,7 @@ declare namespace appAccount { * Application data that can be synchronized: application account name, token, * and data associated with this application account *

- * @permission ohos.permission.DISTRIBUTED_DATASYNC. + * @permission ohos.permission.DISTRIBUTED_DATASYNC * @param name Indicates the name of the application account. * @param isEnabled Specifies whether to enable application data synchronization. * @returns void. @@ -365,7 +366,7 @@ declare namespace appAccount { *

  • Accounts of third-party applications. To obtain such information, * your application must have gained authorization from the third-party applications.
  • * - * @permission ohos.permission.GET_ALL_APP_ACCOUNTS. + * @permission ohos.permission.GET_ALL_APP_ACCOUNTS * @returns Returns a list of application accounts. * @since 7 * @deprecated since 9 @@ -383,7 +384,7 @@ declare namespace appAccount { *
  • Accounts of third-party applications. To obtain such information, * your application must have gained authorization from the third-party applications.
  • * - * @permission ohos.permission.GET_ALL_APP_ACCOUNTS. + * @permission ohos.permission.GET_ALL_APP_ACCOUNTS * @returns Returns a list of application accounts. * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. @@ -402,7 +403,7 @@ declare namespace appAccount { *
  • Accounts of third-party applications. To obtain such information, * your application must have gained authorization from the third-party applications.
  • * - * @permission ohos.permission.GET_ALL_APP_ACCOUNTS. + * @permission ohos.permission.GET_ALL_APP_ACCOUNTS * @param owner Indicates the account owner of your application or third-party applications. * @returns Returns a list of application accounts. * @since 7 @@ -421,14 +422,14 @@ declare namespace appAccount { *
  • Accounts of third-party applications. To obtain such information, * your application must have gained authorization from the third-party applications.
  • * - * @permission ohos.permission.GET_ALL_APP_ACCOUNTS. + * @permission ohos.permission.GET_ALL_APP_ACCOUNTS * @param owner Indicates the account owner of your application or third-party applications. * @returns Returns a list of application accounts. * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. * @throws {BusinessError} 12300002 - invalid owner. - * @throws {BusinessError} 12400001 - the application indicated by bundlename does not exist. + * @throws {BusinessError} 12400001 - the application indicated by bundle name does not exist. * @since 9 */ getAccountsByOwner(owner: string, callback: AsyncCallback>): void; @@ -468,6 +469,7 @@ declare namespace appAccount { * for example, if the account does not exist. * @since 7 * @deprecated since 9 + * @useinstead appAccount.AppAccountManager#getCustomData */ getAccountExtraInfo(name: string, callback: AsyncCallback): void; getAccountExtraInfo(name: string): Promise; @@ -792,7 +794,7 @@ declare namespace appAccount { getAllAuthTokens(name: string, owner: string): Promise>; /** - * Gets the open authorization list with a specified authentication type for a paticular application account. + * Gets the open authorization list with a specified authentication type for a particular application account. *

    * Only the owner of the application account has the permission to call this method. * @param name Indicates the account name of your application. @@ -806,7 +808,7 @@ declare namespace appAccount { getOAuthList(name: string, authType: string): Promise>; /** - * Gets the open authorization list with a specified authentication type for a paticular application account. + * Gets the open authorization list with a specified authentication type for a particular application account. *

    * Only the owner of the application account has the permission to call this method. * @param name Indicates the account name of your application. @@ -875,7 +877,7 @@ declare namespace appAccount { queryAuthenticatorInfo(owner: string): Promise; /** - * Checks whether a paticular account has all specified labels. + * Checks whether a particular account has all specified labels. * @param name Indicates the account name. * @param owner Indicates the account owner. * @param labels Indicates an array of labels to check. @@ -1066,7 +1068,7 @@ declare namespace appAccount { */ interface AuthResult { /** - * The account infomation. + * The account information. * @since 9 */ account?: AppAccountInfo; @@ -1157,7 +1159,7 @@ declare namespace appAccount { */ interface VerifyCredentialOptions { /** - * The credentail type to be verified. + * The credential type to be verified. * @since 9 */ credentialType?: string; @@ -1284,7 +1286,7 @@ declare namespace appAccount { KEY_ACTION = "action", /** - * Indicates the key of authentiaction type. + * Indicates the key of authentication type. * * @since 8 */ diff --git a/api/@ohos.account.distributedAccount.d.ts b/api/@ohos.account.distributedAccount.d.ts index 6d92f11f88..c5deff6f2b 100644 --- a/api/@ohos.account.distributedAccount.d.ts +++ b/api/@ohos.account.distributedAccount.d.ts @@ -51,7 +51,7 @@ declare namespace distributedAccount { /** * Gets the distributed information of the current OS account. - * @permission ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS or ohos.permission.GET_DISTRIBUTED_ACCOUNTS or ohos.permission.DISTRIBUTED_DATASYNC. + * @permission ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS or ohos.permission.GET_DISTRIBUTED_ACCOUNTS or ohos.permission.DISTRIBUTED_DATASYNC * @returns The distributed information of the current OS account. * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. @@ -63,7 +63,7 @@ declare namespace distributedAccount { /** * Updates the distributed information of the OS account. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @param accountInfo Indicates the information of the OS account used for a distributed system. * @returns void * @since 7 @@ -75,7 +75,7 @@ declare namespace distributedAccount { /** * Sets the distributed information of the OS account. - * @permission ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS. + * @permission ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS * @param accountInfo Indicates the information of the OS account used for a distributed system. * @returns void * @throws {BusinessError} 201 - permission denied. diff --git a/api/@ohos.account.osAccount.d.ts b/api/@ohos.account.osAccount.d.ts index 093b0dbfbb..c9ab2e1901 100644 --- a/api/@ohos.account.osAccount.d.ts +++ b/api/@ohos.account.osAccount.d.ts @@ -44,7 +44,7 @@ declare namespace osAccount { * to run in the foreground. Then, the OS account originally running in the foreground will be * switched to the background. *

    - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION * @param localId Indicates the local ID of the OS account. * @returns void. * @throws {BusinessError} 201 - permission denied. @@ -94,7 +94,7 @@ declare namespace osAccount { /** * Checks whether an OS account is activated based on its local ID. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param localId Indicates the local ID of the OS account. * @returns void * @throws {BusinessError} 201 - permission denied. @@ -109,7 +109,7 @@ declare namespace osAccount { /** * Checks whether a constraint has been enabled for an OS account based on its local ID. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @param localId Indicates the local ID of the OS account. * @param constraint Indicates the constraint to check. The value can be: *
      @@ -132,7 +132,7 @@ declare namespace osAccount { /** * Checks whether a constraint has been enabled for an OS account based on its local ID. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @param localId Indicates the local ID of the OS account. * @param constraint Indicates the constraint to check. The value can be: *
        @@ -178,7 +178,7 @@ declare namespace osAccount { /** * Checks whether an OS account has been verified based on its local ID. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param localId Indicates the local ID of the OS account. * @returns Returns {@code true} if the OS account has been verified successfully; * returns {@code false} otherwise. @@ -193,7 +193,7 @@ declare namespace osAccount { /** * Checks whether an OS account has been verified based on its ID. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param localId Indicates the local ID of the OS account. * @returns Returns {@code true} if the OS account has been verified successfully; * returns {@code false} otherwise. @@ -210,7 +210,7 @@ declare namespace osAccount { /** * Removes an OS account based on its local ID. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @param localId Indicates the local ID of the OS account. * @returns void. * @throws {BusinessError} 201 - permission denied. @@ -227,7 +227,7 @@ declare namespace osAccount { /** * Sets constraints for an OS account based on its local ID. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @param localId Indicates the local ID of the OS account. * @param constraints Indicates the constraints to set for the OS account. The value can be: *
          @@ -256,7 +256,7 @@ declare namespace osAccount { /** * Sets the local name for an OS account based on its local ID. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @param localId Indicates the local ID of the OS account. * @param localName Indicates the local name to set for the OS account. * @returns void. @@ -274,7 +274,7 @@ declare namespace osAccount { /** * Obtains the number of all OS accounts created on a device. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @returns Returns the number of created OS accounts. * @since 7 * @deprecated since 9 @@ -285,7 +285,7 @@ declare namespace osAccount { /** * Obtains the number of all OS accounts created on a device. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @returns Returns the number of created OS accounts. * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. @@ -340,7 +340,7 @@ declare namespace osAccount { /** * Queries the local ID of an OS account which is bound to the specified domain account - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @param domainInfo Indicates the domain account info. * @returns Returns the local ID of the OS account. * @since 8 @@ -353,7 +353,7 @@ declare namespace osAccount { /** * Queries the ID of an account which is bound to the specified domain account * - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @param domainInfo Indicates the domain account info. * @returns Returns the local ID of the OS account. * @throws {BusinessError} 201 - permission denied. @@ -378,7 +378,7 @@ declare namespace osAccount { /** * Obtains all constraints of an OS account based on its local ID. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @param localId Indicates the local ID of the OS account. * @returns Returns a list of constraints. * @since 7 @@ -390,7 +390,7 @@ declare namespace osAccount { /** * Obtains all constraints of an account based on its ID. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @param localId Indicates the local ID of the OS account. * @returns Returns a list of constraints. * @throws {BusinessError} 201 - permission denied. @@ -405,7 +405,7 @@ declare namespace osAccount { /** * Queries the list of all the OS accounts that have been created in the system. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @returns Returns a list of OS accounts. * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. @@ -438,7 +438,7 @@ declare namespace osAccount { /** * Creates an OS account using the local name and account type. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @param localName Indicates the local name of the OS account to create. * @param type Indicates the type of the OS account to create. * {@link OsAccountType} specifies the account types available in the system. @@ -458,7 +458,7 @@ declare namespace osAccount { /** * Creates an OS account using the account type and domain account info. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @param type Indicates the type of the OS account to create. * {@link OsAccountType} specifies the account types available in the system. * @param domainInfo Indicates the domain account info. @@ -478,7 +478,7 @@ declare namespace osAccount { /** * Queries information about the current OS account. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @returns Returns information about the current OS account; returns {@code null} if the query fails. * @since 7 * @deprecated since 9 @@ -489,7 +489,7 @@ declare namespace osAccount { /** * Gets information about the current OS account. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @returns Returns information about the current OS account; returns {@code null} if the query fails. * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. @@ -502,7 +502,7 @@ declare namespace osAccount { /** * Queries OS account information based on the local ID. * - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION * @param localId Indicates the local ID of the OS account. * @returns Returns the OS account information; returns {@code null} if the query fails. * @throws {BusinessError} 201 - permission denied. @@ -542,11 +542,11 @@ declare namespace osAccount { * Obtains the distributed virtual device ID (DVID). *

          * If the same OHOS account has logged in to multiple devices, these devices constitute a super device - * through the distributed networking. On the networked devices, you can call this method to obtain the DVIDs. + * through the distributed networking. On the connected devices, you can call this method to obtain the DVIDs. * The same application running on different devices obtains the same DVID, whereas different applications * obtain different DVIDs. *

          - * @permission ohos.permission.DISTRIBUTED_DATASYNC or ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.DISTRIBUTED_DATASYNC or ohos.permission.MANAGE_LOCAL_ACCOUNTS * @returns Returns the DVID if obtained; returns an empty string if no OHOS account has logged in. * @since 7 * @deprecated since 9 @@ -559,11 +559,11 @@ declare namespace osAccount { * Queries the distributed virtual device ID (DVID). *

          * If the same OHOS account has logged in to multiple devices, these devices constitute a super device - * through the distributed networking. On the networked devices, you can call this method to obtain the DVIDs. + * through the distributed networking. On the connected devices, you can call this method to obtain the DVIDs. * The same application running on different devices obtains the same DVID, whereas different applications * obtain different DVIDs. *

          - * @permission ohos.permission.DISTRIBUTED_DATASYNC or ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.DISTRIBUTED_DATASYNC or ohos.permission.MANAGE_LOCAL_ACCOUNTS * @returns Returns the DVID if obtained; returns an empty string if no OHOS account has logged in. * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. @@ -575,7 +575,7 @@ declare namespace osAccount { /** * Obtains the profile photo of an OS account based on its local ID. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @param localId Indicates the local ID of the OS account. * @returns Returns the profile photo if obtained; * returns {@code null} if the profile photo fails to be obtained. @@ -592,7 +592,7 @@ declare namespace osAccount { /** * Sets the profile photo for an OS account based on its local ID. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @param localId Indicates the local ID of the OS account. * @param photo Indicates the profile photo to set for the OS account. * @returns void. @@ -706,7 +706,7 @@ declare namespace osAccount { /** * Check whether current process belongs to the main account. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @returns Returns {@code true} if current process belongs to the main os account; * returns {@code false} otherwise. * @throws {BusinessError} 201 - permission denied. @@ -720,7 +720,7 @@ declare namespace osAccount { /** * Query the constraint source type list of the OS account. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @returns Returns the constraint source type infos of the os account; * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. @@ -979,7 +979,7 @@ declare namespace osAccount { * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. - * @throws {BusinessError} 12300002 - invalid contexId. + * @throws {BusinessError} 12300002 - invalid contextId. * @systemapi Hide this for inner system use. * @since 8 */ @@ -1059,7 +1059,7 @@ declare namespace osAccount { *

          * Add user credential information, pass in credential addition method and credential information * (credential type, subclass, if adding user's non password credentials, pass in password authentication token), - * and get the result / acquireinfo callback. + * and get the result / acquireInfo callback. * @permission ohos.permission.MANAGE_USER_IDM * @param credentialInfo Indicates the credential information. * @param callback Indicates the callback to get results and acquireInfo. @@ -1214,9 +1214,9 @@ declare namespace osAccount { * The authentication result code is returned through the callback. * @param result Indicates the authentication result code. * @param extraInfo Indicates the specific information for different situation. - * If the authentication is passed, the authentication token is returned in extrainfo, - * If the authentication fails, the remaining authentication times are returned in extrainfo, - * If the authentication executor is locked, the freezing time is returned in extrainfo. + * If the authentication is passed, the authentication token is returned in extraInfo, + * If the authentication fails, the remaining authentication times are returned in extraInfo, + * If the authentication executor is locked, the freezing time is returned in extraInfo. * @systemapi Hide this for inner system use. * @since 8 */ -- Gitee From 680d7f8f789acc5a990e28c8aa1dd1321b2bf448 Mon Sep 17 00:00:00 2001 From: donglin Date: Wed, 16 Nov 2022 10:44:42 +0800 Subject: [PATCH 325/438] JsDoc Signed-off-by: donglin Change-Id: I37979ece436dc79f27f0f1c463b7b19c3a404955 --- api/@ohos.ability.featureAbility.d.ts | 22 +++++++++---------- api/@ohos.ability.particleAbility.d.ts | 14 +++++++----- ...application.DataShareExtensionAbility.d.ts | 19 ++++++++-------- ....application.abilityDelegatorRegistry.d.ts | 9 ++------ api/@ohos.application.abilityManager.d.ts | 8 +++---- api/@ohos.application.appManager.d.ts | 21 +++++++++--------- api/@ohos.application.errorManager.d.ts | 5 ++--- ...ohos.continuation.continuationManager.d.ts | 10 +++++---- api/@ohos.wantAgent.d.ts | 15 ++++++------- api/app/context.d.ts | 12 +++++----- api/application/ApplicationContext.d.ts | 8 +++---- api/application/ApplicationStateObserver.d.ts | 10 ++++----- api/application/ErrorObserver.d.ts | 2 +- api/application/MissionListener.d.ts | 14 ++++++------ api/application/ServiceExtensionContext.d.ts | 6 ++--- api/application/abilityDelegator.d.ts | 2 +- api/application/abilityDelegatorArgs.d.ts | 1 - api/application/abilityMonitor.d.ts | 1 - api/application/abilityStageMonitor.d.ts | 1 - api/common/full/featureability.d.ts | 5 ++++- api/common/lite/featureability.d.ts | 1 + 21 files changed, 90 insertions(+), 96 deletions(-) diff --git a/api/@ohos.ability.featureAbility.d.ts b/api/@ohos.ability.featureAbility.d.ts index 944d6d321b..a8f5d17060 100644 --- a/api/@ohos.ability.featureAbility.d.ts +++ b/api/@ohos.ability.featureAbility.d.ts @@ -40,7 +40,7 @@ declare namespace featureAbility { * @since 6 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param parameter Indicates the ability to start. - * @return - + * @returns - * @FAModelOnly */ function getWant(callback: AsyncCallback): void; @@ -52,7 +52,7 @@ declare namespace featureAbility { * @since 6 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param parameter Indicates the ability to start. - * @return - + * @returns - * @FAModelOnly */ function startAbility(parameter: StartAbilityParameter, callback: AsyncCallback): void; @@ -62,7 +62,7 @@ declare namespace featureAbility { * Obtains the application context. * * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @return Returns the application context. + * @returns Returns the application context. * @since 6 * @FAModelOnly */ @@ -74,7 +74,7 @@ declare namespace featureAbility { * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param parameter Indicates the ability to start. - * @return Returns the {@link AbilityResult}. + * @returns Returns the {@link AbilityResult}. * @FAModelOnly */ function startAbilityForResult(parameter: StartAbilityParameter, callback: AsyncCallback): void; @@ -87,7 +87,7 @@ declare namespace featureAbility { * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param parameter Indicates the result to return. - * @return - + * @returns - * @FAModelOnly */ function terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback): void; @@ -98,7 +98,7 @@ declare namespace featureAbility { * * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @return - + * @returns - * @FAModelOnly */ function terminateSelf(callback: AsyncCallback): void; @@ -110,7 +110,7 @@ declare namespace featureAbility { * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param uri Indicates the path of the file to open. - * @return Returns the dataAbilityHelper. + * @returns Returns the dataAbilityHelper. * @FAModelOnly */ function acquireDataAbilityHelper(uri: string): DataAbilityHelper; @@ -120,7 +120,7 @@ declare namespace featureAbility { * * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @return Returns {@code true} if this ability currently has window focus; returns {@code false} otherwise. + * @returns Returns {@code true} if this ability currently has window focus; returns {@code false} otherwise. * @FAModelOnly */ function hasWindowFocus(callback: AsyncCallback): void; @@ -133,7 +133,7 @@ declare namespace featureAbility { * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param request The element name of the service ability * @param options The remote object instance - * @return Returns the number code of the ability connected + * @returns Returns the number code of the ability connected * @FAModelOnly */ function connectAbility(request: Want, options:ConnectOptions ): number; @@ -154,7 +154,7 @@ declare namespace featureAbility { * * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @return Returns the window corresponding to the current ability. + * @returns Returns the window corresponding to the current ability. * @FAModelOnly */ function getWindow(callback: AsyncCallback): void; @@ -223,7 +223,6 @@ declare namespace featureAbility { * * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @import import abilityManager from 'app/context' * @FAModelOnly */ export type Context = _Context @@ -239,7 +238,6 @@ declare namespace featureAbility { * @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 } diff --git a/api/@ohos.ability.particleAbility.d.ts b/api/@ohos.ability.particleAbility.d.ts index 04321ffcd7..9c02954c62 100644 --- a/api/@ohos.ability.particleAbility.d.ts +++ b/api/@ohos.ability.particleAbility.d.ts @@ -35,7 +35,7 @@ declare namespace particleAbility { * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param parameter Indicates the ability to start. - * @return - + * @returns - * @FAModelOnly */ function startAbility(parameter: StartAbilityParameter, callback: AsyncCallback): void; @@ -46,7 +46,7 @@ declare namespace particleAbility { * * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @return - + * @returns - * @FAModelOnly */ function terminateSelf(callback: AsyncCallback): void; @@ -58,7 +58,7 @@ declare namespace particleAbility { * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param uri Indicates the path of the file to open. - * @return Returns the dataAbilityHelper. + * @returns Returns the dataAbilityHelper. * @FAModelOnly */ function acquireDataAbilityHelper(uri: string): DataAbilityHelper; @@ -72,7 +72,8 @@ declare namespace particleAbility { * @param id Identifies the notification bar information. * @param request Indicates the notificationRequest instance containing information for displaying a notification bar. * @FAModelOnly - * @deprecated + * @deprecated since 9 + * @useinstead ohos.resourceschedule.backgroundTaskManager.startBackgroundRunning */ function startBackgroundRunning(id: number, request: NotificationRequest, callback: AsyncCallback): void; function startBackgroundRunning(id: number, request: NotificationRequest): Promise; @@ -83,7 +84,8 @@ declare namespace particleAbility { * @since 7 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask * @FAModelOnly - * @deprecated + * @deprecated since 9 + * @useinstead ohos.resourceschedule.backgroundTaskManager.stopBackgroundRunning */ function cancelBackgroundRunning(callback: AsyncCallback): void; function cancelBackgroundRunning(): Promise; @@ -95,7 +97,7 @@ declare namespace particleAbility { * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param request Indicates the Service ability to connect. * @param options Callback object for the client. If this parameter is null, an exception is thrown. - * @return unique identifier of the connection between the client and the service side. + * @returns unique identifier of the connection between the client and the service side. * @FAModelOnly */ function connectAbility(request: Want, options:ConnectOptions): number; diff --git a/api/@ohos.application.DataShareExtensionAbility.d.ts b/api/@ohos.application.DataShareExtensionAbility.d.ts index c56abbdeb8..5af2f87aa3 100644 --- a/api/@ohos.application.DataShareExtensionAbility.d.ts +++ b/api/@ohos.application.DataShareExtensionAbility.d.ts @@ -45,7 +45,7 @@ export default class DataShareExtensionAbility { * @syscap SystemCapability.DistributedDataManager.DataShare.Provider * @param want Indicates connection information about the datashare extension ability. * @systemapi Hide this for inner system use. - * @return - + * @returns - * @StageModelOnly */ onCreate?(want: Want, callback: AsyncCallback): void; @@ -58,7 +58,7 @@ export default class DataShareExtensionAbility { * @param uri Indicates the position where the data is to insert. * @param valueBucket Indicates the data to insert. * @systemapi Hide this for inner system use. - * @return Returns the index of the newly inserted data record. + * @returns Returns the index of the newly inserted data record. * @StageModelOnly */ insert?(uri: string, valueBucket: ValuesBucket, callback: AsyncCallback): void; @@ -73,7 +73,7 @@ export default class DataShareExtensionAbility { * default. * @param valueBucket Indicates the data to update. This parameter can be null. * @systemapi Hide this for inner system use. - * @return Returns the number of data records updated. + * @returns Returns the number of data records updated. * @StageModelOnly */ update?(uri: string, predicates: dataSharePredicates.DataSharePredicates, valueBucket: ValuesBucket, @@ -88,15 +88,14 @@ export default class DataShareExtensionAbility { * @param predicates Indicates filter criteria. If this parameter is null, all data records will be deleted by * default. * @systemapi Hide this for inner system use. - * @return Returns the number of data records deleted. + * @returns Returns the number of data records deleted. * @StageModelOnly */ delete?(uri: string, predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; /** * Queries one or more data records in the database. This method should be implemented by a data share. - * - * @note Only RDB and distributed KVDB resultsets are supported. The current version does not support custom resultsets. + * Only RDB and distributed KVDB resultsets are supported. The current version does not support custom resultsets. * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Provider * @param uri Indicates the database table storing the data to query. @@ -105,7 +104,7 @@ export default class DataShareExtensionAbility { * @param columns Indicates the columns to be queried, in array, for example, {"name","age"}. You should define * the processing logic when this parameter is null. * @systemapi Hide this for inner system use. - * @return Returns the queried data, only support result set of rdb or kvstore. + * @returns Returns the queried data, only support result set of rdb or kvstore. * @StageModelOnly */ query?(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns: Array, @@ -119,7 +118,7 @@ export default class DataShareExtensionAbility { * @param uri Indicates the position where the data is to insert. * @param valueBuckets Indicates the data to insert. * @systemapi Hide this for inner system use. - * @return Returns the number of data records inserted. + * @returns Returns the number of data records inserted. * @StageModelOnly */ batchInsert?(uri: string, valueBuckets: Array, callback: AsyncCallback): void; @@ -133,7 +132,7 @@ export default class DataShareExtensionAbility { * @syscap SystemCapability.DistributedDataManager.DataShare.Provider * @param uri Indicates the uri to normalize. * @systemapi Hide this for inner system use. - * @return Returns the normalized uri if the data share supports URI normalization; + * @returns Returns the normalized uri if the data share supports URI normalization; * @StageModelOnly */ normalizeUri?(uri: string, callback: AsyncCallback): void; @@ -146,7 +145,7 @@ export default class DataShareExtensionAbility { * @syscap SystemCapability.DistributedDataManager.DataShare.Provider * @param uri Indicates the uri to denormalize. * @systemapi Hide this for inner system use. - * @return Returns the denormalized {@code uri} object if the denormalization is successful; returns the original + * @returns Returns the denormalized {@code uri} object if the denormalization is successful; returns the original * {@code uri} passed to this method if there is nothing to do; returns {@code null} if the data identified by * the original {@code uri} cannot be found in the current environment. * @StageModelOnly diff --git a/api/@ohos.application.abilityDelegatorRegistry.d.ts b/api/@ohos.application.abilityDelegatorRegistry.d.ts index d8d7a51a5b..b5912a8143 100644 --- a/api/@ohos.application.abilityDelegatorRegistry.d.ts +++ b/api/@ohos.application.abilityDelegatorRegistry.d.ts @@ -24,7 +24,6 @@ import { ShellCmdResult as _ShellCmdResult } from './application/shellCmdResult' * * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @import import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' * @permission N/A * @deprecated since 9 * @useinstead ohos.app.ability.abilityDelegatorRegistry @@ -35,7 +34,7 @@ declare namespace abilityDelegatorRegistry { * * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return the AbilityDelegator object initialized when the application is started. + * @returns the AbilityDelegator object initialized when the application is started. */ function getAbilityDelegator(): AbilityDelegator; @@ -44,7 +43,7 @@ declare namespace abilityDelegatorRegistry { * * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return the previously registered AbilityDelegatorArgs object. + * @returns the previously registered AbilityDelegatorArgs object. */ function getArguments(): AbilityDelegatorArgs; @@ -67,7 +66,6 @@ declare namespace abilityDelegatorRegistry { * * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @import import AbilityDelegator from 'application/abilityDelegator.d' */ export type AbilityDelegator = _AbilityDelegator @@ -76,7 +74,6 @@ declare namespace abilityDelegatorRegistry { * * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @import import AbilityDelegatorArgs from 'application/abilityDelegatorArgs.d' */ export type AbilityDelegatorArgs = _AbilityDelegatorArgs @@ -86,7 +83,6 @@ declare namespace abilityDelegatorRegistry { * * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @import import AbilityMonitor from 'application/abilityMonitor.d' */ export type AbilityMonitor = _AbilityMonitor @@ -95,7 +91,6 @@ declare namespace abilityDelegatorRegistry { * * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @import import ShellCmdResult from 'application/shellCmdResult.d' */ export type ShellCmdResult = _ShellCmdResult } diff --git a/api/@ohos.application.abilityManager.d.ts b/api/@ohos.application.abilityManager.d.ts index dfa26ab42b..af7747a0ef 100644 --- a/api/@ohos.application.abilityManager.d.ts +++ b/api/@ohos.application.abilityManager.d.ts @@ -52,7 +52,7 @@ declare namespace abilityManager { * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param config Indicates the new configuration. * @systemapi Hide this for inner system use. - * @return - + * @returns - * @permission ohos.permission.UPDATE_CONFIGURATION */ function updateConfiguration(config: Configuration, callback: AsyncCallback): void; @@ -64,7 +64,7 @@ declare namespace abilityManager { * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi Hide this for inner system use. - * @return Returns the array of {@link AbilityRunningInfo}. + * @returns Returns the array of {@link AbilityRunningInfo}. * @permission ohos.permission.GET_RUNNING_INFO */ function getAbilityRunningInfos(): Promise>; @@ -77,7 +77,7 @@ declare namespace abilityManager { * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param upperLimit Get the maximum limit of the number of messages * @systemapi Hide this for inner system use. - * @return Returns the array of {@link ExtensionRunningInfo}. + * @returns Returns the array of {@link ExtensionRunningInfo}. * @permission ohos.permission.GET_RUNNING_INFO */ function getExtensionRunningInfos(upperLimit: number): Promise>; @@ -89,7 +89,7 @@ declare namespace abilityManager { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi Hide this for inner system use. - * @return Returns the {@link ElementName} info of the top ability. + * @returns Returns the {@link ElementName} info of the top ability. */ function getTopAbility(): Promise; function getTopAbility(callback: AsyncCallback): void; diff --git a/api/@ohos.application.appManager.d.ts b/api/@ohos.application.appManager.d.ts index 3be17cb201..55a7bfcf71 100644 --- a/api/@ohos.application.appManager.d.ts +++ b/api/@ohos.application.appManager.d.ts @@ -25,7 +25,6 @@ import { ProcessRunningInformation as _ProcessRunningInformation } from './appli * * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @import import appManager from '@ohos.application.appManager' * @permission N/A * @deprecated since 9 * @useinstead ohos.app.ability.appManager @@ -70,7 +69,7 @@ declare namespace appManager { * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param observer The application state observer. * @systemapi hide this for inner system use - * @return Returns the number code of the observer. + * @returns Returns the number code of the observer. * @permission ohos.permission.RUNNING_STATE_OBSERVER */ function registerApplicationStateObserver(observer: ApplicationStateObserver): number; @@ -84,7 +83,7 @@ declare namespace appManager { * @param observer The application state observer. * @param bundleNameList The list of bundleName. The max length is 128. * @systemapi - * @return Returns the number code of the observer. + * @returns Returns the number code of the observer. * @permission ohos.permission.RUNNING_STATE_OBSERVER */ function registerApplicationStateObserver(observer: ApplicationStateObserver, bundleNameList: Array): number; @@ -96,7 +95,7 @@ declare namespace appManager { * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param observerId Indicates the number code of the observer. * @systemapi hide this for inner system use - * @return - + * @returns - * @permission ohos.permission.RUNNING_STATE_OBSERVER */ function unregisterApplicationStateObserver(observerId: number, callback: AsyncCallback): void; @@ -108,7 +107,7 @@ declare namespace appManager { * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi hide this for inner system use - * @return Returns the list of AppStateData. + * @returns Returns the list of AppStateData. * @permission ohos.permission.GET_RUNNING_INFO */ function getForegroundApplications(callback: AsyncCallback>): void; @@ -122,7 +121,7 @@ declare namespace appManager { * @param bundleName The process bundle name. * @param accountId The account id. * @systemapi hide this for inner system use - * @return - + * @returns - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS and ohos.permission.CLEAN_BACKGROUND_PROCESSES */ function killProcessWithAccount(bundleName: string, accountId: number): Promise; @@ -133,7 +132,7 @@ declare namespace appManager { * * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return Returns true if user is running stability test. + * @returns Returns true if user is running stability test. */ function isRunningInStabilityTest(callback: AsyncCallback): void; function isRunningInStabilityTest(): Promise; @@ -143,7 +142,7 @@ declare namespace appManager { * * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return Returns the array of {@link ProcessRunningInfo}. + * @returns Returns the array of {@link ProcessRunningInfo}. * @permission ohos.permission.GET_RUNNING_INFO * @deprecated since 9 * @useinstead getProcessRunningInformation @@ -177,7 +176,7 @@ declare namespace appManager { * Is it a ram-constrained device * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return whether a ram-constrained device. + * @returns whether a ram-constrained device. */ function isRamConstrainedDevice(): Promise; function isRamConstrainedDevice(callback: AsyncCallback): void; @@ -186,7 +185,7 @@ declare namespace appManager { * Get the memory size of the application * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return application memory size. + * @returns application memory size. */ function getAppMemorySize(): Promise; function getAppMemorySize(callback: AsyncCallback): void; @@ -196,7 +195,7 @@ declare namespace appManager { * * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return Returns the array of {@link ProcessRunningInformation}. + * @returns Returns the array of {@link ProcessRunningInformation}. * @permission ohos.permission.GET_RUNNING_INFO */ function getProcessRunningInformation(): Promise>; diff --git a/api/@ohos.application.errorManager.d.ts b/api/@ohos.application.errorManager.d.ts index 1709d8e029..57a490dc8b 100644 --- a/api/@ohos.application.errorManager.d.ts +++ b/api/@ohos.application.errorManager.d.ts @@ -21,7 +21,6 @@ import * as _ErrorObserver from './application/ErrorObserver'; * * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @import import errorManager from '@ohos.application.errorManager' * @permission N/A * @deprecated since 9 * @useinstead ohos.app.ability.errorManager @@ -34,7 +33,7 @@ declare namespace errorManager { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param observer The error observer. - * @return Returns the number code of the observer. + * @returns Returns the number code of the observer. */ function registerErrorObserver(observer: ErrorObserver): number; @@ -44,7 +43,7 @@ declare namespace errorManager { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param observerId Indicates the number code of the observer. - * @return - + * @returns - */ function unregisterErrorObserver(observerId: number, callback: AsyncCallback): void; function unregisterErrorObserver(observerId: number): Promise; diff --git a/api/@ohos.continuation.continuationManager.d.ts b/api/@ohos.continuation.continuationManager.d.ts index 292945f77c..7e131fd806 100644 --- a/api/@ohos.continuation.continuationManager.d.ts +++ b/api/@ohos.continuation.continuationManager.d.ts @@ -71,6 +71,7 @@ declare namespace continuationManager { * @syscap SystemCapability.Ability.DistributedAbilityManager * @since 8 * @deprecated since 9 + * @useinstead ohos.continuation.continuationManager.continuationManager#on/off(type: "deviceSelected") */ function on(type: "deviceConnect", callback: Callback): void; function off(type: "deviceConnect", callback?: Callback): void; @@ -84,6 +85,7 @@ declare namespace continuationManager { * @syscap SystemCapability.Ability.DistributedAbilityManager * @since 8 * @deprecated since 9 + * @useinstead ohos.continuation.continuationManager.continuationManager#on/off(type: "deviceUnSelected") */ function on(type: "deviceDisconnect", callback: Callback): void; function off(type: "deviceDisconnect", callback?: Callback): void; @@ -98,7 +100,7 @@ declare namespace continuationManager { * @syscap SystemCapability.Ability.DistributedAbilityManager * @since 8 * @deprecated since 9 - * @useinstead ohos.continuation.continuationManager.registerContinuation + * @useinstead ohos.continuation.continuationManager.continuationManager#registerContinuation */ function register(callback: AsyncCallback): void; function register(options: ContinuationExtraParams, callback: AsyncCallback): void; @@ -113,7 +115,7 @@ declare namespace continuationManager { * @syscap SystemCapability.Ability.DistributedAbilityManager * @since 8 * @deprecated since 9 - * @useinstead ohos.continuation.continuationManager.unregisterContinuation + * @useinstead ohos.continuation.continuationManager.continuationManager#unregisterContinuation */ function unregister(token: number, callback: AsyncCallback): void; function unregister(token: number): Promise; @@ -128,7 +130,7 @@ declare namespace continuationManager { * @syscap SystemCapability.Ability.DistributedAbilityManager * @since 8 * @deprecated since 9 - * @useinstead ohos.continuation.continuationManager.updateContinuationState + * @useinstead ohos.continuation.continuationManager.continuationManager#updateContinuationState */ function updateConnectStatus(token: number, deviceId: string, status: DeviceConnectState, callback: AsyncCallback): void; function updateConnectStatus(token: number, deviceId: string, status: DeviceConnectState): Promise; @@ -143,7 +145,7 @@ declare namespace continuationManager { * @syscap SystemCapability.Ability.DistributedAbilityManager * @since 8 * @deprecated since 9 - * @useinstead ohos.continuation.continuationManager.startContinuationDeviceManager + * @useinstead ohos.continuation.continuationManager.continuationManager#startContinuationDeviceManager */ function startDeviceManager(token: number, callback: AsyncCallback): void; function startDeviceManager(token: number, options: ContinuationExtraParams, callback: AsyncCallback): void; diff --git a/api/@ohos.wantAgent.d.ts b/api/@ohos.wantAgent.d.ts index 9863e89de4..bd03a29f6a 100644 --- a/api/@ohos.wantAgent.d.ts +++ b/api/@ohos.wantAgent.d.ts @@ -25,7 +25,6 @@ import { TriggerInfo as _TriggerInfo } from './wantAgent/triggerInfo'; * @name wantAgent * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @import import wantAgent from '@ohos.wantAgent'; * @permission N/A * @deprecated since 9 * @useinstead ohos.app.ability.wantAgent @@ -35,7 +34,7 @@ declare namespace wantAgent { * Obtains the bundle name of a WantAgent. * * @param WantAgent whose bundle name to obtain. - * @return Returns the bundle name of the {@link WantAgent} if any. + * @returns Returns the bundle name of the {@link WantAgent} if any. */ function getBundleName(agent: WantAgent, callback: AsyncCallback): void; function getBundleName(agent: WantAgent): Promise; @@ -44,7 +43,7 @@ declare namespace wantAgent { * Obtains the UID of a WantAgent. * * @param WantAgent whose UID to obtain. - * @return Returns the UID of the {@link WantAgent} if any; returns {@code -1} otherwise. + * @returns Returns the UID of the {@link WantAgent} if any; returns {@code -1} otherwise. */ function getUid(agent: WantAgent, callback: AsyncCallback): void; function getUid(agent: WantAgent): Promise; @@ -53,7 +52,7 @@ declare namespace wantAgent { * Obtains the {@link Want} of an {@link WantAgent}. * * @param agent Indicates the {@link WantAgent} whose UID is to be obtained. - * @return Returns the {@link Want} of the {@link WantAgent}. + * @returns Returns the {@link Want} of the {@link WantAgent}. * @systemapi Hide this for inner system use. */ function getWant(agent: WantAgent, callback: AsyncCallback): void; @@ -62,7 +61,7 @@ declare namespace wantAgent { * Obtains the {@link Want} of an {@link WantAgent}. * * @param agent Indicates the {@link WantAgent} whose UID is to be obtained. - * @return Returns the {@link Want} of the {@link WantAgent}. + * @returns Returns the {@link Want} of the {@link WantAgent}. * @systemapi Hide this for inner system use. */ function getWant(agent: WantAgent): Promise; @@ -99,7 +98,7 @@ declare namespace wantAgent { * * @param WantAgent to compare. * @param WantAgent to compare. - * @return Returns {@code true} If the two objects are the same; returns {@code false} otherwise. + * @returns Returns {@code true} If the two objects are the same; returns {@code false} otherwise. */ function equal(agent: WantAgent, otherAgent: WantAgent, callback: AsyncCallback): void; function equal(agent: WantAgent, otherAgent: WantAgent): Promise; @@ -108,7 +107,7 @@ declare namespace wantAgent { * Obtains a WantAgent object. * * @param Information about the WantAgent object to obtain. - * @return Returns the created {@link WantAgent} object. + * @returns Returns the created {@link WantAgent} object. */ function getWantAgent(info: WantAgentInfo, callback: AsyncCallback): void; function getWantAgent(info: WantAgentInfo): Promise; @@ -118,7 +117,7 @@ declare namespace wantAgent { * * @since 9 * @param agent Indicates the {@link WantAgent} whose {@link OperationType} is to be obtained. - * @return Returns the {@link OperationType} of the {@link WantAgent}. + * @returns Returns the {@link OperationType} of the {@link WantAgent}. */ function getOperationType(agent: WantAgent, callback: AsyncCallback): void; function getOperationType(agent: WantAgent): Promise; diff --git a/api/app/context.d.ts b/api/app/context.d.ts index e24a3dd24b..2b013c7799 100644 --- a/api/app/context.d.ts +++ b/api/app/context.d.ts @@ -40,12 +40,12 @@ export interface Context extends BaseContext { /** * Get the local root dir of an app. If it is the first call, the dir * will be created. - * @note If in the context of the ability, return the root dir of + * If in the context of the ability, return the root dir of * the ability; if in the context of the application, return the * root dir of the application. * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return the root dir + * @returns the root dir * @FAModelOnly */ getOrCreateLocalDir(): Promise; @@ -53,14 +53,14 @@ export interface Context extends BaseContext { /** * Verify whether the specified permission is allowed for a particular * pid and uid running in the system. + * Pid and uid are optional. If you do not pass in pid and uid, + * it will check your own permission. * @param permission The name of the specified permission * @param pid process id * @param uid user id - * @note Pid and uid are optional. If you do not pass in pid and uid, - * it will check your own permission. * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return asynchronous callback with {@code 0} if the PID + * @returns asynchronous callback with {@code 0} if the PID * and UID have the permission; callback with {@code -1} otherwise. * @FAModelOnly */ @@ -253,7 +253,7 @@ export interface Context extends BaseContext { * Checks whether the configuration of this ability is changing. * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @return true if the configuration of this ability is changing and false otherwise. + * @returns true if the configuration of this ability is changing and false otherwise. * @FAModelOnly */ isUpdatingConfigurations(callback: AsyncCallback): void; diff --git a/api/application/ApplicationContext.d.ts b/api/application/ApplicationContext.d.ts index 8fc1e3b46f..93f53e15b9 100755 --- a/api/application/ApplicationContext.d.ts +++ b/api/application/ApplicationContext.d.ts @@ -32,7 +32,7 @@ export default class ApplicationContext extends Context { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param callback The ability lifecycle callback. - * @return Returns the number code of the callback. + * @returns Returns the number code of the callback. * @StageModelOnly * @deprecated since 9 * @useinstead on @@ -45,7 +45,7 @@ export default class ApplicationContext extends Context { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param callbackId Indicates the number code of the callback. - * @return - + * @returns - * @StageModelOnly * @deprecated since 9 * @useinstead off @@ -59,7 +59,7 @@ export default class ApplicationContext extends Context { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param callback The environment callback. - * @return Returns the number code of the callback. + * @returns Returns the number code of the callback. * @StageModelOnly * @deprecated since 9 * @useinstead on @@ -72,7 +72,7 @@ export default class ApplicationContext extends Context { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param callbackId Indicates the number code of the callback. - * @return - + * @returns - * @StageModelOnly * @deprecated since 9 * @useinstead off diff --git a/api/application/ApplicationStateObserver.d.ts b/api/application/ApplicationStateObserver.d.ts index 71cab9a6b3..3833740a53 100644 --- a/api/application/ApplicationStateObserver.d.ts +++ b/api/application/ApplicationStateObserver.d.ts @@ -33,7 +33,7 @@ export default class ApplicationStateObserver { * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param appStateData State changed Application info. * @systemapi hide for inner use. - * @return - + * @returns - */ onForegroundApplicationChanged(appStateData: AppStateData): void; @@ -44,7 +44,7 @@ export default class ApplicationStateObserver { * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param abilityStateData State changed ability info. * @systemapi hide for inner use. - * @return - + * @returns - */ onAbilityStateChanged(abilityStateData: AbilityStateData): void; @@ -55,7 +55,7 @@ export default class ApplicationStateObserver { * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param processData Process info. * @systemapi hide for inner use. - * @return - + * @returns - */ onProcessCreated(processData: ProcessData): void; @@ -66,7 +66,7 @@ export default class ApplicationStateObserver { * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param processData Process info. * @systemapi hide for inner use. - * @return - + * @returns - */ onProcessDied(processData: ProcessData): void; @@ -77,7 +77,7 @@ export default class ApplicationStateObserver { * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param processData Process info. * @systemapi hide for inner use. - * @return - + * @returns - */ onProcessStateChanged(processData: ProcessData): void; } diff --git a/api/application/ErrorObserver.d.ts b/api/application/ErrorObserver.d.ts index 4765185428..0e6912defe 100644 --- a/api/application/ErrorObserver.d.ts +++ b/api/application/ErrorObserver.d.ts @@ -27,7 +27,7 @@ export default class ErrorObserver { * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param errMsg the message and error stacktrace about the exception. - * @return - + * @returns - */ onUnhandledException(errMsg: string): void; } \ No newline at end of file diff --git a/api/application/MissionListener.d.ts b/api/application/MissionListener.d.ts index e80aaa7d62..c40968b279 100644 --- a/api/application/MissionListener.d.ts +++ b/api/application/MissionListener.d.ts @@ -31,7 +31,7 @@ import image from "../@ohos.multimedia.image"; * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @param mission Indicates the id of created mission. - * @return - + * @returns - */ onMissionCreated(mission: number): void; @@ -41,7 +41,7 @@ import image from "../@ohos.multimedia.image"; * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @param mission Indicates the id of destroyed mission. - * @return - + * @returns - */ onMissionDestroyed(mission: number): void; @@ -51,7 +51,7 @@ import image from "../@ohos.multimedia.image"; * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @param mission Indicates the id of the mission which the snapshot changes - * @return - + * @returns - */ onMissionSnapshotChanged(mission: number): void; @@ -61,7 +61,7 @@ import image from "../@ohos.multimedia.image"; * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @param mission Indicates the id of the mission being moved to the foreground. - * @return - + * @returns - */ onMissionMovedToFront(mission: number): void; @@ -71,7 +71,7 @@ import image from "../@ohos.multimedia.image"; * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @param mission Indicates the id of the mission whose label has changed. - * @return - + * @returns - */ onMissionLabelUpdated(mission: number): void; @@ -82,7 +82,7 @@ import image from "../@ohos.multimedia.image"; * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @param mission Indicates the id of the mission whose icon has changed. * @param icon Indicates the icon of the mission whose icon has changed. - * @return - + * @returns - */ onMissionIconUpdated(mission: number, icon: image.PixelMap): void; @@ -92,7 +92,7 @@ import image from "../@ohos.multimedia.image"; * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Mission * @param mission Indicates the id of the mission whose ability instance is destroyed. - * @return - + * @returns - */ onMissionClosed(mission: number): void; } \ No newline at end of file diff --git a/api/application/ServiceExtensionContext.d.ts b/api/application/ServiceExtensionContext.d.ts index acc02d4176..f24aa0cc70 100644 --- a/api/application/ServiceExtensionContext.d.ts +++ b/api/application/ServiceExtensionContext.d.ts @@ -246,7 +246,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * @param want Indicates the service extension to connect. * @param options Indicates the callback of connection. * @systemapi hide for inner use. - * @return connection id, int value. + * @returns connection id, int value. * @StageModelOnly * @deprecated since 9 * @useinstead connectServiceExtensionAbility @@ -266,7 +266,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * @param accountId Indicates the account to connect. * @param options Indicates the callback of connection. * @systemapi hide for inner use. - * @return connection id, int value. + * @returns connection id, int value. * @StageModelOnly * @deprecated since 9 * @useinstead connectServiceExtensionAbilityWithAccount @@ -281,7 +281,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param connection the connection id returned from connectAbility api. * @systemapi hide for inner use. - * @return - + * @returns - * @StageModelOnly * @deprecated since 9 * @useinstead disconnectServiceExtensionAbility diff --git a/api/application/abilityDelegator.d.ts b/api/application/abilityDelegator.d.ts index 0cabc49f03..7057c64bff 100644 --- a/api/application/abilityDelegator.d.ts +++ b/api/application/abilityDelegator.d.ts @@ -296,7 +296,7 @@ export interface AbilityDelegator { * @syscap SystemCapability.Ability.AbilityRuntime.Core * @param cmd Shell command * @param timeoutSecs Timeout, in seconds - * @return ShellCmdResult object + * @returns ShellCmdResult object */ executeShellCommand(cmd: string, callback: AsyncCallback): void; executeShellCommand(cmd: string, timeoutSecs: number, callback: AsyncCallback): void; diff --git a/api/application/abilityDelegatorArgs.d.ts b/api/application/abilityDelegatorArgs.d.ts index f140bc13d8..b61dadb149 100644 --- a/api/application/abilityDelegatorArgs.d.ts +++ b/api/application/abilityDelegatorArgs.d.ts @@ -19,7 +19,6 @@ * * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @import import AbilityDelegatorArgs from 'application/abilityDelegatorArgs.d' * @permission N/A */ export interface AbilityDelegatorArgs { diff --git a/api/application/abilityMonitor.d.ts b/api/application/abilityMonitor.d.ts index 0e37ca308d..d613f964db 100644 --- a/api/application/abilityMonitor.d.ts +++ b/api/application/abilityMonitor.d.ts @@ -21,7 +21,6 @@ import UIAbility from '../@ohos.app.ability.UIAbility'; * * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @import import AbilityMonitor from 'application/abilityMonitor.d' * @permission N/A */ export interface AbilityMonitor { diff --git a/api/application/abilityStageMonitor.d.ts b/api/application/abilityStageMonitor.d.ts index 6ca989090d..cbe57c44db 100644 --- a/api/application/abilityStageMonitor.d.ts +++ b/api/application/abilityStageMonitor.d.ts @@ -19,7 +19,6 @@ * * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @import import AbilityStageMonitor from 'application/AbilityStageMonitor.d' * @permission N/A */ export interface AbilityStageMonitor { diff --git a/api/common/full/featureability.d.ts b/api/common/full/featureability.d.ts index 308fe6727f..bca1c29fe1 100644 --- a/api/common/full/featureability.d.ts +++ b/api/common/full/featureability.d.ts @@ -295,6 +295,7 @@ export interface FinishWithResultParams { /** * @since 5 * @deprecated since 8 + * @useinstead ohos.ability.featureAbility.FeatureAbility */ export declare class FeatureAbility { /** @@ -303,6 +304,7 @@ export declare class FeatureAbility { * @returns A Promise object is returned, which contains the result of whether to call Ability's interface successfully. * @since 5 * @deprecated since 8 + * @useinstead ohos.ability.featureAbility.FeatureAbility#startAbility */ static startAbility(request: RequestParams): Promise; @@ -312,6 +314,7 @@ export declare class FeatureAbility { * @returns A Promise object is returned, which contains the result of the data FA returned. * @since 5 * @deprecated since 8 + * @useinstead ohos.ability.featureAbility.FeatureAbility#startAbilityForResult */ static startAbilityForResult(request: RequestParams): Promise; @@ -321,11 +324,11 @@ export declare class FeatureAbility { * @returns A Promise object is returned, which contains the result whether to callback successfully. * @since 5 * @deprecated since 8 + * @useinstead ohos.ability.featureAbility.FeatureAbility#terminateSlefWithResult */ static finishWithResult(param: FinishWithResultParams): Promise; /** - * Get device information list. * @param flag Default 0, get the information list of all devices in the network. * @returns A Promise object is returned, which contains the result whether the device information list is obtained successfully. diff --git a/api/common/lite/featureability.d.ts b/api/common/lite/featureability.d.ts index 3b1d820d99..ebfe0fa4b0 100644 --- a/api/common/lite/featureability.d.ts +++ b/api/common/lite/featureability.d.ts @@ -118,6 +118,7 @@ export interface SubscribeMessageOptions { * @since 5 * @systemapi * @deprecated since 8 + * @useinstead ohos.ability.featureAbility.FeatureAbility */ export declare class FeatureAbility { /** -- Gitee From 51bb57ae67f3acbc6066be78330e83b1a10f4f11 Mon Sep 17 00:00:00 2001 From: donglin Date: Wed, 16 Nov 2022 11:03:26 +0800 Subject: [PATCH 326/438] JsDoc Signed-off-by: donglin Change-Id: Ia3cd093380c25609f62faee15ce60dac31d080b7 --- api/@ohos.app.ability.Ability.d.ts | 8 +- api/@ohos.app.ability.AbilityConstant.d.ts | 22 ++--- ....app.ability.AbilityLifecycleCallback.d.ts | 20 ++--- api/@ohos.app.ability.AbilityStage.d.ts | 12 +-- ...@ohos.app.ability.EnvironmentCallback.d.ts | 2 +- api/@ohos.app.ability.ExtensionAbility.d.ts | 2 +- ...s.app.ability.ServiceExtensionAbility.d.ts | 20 ++--- api/@ohos.app.ability.StartOptions.d.ts | 6 +- api/@ohos.app.ability.UIAbility.d.ts | 56 ++++++------- api/@ohos.app.ability.appRecovery.d.ts | 6 +- api/@ohos.app.ability.common.d.ts | 26 +++--- api/@ohos.app.form.FormExtensionAbility.d.ts | 22 ++--- api/@ohos.enterpriseDeviceManager.d.ts | 18 ++-- api/application/AbilityContext.d.ts | 82 +++++++++---------- api/application/ApplicationContext.d.ts | 22 ++--- api/application/Context.d.ts | 34 ++++---- api/application/EventHub.d.ts | 8 +- api/application/FormExtensionContext.d.ts | 4 +- api/application/ServiceExtensionContext.d.ts | 44 +++++----- api/application/UIAbilityContext.d.ts | 82 +++++++++---------- 20 files changed, 248 insertions(+), 248 deletions(-) diff --git a/api/@ohos.app.ability.Ability.d.ts b/api/@ohos.app.ability.Ability.d.ts index a29250be37..4c0485909b 100644 --- a/api/@ohos.app.ability.Ability.d.ts +++ b/api/@ohos.app.ability.Ability.d.ts @@ -19,7 +19,7 @@ import { Configuration } from './@ohos.app.ability.Configuration'; /** * The class of an ability. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ export default class Ability { @@ -27,7 +27,7 @@ export default class Ability { * Called when the system configuration is updated. * @param { Configuration } newConfig - Indicates the updated configuration. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ onConfigurationUpdate(newConfig: Configuration): void; @@ -38,7 +38,7 @@ export default class Ability { * @param { AbilityConstant.MemoryLevel } level - Indicates the memory trim level, which shows the current memory * usage status. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ onMemoryLevel(level: AbilityConstant.MemoryLevel): void; @@ -49,7 +49,7 @@ export default class Ability { * @param wantParam Indicates the want parameter. * @return 0 if ability agrees to save data successfully, otherwise errcode. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ onSaveState(reason: AbilityConstant.StateType, wantParam : {[key: string]: any}): AbilityConstant.OnSaveResult; diff --git a/api/@ohos.app.ability.AbilityConstant.d.ts b/api/@ohos.app.ability.AbilityConstant.d.ts index 3709949ca5..4237bb892a 100644 --- a/api/@ohos.app.ability.AbilityConstant.d.ts +++ b/api/@ohos.app.ability.AbilityConstant.d.ts @@ -17,7 +17,7 @@ * The definition of AbilityConstant. * @namespace AbilityConstant * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ declare namespace AbilityConstant { @@ -25,14 +25,14 @@ declare namespace AbilityConstant { * Interface of launch param. * @typedef LaunchParam * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export interface LaunchParam { /** * Indicates launch reason. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ launchReason: LaunchReason; @@ -40,7 +40,7 @@ declare namespace AbilityConstant { /** * Indicates last exit reason. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ lastExitReason: LastExitReason; @@ -50,7 +50,7 @@ declare namespace AbilityConstant { * Type of launch reason. * @enum { number } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export enum LaunchReason { @@ -65,7 +65,7 @@ declare namespace AbilityConstant { * Type of last exit reason. * @enum { number } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export enum LastExitReason { @@ -78,7 +78,7 @@ declare namespace AbilityConstant { * Type of onContinue result. * @enum { number } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export enum OnContinueResult { @@ -91,7 +91,7 @@ declare namespace AbilityConstant { * Type of memory level. * @enum { number } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export enum MemoryLevel { @@ -104,7 +104,7 @@ declare namespace AbilityConstant { * Type of window mode. * @enum { number } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export enum WindowMode { @@ -119,7 +119,7 @@ declare namespace AbilityConstant { * Type of onSave result. * @enum { number } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export enum OnSaveResult { @@ -135,7 +135,7 @@ declare namespace AbilityConstant { * Type of save state. * @enum { number } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export enum StateType { diff --git a/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts b/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts index 7f62e30fea..0ef4951073 100644 --- a/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts +++ b/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts @@ -20,7 +20,7 @@ import window from './@ohos.window'; /** * The ability lifecycle callback. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ export default class AbilityLifecycleCallback { @@ -28,7 +28,7 @@ export default class AbilityLifecycleCallback { * Called back when an ability is started for initialization. * @param { Ability } ability - Indicates the ability to register for listening. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ onAbilityCreate(ability: UIAbility): void; @@ -38,7 +38,7 @@ export default class AbilityLifecycleCallback { * @param { Ability } ability - Indicates the ability to register for listening. * @param { window.WindowStage } windowStage - window stage to create * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ onWindowStageCreate(ability: UIAbility, windowStage: window.WindowStage): void; @@ -48,7 +48,7 @@ export default class AbilityLifecycleCallback { * @param { Ability } ability - Indicates the ability to register for listening. * @param { window.WindowStage } windowStage - window stage to active * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ onWindowStageActive(ability: UIAbility, windowStage: window.WindowStage): void; @@ -58,7 +58,7 @@ export default class AbilityLifecycleCallback { * @param { Ability } ability - Indicates the ability to register for listening. * @param { window.WindowStage } windowStage - window stage to inactive * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ onWindowStageInactive(ability: UIAbility, windowStage: window.WindowStage): void; @@ -68,7 +68,7 @@ export default class AbilityLifecycleCallback { * @param { Ability } ability - Indicates the ability to register for listening. * @param { window.WindowStage } windowStage - window stage to destroy * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ onWindowStageDestroy(ability: UIAbility, windowStage: window.WindowStage): void; @@ -77,7 +77,7 @@ export default class AbilityLifecycleCallback { * Called back when an ability is destroyed. * @param { Ability } ability - Indicates the ability to register for listening. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ onAbilityDestroy(ability: UIAbility): void; @@ -86,7 +86,7 @@ export default class AbilityLifecycleCallback { * Called back when the state of an ability changes to foreground. * @param { Ability } ability - Indicates the ability to register for listening. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ onAbilityForeground(ability: UIAbility): void; @@ -95,7 +95,7 @@ export default class AbilityLifecycleCallback { * Called back when the state of an ability changes to background. * @param { Ability } ability - Indicates the ability to register for listening. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ onAbilityBackground(ability: UIAbility): void; @@ -104,7 +104,7 @@ export default class AbilityLifecycleCallback { * Called back when an ability prepares to continue. * @param { Ability } ability - Indicates the ability to register for listening. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ onAbilityContinue(ability: UIAbility): void; diff --git a/api/@ohos.app.ability.AbilityStage.d.ts b/api/@ohos.app.ability.AbilityStage.d.ts index 8aa0201a3f..8831378926 100644 --- a/api/@ohos.app.ability.AbilityStage.d.ts +++ b/api/@ohos.app.ability.AbilityStage.d.ts @@ -21,7 +21,7 @@ import { Configuration } from './@ohos.app.ability.Configuration'; /** * The class of an ability stage. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export default class AbilityStage { @@ -29,7 +29,7 @@ export default class AbilityStage { * Indicates configuration information about context. * @type { AbilityStageContext } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ context: AbilityStageContext; @@ -37,7 +37,7 @@ export default class AbilityStage { /** * Called back when an ability stage is started for initialization. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ onCreate(): void; @@ -49,7 +49,7 @@ export default class AbilityStage { * do not create a new instance and pull it back to the top of the stack. * Otherwise, create a new instance and start it. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ onAcceptWant(want: Want): string; @@ -58,7 +58,7 @@ export default class AbilityStage { * Called when the system configuration is updated. * @param { Configuration } newConfig - Indicates the updated configuration. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ onConfigurationUpdate(newConfig: Configuration): void; @@ -68,7 +68,7 @@ export default class AbilityStage { * background and there is no enough memory for running as many background processes as possible. * @param { AbilityConstant.MemoryLevel } level - Indicates the memory trim level, which shows the current memory usage status. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ onMemoryLevel(level: AbilityConstant.MemoryLevel): void; diff --git a/api/@ohos.app.ability.EnvironmentCallback.d.ts b/api/@ohos.app.ability.EnvironmentCallback.d.ts index 03ccc013c3..8490a059ac 100755 --- a/api/@ohos.app.ability.EnvironmentCallback.d.ts +++ b/api/@ohos.app.ability.EnvironmentCallback.d.ts @@ -25,7 +25,7 @@ export default class EnvironmentCallback { * Called when the system configuration is updated. * @param { Configuration } config - Indicates the updated configuration. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ onConfigurationUpdated(config: Configuration): void; diff --git a/api/@ohos.app.ability.ExtensionAbility.d.ts b/api/@ohos.app.ability.ExtensionAbility.d.ts index a64ecb161e..13d3d3e7ed 100644 --- a/api/@ohos.app.ability.ExtensionAbility.d.ts +++ b/api/@ohos.app.ability.ExtensionAbility.d.ts @@ -18,7 +18,7 @@ import Ability from "./@ohos.app.ability.Ability"; /** * class of extension. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export default class ExtensionAbility extends Ability { diff --git a/api/@ohos.app.ability.ServiceExtensionAbility.d.ts b/api/@ohos.app.ability.ServiceExtensionAbility.d.ts index d4eaab2f12..18241e6abd 100644 --- a/api/@ohos.app.ability.ServiceExtensionAbility.d.ts +++ b/api/@ohos.app.ability.ServiceExtensionAbility.d.ts @@ -22,7 +22,7 @@ import { Configuration } from './@ohos.app.ability.Configuration'; * class of service extension ability. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ export default class ServiceExtensionAbility { @@ -30,7 +30,7 @@ export default class ServiceExtensionAbility { * Indicates service extension ability context. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ context: ServiceExtensionContext; @@ -40,7 +40,7 @@ export default class ServiceExtensionAbility { * @param { Want } want - Indicates the want of created service extension. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ onCreate(want: Want): void; @@ -49,7 +49,7 @@ export default class ServiceExtensionAbility { * Called back before a service extension is destroyed. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ onDestroy(): void; @@ -62,7 +62,7 @@ export default class ServiceExtensionAbility { * For example, if the service extension has been started for six times. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ onRequest(want: Want, startId: number): void; @@ -72,7 +72,7 @@ export default class ServiceExtensionAbility { * @param { Want } want - Indicates connection information about the Service ability. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ onConnect(want: Want): rpc.RemoteObject; @@ -82,7 +82,7 @@ export default class ServiceExtensionAbility { * @param { Want } want - Indicates disconnection information about the service extension. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ onDisconnect(want: Want): void; @@ -93,7 +93,7 @@ export default class ServiceExtensionAbility { * @param { Want } want - Indicates the want of the service extension being connected. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ onReconnect(want: Want): void; @@ -103,7 +103,7 @@ export default class ServiceExtensionAbility { * @param { Configuration } newConfig - Indicates the updated configuration. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ onConfigurationUpdate(newConfig: Configuration): void; @@ -115,7 +115,7 @@ export default class ServiceExtensionAbility { * @return { Array } The dump info array. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ onDump(params: Array): Array; diff --git a/api/@ohos.app.ability.StartOptions.d.ts b/api/@ohos.app.ability.StartOptions.d.ts index 2650fce27a..e89e431242 100644 --- a/api/@ohos.app.ability.StartOptions.d.ts +++ b/api/@ohos.app.ability.StartOptions.d.ts @@ -16,14 +16,14 @@ /** * StartOptions is the basic communication component of the system. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export default class StartOptions { /** * windowMode * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ windowMode?: number; @@ -31,7 +31,7 @@ export default class StartOptions { /** * displayId * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ displayId?: number; diff --git a/api/@ohos.app.ability.UIAbility.d.ts b/api/@ohos.app.ability.UIAbility.d.ts index 2f1612dc5c..0d3e8f9bd1 100755 --- a/api/@ohos.app.ability.UIAbility.d.ts +++ b/api/@ohos.app.ability.UIAbility.d.ts @@ -24,7 +24,7 @@ import window from './@ohos.window'; * The prototype of the listener function interface registered by the Caller. * @typedef OnReleaseCallback * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ export interface OnReleaseCallback { @@ -35,7 +35,7 @@ export interface OnReleaseCallback { * The prototype of the message listener function interface registered by the Callee. * @typedef CalleeCallback * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ export interface CalleeCallback { @@ -46,7 +46,7 @@ export interface CalleeCallback { * The interface of a Caller. * @interface * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ export interface Caller { @@ -57,7 +57,7 @@ export interface Caller { * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ call(method: string, data: rpc.Sequenceable): Promise; @@ -69,7 +69,7 @@ export interface Caller { * @returns { Promise } Returns the callee's notification result data. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ callWithResult(method: string, data: rpc.Sequenceable): Promise; @@ -77,7 +77,7 @@ export interface Caller { /** * Clear service records. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ release(): void; @@ -87,7 +87,7 @@ export interface Caller { * @param { OnReleaseCallback } callback - Register a callback function for listening for notifications. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ onRelease(callback: OnReleaseCallback): void; @@ -98,7 +98,7 @@ export interface Caller { * @param { OnReleaseCallback } callback - Register a callback function for listening for notifications. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ on(type: "release", callback: OnReleaseCallback): void; @@ -109,7 +109,7 @@ export interface Caller { * @param { OnReleaseCallback } callback - Unregister a callback function for listening for notifications. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ off(type: "release", callback: OnReleaseCallback): void; @@ -119,7 +119,7 @@ export interface Caller { * @param { string } type - release. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ off(type: "release"): void; @@ -129,7 +129,7 @@ export interface Caller { * The interface of a Callee. * @interface * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ export interface Callee { @@ -139,7 +139,7 @@ export interface Callee { * @param { CalleeCallback } callback - Register a callback function that listens for notification events. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ on(method: string, callback: CalleeCallback): void; @@ -149,7 +149,7 @@ export interface Callee { * @param { string } method - A string registered to listen for notification events. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ off(method: string): void; @@ -158,7 +158,7 @@ export interface Callee { /** * The class of a UI ability. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ export default class UIAbility extends Ability { @@ -166,7 +166,7 @@ export default class UIAbility extends Ability { * Indicates configuration information about an ability context. * @type { UIAbilityContext } * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ context: UIAbilityContext; @@ -175,7 +175,7 @@ export default class UIAbility extends Ability { * Indicates ability launch want. * @type { Want } * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ launchWant: Want; @@ -184,7 +184,7 @@ export default class UIAbility extends Ability { * Indicates ability last request want. * @type { Want } * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ lastRequestWant: Want; @@ -193,7 +193,7 @@ export default class UIAbility extends Ability { * Call Service Stub Object. * @type { Callee } * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ callee: Callee; @@ -203,7 +203,7 @@ export default class UIAbility extends Ability { * @param { Want } want - Indicates the want info of the created ability. * @param { AbilityConstant.LaunchParam } param - Indicates the launch param. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ onCreate(want: Want, param: AbilityConstant.LaunchParam): void; @@ -212,7 +212,7 @@ export default class UIAbility extends Ability { * Called back when an ability window stage is created. * @param { window.WindowStage } windowStage - Indicates the created WindowStage. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ onWindowStageCreate(windowStage: window.WindowStage): void; @@ -220,7 +220,7 @@ export default class UIAbility extends Ability { /** * Called back when an ability window stage is destroyed. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ onWindowStageDestroy(): void; @@ -229,7 +229,7 @@ export default class UIAbility extends Ability { * Called back when an ability window stage is restored. * @param { window.WindowStage } windowStage - window stage to restore * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ onWindowStageRestore(windowStage: window.WindowStage): void; @@ -237,7 +237,7 @@ export default class UIAbility extends Ability { /** * Called back before an ability is destroyed. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ onDestroy(): void; @@ -245,7 +245,7 @@ export default class UIAbility extends Ability { /** * Called back when the state of an ability changes to foreground. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ onForeground(): void; @@ -253,7 +253,7 @@ export default class UIAbility extends Ability { /** * Called back when the state of an ability changes to background. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ onBackground(): void; @@ -263,7 +263,7 @@ export default class UIAbility extends Ability { * @param { {[key: string]: any} } wantParam - Indicates the want parameter. * @returns { AbilityConstant.OnContinueResult } Return the result of onContinue. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ onContinue(wantParam: { [key: string]: any }): AbilityConstant.OnContinueResult; @@ -274,7 +274,7 @@ export default class UIAbility extends Ability { * @param { Want } want - Indicates the want info of ability. * @param { AbilityConstant.LaunchParam } launchParams - Indicates the launch parameters. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ onNewWant(want: Want, launchParams: AbilityConstant.LaunchParam): void; @@ -285,7 +285,7 @@ export default class UIAbility extends Ability { * @param { Array } params - Indicates the params from command. * @returns { Array } Return the dump info array. * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore - * @stagemodelonly + * @StageModelOnly * @since 9 */ onDump(params: Array): Array; diff --git a/api/@ohos.app.ability.appRecovery.d.ts b/api/@ohos.app.ability.appRecovery.d.ts index a9c1cad363..3b63225259 100644 --- a/api/@ohos.app.ability.appRecovery.d.ts +++ b/api/@ohos.app.ability.appRecovery.d.ts @@ -95,7 +95,7 @@ declare namespace appReceovery { * @param saveOccasion The type of When to save * @param saveMode The type of where to save * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ function enableAppRecovery(restart?: RestartFlag, saveOccasion?: SaveOccasionFlag, saveMode?: SaveModeFlag) : void; @@ -103,7 +103,7 @@ declare namespace appReceovery { /** * Restart App when called * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ function restartApp(): void; @@ -112,7 +112,7 @@ declare namespace appReceovery { * Save App state data when called * @return true if save data successfully, otherwise false * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ function saveAppState(): boolean; diff --git a/api/@ohos.app.ability.common.d.ts b/api/@ohos.app.ability.common.d.ts index cd0a1046cb..0661aafb08 100755 --- a/api/@ohos.app.ability.common.d.ts +++ b/api/@ohos.app.ability.common.d.ts @@ -29,7 +29,7 @@ import { ConnectOptions as _ConnectOptions } from "./ability/connectOptions"; /** * The context of an application. It allows access to application-specific resources. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ declare namespace common { @@ -37,7 +37,7 @@ declare namespace common { /** * The context of an ability. It allows access to ability-specific resources. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export type UIAbilityContext = _UIAbilityContext.default @@ -45,7 +45,7 @@ declare namespace common { /** * The context of an abilityStage. It allows access to abilityStage-specific resources. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export type AbilityStageContext = _AbilityStageContext.default @@ -53,7 +53,7 @@ declare namespace common { /** * The context of an application. It allows access to application-specific resources. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export type ApplicationContext = _ApplicationContext.default @@ -69,7 +69,7 @@ declare namespace common { * The base context of an ability or an application. It allows access to * application-specific resources. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export type Context = _Context.default @@ -77,7 +77,7 @@ declare namespace common { /** * The context of an extension. It allows access to extension-specific resources. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export type ExtensionContext = _ExtensionContext.default @@ -86,7 +86,7 @@ declare namespace common { * The context of form extension. It allows access to * formExtension-specific resources. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export type FormExtensionContext = _FormExtensionContext.default @@ -94,7 +94,7 @@ declare namespace common { /** * File area mode * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export enum AreaMode { @@ -111,7 +111,7 @@ declare namespace common { /** * The event center of a context, support the subscription and publication of events. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export type EventHub = _EventHub.default @@ -119,7 +119,7 @@ declare namespace common { /** * The result of requestPermissionsFromUser with asynchronous callback. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export type PermissionRequestResult = _PermissionRequestResult.default @@ -127,7 +127,7 @@ declare namespace common { /** * Defines a PacMap object for storing a series of values. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export type PacMap = _PacMap @@ -135,7 +135,7 @@ declare namespace common { /** * Indicates the result of startAbility. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export type AbilityResult = _AbilityResult @@ -143,7 +143,7 @@ declare namespace common { /** * Indicates the callback of connection * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export type ConnectOptions = _ConnectOptions diff --git a/api/@ohos.app.form.FormExtensionAbility.d.ts b/api/@ohos.app.form.FormExtensionAbility.d.ts index aeed2002d1..a767413cb7 100644 --- a/api/@ohos.app.form.FormExtensionAbility.d.ts +++ b/api/@ohos.app.form.FormExtensionAbility.d.ts @@ -22,7 +22,7 @@ import { Configuration } from './@ohos.app.ability.Configuration'; /** * class of form extension. * @syscap SystemCapability.Ability.Form - * @stagemodelonly + * @StageModelOnly * @since 9 */ export default class FormExtensionAbility { @@ -30,7 +30,7 @@ export default class FormExtensionAbility { * Indicates form extension context. * @type { FormExtensionContext } * @syscap SystemCapability.Ability.Form - * @stagemodelonly + * @StageModelOnly * @since 9 */ context: FormExtensionContext; @@ -43,7 +43,7 @@ export default class FormExtensionAbility { * acquisition, update, and deletion. * @return { formBindingData.FormBindingData } Returns the created {@link formBindingData#FormBindingData} object. * @syscap SystemCapability.Ability.Form - * @stagemodelonly + * @StageModelOnly * @since 9 */ onAddForm(want: Want): formBindingData.FormBindingData; @@ -52,7 +52,7 @@ export default class FormExtensionAbility { * Called when the form provider is notified that a temporary form is successfully converted to a normal form. * @param { string } formId - Indicates the ID of the form. * @syscap SystemCapability.Ability.Form - * @stagemodelonly + * @StageModelOnly * @since 9 */ onCastToNormalForm(formId: string): void; @@ -61,7 +61,7 @@ export default class FormExtensionAbility { * Called to notify the form provider to update a specified form. * @param { string } formId - Indicates the ID of the form to update. * @syscap SystemCapability.Ability.Form - * @stagemodelonly + * @StageModelOnly * @since 9 */ onUpdateForm(formId: string): void; @@ -74,7 +74,7 @@ export default class FormExtensionAbility { * {@link formInfo#VisibilityType#FORM_VISIBLE} means that the form becomes visible, and * {@link formInfo#VisibilityType#FORM_INVISIBLE} means that the form becomes invisible. * @syscap SystemCapability.Ability.Form - * @stagemodelonly + * @StageModelOnly * @since 9 */ onChangeFormVisibility(newStatus: { [key: string]: number }): void; @@ -87,7 +87,7 @@ export default class FormExtensionAbility { * @param { string } message - Indicates the value of the {@code params} field of the message event. This parameter * is used to identify the specific component on which the event is triggered. * @syscap SystemCapability.Ability.Form - * @stagemodelonly + * @StageModelOnly * @since 9 */ onFormEvent(formId: string, message: string): void; @@ -97,7 +97,7 @@ export default class FormExtensionAbility { * you want your application, as the form provider, to be notified of form deletion. * @param { string } formId - Indicates the ID of the destroyed form. * @syscap SystemCapability.Ability.Form - * @stagemodelonly + * @StageModelOnly * @since 9 */ onRemoveForm(formId: string): void; @@ -106,7 +106,7 @@ export default class FormExtensionAbility { * Called when the system configuration is updated. * @param { Configuration } newConfig - Indicates the system configuration, such as language and color mode. * @syscap SystemCapability.Ability.Form - * @stagemodelonly + * @StageModelOnly * @since 9 */ onConfigurationUpdate(newConfig: Configuration): void; @@ -120,7 +120,7 @@ export default class FormExtensionAbility { * form name, and form dimensions. * @return { formInfo.FormState } Returns the {@link formInfo#FormState} object. * @syscap SystemCapability.Ability.Form - * @stagemodelonly + * @StageModelOnly * @since 9 */ onAcquireFormState?(want: Want): formInfo.FormState; @@ -131,7 +131,7 @@ export default class FormExtensionAbility { * @return { { [key: string]: any } } Returns the wantParams object. * @syscap SystemCapability.Ability.Form * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ onShareForm?(formId: string): { [key: string]: any }; diff --git a/api/@ohos.enterpriseDeviceManager.d.ts b/api/@ohos.enterpriseDeviceManager.d.ts index 08f6c2cb53..050419401c 100644 --- a/api/@ohos.enterpriseDeviceManager.d.ts +++ b/api/@ohos.enterpriseDeviceManager.d.ts @@ -84,7 +84,7 @@ declare namespace enterpriseDeviceManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback): void; @@ -105,7 +105,7 @@ declare namespace enterpriseDeviceManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback): void; @@ -126,7 +126,7 @@ declare namespace enterpriseDeviceManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise; @@ -142,7 +142,7 @@ declare namespace enterpriseDeviceManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function disableAdmin(admin: Want, callback: AsyncCallback): void; @@ -159,7 +159,7 @@ declare namespace enterpriseDeviceManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function disableAdmin(admin: Want, userId: number, callback: AsyncCallback): void; @@ -176,7 +176,7 @@ declare namespace enterpriseDeviceManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function disableAdmin(admin: Want, userId?: number): Promise; @@ -192,7 +192,7 @@ declare namespace enterpriseDeviceManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function disableSuperAdmin(bundleName: String, callback: AsyncCallback): void; @@ -208,7 +208,7 @@ declare namespace enterpriseDeviceManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function disableSuperAdmin(bundleName: String): Promise; @@ -220,7 +220,7 @@ declare namespace enterpriseDeviceManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function isAdminEnabled(admin: Want, callback: AsyncCallback): void; diff --git a/api/application/AbilityContext.d.ts b/api/application/AbilityContext.d.ts index 64c9ea8ba9..ae63cabcb6 100755 --- a/api/application/AbilityContext.d.ts +++ b/api/application/AbilityContext.d.ts @@ -32,7 +32,7 @@ import image from '../@ohos.multimedia.image'; /** * The context of an ability. It allows access to ability-specific resources. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export default class AbilityContext extends Context { @@ -40,7 +40,7 @@ export default class AbilityContext extends Context { * Indicates configuration information about an ability. * @type { AbilityInfo } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ abilityInfo: AbilityInfo; @@ -49,7 +49,7 @@ export default class AbilityContext extends Context { * Indicates configuration information about the module. * @type { HapModuleInfo } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ currentHapModuleInfo: HapModuleInfo; @@ -58,7 +58,7 @@ export default class AbilityContext extends Context { * Indicates configuration information. * @type { Configuration } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ config: Configuration; @@ -69,7 +69,7 @@ export default class AbilityContext extends Context { * @param { AsyncCallback } callback - The callback of startAbility. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbility(want: Want, callback: AsyncCallback): void; @@ -81,7 +81,7 @@ export default class AbilityContext extends Context { * @param { AsyncCallback } callback - The callback of startAbility. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; @@ -93,7 +93,7 @@ export default class AbilityContext extends Context { * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbility(want: Want, options?: StartOptions): Promise; @@ -105,7 +105,7 @@ export default class AbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbilityByCall(want: Want): Promise; @@ -119,7 +119,7 @@ export default class AbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; @@ -134,7 +134,7 @@ export default class AbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; @@ -149,7 +149,7 @@ export default class AbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; @@ -160,7 +160,7 @@ export default class AbilityContext extends Context { * @param { AsyncCallback } callback - The callback is used to return the result of startAbility. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbilityForResult(want: Want, callback: AsyncCallback): void; @@ -172,7 +172,7 @@ export default class AbilityContext extends Context { * @param { AsyncCallback } callback - The callback is used to return the result of startAbility. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback): void; @@ -184,7 +184,7 @@ export default class AbilityContext extends Context { * @returns { Promise } Returns the result of startAbility. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbilityForResult(want: Want, options?: StartOptions): Promise; @@ -198,7 +198,7 @@ export default class AbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; @@ -213,7 +213,7 @@ export default class AbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; @@ -228,7 +228,7 @@ export default class AbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; @@ -240,7 +240,7 @@ export default class AbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startServiceExtensionAbility(want: Want, callback: AsyncCallback): void; @@ -252,7 +252,7 @@ export default class AbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startServiceExtensionAbility(want: Want): Promise; @@ -266,7 +266,7 @@ export default class AbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; @@ -280,7 +280,7 @@ export default class AbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; @@ -292,7 +292,7 @@ export default class AbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ stopServiceExtensionAbility(want: Want, callback: AsyncCallback): void; @@ -304,7 +304,7 @@ export default class AbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ stopServiceExtensionAbility(want: Want): Promise; @@ -318,7 +318,7 @@ export default class AbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; @@ -332,7 +332,7 @@ export default class AbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; @@ -342,7 +342,7 @@ export default class AbilityContext extends Context { * @param { AsyncCallback } callback - The callback of terminateSelf. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ terminateSelf(callback: AsyncCallback): void; @@ -352,7 +352,7 @@ export default class AbilityContext extends Context { * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ terminateSelf(): Promise; @@ -364,7 +364,7 @@ export default class AbilityContext extends Context { * @param { AsyncCallback } callback - The callback of terminateSelfWithResult. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback): void; @@ -376,7 +376,7 @@ export default class AbilityContext extends Context { * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ terminateSelfWithResult(parameter: AbilityResult): Promise; @@ -434,7 +434,7 @@ export default class AbilityContext extends Context { * @returns { number } Returns the number code of the ability connected * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ connectServiceExtensionAbility(want: Want, options: ConnectOptions): number; @@ -449,7 +449,7 @@ export default class AbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; @@ -460,7 +460,7 @@ export default class AbilityContext extends Context { * @param { AsyncCallback } callback - The callback of disconnectAbility. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ disconnectServiceExtensionAbility(connection: number, callback: AsyncCallback): void; @@ -471,7 +471,7 @@ export default class AbilityContext extends Context { * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ disconnectServiceExtensionAbility(connection: number): Promise; @@ -482,7 +482,7 @@ export default class AbilityContext extends Context { * @param { AsyncCallback } callback - The callback of setMissionLabel. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ setMissionLabel(label: string, callback: AsyncCallback): void; @@ -493,7 +493,7 @@ export default class AbilityContext extends Context { * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ setMissionLabel(label: string): Promise; @@ -505,7 +505,7 @@ export default class AbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ setMissionIcon(icon: image.PixelMap, callback: AsyncCallback): void; @@ -517,7 +517,7 @@ export default class AbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ setMissionIcon(icon: image.PixelMap): Promise; @@ -530,7 +530,7 @@ export default class AbilityContext extends Context { * request result. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ requestPermissionsFromUser(permissions: Array, requestCallback: AsyncCallback): void; @@ -542,7 +542,7 @@ export default class AbilityContext extends Context { * @returns { Promise } Returns the permission request result. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ requestPermissionsFromUser(permissions: Array): Promise; @@ -552,7 +552,7 @@ export default class AbilityContext extends Context { * @param { LocalStorage } localStorage - the storage data used to restore window stage * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ restoreWindowStage(localStorage: LocalStorage): void; @@ -561,7 +561,7 @@ export default class AbilityContext extends Context { * check to see ability is in terminating state. * @returns { boolean } Returns true when ability is in terminating state, else returns false. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ isTerminating(): boolean; diff --git a/api/application/ApplicationContext.d.ts b/api/application/ApplicationContext.d.ts index 93f53e15b9..891d661146 100755 --- a/api/application/ApplicationContext.d.ts +++ b/api/application/ApplicationContext.d.ts @@ -22,7 +22,7 @@ import { ProcessRunningInformation } from "./ProcessRunningInformation"; /** * The context of an application. It allows access to application-specific resources. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export default class ApplicationContext extends Context { @@ -87,7 +87,7 @@ export default class ApplicationContext extends Context { * @returns { number } Returns the number code of the callback. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ on(type: "abilityLifecycle", callback: AbilityLifecycleCallback): number; @@ -99,7 +99,7 @@ export default class ApplicationContext extends Context { * @param { AsyncCallback } callback - The callback of off. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ off(type: "abilityLifecycle", callbackId: number, callback: AsyncCallback): void; @@ -111,7 +111,7 @@ export default class ApplicationContext extends Context { * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ off(type: "abilityLifecycle", callbackId: number): Promise; @@ -123,7 +123,7 @@ export default class ApplicationContext extends Context { * @returns { number } Returns the number code of the callback. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ on(type: "environment", callback: EnvironmentCallback): number; @@ -135,7 +135,7 @@ export default class ApplicationContext extends Context { * @param { AsyncCallback } callback - The callback of unregisterEnvironmentCallback. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ off(type: "environment", callbackId: number, callback: AsyncCallback): void; @@ -147,7 +147,7 @@ export default class ApplicationContext extends Context { * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ off(type: "environment", callbackId: number): Promise; @@ -157,7 +157,7 @@ export default class ApplicationContext extends Context { * @returns { Promise> } Returns the array of {@link ProcessRunningInformation}. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ getProcessRunningInformation(): Promise>; @@ -167,7 +167,7 @@ export default class ApplicationContext extends Context { * @param { AsyncCallback> } callback - The callback is used to return the array of {@link ProcessRunningInformation}. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ getProcessRunningInformation(callback: AsyncCallback>): void; @@ -177,7 +177,7 @@ export default class ApplicationContext extends Context { * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ killProcessesBySelf(): Promise; @@ -187,7 +187,7 @@ export default class ApplicationContext extends Context { * @param { AsyncCallback } callback - The callback of killProcessesBySelf. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ killProcessesBySelf(callback: AsyncCallback); diff --git a/api/application/Context.d.ts b/api/application/Context.d.ts index 67b1316ac0..20f40a64a0 100755 --- a/api/application/Context.d.ts +++ b/api/application/Context.d.ts @@ -23,7 +23,7 @@ import ApplicationContext from "./ApplicationContext"; * The base context of an ability or an application. It allows access to * application-specific resources. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export default class Context extends BaseContext { @@ -31,7 +31,7 @@ export default class Context extends BaseContext { * Indicates the capability of accessing application resources. * @type { resmgr.ResourceManager } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ resourceManager: resmgr.ResourceManager; @@ -40,7 +40,7 @@ export default class Context extends BaseContext { * Indicates configuration information about an application. * @type { ApplicationInfo } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ applicationInfo: ApplicationInfo; @@ -49,7 +49,7 @@ export default class Context extends BaseContext { * Indicates app cache dir. * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ cacheDir: string; @@ -58,7 +58,7 @@ export default class Context extends BaseContext { * Indicates app temp dir. * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ tempDir: string; @@ -67,7 +67,7 @@ export default class Context extends BaseContext { * Indicates app files dir. * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ filesDir: string; @@ -76,7 +76,7 @@ export default class Context extends BaseContext { * Indicates app database dir. * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ databaseDir: string; @@ -85,7 +85,7 @@ export default class Context extends BaseContext { * Indicates app preferences dir. * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ preferencesDir: string; @@ -94,7 +94,7 @@ export default class Context extends BaseContext { * Indicates app bundle code dir. * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ bundleCodeDir: string; @@ -103,7 +103,7 @@ export default class Context extends BaseContext { * Indicates app distributed files dir. * @type { string } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ distributedFilesDir: string; @@ -112,7 +112,7 @@ export default class Context extends BaseContext { * Indicates event hub. * @type { EventHub } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ eventHub: EventHub; @@ -121,7 +121,7 @@ export default class Context extends BaseContext { * Indicates file area. * @type { AreaMode } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ area: AreaMode; @@ -134,7 +134,7 @@ export default class Context extends BaseContext { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ createBundleContext(bundleName: string): Context; @@ -145,7 +145,7 @@ export default class Context extends BaseContext { * @returns { Context } Returns the application context. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ createModuleContext(moduleName: string): Context; @@ -158,7 +158,7 @@ export default class Context extends BaseContext { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ createModuleContext(bundleName: string, moduleName: string): Context; @@ -167,7 +167,7 @@ export default class Context extends BaseContext { * Get application context * @returns { ApplicationContext } Returns the application context. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ getApplicationContext(): ApplicationContext; @@ -177,7 +177,7 @@ export default class Context extends BaseContext { * Enum for the file area mode * @enum { number } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export enum AreaMode { diff --git a/api/application/EventHub.d.ts b/api/application/EventHub.d.ts index 6947fca11f..5c94424b9f 100644 --- a/api/application/EventHub.d.ts +++ b/api/application/EventHub.d.ts @@ -18,7 +18,7 @@ import { BusinessError } from '../basic'; /** * The event center of a context, support the subscription and publication of events. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export default class EventHub { @@ -28,7 +28,7 @@ export default class EventHub { * @param { Function } callback - Indicates the callback. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ on(event: string, callback: Function): void @@ -39,7 +39,7 @@ export default class EventHub { * @param { Function } callback - Indicates the callback. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ off(event: string, callback?: Function): void @@ -50,7 +50,7 @@ export default class EventHub { * @param { Object[] } args - Indicates the callback arguments. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ emit(event: string, ...args: Object[]): void diff --git a/api/application/FormExtensionContext.d.ts b/api/application/FormExtensionContext.d.ts index 95952a3bb0..062c5033ba 100644 --- a/api/application/FormExtensionContext.d.ts +++ b/api/application/FormExtensionContext.d.ts @@ -22,7 +22,7 @@ import Want from '../@ohos.application.Want'; * The context of form extension. It allows access to * formExtension-specific resources. * @syscap SystemCapability.Ability.Form - * @stagemodelonly + * @StageModelOnly * @since 9 */ export default class FormExtensionContext extends ExtensionContext { @@ -33,7 +33,7 @@ export default class FormExtensionContext extends ExtensionContext { * @returns { Promise } The promise returned by the function. * @syscap SystemCapability.Ability.Form * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbility(want: Want, callback: AsyncCallback): void; diff --git a/api/application/ServiceExtensionContext.d.ts b/api/application/ServiceExtensionContext.d.ts index f24aa0cc70..f2a68b6f2b 100644 --- a/api/application/ServiceExtensionContext.d.ts +++ b/api/application/ServiceExtensionContext.d.ts @@ -25,7 +25,7 @@ import StartOptions from "../@ohos.app.ability.StartOptions"; * serviceExtension-specific resources. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ export default class ServiceExtensionContext extends ExtensionContext { @@ -36,7 +36,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbility(want: Want, callback: AsyncCallback): void; @@ -49,7 +49,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; @@ -62,7 +62,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbility(want: Want, options?: StartOptions): Promise; @@ -75,7 +75,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; @@ -89,7 +89,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; @@ -103,7 +103,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; @@ -115,7 +115,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startServiceExtensionAbility(want: Want, callback: AsyncCallback): void; @@ -127,7 +127,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startServiceExtensionAbility(want: Want): Promise; @@ -141,7 +141,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; @@ -155,7 +155,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; @@ -167,7 +167,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ stopServiceExtensionAbility(want: Want, callback: AsyncCallback): void; @@ -179,7 +179,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ stopServiceExtensionAbility(want: Want): Promise; @@ -193,7 +193,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; @@ -207,7 +207,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; @@ -218,7 +218,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ terminateSelf(callback: AsyncCallback): void; @@ -229,7 +229,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ terminateSelf(): Promise; @@ -299,7 +299,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * @returns { number } Returns the connection id. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ connectServiceExtensionAbility(want: Want, options: ConnectOptions): number; @@ -316,7 +316,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; @@ -327,7 +327,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * @param { AsyncCallback } callback - The callback of disconnectAbility. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ disconnectServiceExtensionAbility(connection: number, callback: AsyncCallback): void; @@ -338,7 +338,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ disconnectServiceExtensionAbility(connection: number): Promise; @@ -350,7 +350,7 @@ export default class ServiceExtensionContext extends ExtensionContext { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbilityByCall(want: Want): Promise; diff --git a/api/application/UIAbilityContext.d.ts b/api/application/UIAbilityContext.d.ts index 0c5e2e0f64..0d81c7dc1c 100755 --- a/api/application/UIAbilityContext.d.ts +++ b/api/application/UIAbilityContext.d.ts @@ -32,7 +32,7 @@ import image from '../@ohos.multimedia.image'; /** * The context of an ability. It allows access to ability-specific resources. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ export default class UIAbilityContext extends Context { @@ -40,7 +40,7 @@ export default class UIAbilityContext extends Context { * Indicates configuration information about an ability. * @type { AbilityInfo } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ abilityInfo: AbilityInfo; @@ -49,7 +49,7 @@ export default class UIAbilityContext extends Context { * Indicates configuration information about the module. * @type { HapModuleInfo } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ currentHapModuleInfo: HapModuleInfo; @@ -58,7 +58,7 @@ export default class UIAbilityContext extends Context { * Indicates configuration information. * @type { Configuration } * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ config: Configuration; @@ -69,7 +69,7 @@ export default class UIAbilityContext extends Context { * @param { AsyncCallback } callback - The callback of startAbility. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbility(want: Want, callback: AsyncCallback): void; @@ -81,7 +81,7 @@ export default class UIAbilityContext extends Context { * @param { AsyncCallback } callback - The callback of startAbility. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; @@ -93,7 +93,7 @@ export default class UIAbilityContext extends Context { * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbility(want: Want, options?: StartOptions): Promise; @@ -105,7 +105,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbilityByCall(want: Want): Promise; @@ -119,7 +119,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; @@ -134,7 +134,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; @@ -149,7 +149,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; @@ -160,7 +160,7 @@ export default class UIAbilityContext extends Context { * @param { AsyncCallback } callback - The callback is used to return the result of startAbility. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbilityForResult(want: Want, callback: AsyncCallback): void; @@ -172,7 +172,7 @@ export default class UIAbilityContext extends Context { * @param { AsyncCallback } callback - The callback is used to return the result of startAbility. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback): void; @@ -184,7 +184,7 @@ export default class UIAbilityContext extends Context { * @returns { Promise } Returns the result of startAbility. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbilityForResult(want: Want, options?: StartOptions): Promise; @@ -198,7 +198,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; @@ -213,7 +213,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void; @@ -228,7 +228,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; @@ -240,7 +240,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startServiceExtensionAbility(want: Want, callback: AsyncCallback): void; @@ -252,7 +252,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startServiceExtensionAbility(want: Want): Promise; @@ -266,7 +266,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; @@ -280,7 +280,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; @@ -292,7 +292,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ stopServiceExtensionAbility(want: Want, callback: AsyncCallback): void; @@ -304,7 +304,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ stopServiceExtensionAbility(want: Want): Promise; @@ -318,7 +318,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void; @@ -332,7 +332,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise; @@ -342,7 +342,7 @@ export default class UIAbilityContext extends Context { * @param { AsyncCallback } callback - The callback of terminateSelf. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ terminateSelf(callback: AsyncCallback): void; @@ -352,7 +352,7 @@ export default class UIAbilityContext extends Context { * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ terminateSelf(): Promise; @@ -364,7 +364,7 @@ export default class UIAbilityContext extends Context { * @param { AsyncCallback } callback - The callback of terminateSelfWithResult. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback): void; @@ -376,7 +376,7 @@ export default class UIAbilityContext extends Context { * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ terminateSelfWithResult(parameter: AbilityResult): Promise; @@ -388,7 +388,7 @@ export default class UIAbilityContext extends Context { * @returns { number } Returns the number code of the ability connected * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ connectServiceExtensionAbility(want: Want, options: ConnectOptions): number; @@ -403,7 +403,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; @@ -414,7 +414,7 @@ export default class UIAbilityContext extends Context { * @param { AsyncCallback } callback - The callback of disconnectAbility. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ disconnectServiceExtensionAbility(connection: number, callback: AsyncCallback): void; @@ -425,7 +425,7 @@ export default class UIAbilityContext extends Context { * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ disconnectServiceExtensionAbility(connection: number): Promise; @@ -436,7 +436,7 @@ export default class UIAbilityContext extends Context { * @param { AsyncCallback } callback - The callback of setMissionLabel. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ setMissionLabel(label: string, callback: AsyncCallback): void; @@ -447,7 +447,7 @@ export default class UIAbilityContext extends Context { * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ setMissionLabel(label: string): Promise; @@ -459,7 +459,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ setMissionIcon(icon: image.PixelMap, callback: AsyncCallback): void; @@ -471,7 +471,7 @@ export default class UIAbilityContext extends Context { * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ setMissionIcon(icon: image.PixelMap): Promise; @@ -484,7 +484,7 @@ export default class UIAbilityContext extends Context { * request result. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ requestPermissionsFromUser(permissions: Array, requestCallback: AsyncCallback): void; @@ -496,7 +496,7 @@ export default class UIAbilityContext extends Context { * @returns { Promise } Returns the permission request result. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ requestPermissionsFromUser(permissions: Array): Promise; @@ -506,7 +506,7 @@ export default class UIAbilityContext extends Context { * @param { LocalStorage } localStorage - the storage data used to restore window stage * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ restoreWindowStage(localStorage: LocalStorage): void; @@ -515,7 +515,7 @@ export default class UIAbilityContext extends Context { * Check to see ability is in terminating state. * @returns { boolean } Returns true when ability is in terminating state, else returns false. * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @stagemodelonly + * @StageModelOnly * @since 9 */ isTerminating(): boolean; -- Gitee From 924ab7bcff392547b457a17fe8c5180ef0666c13 Mon Sep 17 00:00:00 2001 From: crazy_hu Date: Wed, 16 Nov 2022 04:06:40 +0000 Subject: [PATCH 327/438] update jsdoc retures Signed-off-by: crazy_hu --- api/@ohos.rpc.d.ts | 324 ++++++++++++++++++++++----------------------- 1 file changed, 162 insertions(+), 162 deletions(-) diff --git a/api/@ohos.rpc.d.ts b/api/@ohos.rpc.d.ts index 253dc3b0fd..93a91a9ea4 100644 --- a/api/@ohos.rpc.d.ts +++ b/api/@ohos.rpc.d.ts @@ -89,7 +89,7 @@ declare namespace rpc { class MessageParcel { /** * Creates an empty {@link MessageParcel} object. - * @returns Returns the object created. + * @returns Return the object created. * @since 7 */ static create(): MessageParcel; @@ -103,14 +103,14 @@ declare namespace rpc { /** * Serialize a remote object and writes it to the {@link MessageParcel} object. * @param object Remote object to serialize. - * @returns Returns true if it is successful; returns false otherwise. + * @returns Return true if it is successful; return false otherwise. * @since 7 */ writeRemoteObject(object: IRemoteObject): boolean; /** * Reads a remote object from {@link MessageParcel} object. - * @returns Returns the remote object. + * @returns Return the remote object. * @since 7 */ readRemoteObject(): IRemoteObject; @@ -118,29 +118,29 @@ declare namespace rpc { /** * Writes an interface token into the {@link MessageParcel} object. * @param token Interface descriptor to write. - * @returns Returns {@code true} if the interface token has been written into the {@link MessageParcel}; - * returns {@code false} otherwise. + * @returns Return {@code true} if the interface token has been written into the {@link MessageParcel}; + * return {@code false} otherwise. * @since 7 */ writeInterfaceToken(token: string): boolean; /** * Reads an interface token from the {@link MessageParcel} object. - * @returns Returns a string value. + * @returns Return a string value. * @since 7 */ readInterfaceToken(): string; /** * Obtains the size of data (in bytes) contained in the {@link MessageParcel} object. - * @returns Returns the size of data contained in the {@link MessageParcel} object. + * @returns Return the size of data contained in the {@link MessageParcel} object. * @since 7 */ getSize(): number; /** * Obtains the storage capacity (in bytes) of the {@link MessageParcel} object. - * @returns Returns the storage capacity of the {@link MessageParcel} object. + * @returns Return the storage capacity of the {@link MessageParcel} object. * @since 7 */ getCapacity(): number; @@ -151,7 +151,7 @@ declare namespace rpc { * than the storage capacity of the {@link MessageParcel}. * * @param size Indicates the data size of the {@link MessageParcel} object. - * @returns Returns {@code true} if the setting is successful; returns {@code false} otherwise. + * @returns Return {@code true} if the setting is successful; return {@code false} otherwise. * @since 7 */ setSize(size: number): boolean; @@ -162,7 +162,7 @@ declare namespace rpc { * the size of data contained in the {@link MessageParcel}. * * @param size Indicates the storage capacity of the {@link MessageParcel} object. - * @returns Returns {@code true} if the setting is successful; returns {@code false} otherwise. + * @returns Return {@code true} if the setting is successful; return {@code false} otherwise. * @since 7 */ setCapacity(size: number): boolean; @@ -171,7 +171,7 @@ declare namespace rpc { * Obtains the writable data space (in bytes) in the {@link MessageParcel} object. *

          Writable data space = Storage capacity of the {@link MessageParcel} – Size of data contained in the {@link MessageParcel}. * - * @returns Returns the writable data space of the {@link MessageParcel} object. + * @returns Return the writable data space of the {@link MessageParcel} object. * @since 7 */ getWritableBytes(): number; @@ -180,21 +180,21 @@ declare namespace rpc { * Obtains the readable data space (in bytes) in the {@link MessageParcel} object. *

          Readable data space = Size of data contained in the {@link MessageParcel} – Size of data that has been read. * - * @returns Returns the readable data space of the {@link MessageParcel} object. + * @returns Return the readable data space of the {@link MessageParcel} object. * @since 7 */ getReadableBytes(): number; /** * Obtains the current read position in the {@link MessageParcel} object. - * @returns Returns the current read position in the {@link MessageParcel} object. + * @returns Return the current read position in the {@link MessageParcel} object. * @since 7 */ getReadPosition(): number; /** * Obtains the current write position in the {@link MessageParcel} object. - * @returns Returns the current write position in the {@link MessageParcel} object. + * @returns Return the current write position in the {@link MessageParcel} object. * @since 7 */ getWritePosition(): number; @@ -205,7 +205,7 @@ declare namespace rpc { * change it, change it to an accurate position. Otherwise, the read data may be incorrect. * * @param pos Indicates the target position to start data reading. - * @returns Returns {@code true} if the read position is changed; returns {@code false} otherwise. + * @returns Return {@code true} if the read position is changed; return {@code false} otherwise. * @since 7 */ rewindRead(pos: number): boolean; @@ -216,7 +216,7 @@ declare namespace rpc { * change it, change it to an accurate position. Otherwise, the data to be read may be incorrect. * * @param pos Indicates the target position to start data writing. - * @returns Returns {@code true} if the write position is changed; returns {@code false} otherwise. + * @returns Return {@code true} if the write position is changed; return {@code false} otherwise. * @since 7 */ rewindWrite(pos: number): boolean; @@ -241,8 +241,8 @@ declare namespace rpc { /** * Writes a byte value into the {@link MessageParcel} object. * @param val Indicates the byte value to write. - * @returns Returns {@code true} if the value has been written into the {@link MessageParcel}; - * returns {@code false} otherwise. + * @returns Return {@code true} if the value has been written into the {@link MessageParcel}; + * return {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. * @since 7 @@ -252,8 +252,8 @@ declare namespace rpc { /** * Writes a short integer value into the {@link MessageParcel} object. * @param val Indicates the short integer value to write. - * @returns Returns {@code true} if the value has been written into the {@link MessageParcel}; - * returns {@code false} otherwise. + * @returns Return {@code true} if the value has been written into the {@link MessageParcel}; + * return {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. * @since 7 @@ -263,8 +263,8 @@ declare namespace rpc { /** * Writes an integer value into the {@link MessageParcel} object. * @param val Indicates the integer value to write. - * @returns Returns {@code true} if the value has been written into the {@link MessageParcel}; - * returns {@code false} otherwise. + * @returns Return {@code true} if the value has been written into the {@link MessageParcel}; + * return {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. * @since 7 @@ -274,8 +274,8 @@ declare namespace rpc { /** * Writes a long integer value into the {@link MessageParcel} object. * @param val Indicates the long integer value to write. - * @returns Returns {@code true} if the value has been written into the {@link MessageParcel}; - * returns {@code false} otherwise. + * @returns Return {@code true} if the value has been written into the {@link MessageParcel}; + * return {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. * @since 7 @@ -285,8 +285,8 @@ declare namespace rpc { /** * Writes a floating point value into the {@link MessageParcel} object. * @param val Indicates the floating point value to write. - * @returns Returns {@code true} if the value has been written into the {@link MessageParcel}; - * returns {@code false} otherwise. + * @returns Return {@code true} if the value has been written into the {@link MessageParcel}; + * return {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. * @since 7 @@ -296,8 +296,8 @@ declare namespace rpc { /** * Writes a double-precision floating point value into the {@link MessageParcel} object. * @param val Indicates the double-precision floating point value to write. - * @returns Returns {@code true} if the value has been written into the {@link MessageParcel}; - * returns {@code false} otherwise. + * @returns Return {@code true} if the value has been written into the {@link MessageParcel}; + * return {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. * @since 7 @@ -307,8 +307,8 @@ declare namespace rpc { /** * Writes a boolean value into the {@link MessageParcel} object. * @param val Indicates the boolean value to write. - * @returns Returns {@code true} if the value has been written into the {@link MessageParcel}; - * returns {@code false} otherwise. + * @returns Return {@code true} if the value has been written into the {@link MessageParcel}; + * return {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. * @since 7 @@ -318,8 +318,8 @@ declare namespace rpc { /** * Writes a single character value into the {@link MessageParcel} object. * @param val Indicates the single character value to write. - * @returns Returns {@code true} if the value has been written into the {@link MessageParcel}; - * returns {@code false} otherwise. + * @returns Return {@code true} if the value has been written into the {@link MessageParcel}; + * return {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. * @since 7 @@ -329,8 +329,8 @@ declare namespace rpc { /** * Writes a string value into the {@link MessageParcel} object. * @param val Indicates the string value to write. - * @returns Returns {@code true} if the value has been written into the {@link MessageParcel}; - * returns {@code false} otherwise. + * @returns Return {@code true} if the value has been written into the {@link MessageParcel}; + * return {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. * @since 7 @@ -349,8 +349,8 @@ declare namespace rpc { /** * Writes a byte array into the {@link MessageParcel} object. * @param byteArray Indicates the byte array to write. - * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; - * returns {@code false} otherwise. + * @returns Return {@code true} if the array has been written into the {@link MessageParcel}; + * return {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. * @since 7 @@ -362,8 +362,8 @@ declare namespace rpc { * Ensure that the data type and size comply with the interface definition. * Otherwise,data may be truncated. * @param shortArray Indicates the short integer array to write. - * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; - * returns {@code false} otherwise. + * @returns Return {@code true} if the array has been written into the {@link MessageParcel}; + * return {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. * @since 7 @@ -375,8 +375,8 @@ declare namespace rpc { * Ensure that the data type and size comply with the interface definition. * Otherwise,data may be truncated. * @param intArray Indicates the integer array to write. - * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; - * returns {@code false} otherwise. + * @returns Return {@code true} if the array has been written into the {@link MessageParcel}; + * return {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. * @since 7 @@ -388,8 +388,8 @@ declare namespace rpc { * Ensure that the data type and size comply with the interface definition. * Otherwise,data may be truncated. * @param longArray Indicates the long integer array to write. - * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; - * returns {@code false} otherwise. + * @returns Return {@code true} if the array has been written into the {@link MessageParcel}; + * return {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. * @since 7 @@ -401,8 +401,8 @@ declare namespace rpc { * Ensure that the data type and size comply with the interface definition. * Otherwise,data may be truncated. * @param floatArray Indicates the floating point array to write. - * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; - * returns {@code false} otherwise. + * @returns Return {@code true} if the array has been written into the {@link MessageParcel}; + * return {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. * @since 7 @@ -414,8 +414,8 @@ declare namespace rpc { * Ensure that the data type and size comply with the interface definition. * Otherwise,data may be truncated. * @param doubleArray Indicates the double-precision floating point array to write. - * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; - * returns {@code false} otherwise. + * @returns Return {@code true} if the array has been written into the {@link MessageParcel}; + * return {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. * @since 7 @@ -427,8 +427,8 @@ declare namespace rpc { * Ensure that the data type and size comply with the interface definition. * Otherwise,data may be truncated. * @param booleanArray Indicates the boolean array to write. - * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; - * returns {@code false} otherwise. + * @returns Return {@code true} if the array has been written into the {@link MessageParcel}; + * return {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. * @since 7 @@ -440,8 +440,8 @@ declare namespace rpc { * Ensure that the data type and size comply with the interface definition. * Otherwise,data may be truncated. * @param charArray Indicates the single character array to write. - * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; - * returns {@code false} otherwise. + * @returns Return {@code true} if the array has been written into the {@link MessageParcel}; + * return {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. * @since 7 @@ -453,8 +453,8 @@ declare namespace rpc { * Ensure that the data type and size comply with the interface definition. * Otherwise,data may be truncated. * @param stringArray Indicates the string array to write. - * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; - * returns {@code false} otherwise. + * @returns Return {@code true} if the array has been written into the {@link MessageParcel}; + * return {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. * @since 7 @@ -464,8 +464,8 @@ declare namespace rpc { /** * Writes a {@link Sequenceable} object array into the {@link MessageParcel} object. * @param sequenceableArray Indicates the {@link Sequenceable} object array to write. - * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; - * returns {@code false} otherwise. + * @returns Return {@code true} if the array has been written into the {@link MessageParcel}; + * return {@code false} otherwise. * @throws ParcelException When capacity in this parcel is insufficient, * exception message: {@link ParcelException#NO_CAPACITY_ERROR}. * @since 7 @@ -475,71 +475,71 @@ declare namespace rpc { /** * Writes an array of {@link IRemoteObject} objects to this {@link MessageParcel} object. * @param objectArray Array of {@link IRemoteObject} objects to write. - * @returns Returns {@code true} if the {@link IRemoteObject} array is successfully written to the {@link MessageParcel}; - * returns false if the {@link IRemoteObject} array is null or fails to be written to the {@link MessageParcel}. + * @returns Return {@code true} if the {@link IRemoteObject} array is successfully written to the {@link MessageParcel}; + * return false if the {@link IRemoteObject} array is null or fails to be written to the {@link MessageParcel}. * @since 8 */ writeRemoteObjectArray(objectArray: IRemoteObject[]): boolean; /** * Reads a byte value from the {@link MessageParcel} object. - * @returns Returns a byte value. + * @returns Return a byte value. * @since 7 */ readByte(): number; /** * Reads a short integer value from the {@link MessageParcel} object. - * @returns Returns a short integer value. + * @returns Return a short integer value. * @since 7 */ readShort(): number; /** * Reads an integer value from the {@link MessageParcel} object. - * @returns Returns an integer value. + * @returns Return an integer value. * @since 7 */ readInt(): number; /** * Reads a long integer value from the {@link MessageParcel} object. - * @returns Returns a long integer value. + * @returns Return a long integer value. * @since 7 */ readLong(): number; /** * Reads a floating point value from the {@link MessageParcel} object. - * @returns Returns a floating point value. + * @returns Return a floating point value. * @since 7 */ readFloat(): number; /** * Reads a double-precision floating point value from the {@link MessageParcel} object. - * @returns Returns a double-precision floating point value. + * @returns Return a double-precision floating point value. * @since 7 */ readDouble(): number; /** * Reads a boolean value from the {@link MessageParcel} object. - * @returns Returns a boolean value. + * @returns Return a boolean value. * @since 7 */ readBoolean(): boolean; /** * Reads a single character value from the {@link MessageParcel} object. - * @returns Returns a single character value. + * @returns Return a single character value. * @since 7 */ readChar(): number; /** * Reads a string value from the {@link MessageParcel} object. - * @returns Returns a string value. + * @returns Return a string value. * @since 7 */ readString(): string; @@ -548,7 +548,7 @@ declare namespace rpc { * Reads a {@link Sequenceable} object from the {@link MessageParcel} instance. * @param dataIn Indicates the {@link Sequenceable} object that needs to perform the {@code unmarshalling} operation * using the {@link MessageParcel}. - * @returns Returns {@code true} if the unmarshalling is successful; returns {@code false} otherwise. + * @returns Return {@code true} if the unmarshalling is successful; return {@code false} otherwise. * @since 7 */ readSequenceable(dataIn: Sequenceable) : boolean; @@ -556,8 +556,8 @@ declare namespace rpc { /** * Writes a byte array into the {@link MessageParcel} object. * @param dataIn Indicates the byte array read from MessageParcel. - * @returns Returns {@code true} if the array has been written into the {@link MessageParcel}; - * returns {@code false} otherwise. + * @returns Return {@code true} if the array has been written into the {@link MessageParcel}; + * return {@code false} otherwise. * @throws ParcelException When capacity in this MessageParcel is insufficient, * exception message: {@link *MessageParcelException#NO_CAPACITY_ERROR}. * @since 7 @@ -566,7 +566,7 @@ declare namespace rpc { /** * Reads a byte array from the {@link MessageParcel} object. - * @returns Returns a byte array. + * @returns Return a byte array. * @since 7 */ readByteArray(): number[]; @@ -580,7 +580,7 @@ declare namespace rpc { /** * Reads a short integer array from the {@link MessageParcel} object. - * @returns Returns a short integer array. + * @returns Return a short integer array. * @since 7 */ readShortArray(): number[]; @@ -595,7 +595,7 @@ declare namespace rpc { /** * Reads an integer array from the {@link MessageParcel} object. - * @returns Returns an integer array. + * @returns Return an integer array. * @since 7 */ readIntArray(): number[]; @@ -610,7 +610,7 @@ declare namespace rpc { /** * Reads a long integer array from the {@link MessageParcel} object. - * @returns Returns a long integer array. + * @returns Return a long integer array. * @since 7 */ readLongArray(): number[]; @@ -625,7 +625,7 @@ declare namespace rpc { /** * Reads a floating point array from the {@link MessageParcel} object. - * @returns Returns a floating point array. + * @returns Return a floating point array. * @since 7 */ readFloatArray(): number[]; @@ -640,7 +640,7 @@ declare namespace rpc { /** * Reads a double-precision floating point array from the {@link MessageParcel} object. - * @returns Returns a double-precision floating point array. + * @returns Return a double-precision floating point array. * @since 7 */ readDoubleArray(): number[]; @@ -655,7 +655,7 @@ declare namespace rpc { /** * Reads a boolean array from the {@link MessageParcel} object. - * @returns Returns a boolean array. + * @returns Return a boolean array. * @since 7 */ readBooleanArray(): boolean[]; @@ -670,7 +670,7 @@ declare namespace rpc { /** * Reads a single character array from the {@link MessageParcel} object. - * @returns Returns a single character array. + * @returns Return a single character array. * @since 7 */ readCharArray(): number[]; @@ -685,7 +685,7 @@ declare namespace rpc { /** * Reads a string array from the {@link MessageParcel} object. - * @returns Returns a string array. + * @returns Return a string array. * @since 7 */ readStringArray(): string[]; @@ -728,8 +728,8 @@ declare namespace rpc { /** * Checks whether this {@link MessageParcel} object contains a file descriptor. - * @returns Returns true if the {@link MessageParcel} object contains a file descriptor; - * returns false otherwise. + * @returns Return true if the {@link MessageParcel} object contains a file descriptor; + * return false otherwise. * @since 8 */ containFileDescriptors(): boolean; @@ -737,7 +737,7 @@ declare namespace rpc { /** * Writes a file descriptor to this {@link MessageParcel} object. * @param fd File descriptor to wrote. - * @returns Returns true if the operation is successful; returns false otherwise. + * @returns Return true if the operation is successful; return false otherwise. * @since 8 */ writeFileDescriptor(fd: number): boolean; @@ -752,7 +752,7 @@ declare namespace rpc { /** * Writes an anonymous shared memory object to this {@link MessageParcel} object. * @param ashmem Anonymous shared memory object to wrote. - * @returns Returns true if the operation is successful; returns false otherwise. + * @returns Return true if the operation is successful; return false otherwise. * @since 8 */ writeAshmem(ashmem: Ashmem): boolean; @@ -775,7 +775,7 @@ declare namespace rpc { * Writes raw data to this {@link MessageParcel} object. * @param rawData Raw data to wrote. * @param size Size of the raw data, in bytes. - * @returns Returns true if the operation is successful; returns false otherwise. + * @returns Return true if the operation is successful; return false otherwise. * @since 8 */ writeRawData(rawData: number[], size: number): boolean; @@ -811,7 +811,7 @@ declare namespace rpc { class MessageSequence { /** * Creates an empty {@link MessageSequence} object. - * @returns Returns the object created. + * @returns Return the object created. * @since 9 */ static create(): MessageSequence; @@ -834,7 +834,7 @@ declare namespace rpc { /** * Reads a remote object from {@link MessageSequence} object. - * @returns Returns the remote object. + * @returns Return the remote object. * @throws { BusinessError } 1900008 - proxy or remote object is invalid * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 @@ -852,7 +852,7 @@ declare namespace rpc { /** * Reads an interface token from the {@link MessageSequence} object. - * @returns Returns a string value. + * @returns Return a string value. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -860,14 +860,14 @@ declare namespace rpc { /** * Obtains the size of data (in bytes) contained in the {@link MessageSequence} object. - * @returns Returns the size of data contained in the {@link MessageSequence} object. + * @returns Return the size of data contained in the {@link MessageSequence} object. * @since 9 */ getSize(): number; /** * Obtains the storage capacity (in bytes) of the {@link MessageSequence} object. - * @returns Returns the storage capacity of the {@link MessageSequence} object. + * @returns Return the storage capacity of the {@link MessageSequence} object. * @since 9 */ getCapacity(): number; @@ -899,7 +899,7 @@ declare namespace rpc { * Obtains the writable data space (in bytes) in the {@link MessageSequence} object. *

          Writable data space = Storage capacity of the {@link MessageSequence} – Size of data contained in the {@link MessageSequence}. * - * @returns Returns the writable data space of the {@link MessageSequence} object. + * @returns Return the writable data space of the {@link MessageSequence} object. * @since 9 */ getWritableBytes(): number; @@ -908,21 +908,21 @@ declare namespace rpc { * Obtains the readable data space (in bytes) in the {@link MessageSequence} object. *

          Readable data space = Size of data contained in the {@link MessageSequence} – Size of data that has been read. * - * @returns Returns the readable data space of the {@link MessageSequence} object. + * @returns Return the readable data space of the {@link MessageSequence} object. * @since 9 */ getReadableBytes(): number; /** * Obtains the current read position in the {@link MessageSequence} object. - * @returns Returns the current read position in the {@link MessageSequence} object. + * @returns Return the current read position in the {@link MessageSequence} object. * @since 9 */ getReadPosition(): number; /** * Obtains the current write position in the {@link MessageSequence} object. - * @returns Returns the current write position in the {@link MessageSequence} object. + * @returns Return the current write position in the {@link MessageSequence} object. * @since 9 */ getWritePosition(): number; @@ -1174,7 +1174,7 @@ declare namespace rpc { /** * Reads a byte value from the {@link MessageParcel} object. - * @returns Returns a byte value. + * @returns Return a byte value. * @throws { BusinessError } 1900010 read data from message sequence failed * @since 9 */ @@ -1182,7 +1182,7 @@ declare namespace rpc { /** * Reads a short integer value from the {@link MessageSequence} object. - * @returns Returns a short integer value. + * @returns Return a short integer value. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1190,7 +1190,7 @@ declare namespace rpc { /** * Reads an integer value from the {@link MessageSequence} object. - * @returns Returns an integer value. + * @returns Return an integer value. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1198,7 +1198,7 @@ declare namespace rpc { /** * Reads a long integer value from the {@link MessageSequence} object. - * @returns Returns a long integer value. + * @returns Return a long integer value. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1206,7 +1206,7 @@ declare namespace rpc { /** * Reads a floating point value from the {@link MessageSequence} object. - * @returns Returns a floating point value. + * @returns Return a floating point value. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1214,7 +1214,7 @@ declare namespace rpc { /** * Reads a double-precision floating point value from the {@link MessageSequence} object. - * @returns Returns a double-precision floating point value. + * @returns Return a double-precision floating point value. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1222,7 +1222,7 @@ declare namespace rpc { /** * Reads a boolean value from the {@link MessageSequence} object. - * @returns Returns a boolean value. + * @returns Return a boolean value. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1230,7 +1230,7 @@ declare namespace rpc { /** * Reads a single character value from the {@link MessageSequence} object. - * @returns Returns a single character value. + * @returns Return a single character value. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1238,7 +1238,7 @@ declare namespace rpc { /** * Reads a string value from the {@link MessageSequence} object. - * @returns Returns a string value. + * @returns Return a string value. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1266,7 +1266,7 @@ declare namespace rpc { /** * Reads a byte array from the {@link MessageSequence} object. - * @returns Returns a byte array. + * @returns Return a byte array. * @throws { BusinessError } 401 - check param failed * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 @@ -1284,7 +1284,7 @@ declare namespace rpc { /** * Reads a short integer array from the {@link MessageSequence} object. - * @returns Returns a short integer array. + * @returns Return a short integer array. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1301,7 +1301,7 @@ declare namespace rpc { /** * Reads an integer array from the {@link MessageSequence} object. - * @returns Returns an integer array. + * @returns Return an integer array. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1318,7 +1318,7 @@ declare namespace rpc { /** * Reads a long integer array from the {@link MessageSequence} object. - * @returns Returns a long integer array. + * @returns Return a long integer array. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1335,7 +1335,7 @@ declare namespace rpc { /** * Reads a floating point array from the {@link MessageSequence} object. - * @returns Returns a floating point array. + * @returns Return a floating point array. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1352,7 +1352,7 @@ declare namespace rpc { /** * Reads a double-precision floating point array from the {@link MessageSequence} object. - * @returns Returns a double-precision floating point array. + * @returns Return a double-precision floating point array. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1369,7 +1369,7 @@ declare namespace rpc { /** * Reads a boolean array from the {@link MessageSequence} object. - * @returns Returns a boolean array. + * @returns Return a boolean array. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1386,7 +1386,7 @@ declare namespace rpc { /** * Reads a single character array from the {@link MessageSequence} object. - * @returns Returns a single character array. + * @returns Return a single character array. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1404,7 +1404,7 @@ declare namespace rpc { /** * Reads a string array from the {@link MessageSequence} object. - * @returns Returns a string array. + * @returns Return a string array. * @throws { BusinessError } 1900010 - read data from message sequence failed * @since 9 */ @@ -1457,8 +1457,8 @@ declare namespace rpc { /** * Checks whether this {@link MessageSequence} object contains a file descriptor. - * @returns Returns true if the {@link MessageSequence} object contains a file descriptor; - * returns false otherwise. + * @returns Return true if the {@link MessageSequence} object contains a file descriptor; + * return false otherwise. * @since 9 */ containFileDescriptors(): boolean; @@ -1538,7 +1538,7 @@ declare namespace rpc { * * @param dataOut Indicates the {@link MessageParcel} object to which the {@code Sequenceable} * object will be marshalled.. - * @returns Returns {@code true} if the marshalling is successful; returns {@code false} otherwise. + * @returns Return {@code true} if the marshalling is successful; return {@code false} otherwise. * @throws ParcelException Throws this exception if the operation fails. * @since 7 */ @@ -1549,7 +1549,7 @@ declare namespace rpc { * * @param dataIn Indicates the {@link MessageParcel} object into which the {@code Sequenceable} * object has been marshalled. - * @returns Returns {@code true} if the unmarshalling is successful; returns {@code false} otherwise. + * @returns Return {@code true} if the unmarshalling is successful; return {@code false} otherwise. * @throws ParcelException Throws this exception if the operation fails. * @since 7 */ @@ -1566,7 +1566,7 @@ declare namespace rpc { * * @param dataOut Indicates the {@link MessageSequence} object to which the {@code Parcelable} * object will be marshalled.. - * @returns Returns {@code true} if the marshalling is successful; returns {@code false} otherwise. + * @returns Return {@code true} if the marshalling is successful; return {@code false} otherwise. * @throws ParcelException Throws this exception if the operation fails. * @since 9 */ @@ -1577,7 +1577,7 @@ declare namespace rpc { * * @param dataIn Indicates the {@link MessageSequence} object into which the {@code Parcelable} * object has been marshalled. - * @returns Returns {@code true} if the unmarshalling is successful; returns {@code false} otherwise. + * @returns Return {@code true} if the unmarshalling is successful; return {@code false} otherwise. * @throws ParcelException Throws this exception if the operation fails. * @since 9 */ @@ -1671,7 +1671,7 @@ declare namespace rpc { * indicating that the interface is not a local one. * * @param descriptor Indicates the interface descriptor. - * @returns Returns the {@link IRemoteBroker} object bound to the specified interface descriptor. + * @returns Return the {@link IRemoteBroker} object bound to the specified interface descriptor. * @since 7 * @deprecated since 9 * @useinstead ohos.rpc.IRemoteObject#getLocalInterface @@ -1686,7 +1686,7 @@ declare namespace rpc { * indicating that the interface is not a local one. * * @param descriptor Indicates the interface descriptor. - * @returns Returns the {@link IRemoteBroker} object bound to the specified interface descriptor. + * @returns Return the {@link IRemoteBroker} object bound to the specified interface descriptor. * @throws { BusinessError } 401 - check param failed * @since 9 */ @@ -1705,7 +1705,7 @@ declare namespace rpc { * @param data Indicates the {@link MessageParcel} object sent to the peer process. * @param reply Indicates the {@link MessageParcel} object returned by the peer process. * @param options Indicates the synchronous or asynchronous mode to send messages. - * @returns Returns {@code true} if the method is called successfully; returns {@code false} otherwise. + * @returns Return {@code true} if the method is called successfully; return {@code false} otherwise. * @throws RemoteException Throws this exception if the method fails to be called. * @since 7 * @deprecated since 9 @@ -1793,7 +1793,7 @@ declare namespace rpc { * * @param recipient Indicates the callback to be registered. * @param flags Indicates the flag of the death notification. - * @returns Returns {@code true} if the callback is registered successfully; returns {@code false} otherwise. + * @returns Return {@code true} if the callback is registered successfully; return {@code false} otherwise. * @since 7 * @deprecated since 9 * @useinstead ohos.rpc.IRemoteObject#registerDeathRecipient @@ -1816,7 +1816,7 @@ declare namespace rpc { * * @param recipient Indicates the callback to be deregister. * @param flags Indicates the flag of the death notification. - * @returns Returns {@code true} if the callback is deregister successfully; returns {@code false} otherwise. + * @returns Return {@code true} if the callback is deregister successfully; return {@code false} otherwise. * @since 7 * @deprecated since 9 * @useinstead ohos.rpc.IRemoteObject#unregisterDeathRecipient @@ -1839,7 +1839,7 @@ declare namespace rpc { * *

          The interface descriptor is a character string. * - * @returns Returns the interface descriptor. + * @returns Return the interface descriptor. * @since 7 * @deprecated since 9 * @useinstead ohos.rpc.IRemoteObject#getDescriptor @@ -1851,7 +1851,7 @@ declare namespace rpc { * *

          The interface descriptor is a character string. * - * @returns Returns the interface descriptor. + * @returns Return the interface descriptor. * @throws { BusinessError } 1900008 - proxy or remote object is invalid * @since 9 */ @@ -1860,7 +1860,7 @@ declare namespace rpc { /** * Checks whether an object is dead. * - * @returns Returns {@code true} if the object is dead; returns {@code false} otherwise. + * @returns Return {@code true} if the object is dead; return {@code false} otherwise. * @since 7 */ isObjectDead(): boolean; @@ -1874,7 +1874,7 @@ declare namespace rpc { /** * Obtains a proxy or remote object. This method must be implemented by its derived classes. * - * @returns Returns the RemoteObject if the caller is a RemoteObject; returns the IRemoteObject, + * @returns Return the RemoteObject if the caller is a RemoteObject; return the IRemoteObject, * that is, the holder of this RemoteProxy object, if the caller is a RemoteProxy object. * @since 7 */ @@ -1956,7 +1956,7 @@ declare namespace rpc { /** * Obtains the SendRequest call flag, which can be synchronous or asynchronous. * - * @returns Returns whether the SendRequest is called synchronously or asynchronously. + * @returns Return whether the SendRequest is called synchronously or asynchronously. * @since 7 */ getFlags(): number; @@ -1972,7 +1972,7 @@ declare namespace rpc { /** * Obtains the SendRequest call flag, which can be synchronous or asynchronous. * - * @returns Returns whether the SendRequest is called synchronously or asynchronously. + * @returns Return whether the SendRequest is called synchronously or asynchronously. * @since 9 */ isAsync(): boolean; @@ -1988,7 +1988,7 @@ declare namespace rpc { /** * Obtains the maximum wait time for this RPC call. * - * @returns Returns maximum wait time obtained. + * @returns Return maximum wait time obtained. * @since 7 */ getWaitTime(): number; @@ -2019,7 +2019,7 @@ declare namespace rpc { * Queries a remote object using an interface descriptor. * * @param descriptor Indicates the interface descriptor used to query the remote object. - * @returns Returns the remote object matching the interface descriptor; returns null + * @returns Return the remote object matching the interface descriptor; return null * if no such remote object is found. * @since 7 * @deprecated since 9 @@ -2031,7 +2031,7 @@ declare namespace rpc { * Queries a remote object using an interface descriptor. * * @param descriptor Indicates the interface descriptor used to query the remote object. - * @returns Returns the remote object matching the interface descriptor; returns null + * @returns Return the remote object matching the interface descriptor; return null * if no such remote object is found. * @throws { BusinessError } 401 - check param failed * @since 9 @@ -2041,7 +2041,7 @@ declare namespace rpc { /** * Queries an interface descriptor. * - * @returns Returns the interface descriptor. + * @returns Return the interface descriptor. * @since 7 * @deprecated since 9 * @useinstead ohos.rpc.RemoteObject#getDescriptor @@ -2051,7 +2051,7 @@ declare namespace rpc { /** * Queries an interface descriptor. * - * @returns Returns the interface descriptor. + * @returns Return the interface descriptor. * @throws { BusinessError } 1900008 - proxy or remote object is invalid * @since 9 */ @@ -2069,8 +2069,8 @@ declare namespace rpc { * The local service writes the response data to the {@link MessageParcel} object. * @param options Indicates whether the operation is synchronous or asynchronous. * @returns - * Returns a simple boolean which is {@code true} if the operation succeeds; {{@code false} otherwise} when the function call is synchronous. - * Returns a promise object with a boolean when the function call is asynchronous. + * Return a simple boolean which is {@code true} if the operation succeeds; {{@code false} otherwise} when the function call is synchronous. + * Return a promise object with a boolean when the function call is asynchronous. * @since 9 */ onRemoteMessageRequest(code: number, data: MessageSequence, reply: MessageSequence, options: MessageOption): boolean | Promise; @@ -2086,7 +2086,7 @@ declare namespace rpc { * @param reply Indicates the response message object sent from the remote service. * The local service writes the response data to the {@link MessageParcel} object. * @param options Indicates whether the operation is synchronous or asynchronous. - * @returns Returns {@code true} if the operation succeeds; returns {@code false} otherwise. + * @returns Return {@code true} if the operation succeeds; return {@code false} otherwise. * @throws RemoteException Throws this exception if a remote service error occurs. * @since 7 * @deprecated since 9 @@ -2104,7 +2104,7 @@ declare namespace rpc { * @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. - * @returns Returns {@code true} if the operation succeeds; returns {@code false} otherwise. + * @returns Return {@code true} if the operation succeeds; return {@code false} otherwise. * @since 7 * @deprecated since 8 */ @@ -2188,7 +2188,7 @@ declare namespace rpc { /** * Obtains the PID of the {@link RemoteProxy} object. * - * @returns Returns the PID of the {@link RemoteProxy} object. + * @returns Return the PID of the {@link RemoteProxy} object. * @since 7 */ getCallingPid(): number; @@ -2196,7 +2196,7 @@ declare namespace rpc { /** * Obtains the UID of the {@link RemoteProxy} object. * - * @returns Returns the UID of the {@link RemoteProxy} object. + * @returns Return the UID of the {@link RemoteProxy} object. * @since 7 */ getCallingUid(): number; @@ -2285,7 +2285,7 @@ declare namespace rpc { * Queries a local interface with a specified descriptor. * * @param descriptor Indicates the descriptor of the interface to query. - * @returns Returns null by default, indicating a proxy interface. + * @returns Return null by default, indicating a proxy interface. * @since 7 * @deprecated since 9 * @useinstead ohos.rpc.RemoteProxy#getLocalInterface @@ -2296,7 +2296,7 @@ declare namespace rpc { * Queries a local interface with a specified descriptor. * * @param descriptor Indicates the descriptor of the interface to query. - * @returns Returns null by default, indicating a proxy interface. + * @returns Return null by default, indicating a proxy interface. * @throws { BusinessError } 401 - check param failed * @throws { BusinessError } 1900006 - only remote object permitted * @since 9 @@ -2308,7 +2308,7 @@ declare namespace rpc { * * @param recipient Indicates the callback to be registered. * @param flags Indicates the flag of the death notification. This is a reserved parameter. Set it to {@code 0}. - * @returns Returns {@code true} if the callback is registered successfully; returns {@code false} otherwise. + * @returns Return {@code true} if the callback is registered successfully; return {@code false} otherwise. * @since 7 * @deprecated since 9 * @useinstead ohos.rpc.RemoteProxy#registerDeathRecipient @@ -2331,7 +2331,7 @@ declare namespace rpc { * * @param recipient Indicates the callback to be deregister. * @param flags Indicates the flag of the death notification. This is a reserved parameter. Set it to {@code 0}. - * @returns Returns {@code true} if the callback is deregister successfully; returns {@code false} otherwise. + * @returns Return {@code true} if the callback is deregister successfully; return {@code false} otherwise. * @since 7 * @deprecated since 9 * @useinstead ohos.rpc.RemoteProxy#unregisterDeathRecipient @@ -2352,7 +2352,7 @@ declare namespace rpc { /** * Queries the interface descriptor of remote object. * - * @returns Returns the interface descriptor. + * @returns Return the interface descriptor. * @since 7 * @deprecated since 9 * @useinstead ohos.rpc.RemoteProxy#getDescriptor @@ -2362,7 +2362,7 @@ declare namespace rpc { /** * Queries the interface descriptor of remote object. * - * @returns Returns the interface descriptor. + * @returns Return the interface descriptor. * @throws { BusinessError } 1900007 - communication failed * @throws { BusinessError } 1900008 - proxy or remote object is invalid * @since 9 @@ -2379,7 +2379,7 @@ declare namespace rpc { * @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. - * @returns Returns {@code true} if the operation succeeds; returns {@code false} otherwise. + * @returns Return {@code true} if the operation succeeds; return {@code false} otherwise. * @throws RemoteException Throws this exception if a remote object exception occurs. * @since 7 * @deprecated since 8 @@ -2464,7 +2464,7 @@ declare namespace rpc { /** * Checks whether the {@code RemoteObject} corresponding to a {@code RemoteProxy} is dead. * - * @returns Returns {@code true} if the {@code RemoteObject} is dead; returns {@code false} otherwise. + * @returns Return {@code true} if the {@code RemoteObject} is dead; return {@code false} otherwise. * @since 7 */ isObjectDead(): boolean; @@ -2480,7 +2480,7 @@ declare namespace rpc { * *

          This method is static. * - * @returns Returns an {@link IRemoteObject} reference of the registered service. + * @returns Return an {@link IRemoteObject} reference of the registered service. * @since 7 */ static getContextObject(): IRemoteObject; @@ -2494,7 +2494,7 @@ declare namespace rpc { * {@code 0} is returned; if this method is called from the {@link RemoteObject} object, * the PID of the corresponding {@link RemoteProxy} object is returned. * - * @returns Returns the PID of the proxy. + * @returns Return the PID of the proxy. * @since 7 */ static getCallingPid(): number; @@ -2508,7 +2508,7 @@ declare namespace rpc { * {@code 0} is returned; if this method is called from the {@link RemoteObject} object, * the UID of the corresponding {@link RemoteProxy} object is returned. * - * @returns Returns the UID of the proxy. + * @returns Return the UID of the proxy. * @since 7 */ static getCallingUid(): number; @@ -2518,7 +2518,7 @@ declare namespace rpc { * *

          This method is static. * - * @returns Returns the TOKENID. + * @returns Return the TOKENID. * @since 8 */ static getCallingTokenId(): number; @@ -2528,7 +2528,7 @@ declare namespace rpc { * *

          This method is static. * - * @returns Returns the ID of the device where the peer process resides. + * @returns Return the ID of the device where the peer process resides. * @since 7 */ static getCallingDeviceID(): string; @@ -2538,7 +2538,7 @@ declare namespace rpc { * *

          This method is static. * - * @returns Returns the ID of the local device. + * @returns Return the ID of the local device. * @since 7 */ static getLocalDeviceID(): string; @@ -2548,7 +2548,7 @@ declare namespace rpc { * *

          This method is static. * - * @returns Returns {@code true} if the call is made on the same device; returns {@code false} otherwise. + * @returns Return {@code true} if the call is made on the same device; return {@code false} otherwise. * @since 7 */ static isLocalCalling(): boolean; @@ -2559,7 +2559,7 @@ declare namespace rpc { *

          This method is static. You are advised to call this method before performing any time-sensitive operations. * * @param object Indicates the specified {@link RemoteProxy}. - * @returns Returns {@code 0} if the operation succeeds; returns an error code if the input object is empty + * @returns Return {@code 0} if the operation succeeds; return an error code if the input object is empty * or {@link RemoteObject}, or the operation fails. * @since 7 * @deprecated since 9 @@ -2583,7 +2583,7 @@ declare namespace rpc { * *

          This method is static. It can be used in scenarios like authentication. * - * @returns Returns a string containing the UID and PID of the remote user. + * @returns Return a string containing the UID and PID of the remote user. * @since 7 */ static resetCallingIdentity(): string; @@ -2596,7 +2596,7 @@ declare namespace rpc { * * @param identity Indicates the string containing the UID and PID of the remote user, * which is returned by {@code resetCallingIdentity}. - * @returns Returns {@code true} if the operation succeeds; returns {@code false} otherwise. + * @returns Return {@code true} if the operation succeeds; return {@code false} otherwise. * @since 7 * @deprecated since 9 * @useinstead ohos.rpc.IPCSkeleton#restoreCallingIdentity @@ -2666,7 +2666,7 @@ declare namespace rpc { * Creates an Ashmem object with the specified name and size. * @param name Name of the Ashmem object to create. * @param size Size (in bytes) of the Ashmem object to create. - * @returns Returns the Ashmem object if it is created successfully; returns null otherwise. + * @returns Return the Ashmem object if it is created successfully; return null otherwise. * @since 8 * @deprecated since 9 * @useinstead ohos.rpc.Ashmem#create @@ -2677,7 +2677,7 @@ declare namespace rpc { * Creates an Ashmem object with the specified name and size. * @param name Name of the Ashmem object to create. * @param size Size (in bytes) of the Ashmem object to create. - * @returns Returns the Ashmem object if it is created successfully; returns null otherwise. + * @returns Return the Ashmem object if it is created successfully; return null otherwise. * @throws { BusinessError } 401 - check param failed * @since 9 */ @@ -2727,7 +2727,7 @@ declare namespace rpc { * Creates the shared file mapping on the virtual address space of this process. * The size of the mapping region is specified by this Ashmem object. * @param mapType Protection level of the memory region to which the shared file is mapped. - * @returns Returns true if the operation is successful; returns false otherwise. + * @returns Return true if the operation is successful; return false otherwise. * @since 8 * @deprecated since 9 * @useinstead ohos.rpc.Ashmem#mapTypedAshmem @@ -2746,7 +2746,7 @@ declare namespace rpc { /** * Maps the shared file to the readable and writable virtual address space of the process. - * @returns Returns true if the operation is successful; returns false otherwise. + * @returns Return true if the operation is successful; return false otherwise. * @since 8 * @deprecated since 9 * @useinstead ohos.rpc.Ashmem#mapReadWriteAshmem @@ -2762,7 +2762,7 @@ declare namespace rpc { /** * Maps the shared file to the read-only virtual address space of the process. - * @returns Returns true if the operation is successful; returns false otherwise. + * @returns Return true if the operation is successful; return false otherwise. * @since 8 * @deprecated since 9 * @useinstead ohos.rpc.Ashmem#mapReadonlyAshmem @@ -2779,7 +2779,7 @@ declare namespace rpc { /** * Sets the protection level of the memory region to which the shared file is mapped. * @param protectionType Protection type to set. - * @returns Returns true if the operation is successful; returns false otherwise. + * @returns Return true if the operation is successful; return false otherwise. * @since 8 * @deprecated since 9 * @useinstead ohos.rpc.Ashmem#setProtectionType @@ -2800,7 +2800,7 @@ declare namespace rpc { * @param buf Data to write * @param size Size of the data to write * @param offset Start position of the data to write in the memory region associated with this Ashmem object. - * @returns Returns true is the data is written successfully; returns false otherwise. + * @returns Return true is the data is written successfully; return false otherwise. * @since 8 * @deprecated since 9 * @useinstead ohos.rpc.Ashmem#writeAshmem -- Gitee From 05d716711a275d339af4bc99bc041611c9c14d5c Mon Sep 17 00:00:00 2001 From: yuyaozhi Date: Wed, 16 Nov 2022 11:20:21 +0800 Subject: [PATCH 328/438] Fix error word of ability and notification Signed-off-by: yuyaozhi --- api/@ohos.ability.featureAbility.d.ts | 2 +- api/@ohos.ability.wantConstant.d.ts | 2 +- ...s.app.ability.AbilityLifecycleCallback.d.ts | 4 ++-- api/@ohos.app.ability.AbilityStage.d.ts | 2 +- api/@ohos.app.ability.appRecovery.d.ts | 6 +++--- api/@ohos.app.ability.missionManager.d.ts | 4 ++-- api/@ohos.app.ability.wantAgent.d.ts | 4 ++-- api/@ohos.app.ability.wantConstant.d.ts | 2 +- api/@ohos.app.form.formHost.d.ts | 4 ++-- api/@ohos.application.AbilityStage.d.ts | 2 +- api/@ohos.application.abilityManager.d.ts | 2 +- api/@ohos.application.formHost.d.ts | 18 +++++++++--------- api/@ohos.application.missionManager.d.ts | 2 +- ...@ohos.continuation.continuationManager.d.ts | 2 +- api/@ohos.wantAgent.d.ts | 2 +- api/app/context.d.ts | 2 +- api/application/AbilityContext.d.ts | 8 ++++---- api/application/ServiceExtensionContext.d.ts | 8 ++++---- api/application/UIAbilityContext.d.ts | 8 ++++---- 19 files changed, 42 insertions(+), 42 deletions(-) diff --git a/api/@ohos.ability.featureAbility.d.ts b/api/@ohos.ability.featureAbility.d.ts index 944d6d321b..2b6250e53c 100644 --- a/api/@ohos.ability.featureAbility.d.ts +++ b/api/@ohos.ability.featureAbility.d.ts @@ -35,7 +35,7 @@ import window from './@ohos.window'; */ declare namespace featureAbility { /** - * Obtain the want sended from the source ability. + * Obtain the want sent from the source ability. * * @since 6 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel diff --git a/api/@ohos.ability.wantConstant.d.ts b/api/@ohos.ability.wantConstant.d.ts index 9ad6e2e43a..3b4fc7daa9 100644 --- a/api/@ohos.ability.wantConstant.d.ts +++ b/api/@ohos.ability.wantConstant.d.ts @@ -395,7 +395,7 @@ declare namespace wantConstant { FLAG_INSTALL_ON_DEMAND = 0x00000800, /** - * Install the specifiedi ability with background mode if it's not installed. + * Install the specified ability with background mode if it's not installed. */ FLAG_INSTALL_WITH_BACKGROUND_MODE = 0x80000000, diff --git a/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts b/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts index 7f62e30fea..2d96e16385 100644 --- a/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts +++ b/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts @@ -44,7 +44,7 @@ export default class AbilityLifecycleCallback { onWindowStageCreate(ability: UIAbility, windowStage: window.WindowStage): void; /** - * Called back when a window stage is actived. + * Called back when a window stage is active. * @param { Ability } ability - Indicates the ability to register for listening. * @param { window.WindowStage } windowStage - window stage to active * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore @@ -54,7 +54,7 @@ export default class AbilityLifecycleCallback { onWindowStageActive(ability: UIAbility, windowStage: window.WindowStage): void; /** - * Called back when a window stage is inactived. + * Called back when a window stage is inactive. * @param { Ability } ability - Indicates the ability to register for listening. * @param { window.WindowStage } windowStage - window stage to inactive * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore diff --git a/api/@ohos.app.ability.AbilityStage.d.ts b/api/@ohos.app.ability.AbilityStage.d.ts index 8aa0201a3f..34640a7be8 100644 --- a/api/@ohos.app.ability.AbilityStage.d.ts +++ b/api/@ohos.app.ability.AbilityStage.d.ts @@ -44,7 +44,7 @@ export default class AbilityStage { /** * Called back when start specified ability. - * @param { Want } want - Indicates the want info of startd ability. + * @param { Want } want - Indicates the want info of started ability. * @return { string } The user returns an ability string ID. If the ability of this ID has been started before, * do not create a new instance and pull it back to the top of the stack. * Otherwise, create a new instance and start it. diff --git a/api/@ohos.app.ability.appRecovery.d.ts b/api/@ohos.app.ability.appRecovery.d.ts index a9c1cad363..ba817cdb66 100644 --- a/api/@ohos.app.ability.appRecovery.d.ts +++ b/api/@ohos.app.ability.appRecovery.d.ts @@ -15,11 +15,11 @@ /** * This module provides the capability to app receovery. - * @import appReceovery from '@ohos.app.ability.appRecovery' + * @import appRecovery from '@ohos.app.ability.appRecovery' * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 */ -declare namespace appReceovery { +declare namespace appRecovery { /** * The type of no restart mode. * @enum { number } @@ -118,4 +118,4 @@ declare namespace appReceovery { function saveAppState(): boolean; } -export default appReceovery; \ No newline at end of file +export default appRecovery; \ No newline at end of file diff --git a/api/@ohos.app.ability.missionManager.d.ts b/api/@ohos.app.ability.missionManager.d.ts index efbed8686f..898b5b42d1 100644 --- a/api/@ohos.app.ability.missionManager.d.ts +++ b/api/@ohos.app.ability.missionManager.d.ts @@ -40,7 +40,7 @@ declare namespace missionManager { function on(type: "mission", listener: MissionListener): number; /** - * Unrgister the missionListener to ams. + * Unregister the missionListener to ams. * @param { string } type - mission. * @param { number } listenerId - Indicates the listener id to be unregistered. * @param { AsyncCallback } callback - The callback of off. @@ -51,7 +51,7 @@ declare namespace missionManager { function off(type: "mission", listenerId: number, callback: AsyncCallback): void; /** - * Unrgister the missionListener to ams. + * Unregister the missionListener to ams. * @param { string } type - mission. * @param { number } listenerId - Indicates the listener id to be unregistered. * @returns { Promise } The promise returned by the function. diff --git a/api/@ohos.app.ability.wantAgent.d.ts b/api/@ohos.app.ability.wantAgent.d.ts index ace81f0b44..fa4f617f99 100644 --- a/api/@ohos.app.ability.wantAgent.d.ts +++ b/api/@ohos.app.ability.wantAgent.d.ts @@ -81,7 +81,7 @@ declare namespace wantAgent { function getWant(agent: WantAgent): Promise; /** - * Cancels a WantAgent. Only the application that creates the WantAgent can cancel it. + * Cancel a WantAgent. Only the application that creates the WantAgent can cancel it. * @param { WantAgent } agent - Indicates the WantAgent. * @param { AsyncCallback } callback - The callback of cancel. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. @@ -91,7 +91,7 @@ declare namespace wantAgent { function cancel(agent: WantAgent, callback: AsyncCallback): void; /** - * Cancels a WantAgent. Only the application that creates the WantAgent can cancel it. + * Cancel a WantAgent. Only the application that creates the WantAgent can cancel it. * @param { WantAgent } agent - Indicates the WantAgent. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. diff --git a/api/@ohos.app.ability.wantConstant.d.ts b/api/@ohos.app.ability.wantConstant.d.ts index 05e563cd9f..5df833d014 100644 --- a/api/@ohos.app.ability.wantConstant.d.ts +++ b/api/@ohos.app.ability.wantConstant.d.ts @@ -405,7 +405,7 @@ declare namespace wantConstant { FLAG_INSTALL_ON_DEMAND = 0x00000800, /** - * Install the specifiedi ability with background mode if it's not installed. + * Install the specified ability with background mode if it's not installed. * @syscap SystemCapability.Ability.AbilityBase * @since 9 */ diff --git a/api/@ohos.app.form.formHost.d.ts b/api/@ohos.app.form.formHost.d.ts index 96d204f779..acc0981a47 100644 --- a/api/@ohos.app.form.formHost.d.ts +++ b/api/@ohos.app.form.formHost.d.ts @@ -512,7 +512,7 @@ declare namespace formHost { /** * Notify form that privacy whether to be protected. - * @permission ohos.permission.REQUIRE_FORM. + * @permission ohos.permission.REQUIRE_FORM * @param { Array } formIds - Indicates the specified form id. * @param { boolean } isProtected - Indicates whether to be protected. * @param { AsyncCallback } callback - The callback of notifyFormsPrivacyProtected. @@ -525,7 +525,7 @@ declare namespace formHost { /** * Notify form that privacy whether to be protected. - * @permission ohos.permission.REQUIRE_FORM. + * @permission ohos.permission.REQUIRE_FORM * @param { Array } formIds - Indicates the specified form id. * @param { boolean } isProtected - Indicates whether to be protected. * @returns { Promise } The promise returned by the function. diff --git a/api/@ohos.application.AbilityStage.d.ts b/api/@ohos.application.AbilityStage.d.ts index 8d7b4cc1c8..7b452bb747 100644 --- a/api/@ohos.application.AbilityStage.d.ts +++ b/api/@ohos.application.AbilityStage.d.ts @@ -53,7 +53,7 @@ export default class AbilityStage { * * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @param want Indicates the want info of startd ability. + * @param want Indicates the want info of started ability. * @return The user returns an ability string ID. If the ability of this ID has been started before, * do not create a new instance and pull it back to the top of the stack. * Otherwise, create a new instance and start it. diff --git a/api/@ohos.application.abilityManager.d.ts b/api/@ohos.application.abilityManager.d.ts index dfa26ab42b..9c23cb053c 100644 --- a/api/@ohos.application.abilityManager.d.ts +++ b/api/@ohos.application.abilityManager.d.ts @@ -59,7 +59,7 @@ declare namespace abilityManager { function updateConfiguration(config: Configuration): Promise; /** - * Get information about running abilitys + * Get information about running abilities * * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Core diff --git a/api/@ohos.application.formHost.d.ts b/api/@ohos.application.formHost.d.ts index 7f38585eda..90fb9445d1 100644 --- a/api/@ohos.application.formHost.d.ts +++ b/api/@ohos.application.formHost.d.ts @@ -137,7 +137,7 @@ declare namespace formHost { function enableFormsUpdate(formIds: Array): Promise; /** - * Notifys the form framework to make the specified forms non updatable. + * Notify the form framework to make the specified forms non updatable. * *

          You can use this method to set form refresh state to false, the form do not receive * new update from service.

          @@ -197,7 +197,7 @@ declare namespace formHost { * @syscap SystemCapability.Ability.Form * @param formIds Indicates the specify form id. * @return Returns the number of invalid forms deleted by the Form Manager Service - * @permission ohos.permission.REQUIRE_FORM. + * @permission ohos.permission.REQUIRE_FORM */ function deleteInvalidForms(formIds: Array, callback: AsyncCallback): void; function deleteInvalidForms(formIds: Array): Promise; @@ -211,7 +211,7 @@ declare namespace formHost { * @syscap SystemCapability.Ability.Form * @param want Indicates want of the form. * @return Returns form state {@link FormStateInfo} - * @permission ohos.permission.REQUIRE_FORM and ohos.permission.GET_BUNDLE_INFO_PRIVILEGED. + * @permission ohos.permission.REQUIRE_FORM and ohos.permission.GET_BUNDLE_INFO_PRIVILEGED */ function acquireFormState(want: Want, callback: AsyncCallback): void; function acquireFormState(want: Want): Promise; @@ -241,7 +241,7 @@ declare namespace formHost { function off(type: "formUninstall", callback?: Callback): void; /** - * notify form is Visible + * Notify form is Visible * *

          You can use this method to notify form visible state.

          * @@ -250,13 +250,13 @@ declare namespace formHost { * @param formIds Indicates the specify form id. * @param isVisible Indicates whether visible. * @return - - * @permission ohos.permission.REQUIRE_FORM. + * @permission ohos.permission.REQUIRE_FORM */ function notifyFormsVisible(formIds: Array, isVisible: boolean, callback: AsyncCallback): void; function notifyFormsVisible(formIds: Array, isVisible: boolean): Promise; /** - * notify form enable update state. + * Notify form enable update state. * *

          You can use this method to notify form enable update state.

          * @@ -265,7 +265,7 @@ declare namespace formHost { * @param formIds Indicates the specify form id. * @param isEnableUpdate Indicates whether enable update. * @return - - * @permission ohos.permission.REQUIRE_FORM. + * @permission ohos.permission.REQUIRE_FORM */ function notifyFormsEnableUpdate(formIds: Array, isEnableUpdate: boolean, callback: AsyncCallback): void; function notifyFormsEnableUpdate(formIds: Array, isEnableUpdate: boolean): Promise; @@ -285,7 +285,7 @@ declare namespace formHost { function shareForm(formId: string, deviceId: string): Promise; /** - * notify form that privacy wether need to be protected. + * Notify form that privacy wether need to be protected. * * @since 9 * @syscap SystemCapability.Ability.Form @@ -293,7 +293,7 @@ declare namespace formHost { * @param isProtected Indicates whether enable update. * @systemapi hide for inner use. * @return - - * @permission ohos.permission.REQUIRE_FORM. + * @permission ohos.permission.REQUIRE_FORM */ function notifyFormsPrivacyProtected(formIds: Array, isProtected: boolean, callback: AsyncCallback): void; function notifyFormsPrivacyProtected(formIds: Array, isProtected: boolean): Promise; diff --git a/api/@ohos.application.missionManager.d.ts b/api/@ohos.application.missionManager.d.ts index 46062f5f42..2ecb582a8e 100644 --- a/api/@ohos.application.missionManager.d.ts +++ b/api/@ohos.application.missionManager.d.ts @@ -42,7 +42,7 @@ declare namespace missionManager { function registerMissionListener(listener: MissionListener): number; /** - * Unrgister the missionListener to ams. + * Unregister the missionListener to ams. * * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Mission diff --git a/api/@ohos.continuation.continuationManager.d.ts b/api/@ohos.continuation.continuationManager.d.ts index 292945f77c..12e1016b29 100644 --- a/api/@ohos.continuation.continuationManager.d.ts +++ b/api/@ohos.continuation.continuationManager.d.ts @@ -19,7 +19,7 @@ import { ContinuationExtraParams } from './continuation/continuationExtraParams' /** * Provides methods for interacting with the continuation manager service, including methods for registering and - * unregistering the ability to hop, updating the device connection state, and showing the list of devices + * Unregister the ability to hop, updating the device connection state, and showing the list of devices * that can be selected for hopping. * @namespace continuationManager * @syscap SystemCapability.Ability.DistributedAbilityManager diff --git a/api/@ohos.wantAgent.d.ts b/api/@ohos.wantAgent.d.ts index 9863e89de4..e0d02af075 100644 --- a/api/@ohos.wantAgent.d.ts +++ b/api/@ohos.wantAgent.d.ts @@ -68,7 +68,7 @@ declare namespace wantAgent { function getWant(agent: WantAgent): Promise; /** - * Cancels a WantAgent. Only the application that creates the WantAgent can cancel it. + * Cancel a WantAgent. Only the application that creates the WantAgent can cancel it. * * @param WantAgent to cancel. */ diff --git a/api/app/context.d.ts b/api/app/context.d.ts index e24a3dd24b..caa859e1d8 100644 --- a/api/app/context.d.ts +++ b/api/app/context.d.ts @@ -260,7 +260,7 @@ export interface Context extends BaseContext { isUpdatingConfigurations(): Promise; /** - * Informs the system of the time required for drawing this Page ability. + * Inform the system of the time required for drawing this Page ability. * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.Core * @FAModelOnly diff --git a/api/application/AbilityContext.d.ts b/api/application/AbilityContext.d.ts index 64c9ea8ba9..40b12e59f4 100755 --- a/api/application/AbilityContext.d.ts +++ b/api/application/AbilityContext.d.ts @@ -259,7 +259,7 @@ export default class AbilityContext extends Context { /** * Starts a new service extension ability with account. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the want info to start. * @param { number } accountId - Indicates the account to start. * @param { AsyncCallback } callback - The callback of startServiceExtensionAbilityWithAccount. @@ -273,7 +273,7 @@ export default class AbilityContext extends Context { /** * Starts a new service extension ability with account. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the want info to start. * @param { number } accountId - Indicates the account to start. * @returns { Promise } The promise returned by the function. @@ -311,7 +311,7 @@ export default class AbilityContext extends Context { /** * Stops a service within the same application with account. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the want info to start. * @param { number } accountId - Indicates the accountId to start. * @param { AsyncCallback } callback - The callback of stopServiceExtensionAbilityWithAccount. @@ -325,7 +325,7 @@ export default class AbilityContext extends Context { /** * Stops a service within the same application with account. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the want info to start. * @param { number } accountId - Indicates the accountId to start. * @returns { Promise } The promise returned by the function. diff --git a/api/application/ServiceExtensionContext.d.ts b/api/application/ServiceExtensionContext.d.ts index acc02d4176..37a5930250 100644 --- a/api/application/ServiceExtensionContext.d.ts +++ b/api/application/ServiceExtensionContext.d.ts @@ -134,7 +134,7 @@ export default class ServiceExtensionContext extends ExtensionContext { /** * Starts a new service extension ability with account. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the want info to start. * @param { number } accountId - Indicates the account to start. * @param { AsyncCallback } callback - The callback of startServiceExtensionAbilityWithAccount. @@ -148,7 +148,7 @@ export default class ServiceExtensionContext extends ExtensionContext { /** * Starts a new service extension ability with account. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the want info to start. * @param { number } accountId - Indicates the account to start. * @returns { Promise } The promise returned by the function. @@ -186,7 +186,7 @@ export default class ServiceExtensionContext extends ExtensionContext { /** * Stops a service within the same application with account. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the want info to start. * @param { number } accountId - Indicates the accountId to start. * @param { AsyncCallback } callback - The callback of stopServiceExtensionAbilityWithAccount. @@ -200,7 +200,7 @@ export default class ServiceExtensionContext extends ExtensionContext { /** * Stops a service within the same application with account. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the want info to start. * @param { number } accountId - Indicates the accountId to start. * @returns { Promise } The promise returned by the function. diff --git a/api/application/UIAbilityContext.d.ts b/api/application/UIAbilityContext.d.ts index 0c5e2e0f64..850a74cb0d 100755 --- a/api/application/UIAbilityContext.d.ts +++ b/api/application/UIAbilityContext.d.ts @@ -259,7 +259,7 @@ export default class UIAbilityContext extends Context { /** * Starts a new service extension ability with account. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the want info to start. * @param { number } accountId - Indicates the account to start. * @param { AsyncCallback } callback - The callback of startServiceExtensionAbilityWithAccount. @@ -273,7 +273,7 @@ export default class UIAbilityContext extends Context { /** * Starts a new service extension ability with account. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the want info to start. * @param { number } accountId - Indicates the account to start. * @returns { Promise } The promise returned by the function. @@ -311,7 +311,7 @@ export default class UIAbilityContext extends Context { /** * Stops a service within the same application with account. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the want info to start. * @param { number } accountId - Indicates the accountId to start. * @param { AsyncCallback } callback - The callback of stopServiceExtensionAbilityWithAccount. @@ -325,7 +325,7 @@ export default class UIAbilityContext extends Context { /** * Stops a service within the same application with account. - * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param { Want } want - Indicates the want info to start. * @param { number } accountId - Indicates the accountId to start. * @returns { Promise } The promise returned by the function. -- Gitee From ef3c99542ae2fe12b6524f65f488a3301527f2ed Mon Sep 17 00:00:00 2001 From: youliang_1314 Date: Fri, 28 Oct 2022 16:36:38 +0800 Subject: [PATCH 329/438] update userAuth error code Signed-off-by: youliang_1314 Change-Id: Ibf964f3ef8a12fed27f15f734400aff3477ed200 --- api/@ohos.userIAM.faceAuth.d.ts | 18 +++----------- api/@ohos.userIAM.userAuth.d.ts | 43 ++++++++++++++++----------------- 2 files changed, 24 insertions(+), 37 deletions(-) diff --git a/api/@ohos.userIAM.faceAuth.d.ts b/api/@ohos.userIAM.faceAuth.d.ts index 391b4b41b6..e1ac81440a 100644 --- a/api/@ohos.userIAM.faceAuth.d.ts +++ b/api/@ohos.userIAM.faceAuth.d.ts @@ -43,24 +43,12 @@ declare namespace faceAuth { * @param surfaceId Indicates surface id for face enroll preview. * @permission ohos.permission.MANAGE_USER_IDM * @systemapi Hide this for inner system use. + * @throws { BusinessError } 201 - Permission verification failed. + * @throws { BusinessError } 202 - The caller is not a system application. + * @throws { BusinessError } 12700001 - The operation is failed. */ setSurfaceId(surfaceId: string): void; } - - /** - * Indicates the enumeration of operation result code. - * - * @name ResultCode - * @since 9 - * @syscap SystemCapability.UserIAM.UserAuth.FaceAuth - * @systemapi Hide this for inner system use. - */ - enum ResultCode { - /** - * Indicates that operation is fail. - */ - FAIL = 12700001, - } } export default faceAuth; \ No newline at end of file diff --git a/api/@ohos.userIAM.userAuth.d.ts b/api/@ohos.userIAM.userAuth.d.ts index c72b7b01c3..27623d6e45 100644 --- a/api/@ohos.userIAM.userAuth.d.ts +++ b/api/@ohos.userIAM.userAuth.d.ts @@ -171,7 +171,7 @@ declare namespace userAuth { * @param challenge pass in challenge value. * @param authType type of authentication. * @param authTrustLevel Trust level of authentication result. - * @param callback Return result and acquireinfo through callback. + * @param callback Return result and acquireInfo through callback. * @return Returns ContextId for cancel. * @deprecated since 9 * @useinstead ohos.userIAM.userAuth.AuthInstance.start @@ -179,7 +179,7 @@ declare namespace userAuth { auth(challenge: Uint8Array, authType: UserAuthType, authTrustLevel: AuthTrustLevel, callback: IUserAuthCallback): Uint8Array; /** - * Cancels authentication with ContextID. + * Cancel authentication with ContextID. * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core * @permission ohos.permission.ACCESS_BIOMETRIC @@ -198,9 +198,9 @@ declare namespace userAuth { * @syscap SystemCapability.UserIAM.UserAuth.Core * @param result authentication result code. * @param extraInfo pass the specific information for different situation. - * If the authentication is passed, the authentication token is returned in extrainfo, - * If the authentication fails, the remaining authentication times are returned in extrainfo, - * If the authentication executor is locked, the freezing time is returned in extrainfo. + * If the authentication is passed, the authentication token is returned in extraInfo, + * If the authentication fails, the remaining authentication times are returned in extraInfo, + * If the authentication executor is locked, the freezing time is returned in extraInfo. * @deprecated since 9 * @useinstead ohos.userIAM.userAuth.AuthEvent.callback */ @@ -225,7 +225,7 @@ declare namespace userAuth { * @syscap SystemCapability.UserIAM.UserAuth.Core * @param token pass the authentication result if the authentication is passed. * @param remainTimes return the remaining authentication times if the authentication fails. - * @param freezingTime return the freezing time if the authectication executor is locked. + * @param freezingTime return the freezing time if the authentication executor is locked. * @deprecated since 9 * @useinstead ohos.userIAM.userAuth.AuthResultInfo */ @@ -540,7 +540,7 @@ declare namespace userAuth { * @param result Authentication result. * @param token Pass the authentication token if the authentication is passed. * @param remainAttempts Return the remaining authentication attempts if the authentication fails. - * @param lockoutDuration Return the lockout duration if the authectication executor is locked. + * @param lockoutDuration Return the lockout duration if the authentication executor is locked. */ interface AuthResultInfo { result : number; @@ -573,8 +573,8 @@ declare namespace userAuth { * @syscap SystemCapability.UserIAM.UserAuth.Core * @param name Event name. * @param callback Event information return. + * @throws { BusinessError } 401 - Incorrect parameters. * @throws { BusinessError } 12500002 - General operation error. - * @throws { BusinessError } 12500008 - Incorrect parameters. */ on: (name: AuthEventKey, callback: AuthEvent) => void; @@ -583,8 +583,8 @@ declare namespace userAuth { * @since since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core * @param name Event name. + * @throws { BusinessError } 401 - Incorrect parameters. * @throws { BusinessError } 12500002 - General operation error. - * @throws { BusinessError } 12500008 - Incorrect parameters. */ off: (name: AuthEventKey) => void; @@ -593,9 +593,12 @@ declare namespace userAuth { * @since since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core * @permission ohos.permission.ACCESS_BIOMETRIC - * @throws { BusinessError } 12500001 - Execution failed. + * @throws { BusinessError } 201 - Permission verification failed. + * @throws { BusinessError } 401 - Incorrect parameters. * @throws { BusinessError } 12500002 - General operation error. - * @throws { BusinessError } 12500008 - Incorrect parameters. + * @throws { BusinessError } 12500005 - The authentication type is not supported. + * @throws { BusinessError } 12500006 - The authentication trust level is not supported. + * @throws { BusinessError } 12500010 - The type of credential has not been enrolled. */ start: () => void; @@ -604,7 +607,8 @@ declare namespace userAuth { * @since since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core * @permission ohos.permission.ACCESS_BIOMETRIC - * @throws { BusinessError } 12500001 - Execution failed. + * @throws { BusinessError } 201 - Permission verification failed. + * @throws { BusinessError } 401 - Incorrect parameters. * @throws { BusinessError } 12500002 - General operation error. */ cancel: () => void; @@ -616,6 +620,7 @@ declare namespace userAuth { * @syscap SystemCapability.UserIAM.UserAuth.Core * @permission ohos.permission.ACCESS_BIOMETRIC * @return Returns version information. + * @throws { BusinessError } 201 - Permission verification failed. * @throws { BusinessError } 12500002 - General operation error. */ function getVersion(): number; @@ -627,11 +632,12 @@ declare namespace userAuth { * @permission ohos.permission.ACCESS_BIOMETRIC * @param authType Credential type for authentication. * @param authTrustLevel Trust level of authentication result. - * @throws { BusinessError } 12500001 - Execution failed. + * @throws { BusinessError } 201 - Permission verification failed. + * @throws { BusinessError } 401 - Incorrect parameters. * @throws { BusinessError } 12500002 - General operation error. * @throws { BusinessError } 12500005 - The authentication type is not supported. * @throws { BusinessError } 12500006 - The authentication trust level is not supported. - * @throws { BusinessError } 12500008 - Incorrect parameters. + * @throws { BusinessError } 12500010 - The type of credential has not been enrolled. */ function getAvailableStatus(authType : UserAuthType, authTrustLevel : AuthTrustLevel): void; @@ -640,10 +646,10 @@ declare namespace userAuth { * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core * @return Returns an authentication instance. + * @throws { BusinessError } 401 - Incorrect parameters. * @throws { BusinessError } 12500002 - General operation error. * @throws { BusinessError } 12500005 - The authentication type is not supported. * @throws { BusinessError } 12500006 - The authentication trust level is not supported. - * @throws { BusinessError } 12500008 - Incorrect parameters. */ function getAuthInstance(challenge : Uint8Array, authType : UserAuthType, authTrustLevel : AuthTrustLevel): AuthInstance; @@ -709,13 +715,6 @@ declare namespace userAuth { */ BUSY = 12500007, - /** - * Indicates incorrect parameters. - * @since 9 - * @syscap SystemCapability.UserIAM.UserAuth.Core - */ - INVALID_PARAMETERS = 12500008, - /** * Indicates that the authenticator is locked. * @since 9 -- Gitee From c54b4c7f0830984334e275b5d991f2153962cce5 Mon Sep 17 00:00:00 2001 From: huangjie Date: Wed, 16 Nov 2022 18:10:56 +0800 Subject: [PATCH 330/438] =?UTF-8?q?doc=E8=A7=84=E8=8C=83=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huangjie --- api/@ohos.resourceManager.d.ts | 74 +++++++++++++++++----------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/api/@ohos.resourceManager.d.ts b/api/@ohos.resourceManager.d.ts index 6b43f6b7df..d8fc0a9bb8 100644 --- a/api/@ohos.resourceManager.d.ts +++ b/api/@ohos.resourceManager.d.ts @@ -216,7 +216,7 @@ export function getResourceManager(bundleName: string, callback: AsyncCallback; * Obtains the ResourceManager object of the specified application. * * @param bundleName Indicates the bundle name of the specified application. - * @return Returns that the ResourceManager object is returned in Promise mode. + * @returns Returns that the ResourceManager object is returned in Promise mode. * @since 6 * @FAModelOnly */ @@ -253,7 +253,7 @@ export interface ResourceManager { * Obtains string resources associated with a specified resource ID in Promise mode. * * @param resId Indicates the resource ID. - * @return Returns the character string corresponding to the resource ID. + * @returns Returns the character string corresponding to the resource ID. * @since 6 * @deprecated since 9 * @useinstead ohos.resourceManager.getStringValue @@ -277,7 +277,7 @@ export interface ResourceManager { * Obtains string resources associated with a specified resource object in Promise mode. * * @param resource Indicates the resource object. - * @return Returns the character string corresponding to the resource object. + * @returns Returns the character string corresponding to the resource object. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the module resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by module resId. @@ -301,7 +301,7 @@ export interface ResourceManager { * Obtains the array of character strings corresponding to a specified resource ID in Promise mode. * * @param resId Indicates the resource ID. - * @return Returns the array of character strings corresponding to the specified resource ID. + * @returns Returns the array of character strings corresponding to the specified resource ID. * @since 6 * @deprecated since 9 * @useinstead ohos.resourceManager.getStringArrayValue @@ -325,7 +325,7 @@ export interface ResourceManager { * Obtains the array of character strings corresponding to a specified resource object in Promise mode. * * @param resource Indicates the resource object. - * @return Returns the array of character strings corresponding to the specified resource object. + * @returns Returns the array of character strings corresponding to the specified resource object. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the module resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by module resId. @@ -349,7 +349,7 @@ export interface ResourceManager { * Obtains the content of the media file corresponding to a specified resource ID in Promise mode. * * @param resId Indicates the resource ID. - * @return Returns the content of the media file corresponding to the specified resource ID. + * @returns Returns the content of the media file corresponding to the specified resource ID. * @since 6 * @deprecated since 9 * @useinstead ohos.resourceManager.getMediaContent @@ -372,7 +372,7 @@ export interface ResourceManager { * Obtains the content of the media file corresponding to a specified resource object in Promise mode. * * @param resource Indicates the resource object. - * @return Returns the content of the media file corresponding to the specified resource object. + * @returns Returns the content of the media file corresponding to the specified resource object. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the module resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by module resId. @@ -396,7 +396,7 @@ export interface ResourceManager { * Obtains the Base64 code of the image resource corresponding to the specified resource ID in Promise mode. * * @param resId Indicates the resource ID. - * @return Returns the Base64 code of the image resource corresponding to the specified resource ID. + * @returns Returns the Base64 code of the image resource corresponding to the specified resource ID. * @since 6 * @deprecated since 9 * @useinstead ohos.resourceManager.getMediaContentBase64 @@ -420,7 +420,7 @@ export interface ResourceManager { * Obtains the Base64 code of the image resource corresponding to the specified resource object in Promise mode. * * @param resource Indicates the resource object. - * @return Returns the Base64 code of the image resource corresponding to the specified resource object. + * @returns Returns the Base64 code of the image resource corresponding to the specified resource object. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the module resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by module resId. @@ -439,7 +439,7 @@ export interface ResourceManager { /** * Obtains the device capability in Promise mode. * - * @return Returns the device capability. + * @returns Returns the device capability. * @since 6 */ getDeviceCapability(): Promise; @@ -481,7 +481,7 @@ export interface ResourceManager { * * @param resId Indicates the resource ID. * @param num Indicates the number. - * @return Returns the singular-plural character string represented by the ID string + * @returns Returns the singular-plural character string represented by the ID string * corresponding to the specified number. * @since 6 * @deprecated since 9 @@ -511,7 +511,7 @@ export interface ResourceManager { * * @param resource Indicates the resource object. * @param num Indicates the number. - * @return Returns the singular-plural character string represented by the resource object string + * @returns Returns the singular-plural character string represented by the resource object string * corresponding to the specified number. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the resId invalid. @@ -536,7 +536,7 @@ export interface ResourceManager { * Obtains the raw file resource corresponding to the specified resource path in Promise mode. * * @param path Indicates the resource relative path. - * @return Returns the raw file resource corresponding to the specified resource path. + * @returns Returns the raw file resource corresponding to the specified resource path. * @since 8 * @deprecated since 9 * @useinstead ohos.resourceManager.getRawFileContent @@ -558,7 +558,7 @@ export interface ResourceManager { * Obtains the raw file resource descriptor corresponding to the specified resource path in Promise mode. * * @param path Indicates the resource relative path. - * @return Returns the raw file resource descriptor corresponding to the specified resource path. + * @returns Returns the raw file resource descriptor corresponding to the specified resource path. * @since 8 * @deprecated since 9 * @useinstead ohos.resourceManager.getRawFd @@ -580,7 +580,7 @@ export interface ResourceManager { * Obtains close raw file resource descriptor corresponding to the specified resource path in Promise mode. * * @param path Indicates the resource relative path. - * @return Returns result close raw file resource descriptor corresponding to the specified resource path. + * @returns Returns result close raw file resource descriptor corresponding to the specified resource path. * @since 8 * @deprecated since 9 * @useinstead ohos.resourceManager.closeRawFd @@ -604,7 +604,7 @@ export interface ResourceManager { * Obtains string resources associated with a specified resource name in Promise mode. * * @param resName Indicates the resource name. - * @return Returns the character string corresponding to the resource name. + * @returns Returns the character string corresponding to the resource name. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001003 - If the resName invalid. * @throws { BusinessError } 9001004 - If the resource not found by resName. @@ -630,7 +630,7 @@ export interface ResourceManager { * Obtains the array of character strings corresponding to a specified resource name in Promise mode. * * @param resName Indicates the resource name. - * @return Returns the array of character strings corresponding to the specified resource name. + * @returns Returns the array of character strings corresponding to the specified resource name. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001003 - If the resName invalid. * @throws { BusinessError } 9001004 - If the resource not found by resName. @@ -655,7 +655,7 @@ export interface ResourceManager { * Obtains the content of the media file corresponding to a specified resource name in Promise mode. * * @param resName Indicates the resource name. - * @return Returns the content of the media file corresponding to the specified resource name. + * @returns Returns the content of the media file corresponding to the specified resource name. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001003 - If the resName invalid. * @throws { BusinessError } 9001004 - If the resource not found by resName. @@ -680,7 +680,7 @@ export interface ResourceManager { * Obtains the Base64 code of the image resource corresponding to the specified resource name in Promise mode. * * @param resName Indicates the resource name. - * @return Returns the Base64 code of the image resource corresponding to the specified resource name. + * @returns Returns the Base64 code of the image resource corresponding to the specified resource name. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001003 - If the resName invalid. * @throws { BusinessError } 9001004 - If the resource not found by resName. @@ -710,7 +710,7 @@ export interface ResourceManager { * * @param resName Indicates the resource name. * @param num Indicates the number. - * @return Returns the singular-plural character string represented by the name string + * @returns Returns the singular-plural character string represented by the name string * corresponding to the specified number. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001003 - If the resName invalid. @@ -724,7 +724,7 @@ export interface ResourceManager { * Obtains string resources associated with a specified resource ID. * * @param resId Indicates the resource ID. - * @return Returns the character string corresponding to the resource ID. + * @returns Returns the character string corresponding to the resource ID. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by resId. @@ -737,7 +737,7 @@ export interface ResourceManager { * Obtains string resources associated with a specified resource object. * * @param resource Indicates the resource object. - * @return Returns the character string corresponding to the resource object. + * @returns Returns the character string corresponding to the resource object. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the module resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by module resId. @@ -750,7 +750,7 @@ export interface ResourceManager { * Obtains string resources associated with a specified resource name. * * @param resName Indicates the resource name. - * @return Returns the character string corresponding to the resource name. + * @returns Returns the character string corresponding to the resource name. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001003 - If the resName invalid. * @throws { BusinessError } 9001004 - If the resource not found by resName. @@ -763,7 +763,7 @@ export interface ResourceManager { * Obtains the boolean result with a specified resource ID. * * @param resId Indicates the resource ID. - * @return Returns the boolean resource corresponding to the resource ID. + * @returns Returns the boolean resource corresponding to the resource ID. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by resId. @@ -776,7 +776,7 @@ export interface ResourceManager { * Obtains the boolean result with a specified resource object. * * @param resource Indicates the resource object. - * @return Returns the boolean resource corresponding to the resource object. + * @returns Returns the boolean resource corresponding to the resource object. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the module resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by module resId. @@ -789,7 +789,7 @@ export interface ResourceManager { * Obtains the boolean result with a specified resource name. * * @param resName Indicates the resource name. - * @return Returns the boolean resource corresponding to the resource name. + * @returns Returns the boolean resource corresponding to the resource name. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001003 - If the resName invalid. * @throws { BusinessError } 9001004 - If the resource not found by resName. @@ -802,7 +802,7 @@ export interface ResourceManager { * Obtains the number result with a specified resource ID. * * @param resId Indicates the resource ID. - * @return Returns the number resource corresponding to the resource ID. + * @returns Returns the number resource corresponding to the resource ID. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by resId. @@ -815,7 +815,7 @@ export interface ResourceManager { * Obtains the number result with a specified resource object. * * @param resource Indicates the resource object. - * @return Returns the number resource corresponding to the resource object. + * @returns Returns the number resource corresponding to the resource object. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the module resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by module resId. @@ -828,7 +828,7 @@ export interface ResourceManager { * Obtains the number result with a specified resource name. * * @param resName Indicates the resource name. - * @return Returns the number resource corresponding to the resource name. + * @returns Returns the number resource corresponding to the resource name. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001003 - If the resName invalid. * @throws { BusinessError } 9001004 - If the resource not found by resName. @@ -861,7 +861,7 @@ export interface ResourceManager { * Obtains string resources associated with a specified resource ID in Promise mode. * * @param resId Indicates the resource ID. - * @return Returns the character string corresponding to the resource ID. + * @returns Returns the character string corresponding to the resource ID. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by resId. @@ -887,7 +887,7 @@ export interface ResourceManager { * Obtains the array of character strings corresponding to a specified resource ID in Promise mode. * * @param resId Indicates the resource ID. - * @return Returns the array of character strings corresponding to the specified resource ID. + * @returns Returns the array of character strings corresponding to the specified resource ID. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by resId. @@ -918,7 +918,7 @@ export interface ResourceManager { * * @param resId Indicates the resource ID. * @param num Indicates the number. - * @return Returns the singular-plural character string represented by the ID string + * @returns Returns the singular-plural character string represented by the ID string * corresponding to the specified number. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the resId invalid. @@ -944,7 +944,7 @@ export interface ResourceManager { * Obtains the content of the media file corresponding to a specified resource ID in Promise mode. * * @param resId Indicates the resource ID. - * @return Returns the content of the media file corresponding to the specified resource ID. + * @returns Returns the content of the media file corresponding to the specified resource ID. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by resId. @@ -969,7 +969,7 @@ export interface ResourceManager { * Obtains the Base64 code of the image resource corresponding to the specified resource ID in Promise mode. * * @param resId Indicates the resource ID. - * @return Returns the Base64 code of the image resource corresponding to the specified resource ID. + * @returns Returns the Base64 code of the image resource corresponding to the specified resource ID. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001001 - If the resId invalid. * @throws { BusinessError } 9001002 - If the resource not found by resId. @@ -992,7 +992,7 @@ export interface ResourceManager { * Obtains the raw file resource corresponding to the specified resource path in Promise mode. * * @param path Indicates the resource relative path. - * @return Returns the raw file resource corresponding to the specified resource path. + * @returns Returns the raw file resource corresponding to the specified resource path. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001005 - If the resource not found by path. * @since 9 @@ -1014,7 +1014,7 @@ export interface ResourceManager { * Obtains the raw file resource descriptor corresponding to the specified resource path in Promise mode. * * @param path Indicates the resource relative path. - * @return Returns the raw file resource descriptor corresponding to the specified resource path. + * @returns Returns the raw file resource descriptor corresponding to the specified resource path. * @throws { BusinessError } 401 - If the input parameter invalid. * @throws { BusinessError } 9001005 - If the resource not found by path. * @since 9 -- Gitee From 915ef2b5f787701a221a8ddc18bcfb8cd1b6018f Mon Sep 17 00:00:00 2001 From: xuzhihao Date: Wed, 16 Nov 2022 11:21:04 +0800 Subject: [PATCH 331/438] Feature: Fix spell error of Ability & Notification dts Signed-off-by: xuzhihao --- api/@ohos.commonEvent.d.ts | 108 ++--- api/@ohos.commonEventManager.d.ts | 6 +- api/@ohos.events.emitter.d.ts | 6 +- api/@ohos.notification.d.ts | 10 +- api/@ohos.notificationManager.d.ts | 18 +- api/@ohos.reminderAgentManager.d.ts | 12 +- api/application/MissionInfo.d.ts | 177 ++++--- api/application/MissionListener.d.ts | 4 +- api/application/MissionParameter.d.ts | 2 +- api/application/ServiceExtensionContext.d.ts | 6 +- api/common/full/featureability.d.ts | 16 +- api/common/lite/featureability.d.ts | 6 +- api/commonEvent/commonEventSubscriber.d.ts | 476 +++++++++---------- api/notification/notificationSubscriber.d.ts | 166 +++---- 14 files changed, 506 insertions(+), 507 deletions(-) diff --git a/api/@ohos.commonEvent.d.ts b/api/@ohos.commonEvent.d.ts index 9920b8afb0..93653e2553 100644 --- a/api/@ohos.commonEvent.d.ts +++ b/api/@ohos.commonEvent.d.ts @@ -20,7 +20,7 @@ import { CommonEventSubscribeInfo } from './commonEvent/commonEventSubscribeInfo import { CommonEventPublishData } from './commonEvent/commonEventPublishData'; /** - * Common event defination + * Common event definition * @name commonEvent * @since 7 * @syscap SystemCapability.Notification.CommonEvent @@ -142,156 +142,156 @@ declare namespace commonEvent { */ export enum Support { /** - * this commonEvent means when the device is booted or system upgrade completed, and only be sent by system. + * This commonEvent means when the device is booted or system upgrade completed, and only be sent by system. */ COMMON_EVENT_BOOT_COMPLETED = "usual.event.BOOT_COMPLETED", /** - * this commonEvent means when the device finnish booting, but still in the locked state. + * This commonEvent means when the device finnish booting, but still in the locked state. */ COMMON_EVENT_LOCKED_BOOT_COMPLETED = "usual.event.LOCKED_BOOT_COMPLETED", /** - * this commonEvent means when the device is shutting down, note: turn off, not sleeping. + * This commonEvent means when the device is shutting down, note: turn off, not sleeping. */ COMMON_EVENT_SHUTDOWN = "usual.event.SHUTDOWN", /** - * this commonEvent means when the charging state, level and so on about the battery. + * This commonEvent means when the charging state, level and so on about the battery. */ COMMON_EVENT_BATTERY_CHANGED = "usual.event.BATTERY_CHANGED", /** - * this commonEvent means when the device in low battery state.. + * This commonEvent means when the device in low battery state.. */ COMMON_EVENT_BATTERY_LOW = "usual.event.BATTERY_LOW", /** - * this commonEvent means when the battery level is an ok state. + * This commonEvent means when the battery level is an ok state. */ COMMON_EVENT_BATTERY_OKAY = "usual.event.BATTERY_OKAY", /** - * this commonEvent means when the other power is connected to the device. + * This commonEvent means when the other power is connected to the device. */ COMMON_EVENT_POWER_CONNECTED = "usual.event.POWER_CONNECTED", /** - * this commonEvent means when the other power is removed from the device. + * This commonEvent means when the other power is removed from the device. */ COMMON_EVENT_POWER_DISCONNECTED = "usual.event.POWER_DISCONNECTED", /** - * this commonEvent means when the screen is turned off. + * This commonEvent means when the screen is turned off. */ COMMON_EVENT_SCREEN_OFF = "usual.event.SCREEN_OFF", /** - * this commonEvent means when the device is waked up and interactive. + * This commonEvent means when the device is woken up and interactive. */ COMMON_EVENT_SCREEN_ON = "usual.event.SCREEN_ON", /** - * this commonEvent means when the thermal state level change + * This commonEvent means when the thermal state level change * @since 8 */ COMMON_EVENT_THERMAL_LEVEL_CHANGED = "usual.event.THERMAL_LEVEL_CHANGED", /** - * this commonEvent means when the user is present after the device waked up. + * This commonEvent means when the user is present after the device woken up. */ COMMON_EVENT_USER_PRESENT = "usual.event.USER_PRESENT", /** - * this commonEvent means when the current time is changed. + * This commonEvent means when the current time is changed. */ COMMON_EVENT_TIME_TICK = "usual.event.TIME_TICK", /** - * this commonEvent means when the time is set. + * This commonEvent means when the time is set. */ COMMON_EVENT_TIME_CHANGED = "usual.event.TIME_CHANGED", /** - * this commonEvent means when the current date is changed. + * This commonEvent means when the current date is changed. */ COMMON_EVENT_DATE_CHANGED = "usual.event.DATE_CHANGED", /** - * this commonEvent means when the time zone is changed. + * This commonEvent means when the time zone is changed. */ COMMON_EVENT_TIMEZONE_CHANGED = "usual.event.TIMEZONE_CHANGED", /** - * this commonEvent means when the dialog to dismiss. + * This commonEvent means when the dialog to dismiss. */ COMMON_EVENT_CLOSE_SYSTEM_DIALOGS = "usual.event.CLOSE_SYSTEM_DIALOGS", /** - * this commonEvent means when a new application package is installed on the device. + * This commonEvent means when a new application package is installed on the device. */ COMMON_EVENT_PACKAGE_ADDED = "usual.event.PACKAGE_ADDED", /** - * this commonEvent means when a new version application package is installed on the device and + * This commonEvent means when a new version application package is installed on the device and * replace the old version.the data contains the name of the package. */ COMMON_EVENT_PACKAGE_REPLACED = "usual.event.PACKAGE_REPLACED", /** - * this commonEvent means when a new version application package is installed on the device and + * This commonEvent means when a new version application package is installed on the device and * replace the old version, it does not contain additional data and only be sent to the replaced application. */ COMMON_EVENT_MY_PACKAGE_REPLACED = "usual.event.MY_PACKAGE_REPLACED", /** - * this commonEvent means when an existing application package is removed from the device. + * This commonEvent means when an existing application package is removed from the device. */ COMMON_EVENT_PACKAGE_REMOVED = "usual.event.PACKAGE_REMOVED", /** - * this commonEvent means when an existing application package is removed from the device. + * This commonEvent means when an existing application package is removed from the device. */ COMMON_EVENT_BUNDLE_REMOVED = "usual.event.BUNDLE_REMOVED", /** - * this commonEvent means when an existing application package is completely removed from the device. + * This commonEvent means when an existing application package is completely removed from the device. */ COMMON_EVENT_PACKAGE_FULLY_REMOVED = "usual.event.PACKAGE_FULLY_REMOVED", /** - * this commonEvent means when an existing application package has been changed. + * This commonEvent means when an existing application package has been changed. */ COMMON_EVENT_PACKAGE_CHANGED = "usual.event.PACKAGE_CHANGED", /** - * this commonEvent means the user has restarted a package, and all of its processes have been killed. + * This commonEvent means the user has restarted a package, and all of its processes have been killed. */ COMMON_EVENT_PACKAGE_RESTARTED = "usual.event.PACKAGE_RESTARTED", /** - * this commonEvent means the user has cleared the package data. + * This commonEvent means the user has cleared the package data. */ COMMON_EVENT_PACKAGE_DATA_CLEARED = "usual.event.PACKAGE_DATA_CLEARED", /** - * this commonEvent means the user has cleared the package cache. + * 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. + * This commonEvent means the packages have been suspended. */ COMMON_EVENT_PACKAGES_SUSPENDED = "usual.event.PACKAGES_SUSPENDED", /** - * this commonEvent means the packages have been un-suspended. + * This commonEvent means the packages have been un-suspended. */ COMMON_EVENT_PACKAGES_UNSUSPENDED = "usual.event.PACKAGES_UNSUSPENDED", /** - * this commonEvent Sent to a package that has been suspended by the system. + * This commonEvent Sent to a package that has been suspended by the system. */ COMMON_EVENT_MY_PACKAGE_SUSPENDED = "usual.event.MY_PACKAGE_SUSPENDED", @@ -301,23 +301,23 @@ declare namespace commonEvent { COMMON_EVENT_MY_PACKAGE_UNSUSPENDED = "usual.event.MY_PACKAGE_UNSUSPENDED", /** - * a user id has been removed from the system. + * A user id has been removed from the system. */ COMMON_EVENT_UID_REMOVED = "usual.event.UID_REMOVED", /** - * the application is first launched after installed. + * The application is first launched after installed. */ COMMON_EVENT_PACKAGE_FIRST_LAUNCH = "usual.event.PACKAGE_FIRST_LAUNCH", /** - * sent by system package verifier when a package need to be verified. + * Sent by system package verifier when a package need to be verified. */ COMMON_EVENT_PACKAGE_NEEDS_VERIFICATION = "usual.event.PACKAGE_NEEDS_VERIFICATION", /** - * sent by system package verifier when a package is verified. + * Sent by system package verifier when a package is verified. */ COMMON_EVENT_PACKAGE_VERIFIED = "usual.event.PACKAGE_VERIFIED", @@ -335,7 +335,7 @@ declare namespace commonEvent { "usual.event.EXTERNAL_APPLICATIONS_UNAVAILABLE", /** - * the device configuration such as orientation,locale have been changed. + * The device configuration such as orientation,locale have been changed. */ COMMON_EVENT_CONFIGURATION_CHANGED = "usual.event.CONFIGURATION_CHANGED", @@ -350,57 +350,57 @@ declare namespace commonEvent { COMMON_EVENT_MANAGE_PACKAGE_STORAGE = "usual.event.MANAGE_PACKAGE_STORAGE", /** - * sent by the smart function when the system in drive mode. + * Sent by the smart function when the system in drive mode. */ COMMON_EVENT_DRIVE_MODE = "common.event.DRIVE_MODE", /** - * sent by the smart function when the system in home mode. + * Sent by the smart function when the system in home mode. */ COMMON_EVENT_HOME_MODE = "common.event.HOME_MODE", /** - * sent by the smart function when the system in office mode. + * Sent by the smart function when the system in office mode. */ COMMON_EVENT_OFFICE_MODE = "common.event.OFFICE_MODE", /** - * remind new user of preparing to start. + * Remind new user of preparing to start. */ COMMON_EVENT_USER_STARTED = "usual.event.USER_STARTED", /** - * remind previous user of that the service has been the background. + * Remind previous user of that the service has been the background. */ COMMON_EVENT_USER_BACKGROUND = "usual.event.USER_BACKGROUND", /** - * remind new user of that the service has been the foreground. + * Remind new user of that the service has been the foreground. */ COMMON_EVENT_USER_FOREGROUND = "usual.event.USER_FOREGROUND", /** - * remind new user of that the service has been switched to new user. + * Remind new user of that the service has been switched to new user. */ COMMON_EVENT_USER_SWITCHED = "usual.event.USER_SWITCHED", /** - * remind new user of that the service has been starting. + * Remind new user of that the service has been starting. */ COMMON_EVENT_USER_STARTING = "usual.event.USER_STARTING", /** - * remind new user of that the service has been unlocked. + * Remind new user of that the service has been unlocked. */ COMMON_EVENT_USER_UNLOCKED = "usual.event.USER_UNLOCKED", /** - * remind new user of that the service has been stopping. + * Remind new user of that the service has been stopping. */ COMMON_EVENT_USER_STOPPING = "usual.event.USER_STOPPING", /** - * remind new user of that the service has stopped. + * Remind new user of that the service has stopped. */ COMMON_EVENT_USER_STOPPED = "usual.event.USER_STOPPED", @@ -465,7 +465,7 @@ declare namespace commonEvent { COMMON_EVENT_WIFI_MPLINK_STATE_CHANGE = "usual.event.wifi.mplink.STATE_CHANGE", /** - * Indicates Wi-Fi P2P connection state notification acknowledged by connecting or disconnecting P2P. + * Indicates Wi-Fi P2P connection state notification acknowledged by connecting or disconnected P2P. */ COMMON_EVENT_WIFI_P2P_CONN_STATE = "usual.event.wifi.p2p.CONN_STATE_CHANGE", @@ -720,19 +720,19 @@ declare namespace commonEvent { "usual.event.bluetooth.a2dpsink.AUDIO_STATE_UPDATE", /** - * nfc state change. + * Nfc state change. */ COMMON_EVENT_NFC_ACTION_ADAPTER_STATE_CHANGED = "usual.event.nfc.action.ADAPTER_STATE_CHANGED", /** - * nfc field on detected. + * Nfc field on detected. */ COMMON_EVENT_NFC_ACTION_RF_FIELD_ON_DETECTED = "usual.event.nfc.action.RF_FIELD_ON_DETECTED", /** - * nfc field off detected. + * Nfc field off detected. */ COMMON_EVENT_NFC_ACTION_RF_FIELD_OFF_DETECTED = "usual.event.nfc.action.RF_FIELD_OFF_DETECTED", @@ -758,12 +758,12 @@ declare namespace commonEvent { COMMON_EVENT_POWER_SAVE_MODE_CHANGED = "usual.event.POWER_SAVE_MODE_CHANGED", /** - * user added. + * User added. */ COMMON_EVENT_USER_ADDED = "usual.event.USER_ADDED", /** - * user removed. + * User removed. */ COMMON_EVENT_USER_REMOVED = "usual.event.USER_REMOVED", @@ -783,7 +783,7 @@ declare namespace commonEvent { COMMON_EVENT_ABILITY_UPDATED = "common.event.ABILITY_UPDATED", /** - * gps mode state changed. + * Gps mode state changed. */ COMMON_EVENT_LOCATION_MODE_STATE_CHANGED = "usual.event.location.MODE_STATE_CHANGED", diff --git a/api/@ohos.commonEventManager.d.ts b/api/@ohos.commonEventManager.d.ts index c327741a04..f528ee6162 100644 --- a/api/@ohos.commonEventManager.d.ts +++ b/api/@ohos.commonEventManager.d.ts @@ -165,7 +165,7 @@ declare namespace commonEventManager { COMMON_EVENT_SCREEN_OFF = "usual.event.SCREEN_OFF", /** - * This commonEvent means when the device is waked up and interactive. + * This commonEvent means when the device is woken up and interactive. */ COMMON_EVENT_SCREEN_ON = "usual.event.SCREEN_ON", @@ -175,7 +175,7 @@ declare namespace commonEventManager { COMMON_EVENT_THERMAL_LEVEL_CHANGED = "usual.event.THERMAL_LEVEL_CHANGED", /** - * This commonEvent means when the user is present after the device waked up. + * This commonEvent means when the user is present after the device woken up. */ COMMON_EVENT_USER_PRESENT = "usual.event.USER_PRESENT", @@ -441,7 +441,7 @@ declare namespace commonEventManager { COMMON_EVENT_WIFI_MPLINK_STATE_CHANGE = "usual.event.wifi.mplink.STATE_CHANGE", /** - * Indicates Wi-Fi P2P connection state notification acknowledged by connecting or disconnecting P2P. + * Indicates Wi-Fi P2P connection state notification acknowledged by connecting or disconnected P2P. */ COMMON_EVENT_WIFI_P2P_CONN_STATE = "usual.event.wifi.p2p.CONN_STATE_CHANGE", diff --git a/api/@ohos.events.emitter.d.ts b/api/@ohos.events.emitter.d.ts index fbc91b20f5..ee1ae48a41 100644 --- a/api/@ohos.events.emitter.d.ts +++ b/api/@ohos.events.emitter.d.ts @@ -25,7 +25,7 @@ import { Callback } from './basic'; */ declare namespace emitter { /** - * Subscribes to a certain event in persistent manner and receives the event callback. + * Subscribe to a certain event in persistent manner and receives the event callback. * * @since 7 * @param event indicate event to subscribe to. @@ -35,7 +35,7 @@ declare namespace emitter { function on(event: InnerEvent, callback: Callback): void; /** - * Subscribes to a certain event in one-shot manner and unsubscribes from it + * Subscribe to a certain event in one-shot manner and unsubscribe from it * after the event callback is received. * * @since 7 @@ -46,7 +46,7 @@ declare namespace emitter { function once(event: InnerEvent, callback: Callback): void; /** - * Unsubscribes from an event. + * Unsubscribe from an event. * * @since 7 * @param eventId indicate ID of the event to unsubscribe from. diff --git a/api/@ohos.notification.d.ts b/api/@ohos.notification.d.ts index de8c1ae964..9702a8bcd8 100644 --- a/api/@ohos.notification.d.ts +++ b/api/@ohos.notification.d.ts @@ -36,7 +36,7 @@ import { NotificationUserInput as _NotificationUserInput } from './notification/ /** * Manages notifications. * - *

          Generally, only system applications have permissions on notification subscription and unsubscription. + *

          Generally, only system applications have permissions on notification subscription and unsubscribe. * You can specify the content of a notification to be published and the content is carried by * {@link NotificationRequest}. A notification ID is unique in an application and must be specified * when using {@link NotificationRequest} to carry the notification content. If a notification @@ -99,7 +99,7 @@ declare namespace notification { function publishAsBundle(request: NotificationRequest, representativeBundle: string, userId: number): Promise; /** - * Cancels a notification with the specified ID. + * Cancel a notification with the specified ID. * * @param id of the notification to cancel, which must be unique in the application. * @param callback callback function @@ -109,7 +109,7 @@ declare namespace notification { function cancel(id: number, callback: AsyncCallback): void; /** - * Cancels a notification with the specified label and ID. + * Cancel a notification with the specified label and ID. * * @param id ID of the notification to cancel, which must be unique in the application. * @param label Label of the notification to cancel. @@ -121,7 +121,7 @@ declare namespace notification { function cancel(id: number, label?: string): Promise; /** - * Cancels a representative notification. + * Cancel a representative notification. * * @since 9 * @param id ID of the notification to cancel, which must be unique in the application. @@ -991,7 +991,7 @@ declare namespace notification { } /** - * The remind type of the nofication. + * The remind type of the notification. * * @since 8 * @systemapi Hide this for inner system use. diff --git a/api/@ohos.notificationManager.d.ts b/api/@ohos.notificationManager.d.ts index e35bfb4fcd..cb1162fbb9 100644 --- a/api/@ohos.notificationManager.d.ts +++ b/api/@ohos.notificationManager.d.ts @@ -31,7 +31,7 @@ import { NotificationUserInput as _NotificationUserInput } from './notification/ /** * Manages notifications. - *

          Generally, only system applications have permissions on notification subscription and unsubscription. + *

          Generally, only system applications have permissions on notification subscription and unsubscribe. * You can specify the content of a notification to be published and the content is carried by * {@link NotificationRequest}. A notification ID is unique in an application and must be specified * when using {@link NotificationRequest} to carry the notification content. If a notification @@ -122,7 +122,7 @@ declare namespace notificationManager { function publishAsBundle(request: NotificationRequest, representativeBundle: string, userId: number): Promise; /** - * Cancels a notification with the specified ID. + * Cancel a notification with the specified ID. * @param { number } id - ID of the notification to cancel, which must be unique in the application. * @param { AsyncCallback } callback - The callback of cancel. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. @@ -132,7 +132,7 @@ declare namespace notificationManager { function cancel(id: number, callback: AsyncCallback): void; /** - * Cancels a notification with the specified label and ID. + * Cancel a notification with the specified label and ID. * @param { number } id - ID of the notification to cancel, which must be unique in the application. * @param { string }label - Label of the notification to cancel. * @param { AsyncCallback } callback - The callback of cancel. @@ -143,7 +143,7 @@ declare namespace notificationManager { function cancel(id: number, label: string, callback: AsyncCallback): void; /** - * Cancels a notification with the specified label and ID. + * Cancel a notification with the specified label and ID. * @param { number } id - ID of the notification to cancel, which must be unique in the application. * @param { string }label - Label of the notification to cancel. * @returns { Promise } The promise returned by the function. @@ -154,7 +154,7 @@ declare namespace notificationManager { function cancel(id: number, label?: string): Promise; /** - * Cancels a representative notification. + * Cancel a representative notification. * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER * @param { number } id - ID of the notification to cancel, which must be unique in the application. * @param { string } representativeBundle - bundle name of the representative. @@ -168,7 +168,7 @@ declare namespace notificationManager { function cancelAsBundle(id: number, representativeBundle: string, userId: number, callback: AsyncCallback): void; /** - * Cancels a representative notification. + * Cancel a representative notification. * @permission ohos.permission.NOTIFICATION_CONTROLLER and ohos.permission.NOTIFICATION_AGENT_CONTROLLER * @param { number } id - ID of the notification to cancel, which must be unique in the application. * @param { string } representativeBundle - bundle name of the representative. @@ -182,7 +182,7 @@ declare namespace notificationManager { function cancelAsBundle(id: number, representativeBundle: string, userId: number): Promise; /** - * Cancels all notifications of the current application. + * Cancel all notifications of the current application. * @param { AsyncCallback } callback - The callback of cancelAll. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Notification.Notification @@ -191,7 +191,7 @@ declare namespace notificationManager { function cancelAll(callback: AsyncCallback): void; /** - * Cancels all notifications of the current application. + * Cancel all notifications of the current application. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. * @syscap SystemCapability.Notification.Notification @@ -1225,7 +1225,7 @@ declare namespace notificationManager { } /** - * The remind type of the nofication. + * The remind type of the notification. * @enum { number } * @syscap SystemCapability.Notification.Notification * @systemapi diff --git a/api/@ohos.reminderAgentManager.d.ts b/api/@ohos.reminderAgentManager.d.ts index b96875149f..f6e96cf316 100644 --- a/api/@ohos.reminderAgentManager.d.ts +++ b/api/@ohos.reminderAgentManager.d.ts @@ -19,7 +19,7 @@ import { NotificationSlot } from './notification/notificationSlot'; /** * Providers static methods for managing reminders, including publishing or canceling a reminder. - * adding or removing a notification slot, and obtaining or cancelling all reminders of the current application. + * Add or remove a notification slot, and obtain or cancel all reminders of the current application. * * @since 9 * @syscap SystemCapability.Notification.ReminderAgent @@ -51,7 +51,7 @@ declare namespace reminderAgentManager { function publishReminder(reminderReq: ReminderRequest): Promise; /** - * Cancels a reminder. + * Cancel a reminder. * * @since 9 * @syscap SystemCapability.Notification.ReminderAgent @@ -62,7 +62,7 @@ declare namespace reminderAgentManager { function cancelReminder(reminderId: number, callback: AsyncCallback): void; /** - * Cancels a reminder. + * Cancel a reminder. * * @since 9 * @syscap SystemCapability.Notification.ReminderAgent @@ -93,7 +93,7 @@ declare namespace reminderAgentManager { function getValidReminders(): Promise>; /** - * Cancels all the reminders of current application. + * Cancel all the reminders of current application. * * @since 9 * @syscap SystemCapability.Notification.ReminderAgent @@ -103,7 +103,7 @@ declare namespace reminderAgentManager { function cancelAllReminders(callback: AsyncCallback): void; /** - * Cancels all the reminders of current application. + * Cancel all the reminders of current application. * * @since 9 * @syscap SystemCapability.Notification.ReminderAgent @@ -420,7 +420,7 @@ declare namespace reminderAgentManager { minute: number; /** - * Days of a week when the reminder repeates. + * Days of a week when the reminder repeats. * @since 9 * @syscap SystemCapability.Notification.ReminderAgent */ diff --git a/api/application/MissionInfo.d.ts b/api/application/MissionInfo.d.ts index 5233bce35e..6402b4fdfe 100644 --- a/api/application/MissionInfo.d.ts +++ b/api/application/MissionInfo.d.ts @@ -1,90 +1,89 @@ -/* - * Copyright (c) 2021 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 Want from "../@ohos.application.Want"; - -/** - * Mission information corresponding to ability. - * - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - * @permission N/A - * @systemapi hide for inner use. - */ -export interface MissionInfo { - /** - * Indicates mission id. - * - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - */ - missionId: number; - - /** - * Indicates running state. - * - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - */ - runningState: number; - - /** - * Indicates locked state. - * - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - */ - lockedState: boolean; - - /** - * Indicates the recent create or update time of the mission. - * - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - */ - timestamp: string; - - /** - * Indicates want of the mission. - * - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - */ - want: Want; - - /** - * Indicates label of the mission. - * - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - */ - label: string; - - /** - * Indicates icon path of the mission. - * - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - */ - iconPath: string; - - /** - * Indicates whether the mision is continuable. - * - * @since 8 - * @syscap SystemCapability.Ability.AbilityRuntime.Mission - */ - continuable: boolean; +/* + * Copyright (c) 2021 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 Want from "../@ohos.application.Want"; + +/** + * Mission information corresponding to ability. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + * @systemapi hide for inner use. + */ +export interface MissionInfo { + /** + * Indicates mission id. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + */ + missionId: number; + + /** + * Indicates running state. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + */ + runningState: number; + + /** + * Indicates locked state. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + */ + lockedState: boolean; + + /** + * Indicates the recent created or updated time of the mission. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + */ + timestamp: string; + + /** + * Indicates want of the mission. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + */ + want: Want; + + /** + * Indicates label of the mission. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + */ + label: string; + + /** + * Indicates icon path of the mission. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + */ + iconPath: string; + + /** + * Indicates whether the mission is continuable. + * + * @since 8 + * @syscap SystemCapability.Ability.AbilityRuntime.Mission + */ + continuable: boolean; } \ No newline at end of file diff --git a/api/application/MissionListener.d.ts b/api/application/MissionListener.d.ts index e80aaa7d62..5b425a9665 100644 --- a/api/application/MissionListener.d.ts +++ b/api/application/MissionListener.d.ts @@ -46,7 +46,7 @@ import image from "../@ohos.multimedia.image"; onMissionDestroyed(mission: number): void; /** - * Called by system when mission shapshot changed. + * Called by system when mission snapshot changed. * * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Mission @@ -56,7 +56,7 @@ import image from "../@ohos.multimedia.image"; onMissionSnapshotChanged(mission: number): void; /** - * Called by system when mission moved to fornt. + * Called by system when mission moved to front. * * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.Mission diff --git a/api/application/MissionParameter.d.ts b/api/application/MissionParameter.d.ts index e1b67f209e..a21e109745 100755 --- a/api/application/MissionParameter.d.ts +++ b/api/application/MissionParameter.d.ts @@ -31,7 +31,7 @@ export interface MissionParameter { deviceId: string; /** - * If needed to fix the versions confilct. + * If needed to fix the versions conflict. * * @since 9 * @syscap SystemCapability.Ability.AbilityRuntime.Mission diff --git a/api/application/ServiceExtensionContext.d.ts b/api/application/ServiceExtensionContext.d.ts index acc02d4176..86ff277356 100644 --- a/api/application/ServiceExtensionContext.d.ts +++ b/api/application/ServiceExtensionContext.d.ts @@ -274,7 +274,7 @@ export default class ServiceExtensionContext extends ExtensionContext { connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; /** - * Disconnects an ability to a service extension, in contrast to + * Disconnect an ability to a service extension, in contrast to * {@link connectAbility}. * * @since 9 @@ -322,7 +322,7 @@ export default class ServiceExtensionContext extends ExtensionContext { connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; /** - * Disconnects an ability to a service extension, in contrast to {@link connectAbility}. + * Disconnect an ability to a service extension, in contrast to {@link connectAbility}. * @param { number } connection - the connection id returned from connectAbility api. * @param { AsyncCallback } callback - The callback of disconnectAbility. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. @@ -333,7 +333,7 @@ export default class ServiceExtensionContext extends ExtensionContext { disconnectServiceExtensionAbility(connection: number, callback: AsyncCallback): void; /** - * Disconnects an ability to a service extension, in contrast to {@link connectAbility}. + * Disconnect an ability to a service extension, in contrast to {@link connectAbility}. * @param { number } connection - the connection id returned from connectAbility api. * @returns { Promise } The promise returned by the function. * @throws { BusinessError } 401 - If the input parameter is not valid parameter. diff --git a/api/common/full/featureability.d.ts b/api/common/full/featureability.d.ts index 308fe6727f..6d649abfa3 100644 --- a/api/common/full/featureability.d.ts +++ b/api/common/full/featureability.d.ts @@ -44,7 +44,7 @@ export interface SubscribeMessageResponse { deviceId: string; /** - * Name of the bundle where the peer ability locates. The name is case sensitive. + * Name of the bundle where the peer ability has been located. The name is case sensitive. * @since 5 */ bundleName: string; @@ -68,7 +68,7 @@ export interface SubscribeMessageResponse { */ export interface CallAbilityParam { /** - * Name of the bundle where the ability locates. The name is case sensitive and must be the same as that on the AA side. + * Name of the bundle where the ability has been located. The name is case sensitive and must be the same as that on the AA side. * @since 5 */ bundleName: string; @@ -114,7 +114,7 @@ export interface CallAbilityParam { */ export interface SubscribeAbilityEventParam { /** - * Name of the bundle where the ability locates. The name is case sensitive and must be the same as that on the AA side. + * Name of the bundle where the ability has been located. The name is case sensitive and must be the same as that on the AA side. * @since 5 */ bundleName: string; @@ -161,7 +161,7 @@ export interface SendMessageOptions { deviceId: string; /** - * Name of the destination bundle where the ability locates. The name is case sensitive. + * Name of the destination bundle where the ability has been located. The name is case sensitive. * @since 5 */ bundleName: string; @@ -316,7 +316,7 @@ export declare class FeatureAbility { static startAbilityForResult(request: RequestParams): Promise; /** - * FA call the interface to destory itself and set the result as parameters. + * FA call the interface to destroy itself and set the result as parameters. * @param request Indicates the request param. * @returns A Promise object is returned, which contains the result whether to callback successfully. * @since 5 @@ -353,7 +353,7 @@ export declare class FeatureAbility { static continueAbility(): Promise; /** - * Subscribes to events of an AA. + * Subscribe to events of an AA. * @param param Indicates the request param. * @param func Indicates the event reporting callback. * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. @@ -363,7 +363,7 @@ export declare class FeatureAbility { static subscribeAbilityEvent(param: SubscribeAbilityEventParam, func: Function): Promise; /** - * Unsubscribes from events of an AA. + * Unsubscribe from events of an AA. * @param param Indicates the request param. * @returns A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string. * @since 5 @@ -390,7 +390,7 @@ export declare class FeatureAbility { static subscribeMsg(options: SubscribeMessageOptions): void; /** - * Cancels the listening for messages sent from other devices. + * Cancel the listening for messages sent from other devices. * @syscap SystemCapability.ArkUI.ArkUI.Lite * @since 5 * @deprecated since 8 diff --git a/api/common/lite/featureability.d.ts b/api/common/lite/featureability.d.ts index 3b1d820d99..c968c213ed 100644 --- a/api/common/lite/featureability.d.ts +++ b/api/common/lite/featureability.d.ts @@ -26,7 +26,7 @@ export interface SubscribeMessageResponse { deviceId: string; /** - * Name of the bundle where the peer ability locates. The name is case sensitive. + * Name of the bundle where the peer ability has been located. The name is case sensitive. * @since 5 */ bundleName: string; @@ -57,7 +57,7 @@ export interface SendMessageOptions { deviceId: string; /** - * Name of the destination bundle where the ability locates. The name is case sensitive. + * Name of the destination bundle where the ability has been located. The name is case sensitive. * @since 5 */ bundleName: string; @@ -139,7 +139,7 @@ export declare class FeatureAbility { static subscribeMsg(options: SubscribeMessageOptions): void; /** - * Cancels the listening for messages sent from other devices. + * Cancel the listening for messages sent from other devices. * @syscap SystemCapability.ArkUI.ArkUI.Lite * @since 5 * @deprecated since 8 diff --git a/api/commonEvent/commonEventSubscriber.d.ts b/api/commonEvent/commonEventSubscriber.d.ts index c9e1beb8d7..eb6dd435a2 100644 --- a/api/commonEvent/commonEventSubscriber.d.ts +++ b/api/commonEvent/commonEventSubscriber.d.ts @@ -1,238 +1,238 @@ -/* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { AsyncCallback } from './../basic'; -import { CommonEventSubscribeInfo } from './commonEventSubscribeInfo'; - -/** - * the subscriber of common event - * @name CommonEventSubscriber - * @since 7 - * @syscap SystemCapability.Notification.CommonEvent - * @permission N/A - */ -export interface CommonEventSubscriber { - /** - * Obtains the result code of the current ordered common event. - * - * @since 7 - * @param callback Indicate the callback function to receive the common event. - * @return - - */ - getCode(callback: AsyncCallback): void; - - /** - * Obtains the result code of the current ordered common event. - * - * @since 7 - * @return Returns code of this common event - */ - getCode(): Promise; - - /** - * Sets the result code of the current ordered common event. - * - * @since 7 - * @param code Indicates the custom result code to set. You can set it to any value. - * @param callback Indicate the callback function to receive the common event. - * @return - - */ - setCode(code: number, callback: AsyncCallback): void; - - /** - * Sets the result code of the current ordered common event. - * - * @since 7 - * @param code Indicates the custom result code to set. You can set it to any value. - * @return - - */ - setCode(code: number): Promise; - - /** - * Obtains the result data of the current ordered common event. - * - * @since 7 - * @param callback Indicate the callback function to receive the common event. - * @return - - */ - getData(callback: AsyncCallback): void; - - /** - * Obtains the result data of the current ordered common event. - * - * @since 7 - * @return - * @return Returns data of this common event - */ - getData(): Promise; - - /** - * Sets the result data of the current ordered common event. - * - * @since 7 - * @param data Indicates the custom result data to set. You can set it to any character string. - * @param callback Indicate the callback function to receive the common event. - * @return - - */ - setData(data: string, callback: AsyncCallback): void; - - /** - * Sets the result data of the current ordered common event. - * - * @since 7 - * @param data Indicates the custom result data to set. You can set it to any character string. - * @return - - */ - setData(data: string): Promise; - - /** - * Sets the result of the current ordered common event. - * - * @since 7 - * @param code Indicates the custom result code to set. You can set it to any value. - * @param data Indicates the custom result data to set. You can set it to any character string. - * @param callback Indicate the callback function to receive the common event. - * @return - - */ - setCodeAndData(code: number, data: string, callback: AsyncCallback): void; - - /** - * Sets the result of the current ordered common event. - * - * @since 7 - * @param code Indicates the custom result code to set. You can set it to any value. - * @param data Indicates the custom result data to set. You can set it to any character string. - * @return - - */ - setCodeAndData(code: number, data: string): Promise; - - /** - * Checks whether the current common event is an ordered common event. - * - * @since 7 - * @param callback Indicate the callback function to receive the common event. - * @return - - */ - isOrderedCommonEvent(callback: AsyncCallback): void; - - /** - * Checks whether the current common event is an ordered common event. - * - * @since 7 - * @return Returns true if this common event is ordered, false otherwise - */ - isOrderedCommonEvent(): Promise; - - /** - * Checks whether the current common event is a sticky common event. - * - * @since 7 - * @param callback Indicate the callback function to receive the common event. - * @return - - */ - isStickyCommonEvent(callback: AsyncCallback): void; - - /** - * Checks whether the current common event is a sticky common event. - * - * @since 7 - * @return Returns true if this common event is sticky, false otherwise - */ - isStickyCommonEvent(): Promise; - - /** - * Aborts the current ordered common event. - * - * @since 7 - * @param callback Indicate the callback function to receive the common event. - * @return - - */ - abortCommonEvent(callback: AsyncCallback): void; - - /** - * Aborts the current ordered common event. - * - * @since 7 - * @return - - */ - abortCommonEvent(): Promise; - - /** - * Clears the abort state of the current ordered common event - * - * @since 7 - * @param callback Indicate the callback function to receive the common event. - * @return - - */ - clearAbortCommonEvent(callback: AsyncCallback): void; - - /** - * Clears the abort state of the current ordered common event - * - * @since 7 - * @return - - */ - clearAbortCommonEvent(): Promise; - - /** - * Checks whether the current ordered common event should be aborted. - * - * @since 7 - * @param callback Indicate the callback function to receive the common event. - * @return - - */ - getAbortCommonEvent(callback: AsyncCallback): void; - - /** - * Checks whether the current ordered common event should be aborted. - * - * @since 7 - * @return Returns true if this common event is aborted, false otherwise - */ - getAbortCommonEvent(): Promise; - - /** - * get the CommonEventSubscribeInfo of this CommonEventSubscriber. - * - * @since 7 - * @param callback Indicate the callback function to receive the common event. - * @return - - */ - getSubscribeInfo(callback: AsyncCallback): void; - - /** - * get the CommonEventSubscribeInfo of this CommonEventSubscriber. - * - * @since 7 - * @return Returns the commonEvent subscribe information - */ - getSubscribeInfo(): Promise; - - /** - * finish the current ordered common event. - * - * @since 9 - * @param callback Indicate the callback function after the ordered common event is finished. - * @return - - */ - finishCommonEvent(callback: AsyncCallback): void; - - /** - * finish the current ordered common event. - * - * @since 9 - * @return - - */ - finishCommonEvent(): Promise; -} +/* + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import { AsyncCallback } from './../basic'; +import { CommonEventSubscribeInfo } from './commonEventSubscribeInfo'; + +/** + * the subscriber of common event + * @name CommonEventSubscriber + * @since 7 + * @syscap SystemCapability.Notification.CommonEvent + * @permission N/A + */ +export interface CommonEventSubscriber { + /** + * Obtains the result code of the current ordered common event. + * + * @since 7 + * @param callback Indicate the callback function to receive the common event. + * @return - + */ + getCode(callback: AsyncCallback): void; + + /** + * Obtains the result code of the current ordered common event. + * + * @since 7 + * @return Returns code of this common event + */ + getCode(): Promise; + + /** + * Sets the result code of the current ordered common event. + * + * @since 7 + * @param code Indicates the custom result code to set. You can set it to any value. + * @param callback Indicate the callback function to receive the common event. + * @return - + */ + setCode(code: number, callback: AsyncCallback): void; + + /** + * Sets the result code of the current ordered common event. + * + * @since 7 + * @param code Indicates the custom result code to set. You can set it to any value. + * @return - + */ + setCode(code: number): Promise; + + /** + * Obtains the result data of the current ordered common event. + * + * @since 7 + * @param callback Indicate the callback function to receive the common event. + * @return - + */ + getData(callback: AsyncCallback): void; + + /** + * Obtains the result data of the current ordered common event. + * + * @since 7 + * @return + * @return Returns data of this common event + */ + getData(): Promise; + + /** + * Sets the result data of the current ordered common event. + * + * @since 7 + * @param data Indicates the custom result data to set. You can set it to any character string. + * @param callback Indicate the callback function to receive the common event. + * @return - + */ + setData(data: string, callback: AsyncCallback): void; + + /** + * Sets the result data of the current ordered common event. + * + * @since 7 + * @param data Indicates the custom result data to set. You can set it to any character string. + * @return - + */ + setData(data: string): Promise; + + /** + * Sets the result of the current ordered common event. + * + * @since 7 + * @param code Indicates the custom result code to set. You can set it to any value. + * @param data Indicates the custom result data to set. You can set it to any character string. + * @param callback Indicate the callback function to receive the common event. + * @return - + */ + setCodeAndData(code: number, data: string, callback: AsyncCallback): void; + + /** + * Sets the result of the current ordered common event. + * + * @since 7 + * @param code Indicates the custom result code to set. You can set it to any value. + * @param data Indicates the custom result data to set. You can set it to any character string. + * @return - + */ + setCodeAndData(code: number, data: string): Promise; + + /** + * Checks whether the current common event is an ordered common event. + * + * @since 7 + * @param callback Indicate the callback function to receive the common event. + * @return - + */ + isOrderedCommonEvent(callback: AsyncCallback): void; + + /** + * Checks whether the current common event is an ordered common event. + * + * @since 7 + * @return Returns true if this common event is ordered, false otherwise + */ + isOrderedCommonEvent(): Promise; + + /** + * Checks whether the current common event is a sticky common event. + * + * @since 7 + * @param callback Indicate the callback function to receive the common event. + * @return - + */ + isStickyCommonEvent(callback: AsyncCallback): void; + + /** + * Checks whether the current common event is a sticky common event. + * + * @since 7 + * @return Returns true if this common event is sticky, false otherwise + */ + isStickyCommonEvent(): Promise; + + /** + * Abort the current ordered common event. + * + * @since 7 + * @param callback Indicate the callback function to receive the common event. + * @return - + */ + abortCommonEvent(callback: AsyncCallback): void; + + /** + * Abort the current ordered common event. + * + * @since 7 + * @return - + */ + abortCommonEvent(): Promise; + + /** + * Clears the abort state of the current ordered common event + * + * @since 7 + * @param callback Indicate the callback function to receive the common event. + * @return - + */ + clearAbortCommonEvent(callback: AsyncCallback): void; + + /** + * Clears the abort state of the current ordered common event + * + * @since 7 + * @return - + */ + clearAbortCommonEvent(): Promise; + + /** + * Checks whether the current ordered common event should be aborted. + * + * @since 7 + * @param callback Indicate the callback function to receive the common event. + * @return - + */ + getAbortCommonEvent(callback: AsyncCallback): void; + + /** + * Checks whether the current ordered common event should be aborted. + * + * @since 7 + * @return Returns true if this common event is aborted, false otherwise + */ + getAbortCommonEvent(): Promise; + + /** + * get the CommonEventSubscribeInfo of this CommonEventSubscriber. + * + * @since 7 + * @param callback Indicate the callback function to receive the common event. + * @return - + */ + getSubscribeInfo(callback: AsyncCallback): void; + + /** + * get the CommonEventSubscribeInfo of this CommonEventSubscriber. + * + * @since 7 + * @return Returns the commonEvent subscribe information + */ + getSubscribeInfo(): Promise; + + /** + * finish the current ordered common event. + * + * @since 9 + * @param callback Indicate the callback function after the ordered common event is finished. + * @return - + */ + finishCommonEvent(callback: AsyncCallback): void; + + /** + * finish the current ordered common event. + * + * @since 9 + * @return - + */ + finishCommonEvent(): Promise; +} diff --git a/api/notification/notificationSubscriber.d.ts b/api/notification/notificationSubscriber.d.ts index f2356ec81f..383eed775c 100644 --- a/api/notification/notificationSubscriber.d.ts +++ b/api/notification/notificationSubscriber.d.ts @@ -1,83 +1,83 @@ -/* - * Copyright (c) 2021 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 { NotificationRequest } from './notificationRequest'; -import { NotificationSortingMap } from './notificationSortingMap'; -import notification from '../@ohos.notification'; - -/** - * Provides methods that will be called back when the subscriber receives a new notification or - * a notification is canceled. - * - * @name NotificationSubscriber - * @syscap SystemCapability.Notification.Notification - * @permission N/A - * @systemapi Hide this for inner system use. - * @since 7 - */ -export interface NotificationSubscriber { - onConsume?:(data: SubscribeCallbackData) => void; - onCancel?:(data: SubscribeCallbackData) => void; - onUpdate?:(data: NotificationSortingMap) => void; - onConnect?:() => void; - onDisconnect?:() => void; - onDestroy?:() => void; - - /** - * Callback when the Do Not Disturb setting changed. - * @syscap SystemCapability.Notification.Notification - * @since 8 - */ - onDoNotDisturbDateChange?:(mode: notification.DoNotDisturbDate) => void; - - /** - * Callback when the notificaition permission is changed. - * @syscap SystemCapability.Notification.Notification - * @since 8 - */ - onEnabledNotificationChanged?:(callbackData: EnabledNotificationCallbackData) => void; -} - -/** - * Provides methods that will be called back when the subscriber receives a new notification or - * a notification is canceled. - * - * @name SubscribeCallbackData - * @syscap SystemCapability.Notification.Notification - * @permission N/A - * @systemapi Hide this for inner system use. - * @since 7 - */ -export interface SubscribeCallbackData { - readonly request: NotificationRequest; - readonly sortingMap?: NotificationSortingMap; - readonly reason?: number; - readonly sound?: string; - readonly vibrationValues?: Array; -} - -/** - * Describes the properties of the application that the permission to send notifications has changed. - * - * @name EnabledNotificationCallbackData - * @syscap SystemCapability.Notification.Notification - * @systemapi Hide this for inner system use. - * @since 8 - */ -export interface EnabledNotificationCallbackData { - readonly bundle: string; - readonly uid: number; - readonly enable: boolean; -} +/* + * Copyright (c) 2021 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 { NotificationRequest } from './notificationRequest'; +import { NotificationSortingMap } from './notificationSortingMap'; +import notification from '../@ohos.notification'; + +/** + * Provides methods that will be called back when the subscriber receives a new notification or + * a notification is canceled. + * + * @name NotificationSubscriber + * @syscap SystemCapability.Notification.Notification + * @permission N/A + * @systemapi Hide this for inner system use. + * @since 7 + */ +export interface NotificationSubscriber { + onConsume?:(data: SubscribeCallbackData) => void; + onCancel?:(data: SubscribeCallbackData) => void; + onUpdate?:(data: NotificationSortingMap) => void; + onConnect?:() => void; + onDisconnect?:() => void; + onDestroy?:() => void; + + /** + * Callback when the Do Not Disturb setting changed. + * @syscap SystemCapability.Notification.Notification + * @since 8 + */ + onDoNotDisturbDateChange?:(mode: notification.DoNotDisturbDate) => void; + + /** + * Callback when the notification permission is changed. + * @syscap SystemCapability.Notification.Notification + * @since 8 + */ + onEnabledNotificationChanged?:(callbackData: EnabledNotificationCallbackData) => void; +} + +/** + * Provides methods that will be called back when the subscriber receives a new notification or + * a notification is canceled. + * + * @name SubscribeCallbackData + * @syscap SystemCapability.Notification.Notification + * @permission N/A + * @systemapi Hide this for inner system use. + * @since 7 + */ +export interface SubscribeCallbackData { + readonly request: NotificationRequest; + readonly sortingMap?: NotificationSortingMap; + readonly reason?: number; + readonly sound?: string; + readonly vibrationValues?: Array; +} + +/** + * Describes the properties of the application that the permission to send notifications has changed. + * + * @name EnabledNotificationCallbackData + * @syscap SystemCapability.Notification.Notification + * @systemapi Hide this for inner system use. + * @since 8 + */ +export interface EnabledNotificationCallbackData { + readonly bundle: string; + readonly uid: number; + readonly enable: boolean; +} -- Gitee From 953d6dc707b8254a0f659fdbce82937401b6c80a Mon Sep 17 00:00:00 2001 From: mayunteng_1 Date: Thu, 17 Nov 2022 09:07:20 +0800 Subject: [PATCH 332/438] =?UTF-8?q?api=E9=97=AE=E9=A2=98=E6=95=B4=E6=94=B9?= =?UTF-8?q?&supportKeys=E6=8E=A5=E5=8F=A3=E5=9B=9E=E8=B0=83=E6=94=B9?= =?UTF-8?q?=E4=B8=BAAsyncCallback?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: mayunteng_1 Change-Id: I49cf285d6bb7ec6590a5dc267cd086ae6bbe4e30 --- api/@ohos.multimodalInput.inputConsumer.d.ts | 1 - api/@ohos.multimodalInput.inputDevice.d.ts | 15 +++++++-------- api/@ohos.multimodalInput.inputEvent.d.ts | 1 - api/@ohos.multimodalInput.inputEventClient.d.ts | 1 - api/@ohos.multimodalInput.inputMonitor.d.ts | 5 ++--- api/@ohos.multimodalInput.keyCode.d.ts | 1 - api/@ohos.multimodalInput.keyEvent.d.ts | 3 --- api/@ohos.multimodalInput.mouseEvent.d.ts | 5 ----- api/@ohos.multimodalInput.pointer.d.ts | 13 ++++++------- api/@ohos.multimodalInput.touchEvent.d.ts | 5 ----- 10 files changed, 15 insertions(+), 35 deletions(-) diff --git a/api/@ohos.multimodalInput.inputConsumer.d.ts b/api/@ohos.multimodalInput.inputConsumer.d.ts index b7e0d8f3c9..bd0666174c 100644 --- a/api/@ohos.multimodalInput.inputConsumer.d.ts +++ b/api/@ohos.multimodalInput.inputConsumer.d.ts @@ -20,7 +20,6 @@ import { Callback } from './basic'; * * @since 8 * @syscap SystemCapability.MultimodalInput.Input.InputConsumer - * @import import inputConsumer from '@ohos.multimodalInput.inputConsumer'; * @systemapi hide for inner use */ diff --git a/api/@ohos.multimodalInput.inputDevice.d.ts b/api/@ohos.multimodalInput.inputDevice.d.ts index 2d3cc32091..01b85fda5a 100755 --- a/api/@ohos.multimodalInput.inputDevice.d.ts +++ b/api/@ohos.multimodalInput.inputDevice.d.ts @@ -21,7 +21,6 @@ import { KeyCode } from "./@ohos.multimodalInput.keyCode" * * @since 8 * @syscap SystemCapability.MultimodalInput.Input.InputDevice - * @import import inputDevice from '@ohos.multimodalInput.inputDevice'; */ declare namespace inputDevice { /** @@ -93,7 +92,7 @@ declare namespace inputDevice { * @since 9 * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @param type Type of the input device event, which is **change**. - * @return Callback for the input device event. + * @returns Callback for the input device event. * @throws {BusinessError} 401 - Parameter error. */ function on(type: "change", listener: Callback): void; @@ -104,7 +103,7 @@ declare namespace inputDevice { * @since 9 * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @param type Type of the input device event, which is **change**. - * @return Callback for the input device event. + * @returns Callback for the input device event. * @throws {BusinessError} 401 - Parameter error. */ function off(type: "change", listener?: Callback): void; @@ -318,10 +317,10 @@ declare namespace inputDevice { * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @param deviceId ID of the input device. * @param keys Key codes of the input device, You can query a maximum of five key codes at a time. - * @return Returns a result indicating whether the specified key codes are supported. + * @returns Returns a result indicating whether the specified key codes are supported. * @throws {BusinessError} 401 - Parameter error. */ - function supportKeys(deviceId: number, keys: Array, callback: Callback>): void; + function supportKeys(deviceId: number, keys: Array, callback: AsyncCallback>): void; /** * Checks whether the specified key codes of an input device are supported. @@ -330,7 +329,7 @@ declare namespace inputDevice { * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @param deviceId ID of the input device. * @param keys Key codes of the input device, You can query a maximum of five key codes at a time. - * @return Returns a result indicating whether the specified key codes are supported. + * @returns Returns a result indicating whether the specified key codes are supported. * @throws {BusinessError} 401 - Parameter error. */ function supportKeys(deviceId: number, keys: Array): Promise>; @@ -341,7 +340,7 @@ declare namespace inputDevice { * @since 9 * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @param deviceId ID of the specified input device. - * @return Returns the keyboard type. + * @returns Returns the keyboard type. * @throws {BusinessError} 401 - Parameter error. */ function getKeyboardType(deviceId: number, callback: AsyncCallback): void; @@ -352,7 +351,7 @@ declare namespace inputDevice { * @since 9 * @syscap SystemCapability.MultimodalInput.Input.InputDevice * @param deviceId ID of the specified input device. - * @return Returns the keyboard type. + * @returns Returns the keyboard type. * @throws {BusinessError} 401 - Parameter error. */ function getKeyboardType(deviceId: number): Promise; diff --git a/api/@ohos.multimodalInput.inputEvent.d.ts b/api/@ohos.multimodalInput.inputEvent.d.ts index a335447db2..79de5c4193 100755 --- a/api/@ohos.multimodalInput.inputEvent.d.ts +++ b/api/@ohos.multimodalInput.inputEvent.d.ts @@ -18,7 +18,6 @@ * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core - * @import import InputEvent from '@ohos.multimodalInput.inputEvent'; */ export declare interface InputEvent { /** diff --git a/api/@ohos.multimodalInput.inputEventClient.d.ts b/api/@ohos.multimodalInput.inputEventClient.d.ts index 589bb0c18c..39b5a50717 100644 --- a/api/@ohos.multimodalInput.inputEventClient.d.ts +++ b/api/@ohos.multimodalInput.inputEventClient.d.ts @@ -18,7 +18,6 @@ * * @since 8 * @syscap SystemCapability.MultimodalInput.Input.InputSimulator - * @import import inputEventClient from '@ohos.multimodalInput.inputEventClient'; * @systemapi hide for inner use */ diff --git a/api/@ohos.multimodalInput.inputMonitor.d.ts b/api/@ohos.multimodalInput.inputMonitor.d.ts index f61123da73..3d16252a71 100644 --- a/api/@ohos.multimodalInput.inputMonitor.d.ts +++ b/api/@ohos.multimodalInput.inputMonitor.d.ts @@ -21,7 +21,6 @@ import { MouseEvent } from './@ohos.multimodalInput.mouseEvent'; * System API, available only to system processes * @since 7 * @syscap SystemCapability.MultimodalInput.Input.InputMonitor - * @import import inputMonitor from '@ohos.multimodalInput.inputMonitor'; * @permission ohos.permission.INPUT_MONITORING * @systemapi hide for inner use */ @@ -63,7 +62,7 @@ declare namespace inputMonitor { function on(type:"mouse", receiver:Callback):void; /** - * Cancels listening for touch input events. + * Cancel listening for touch input events. * @since 7 * @syscap SystemCapability.MultimodalInput.Input.InputMonitor * @systemapi hide for inner use @@ -76,7 +75,7 @@ declare namespace inputMonitor { function off(type:"touch", receiver?:TouchEventReceiver):void; /** - * Cancels listening for mouse input events. + * Cancel listening for mouse input events. * @since 9 * @syscap SystemCapability.MultimodalInput.Input.InputMonitor * @systemapi hide for inner use diff --git a/api/@ohos.multimodalInput.keyCode.d.ts b/api/@ohos.multimodalInput.keyCode.d.ts index 7da279b403..f25638ee7d 100644 --- a/api/@ohos.multimodalInput.keyCode.d.ts +++ b/api/@ohos.multimodalInput.keyCode.d.ts @@ -18,7 +18,6 @@ * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core -* @import import {KeyCode} from '@ohos.multimodalInput.keyCode', */ export declare enum KeyCode { diff --git a/api/@ohos.multimodalInput.keyEvent.d.ts b/api/@ohos.multimodalInput.keyEvent.d.ts index af0acb4ad4..d51cf1af58 100755 --- a/api/@ohos.multimodalInput.keyEvent.d.ts +++ b/api/@ohos.multimodalInput.keyEvent.d.ts @@ -19,7 +19,6 @@ import { KeyCode } from "./@ohos.multimodalInput.keyCode" * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core -* @import import {Action} from '@ohos.multimodalInput.keyEvent'; */ export declare enum Action { /** @@ -43,7 +42,6 @@ export declare enum Action { * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core -* @import import {Key} from '@ohos.multimodalInput.keyEvent'; */ export declare interface Key { /** @@ -67,7 +65,6 @@ export declare interface Key { * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core -* @import import {KeyEvent} from '@ohos.multimodalInput.keyEvent'; */ export declare interface KeyEvent extends InputEvent { /** diff --git a/api/@ohos.multimodalInput.mouseEvent.d.ts b/api/@ohos.multimodalInput.mouseEvent.d.ts index 8598db12bf..7828872e9c 100755 --- a/api/@ohos.multimodalInput.mouseEvent.d.ts +++ b/api/@ohos.multimodalInput.mouseEvent.d.ts @@ -20,7 +20,6 @@ import { KeyCode } from "./@ohos.multimodalInput.keyCode" * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core - * @import import {Action} from '@ohos.multimodalInput.mouseEvent'; */ export declare enum Action { /** @@ -64,7 +63,6 @@ export declare enum Action { * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core - * @import import {Button} from '@ohos.multimodalInput.mouseEvent'; */ export declare enum Button { /** @@ -113,7 +111,6 @@ export declare enum Button { * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core - * @import import {Axis} from '@ohos.multimodalInput.mouseEvent'; */ export declare enum Axis { /** @@ -137,7 +134,6 @@ export declare enum Axis { * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core - * @import import {AxisValue} from '@ohos.multimodalInput.mouseEvent'; */ export declare interface AxisValue { /** @@ -156,7 +152,6 @@ export declare interface AxisValue { * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core - * @import import {MouseEvent} from '@ohos.multimodalInput.mouseEvent'; */ export declare interface MouseEvent extends InputEvent { /** diff --git a/api/@ohos.multimodalInput.pointer.d.ts b/api/@ohos.multimodalInput.pointer.d.ts index 55fa1863b6..195b6d098f 100644 --- a/api/@ohos.multimodalInput.pointer.d.ts +++ b/api/@ohos.multimodalInput.pointer.d.ts @@ -20,7 +20,6 @@ import { AsyncCallback } from "./basic"; * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Pointer - * @import import pointer from '@ohos.multimodalInput.pointer'; */ declare namespace pointer { /** @@ -242,7 +241,7 @@ declare namespace pointer { * @syscap SystemCapability.MultimodalInput.Input.Pointer * @systemapi hide for inner use * @param speed Pointer moving speed. - * @return Returns the result through a promise. + * @returns Returns the result through a promise. * @throws {BusinessError} 401 - Parameter error. */ function setPointerSpeed(speed: number): Promise; @@ -262,7 +261,7 @@ declare namespace pointer { * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Pointer * @systemapi hide for inner use - * @return Returns the result through a promise. + * @returns Returns the result through a promise. */ function getPointerSpeed(): Promise; @@ -283,7 +282,7 @@ declare namespace pointer { * @syscap SystemCapability.MultimodalInput.Input.Pointer * @param windowId Window ID. * @param pointerStyle Pointer style. - * @return Returns the result through a promise. + * @returns Returns the result through a promise. * @throws {BusinessError} 401 - Parameter error. */ function setPointerStyle(windowId: number, pointerStyle: PointerStyle): Promise; @@ -303,7 +302,7 @@ declare namespace pointer { * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Pointer * @param windowId Window ID. - * @return Returns the result through a promise. + * @returns Returns the result through a promise. * @throws {BusinessError} 401 - Parameter error. */ function getPointerStyle(windowId: number): Promise; @@ -335,7 +334,7 @@ declare namespace pointer { * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Pointer - * @return Returns true if the pointer icon is visible; returns false otherwise. + * @returns Returns true if the pointer icon is visible; returns false otherwise. * @throws {BusinessError} 401 - Parameter error. */ function isPointerVisible(callback: AsyncCallback): void; @@ -345,7 +344,7 @@ declare namespace pointer { * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Pointer - * @return Returns true if the pointer icon is visible; returns false otherwise. + * @returns Returns true if the pointer icon is visible; returns false otherwise. */ function isPointerVisible(): Promise; } diff --git a/api/@ohos.multimodalInput.touchEvent.d.ts b/api/@ohos.multimodalInput.touchEvent.d.ts index bf637da06e..5748890333 100755 --- a/api/@ohos.multimodalInput.touchEvent.d.ts +++ b/api/@ohos.multimodalInput.touchEvent.d.ts @@ -19,7 +19,6 @@ import { InputEvent } from './@ohos.multimodalInput.inputEvent' * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core - * @import import {Action} from '@ohos.multimodalInput.touchEvent'; */ export declare enum Action { /** @@ -48,7 +47,6 @@ export declare enum Action { * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core - * @import import {ToolType} from '@ohos.multimodalInput.touchEvent'; */ export declare enum ToolType { /** @@ -94,7 +92,6 @@ export declare enum ToolType { * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core - * @import import {SourceType} from '@ohos.multimodalInput.touchEvent'; */ export declare enum SourceType { /** @@ -118,7 +115,6 @@ export declare enum SourceType { * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core - * @import import {Touch} from '@ohos.multimodalInput.touchEvent'; */ export declare interface Touch { /** @@ -217,7 +213,6 @@ export declare interface Touch { * * @since 9 * @syscap SystemCapability.MultimodalInput.Input.Core - * @import import {TouchEvent} from '@ohos.multimodalInput.touchEvent'; */ export declare interface TouchEvent extends InputEvent { /** -- Gitee From 32162f1f32a2a5414e5260236f1132bc13564b23 Mon Sep 17 00:00:00 2001 From: Hollokin Date: Tue, 1 Nov 2022 18:05:42 +0800 Subject: [PATCH 333/438] =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=B3=95=E6=A1=86?= =?UTF-8?q?=E6=9E=B6=E4=BB=8Ed.ts=E4=B8=AD=E5=88=A0=E9=99=A4=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=A0=81=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Hollokin --- api/@ohos.inputmethod.d.ts | 86 +------------------------------- api/@ohos.inputmethodengine.d.ts | 6 +-- 2 files changed, 5 insertions(+), 87 deletions(-) diff --git a/api/@ohos.inputmethod.d.ts b/api/@ohos.inputmethod.d.ts index 956e08c7ba..55afa0702a 100644 --- a/api/@ohos.inputmethod.d.ts +++ b/api/@ohos.inputmethod.d.ts @@ -23,90 +23,6 @@ import InputMethodSubtype from './@ohos.inputMethodSubtype'; * @syscap SystemCapability.MiscServices.InputMethodFramework */ declare namespace inputMethod { - /** - * Errorcode 201. The permissions check fails. - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @since 9 - */ - const EXCEPTION_PERMISSION: number; - - /** - * Errorcode 401. The parameters check fails. - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @since 9 - */ - const EXCEPTION_PARAMCHECK: number; - - /** - * Errorcode 801. Call unsupported api. - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @since 9 - */ - const EXCEPTION_UNSUPPORTED: number; - - /** - * Errorcode 12800001. Package manager error. - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @since 9 - */ - const EXCEPTION_PACKAGEMANAGER: number; - - /** - * Errorcode 12800002. Input method engine error. - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @since 9 - */ - const EXCEPTION_IMENGINE: number; - - /** - * Errorcode 12800003. Input method client error. - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @since 9 - */ - const EXCEPTION_IMCLIENT: number; - - /** - * Errorcode 12800004. Key event processing error. - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @since 9 - */ - const EXCEPTION_KEYEVENT: number; - - /** - * Errorcode 12800005. Configuration persisting error. - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @since 9 - */ - const EXCEPTION_CONFPERSIST: number; - - /** - * Errorcode 12800006. Input method controller error. - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @since 9 - */ - const EXCEPTION_CONTROLLER: number; - - /** - * Errorcode 12800007. Input method settings extension error. - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @since 9 - */ - const EXCEPTION_SETTINGS: number; - - /** - * Errorcode 12800008. Input method manager service error. - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @since 9 - */ - const EXCEPTION_IMMS: number; - - /** - * Errorcode 12899999. Others error. - * @syscap SystemCapability.MiscServices.InputMethodFramework - * @since 9 - */ - const EXCEPTION_OTHERS: number; - /** * Keyboard max number * @since 8 @@ -402,6 +318,7 @@ declare namespace inputMethod { * @since 9 * @return :- * @throws {BusinessError} 201 - permissions check fails. + * @throws {BusinessError} 12800003 - input method client error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ @@ -412,6 +329,7 @@ declare namespace inputMethod { * @since 9 * @return :- * @throws {BusinessError} 201 - permissions check fails. + * @throws {BusinessError} 12800003 - input method client error. * @throws {BusinessError} 12800008 - input method manager service error. * @syscap SystemCapability.MiscServices.InputMethodFramework */ diff --git a/api/@ohos.inputmethodengine.d.ts b/api/@ohos.inputmethodengine.d.ts index c5426577ba..00f2ac215d 100644 --- a/api/@ohos.inputmethodengine.d.ts +++ b/api/@ohos.inputmethodengine.d.ts @@ -403,7 +403,7 @@ declare namespace inputMethodEngine { * @return :- * @syscap SystemCapability.MiscServices.InputMethodFramework */ - off(ype: 'setSubtype', callback?: (inputMethodSubtype: InputMethodSubtype) => void): void; + off(type: 'setSubtype', callback?: (inputMethodSubtype: InputMethodSubtype) => void): void; } /** @@ -649,7 +649,7 @@ declare namespace inputMethodEngine { moveCursor(direction: number, callback: AsyncCallback): void; /** - * Move curosr from input method. + * Move cursor from input method. * * @since 9 * @syscap SystemCapability.MiscServices.InputMethodFramework @@ -763,4 +763,4 @@ declare namespace inputMethodEngine { } } -export default inputMethodEngine; \ No newline at end of file +export default inputMethodEngine; -- Gitee From 8195d4a9edccd3da148417413f9e351044227029 Mon Sep 17 00:00:00 2001 From: leiiyb Date: Thu, 17 Nov 2022 09:52:21 +0800 Subject: [PATCH 334/438] modify the spelling error of parameter Signed-off-by: leiiyb --- api/@ohos.multimedia.avsession.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.multimedia.avsession.d.ts b/api/@ohos.multimedia.avsession.d.ts index 060f6b6ed0..401709f398 100644 --- a/api/@ohos.multimedia.avsession.d.ts +++ b/api/@ohos.multimedia.avsession.d.ts @@ -134,7 +134,7 @@ declare namespace avSession { * @param type Registration Type * @param callback Used to handle the session service death event. * @throws {BusinessError} 201 - permission denied - * @throws {BusinessError} 401 - packagearameter check failed + * @throws {BusinessError} 401 - parameter check failed * @throws {BusinessError} {@link #ERR_CODE_SERVICE_EXCEPTION} - server exception * @syscap SystemCapability.Multimedia.AVSession.Core * @since 9 -- Gitee From f2e0c5764baf2794f311d0e7157d98ddc520c43e Mon Sep 17 00:00:00 2001 From: magekkkk Date: Thu, 17 Nov 2022 11:09:19 +0800 Subject: [PATCH 335/438] fix word and decorator issues Signed-off-by: magekkkk --- api/@ohos.multimedia.audio.d.ts | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/api/@ohos.multimedia.audio.d.ts b/api/@ohos.multimedia.audio.d.ts index d273507577..3ecfb1b9bd 100644 --- a/api/@ohos.multimedia.audio.d.ts +++ b/api/@ohos.multimedia.audio.d.ts @@ -18,7 +18,6 @@ import {ErrorCallback, AsyncCallback, Callback} from './basic'; /** * @name audio * @since 7 - * @import import audio from '@ohos.multimedia.audio' */ declare namespace audio { /** @@ -401,6 +400,7 @@ declare namespace audio { * @since 7 * @syscap SystemCapability.Multimedia.Audio.Device * @deprecated since 9 + * @useinstead ohos.multimedia.audio.CommunicationDeviceType.SPEAKER */ SPEAKER = 2, /** @@ -661,7 +661,7 @@ declare namespace audio { */ enum StreamUsage { /** - * Unkown usage. + * Unknown usage. * @since 7 * @syscap SystemCapability.Multimedia.Audio.Core */ @@ -2082,14 +2082,14 @@ declare namespace audio { */ enum ConnectType { /** - * Descript connect type for local device. + * Connect type for local device. * @since 9 * @syscap SystemCapability.Multimedia.Audio.Volume */ CONNECT_TYPE_LOCAL = 1, /** - * Descript virtual type for local device. + * Connect type for distributed device. * @since 9 * @syscap SystemCapability.Multimedia.Audio.Volume */ @@ -2273,42 +2273,42 @@ declare namespace audio { /** * Audio device id. * @since 9 - * @SysCap SystemCapability.Multimedia.Audio.Device + * @syscap SystemCapability.Multimedia.Audio.Device */ readonly id: number; /** * Audio device name. * @since 9 - * @SysCap SystemCapability.Multimedia.Audio.Device + * @syscap SystemCapability.Multimedia.Audio.Device */ readonly name: string; /** * Audio device address. * @since 9 - * @SysCap SystemCapability.Multimedia.Audio.Device + * @syscap SystemCapability.Multimedia.Audio.Device */ readonly address: string; /** * Supported sampling rates. * @since 9 - * @SysCap SystemCapability.Multimedia.Audio.Device + * @syscap SystemCapability.Multimedia.Audio.Device */ readonly sampleRates: Array; /** * Supported channel counts. * @since 9 - * @SysCap SystemCapability.Multimedia.Audio.Device + * @syscap SystemCapability.Multimedia.Audio.Device */ readonly channelCounts: Array; /** * Supported channel masks. * @since 9 - * @SysCap SystemCapability.Multimedia.Audio.Device + * @syscap SystemCapability.Multimedia.Audio.Device */ readonly channelMasks: Array; /** @@ -3189,7 +3189,7 @@ declare namespace audio { */ TONE_TYPE_COMMON_SUPERVISORY_CONGESTION = 102, /** - * Supervisory tone for radio path acknowlegment. + * Supervisory tone for radio path acknowledgment. * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone */ @@ -3219,7 +3219,7 @@ declare namespace audio { */ TONE_TYPE_COMMON_PROPRIETARY_BEEP = 200, /** - * Proprietary tone for positive acknowlegment. + * Proprietary tone for positive acknowledgment. * @since 9 * @syscap SystemCapability.Multimedia.Audio.Tone */ @@ -3246,7 +3246,7 @@ declare namespace audio { */ interface TonePlayer { /** - * Starts player. This method uses an asynchronous callback to return the result. + * Loads tone. This method uses an asynchronous callback to return the result. * @param type Tone type to play. * @param callback Callback used to return the result. * @since 9 @@ -3254,7 +3254,7 @@ declare namespace audio { */ load(type: ToneType, callback: AsyncCallback): void; /** - * Starts tplayerone. This method uses a promise to return the result. + * Loads tone. This method uses a promise to return the result. * @param type Tone type to play. * @return Promise used to return the result. * @since 9 -- Gitee From e9077f69914c14606d662acf5e2db214b8e53e52 Mon Sep 17 00:00:00 2001 From: leiiyb Date: Thu, 17 Nov 2022 11:11:25 +0800 Subject: [PATCH 336/438] modify the spelling error of parameter and header file format Signed-off-by: leiiyb --- api/@ohos.multimedia.avsession.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.multimedia.avsession.d.ts b/api/@ohos.multimedia.avsession.d.ts index 401709f398..7934f63114 100644 --- a/api/@ohos.multimedia.avsession.d.ts +++ b/api/@ohos.multimedia.avsession.d.ts @@ -14,8 +14,8 @@ */ import { AsyncCallback } from './basic'; -import { WantAgent } from '@ohos.wantAgent'; -import KeyEvent from './@ohos.multimodalInput.keyEvent'; +import { WantAgent } from './@ohos.wantAgent'; +import { KeyEvent } from './@ohos.multimodalInput.keyEvent'; import { ElementName } from './bundleManager/elementName'; import image from './@ohos.multimedia.image'; import audio from './@ohos.multimedia.audio'; -- Gitee From 819e2455846cf2879c14058547648f8787c55f99 Mon Sep 17 00:00:00 2001 From: zhaogan Date: Tue, 15 Nov 2022 16:16:24 +0800 Subject: [PATCH 337/438] Issue: #I619YA Description: master: fix alarms of d.ts files Sig: SIG_ApplicaitonFramework Feature or Bugfix: Feature Binary Source: No Signed-off-by: zhaogan --- api/@ohos.bundle.appControl.d.ts | 12 ++--- api/@ohos.bundle.bundleManager.d.ts | 38 +++++++-------- api/@ohos.bundle.d.ts | 19 -------- api/@ohos.bundle.defaultAppManager.d.ts | 52 ++++++++++----------- api/@ohos.bundle.distributedBundle.d.ts | 16 +++---- api/@ohos.bundle.freeInstall.d.ts | 8 ++-- api/@ohos.bundle.innerBundleManager.d.ts | 5 +- api/@ohos.bundle.installer.d.ts | 28 +++++------ api/@ohos.bundle.launcherBundleManager.d.ts | 8 ++-- api/@ohos.distributedBundle.d.ts | 1 - api/@ohos.zlib.d.ts | 10 ---- api/@system.package.d.ts | 5 +- api/bundle/PermissionDef.d.ts | 1 - api/bundle/abilityInfo.d.ts | 1 - api/bundle/applicationInfo.d.ts | 7 +-- api/bundle/bundleInfo.d.ts | 3 -- api/bundle/bundleInstaller.d.ts | 3 -- api/bundle/customizeData.d.ts | 1 - api/bundle/elementName.d.ts | 2 - api/bundle/hapModuleInfo.d.ts | 1 - api/bundle/launcherAbilityInfo.d.ts | 14 ------ api/bundle/moduleInfo.d.ts | 1 - api/bundle/remoteAbilityInfo.d.ts | 6 +-- api/bundle/shortcutInfo.d.ts | 23 ++------- 24 files changed, 96 insertions(+), 169 deletions(-) diff --git a/api/@ohos.bundle.appControl.d.ts b/api/@ohos.bundle.appControl.d.ts index 519affca68..d780a5e477 100644 --- a/api/@ohos.bundle.appControl.d.ts +++ b/api/@ohos.bundle.appControl.d.ts @@ -33,7 +33,7 @@ declare namespace appControl { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 17700005 - The specified appId was not found. + * @throws { BusinessError } 17700005 - The specified app ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.AppControl * @systemapi * @since 9 @@ -49,7 +49,7 @@ declare namespace appControl { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 17700005 - The specified appId was not found. + * @throws { BusinessError } 17700005 - The specified app ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.AppControl * @systemapi * @since 9 @@ -64,7 +64,7 @@ declare namespace appControl { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 17700005 - The specified appId was not found. + * @throws { BusinessError } 17700005 - The specified app ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.AppControl * @systemapi * @since 9 @@ -79,7 +79,7 @@ declare namespace appControl { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 17700005 - The specified appId was not found. + * @throws { BusinessError } 17700005 - The specified app ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.AppControl * @systemapi * @since 9 @@ -94,7 +94,7 @@ declare namespace appControl { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 17700005 - The specified appId was not found. + * @throws { BusinessError } 17700005 - The specified app ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.AppControl * @systemapi * @since 9 @@ -109,7 +109,7 @@ declare namespace appControl { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 17700005 - The specified appId was not found. + * @throws { BusinessError } 17700005 - The specified app ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.AppControl * @systemapi * @since 9 diff --git a/api/@ohos.bundle.bundleManager.d.ts b/api/@ohos.bundle.bundleManager.d.ts index 49c47e6b98..4899df4c73 100644 --- a/api/@ohos.bundle.bundleManager.d.ts +++ b/api/@ohos.bundle.bundleManager.d.ts @@ -575,7 +575,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 17700001 - The specified bundleName is not found. - * @throws { BusinessError } 17700004 - The specified userId is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi @@ -594,7 +594,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 17700001 - The specified bundleName is not found. - * @throws { BusinessError } 17700004 - The specified userId is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi @@ -612,7 +612,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 17700001 - The specified bundleName is not found. - * @throws { BusinessError } 17700004 - The specified userId is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi @@ -631,7 +631,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 17700001 - The specified bundleName is not found. - * @throws { BusinessError } 17700004 - The specified userId is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi @@ -647,7 +647,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @param { AsyncCallback } callback - The callback of getting a list of BundleInfo objects. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. - * @throws { BusinessError } 17700004 - The specified userId is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi * @since 9 @@ -663,7 +663,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @returns { Promise> } Returns a list of BundleInfo objects. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. - * @throws { BusinessError } 17700004 - The specified userId is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi * @since 9 @@ -678,7 +678,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @param { AsyncCallback } callback - The callback of getting a list of ApplicationInfo objects. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. - * @throws { BusinessError } 17700004 - The specified userId is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi * @since 9 @@ -694,7 +694,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @returns { Promise> } Returns a list of ApplicationInfo objects. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. - * @throws { BusinessError } 17700004 - The specified userId is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi * @since 9 @@ -849,7 +849,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 17700001 - The specified bundleName is not found. - * @throws { BusinessError } 17700030 - The specified bundleName does not support cleaning cache files. + * @throws { BusinessError } 17700030 - The specified bundle does not support clearing of cache files. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi * @since 9 @@ -864,7 +864,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 17700001 - The specified bundleName is not found. - * @throws { BusinessError } 17700030 - The specified bundleName does not support cleaning cache files. + * @throws { BusinessError } 17700030 - The specified bundle does not support clearing of cache files. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi * @since 9 @@ -994,7 +994,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. * @throws { BusinessError } 401 - Input parameters check failed. * @throws { BusinessError } 17700001 - The specified bundleName is not found. - * @throws { BusinessError } 17700004 - The specified userId is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi @@ -1012,7 +1012,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. * @throws { BusinessError } 401 - Input parameters check failed. * @throws { BusinessError } 17700001 - The specified bundleName is not found. - * @throws { BusinessError } 17700004 - The specified userId is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi @@ -1031,7 +1031,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.GET_BUNDLE_INFO_PRIVILEGED'. * @throws { BusinessError } 401 - Input parameters check failed. * @throws { BusinessError } 17700001 - The specified bundleName is not found. - * @throws { BusinessError } 17700004 - The specified userId is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi @@ -1048,7 +1048,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @throws { BusinessError } 401 - Input parameters check failed. * @throws { BusinessError } 17700002 - The specified moduleName is not existed. * @throws { BusinessError } 17700003 - The specified abilityName is not existed. - * @throws { BusinessError } 17700024 - The specified metadataName is not existed or the profile is not json-format. + * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @throws { BusinessError } 17700029 - The specified ability is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core @@ -1065,7 +1065,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @throws { BusinessError } 401 - Input parameters check failed. * @throws { BusinessError } 17700002 - The specified moduleName is not existed. * @throws { BusinessError } 17700003 - The specified abilityName is not existed. - * @throws { BusinessError } 17700024 - The specified metadataName is not existed or the profile is not json-format. + * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @throws { BusinessError } 17700029 - The specified ability is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core @@ -1082,7 +1082,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @throws { BusinessError } 401 - Input parameters check failed. * @throws { BusinessError } 17700002 - The specified moduleName is not existed. * @throws { BusinessError } 17700003 - The specified extensionAbilityName not existed. - * @throws { BusinessError } 17700024 - The specified metadataName is not existed or the profile is not json-format. + * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 @@ -1098,7 +1098,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @throws { BusinessError } 401 - Input parameters check failed. * @throws { BusinessError } 17700002 - The specified moduleName is not existed. * @throws { BusinessError } 17700003 - The specified extensionAbilityName not existed. - * @throws { BusinessError } 17700024 - The specified metadataName is not existed or the profile is not json-format. + * @throws { BusinessError } 17700024 - Failed to get the profile because there is no profile in the HAP. * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 @@ -1227,7 +1227,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 17700001 - The specified bundleName is not found. - * @throws { BusinessError } 17700004 - The specified userId is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi @@ -1246,7 +1246,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 17700001 - The specified bundleName is not found. - * @throws { BusinessError } 17700004 - The specified userId is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. * @throws { BusinessError } 17700026 - The specified bundle is disabled. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi diff --git a/api/@ohos.bundle.d.ts b/api/@ohos.bundle.d.ts index 7279d03950..7f0fba3c7d 100644 --- a/api/@ohos.bundle.d.ts +++ b/api/@ohos.bundle.d.ts @@ -27,7 +27,6 @@ import { BundleInstaller } from './bundle/bundleInstaller'; * @name bundle * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA * @deprecated since 9 * @useinstead ohos.bundle.bundleManager */ @@ -37,8 +36,6 @@ declare namespace bundle { * @name BundleFlag * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * @import NA - * @permission NA * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.BundleFlag, ohos.bundle.bundleManager.ApplicationFlag or * ohos.bundle.bundleManager.AbilityFlag @@ -77,8 +74,6 @@ declare namespace bundle { * @name ColorMode * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * @import NA - * @permission NA * @deprecated since 9 */ export enum ColorMode { @@ -91,8 +86,6 @@ declare namespace bundle { * @name GrantStatus * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * @import NA - * @permission NA * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.PermissionGrantState */ @@ -105,8 +98,6 @@ declare namespace bundle { * @name AbilityType * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * @import NA - * @permission NA * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.AbilityType */ @@ -144,8 +135,6 @@ declare namespace bundle { * @name AbilitySubType * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * @import NA - * @permission NA * @deprecated since 9 */ export enum AbilitySubType { @@ -157,8 +146,6 @@ declare namespace bundle { * @name DisplayOrientation * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * @import NA - * @permission NA * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.DisplayOrientation */ @@ -196,8 +183,6 @@ declare namespace bundle { * @name LaunchMode * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * @import NA - * @permission NA * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.LaunchType */ @@ -221,8 +206,6 @@ declare namespace bundle { * @name BundleOptions * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * @import NA - * @permission NA * @deprecated since 9 */ export interface BundleOptions { @@ -238,8 +221,6 @@ declare namespace bundle { * @name InstallErrorCode * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * @import NA - * @permission NA * @deprecated since 9 */ export enum InstallErrorCode{ diff --git a/api/@ohos.bundle.defaultAppManager.d.ts b/api/@ohos.bundle.defaultAppManager.d.ts index 65a065a00c..9dc3842280 100644 --- a/api/@ohos.bundle.defaultAppManager.d.ts +++ b/api/@ohos.bundle.defaultAppManager.d.ts @@ -20,62 +20,62 @@ import { ElementName } from './bundleManager/elementName'; /** * Default application manager. * @namespace defaultAppManager - * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp * @since 9 */ declare namespace defaultAppManager { /** * The constant for application type. * @enum {number} - * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp * @since 9 */ export enum ApplicationType { /** * Default browser identifier. - * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp * @since 9 */ BROWSER = "Web Browser", /** * Default image identifier. - * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp * @since 9 */ IMAGE = "Image Gallery", /** * Default audio identifier. - * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp * @since 9 */ AUDIO = "Audio Player", /** * Default video identifier. - * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp * @since 9 */ VIDEO = "Video Player", /** * Default PDF identifier. - * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp * @since 9 */ PDF = "PDF Viewer", /** * Default word identifier. - * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp * @since 9 */ WORD = "Word Viewer", /** * Default excel identifier. - * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp * @since 9 */ EXCEL = "Excel Viewer", /** * Default PPT identifier. - * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp * @since 9 */ PPT = "PPT Viewer", @@ -87,7 +87,7 @@ declare namespace defaultAppManager { * @param { AsyncCallback } callback - The callback of querying default application result. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. - * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp * @since 9 */ function isDefaultApplication(type: string, callback: AsyncCallback) : void; @@ -98,7 +98,7 @@ declare namespace defaultAppManager { * @returns { Promise } Return true if caller is default application; return false otherwise. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. - * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp * @since 9 */ function isDefaultApplication(type: string) : Promise; @@ -112,10 +112,10 @@ declare namespace defaultAppManager { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 17700004 - The specified user id is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. * @throws { BusinessError } 17700023 - The specified default app does not exist. * @throws { BusinessError } 17700025 - The specified type is invalid. - * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp * @systemapi * @since 9 */ @@ -131,10 +131,10 @@ declare namespace defaultAppManager { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 17700004 - The specified user id is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. * @throws { BusinessError } 17700023 - The specified default app does not exist. * @throws { BusinessError } 17700025 - The specified type is invalid. - * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp * @systemapi * @since 9 */ @@ -150,10 +150,10 @@ declare namespace defaultAppManager { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 17700004 - The specified user id is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. * @throws { BusinessError } 17700025 - The specified type is invalid. - * @throws { BusinessError } 17700028 - The specified ability and type does not match. - * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager + * @throws { BusinessError } 17700028 - The specified ability does not match the type. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp * @systemapi * @since 9 */ @@ -170,10 +170,10 @@ declare namespace defaultAppManager { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 17700004 - The specified user id is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. * @throws { BusinessError } 17700025 - The specified type is invalid. - * @throws { BusinessError } 17700028 - The specified ability and type does not match. - * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager + * @throws { BusinessError } 17700028 - The specified ability does not match the type. + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp * @systemapi * @since 9 */ @@ -188,9 +188,9 @@ declare namespace defaultAppManager { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 17700004 - The specified user id is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. * @throws { BusinessError } 17700025 - The specified type is invalid. - * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp * @systemapi * @since 9 */ @@ -206,9 +206,9 @@ declare namespace defaultAppManager { * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 401 - The parameter check failed. * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 17700004 - The specified user id is not found. + * @throws { BusinessError } 17700004 - The specified user ID is not found. * @throws { BusinessError } 17700025 - The specified type is invalid. - * @syscap SystemCapability.BundleManager.BundleFramework.DefaultAppManager + * @syscap SystemCapability.BundleManager.BundleFramework.DefaultApp * @systemapi * @since 9 */ diff --git a/api/@ohos.bundle.distributedBundle.d.ts b/api/@ohos.bundle.distributedBundle.d.ts index 76c67d47bd..a5b16cec77 100644 --- a/api/@ohos.bundle.distributedBundle.d.ts +++ b/api/@ohos.bundle.distributedBundle.d.ts @@ -35,7 +35,7 @@ declare namespace distributedBundle { * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 17700001 - The specified bundle name is not found. * @throws { BusinessError } 17700003 - The specified ability name is not found. - * @throws { BusinessError } 17700007 - The specified device id is not found. + * @throws { BusinessError } 17700007 - The specified device ID is not found. * @throws { BusinessError } 17700027 - The distributed service is not running. * @syscap SystemCapability.BundleManager.DistributedBundleFramework * @systemapi @@ -53,7 +53,7 @@ declare namespace distributedBundle { * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 17700001 - The specified bundle name is not found. * @throws { BusinessError } 17700003 - The specified ability name is not found. - * @throws { BusinessError } 17700007 - The specified device id is not found. + * @throws { BusinessError } 17700007 - The specified device ID is not found. * @throws { BusinessError } 17700027 - The distributed service is not running. * @syscap SystemCapability.BundleManager.DistributedBundleFramework * @systemapi @@ -71,7 +71,7 @@ declare namespace distributedBundle { * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 17700001 - The specified bundle name is not found. * @throws { BusinessError } 17700003 - The specified ability name is not found. - * @throws { BusinessError } 17700007 - The specified device id is not found. + * @throws { BusinessError } 17700007 - The specified device ID is not found. * @throws { BusinessError } 17700027 - The distributed service is not running. * @syscap SystemCapability.BundleManager.DistributedBundleFramework * @systemapi @@ -89,7 +89,7 @@ declare namespace distributedBundle { * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 17700001 - The specified bundle name is not found. * @throws { BusinessError } 17700003 - The specified ability name is not found. - * @throws { BusinessError } 17700007 - The specified device id is not found. + * @throws { BusinessError } 17700007 - The specified device ID is not found. * @throws { BusinessError } 17700027 - The distributed service is not running. * @syscap SystemCapability.BundleManager.DistributedBundleFramework * @systemapi @@ -108,7 +108,7 @@ declare namespace distributedBundle { * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 17700001 - The specified bundle name is not found. * @throws { BusinessError } 17700003 - The specified ability name is not found. - * @throws { BusinessError } 17700007 - The specified device id is not found. + * @throws { BusinessError } 17700007 - The specified device ID is not found. * @throws { BusinessError } 17700027 - The distributed service is not running. * @syscap SystemCapability.BundleManager.DistributedBundleFramework * @systemapi @@ -127,7 +127,7 @@ declare namespace distributedBundle { * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 17700001 - The specified bundle name is not found. * @throws { BusinessError } 17700003 - The specified ability name is not found. - * @throws { BusinessError } 17700007 - The specified device id is not found. + * @throws { BusinessError } 17700007 - The specified device ID is not found. * @throws { BusinessError } 17700027 - The distributed service is not running. * @syscap SystemCapability.BundleManager.DistributedBundleFramework * @systemapi @@ -146,7 +146,7 @@ declare namespace distributedBundle { * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 17700001 - The specified bundle name is not found. * @throws { BusinessError } 17700003 - The specified ability name is not found. - * @throws { BusinessError } 17700007 - The specified device id is not found. + * @throws { BusinessError } 17700007 - The specified device ID is not found. * @throws { BusinessError } 17700027 - The distributed service is not running. * @syscap SystemCapability.BundleManager.DistributedBundleFramework * @systemapi @@ -165,7 +165,7 @@ declare namespace distributedBundle { * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 17700001 - The specified bundle name is not found. * @throws { BusinessError } 17700003 - The specified ability name is not found. - * @throws { BusinessError } 17700007 - The specified device id is not found. + * @throws { BusinessError } 17700007 - The specified device ID is not found. * @throws { BusinessError } 17700027 - The distributed service is not running. * @syscap SystemCapability.BundleManager.DistributedBundleFramework * @systemapi diff --git a/api/@ohos.bundle.freeInstall.d.ts b/api/@ohos.bundle.freeInstall.d.ts index 1d42117b9b..331dbced29 100644 --- a/api/@ohos.bundle.freeInstall.d.ts +++ b/api/@ohos.bundle.freeInstall.d.ts @@ -88,7 +88,7 @@ declare namespace freeInstall { } /** - * Sets wether to upgrade the module. + * Sets whether to upgrade the module. * @permission ohos.permission.INSTALL_BUNDLE * @param { string } bundleName - Indicates the bundle name of the application. * @param { string } moduleName - Indicates the module name of the application. @@ -106,7 +106,7 @@ declare namespace freeInstall { function setHapModuleUpgradeFlag(bundleName: string, moduleName: string, upgradeFlag: UpgradeFlag, callback: AsyncCallback) : void; /** - * Sets wether to upgrade the module. + * Sets whether to upgrade the module. * @permission ohos.permission.INSTALL_BUNDLE * @param { string } bundleName - Indicates the bundle name of the application. * @param { string } moduleName - Indicates the module name of the application. @@ -158,7 +158,7 @@ declare namespace freeInstall { function isHapModuleRemovable(bundleName: string, moduleName: string): Promise; /** - * Obtains bundlePackInfo based on bundleName and bundleFlags. + * Obtains bundlePackInfo based on bundleName and bundlePackFlags. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { string } bundleName - Indicates the application bundle name to be queried. * @param { BundlePackFlag } bundlePackFlag - Indicates the application bundle pack flag to be queried. @@ -174,7 +174,7 @@ declare namespace freeInstall { function getBundlePackInfo(bundleName: string, bundlePackFlag : BundlePackFlag, callback: AsyncCallback): void; /** - * Obtains bundlePackInfo based on bundleName and bundleFlags. + * Obtains bundlePackInfo based on bundleName and bundlePackFlags. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @param { string } bundleName - Indicates the application bundle name to be queried. * @param { BundlePackFlag } bundlePackFlag - Indicates the application bundle pack flag to be queried. diff --git a/api/@ohos.bundle.innerBundleManager.d.ts b/api/@ohos.bundle.innerBundleManager.d.ts index f9d0bb358e..526e4bee19 100644 --- a/api/@ohos.bundle.innerBundleManager.d.ts +++ b/api/@ohos.bundle.innerBundleManager.d.ts @@ -23,7 +23,6 @@ import { ShortcutInfo } from './bundle/shortcutInfo'; * @name innerBundleManager * @since 8 * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA * @systemapi Hide this for inner system use * @deprecated since 9 * @useinstead ohos.bundle.launcherBundleManager @@ -53,7 +52,7 @@ declare namespace innerBundleManager { * @syscap SystemCapability.BundleManager.BundleFramework * @param type Indicates the command should be implement. * @param LauncherStatusCallback Indicates the callback to be register. - * @return Returns the result or error maeeage. + * @return { string | Promise } Returns the result of register. * @permission ohos.permission.LISTEN_BUNDLE_CHANGE * @systemapi Hide this for inner system use * @deprecated since 9 @@ -68,7 +67,7 @@ declare namespace innerBundleManager { * @since 8 * @syscap SystemCapability.BundleManager.BundleFramework * @param type Indicates the command should be implement. - * @return Returns the result or error maeeage. + * @return { string | Promise } Returns the result of unregister. * @permission ohos.permission.LISTEN_BUNDLE_CHANGE * @systemapi Hide this for inner system use * @deprecated since 9 diff --git a/api/@ohos.bundle.installer.d.ts b/api/@ohos.bundle.installer.d.ts index 854e0b7d31..40ffa7185a 100644 --- a/api/@ohos.bundle.installer.d.ts +++ b/api/@ohos.bundle.installer.d.ts @@ -60,13 +60,13 @@ declare namespace installer { * @param { AsyncCallback } callback - The callback of installing haps result. * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. * @throws { BusinessError } 401 - Input parameters check failed. - * @throws { BusinessError } 17700004 - The specified userId is not existed. - * @throws { BusinessError } 17700010 - To parse file of config.json or module.json failed. - * @throws { BusinessError } 17700011 - To verify signature failed. - * @throws { BusinessError } 17700012 - Invalid hap file path or too large file size. - * @throws { BusinessError } 17700015 - Multiple haps have inconsistent configured information. - * @throws { BusinessError } 17700016 - No disk space left for installation. - * @throws { BusinessError } 17700017 - Downgrade installation is prohibited. + * @throws { BusinessError } 17700004 - The specified user ID is not found. + * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. + * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. + * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. + * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. + * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. + * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. * @throws { BusinessError } 17700101 - The system service is excepted. * @throws { BusinessError } 17700103 - I/O operation is failed. * @syscap SystemCapability.BundleManager.BundleFramework.Core @@ -79,11 +79,11 @@ declare namespace installer { * Uninstall an application. * @permission ohos.permission.INSTALL_BUNDLE * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled. - * @param { InstallParam } installParam - Indicates other parameters required for the uninstallation. + * @param { InstallParam } installParam - Indicates other parameters required for the uninstall. * @param { AsyncCallback } callback - The callback of uninstalling application result. * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. * @throws { BusinessError } 401 - Input parameters check failed. - * @throws { BusinessError } 17700004 - The specified userId is not existed. + * @throws { BusinessError } 17700004 - The specified user ID is not found. * @throws { BusinessError } 17700020 - The specified bundle is pre-installed bundle which cannot be uninstalled. * @throws { BusinessError } 17700101 - The system service is excepted. * @syscap SystemCapability.BundleManager.BundleFramework.Core @@ -91,16 +91,16 @@ declare namespace installer { * @since 9 */ uninstall(bundleName: string, installParam: InstallParam, callback : AsyncCallback) : void; - + /** * recover an application. * @permission ohos.permission.INSTALL_BUNDLE * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled. - * @param { InstallParam } installParam - Indicates other parameters required for the uninstallation. - * @param { AsyncCallback } callback - The callback of recoverring application result. + * @param { InstallParam } installParam - Indicates other parameters required for the uninstall. + * @param { AsyncCallback } callback - The callback of recovering application result. * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. * @throws { BusinessError } 401 - Input parameters check failed. - * @throws { BusinessError } 17700004 - The specified userId is not existed. + * @throws { BusinessError } 17700004 - The specified user ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @systemapi * @since 9 @@ -122,7 +122,7 @@ declare namespace installer { * @since 9 */ moduleName: string; - + /** * Indicates the hash value * @syscap SystemCapability.BundleManager.BundleFramework.Core diff --git a/api/@ohos.bundle.launcherBundleManager.d.ts b/api/@ohos.bundle.launcherBundleManager.d.ts index 11759af3a6..1553297a6e 100644 --- a/api/@ohos.bundle.launcherBundleManager.d.ts +++ b/api/@ohos.bundle.launcherBundleManager.d.ts @@ -36,7 +36,7 @@ declare namespace launcherBundleManager { * @throws {BusinessError} 401 - The parameter check failed. * @throws {BusinessError} 801 - Capability not support. * @throws {BusinessError} 17700001 - The specified bundle name is not found. - * @throws {BusinessError} 17700004 - The specified user id is not found. + * @throws {BusinessError} 17700004 - The specified user ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Launcher * @systemapi * @since 9 @@ -53,7 +53,7 @@ declare namespace launcherBundleManager { * @throws {BusinessError} 401 - The parameter check failed. * @throws {BusinessError} 801 - Capability not support. * @throws {BusinessError} 17700001 - The specified bundle name is not found. - * @throws {BusinessError} 17700004 - The specified user id is not found. + * @throws {BusinessError} 17700004 - The specified user ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Launcher * @systemapi * @since 9 @@ -68,7 +68,7 @@ declare namespace launcherBundleManager { * @throws {BusinessError} 201 - Verify permission denied. * @throws {BusinessError} 401 - The parameter check failed. * @throws {BusinessError} 801 - Capability not support. - * @throws {BusinessError} 17700004 - The specified user id is not found. + * @throws {BusinessError} 17700004 - The specified user ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Launcher * @systemapi * @since 9 @@ -83,7 +83,7 @@ declare namespace launcherBundleManager { * @throws {BusinessError} 201 - Verify permission denied. * @throws {BusinessError} 401 - The parameter check failed. * @throws {BusinessError} 801 - Capability not support. - * @throws {BusinessError} 17700004 - The specified user id is not found. + * @throws {BusinessError} 17700004 - The specified user ID is not found. * @syscap SystemCapability.BundleManager.BundleFramework.Launcher * @systemapi * @since 9 diff --git a/api/@ohos.distributedBundle.d.ts b/api/@ohos.distributedBundle.d.ts index a00959bcb3..0edb99e97f 100644 --- a/api/@ohos.distributedBundle.d.ts +++ b/api/@ohos.distributedBundle.d.ts @@ -22,7 +22,6 @@ import { RemoteAbilityInfo } from './bundle/remoteAbilityInfo'; * @name distributedBundle * @since 8 * @syscap SystemCapability.BundleManager.DistributedBundleFramework - * @permission NA * @systemapi Hide this for inner system use * @deprecated since 9 * @useinstead ohos.bundle.distributeBundle diff --git a/api/@ohos.zlib.d.ts b/api/@ohos.zlib.d.ts index 6aca560c79..9230b0f9c4 100644 --- a/api/@ohos.zlib.d.ts +++ b/api/@ohos.zlib.d.ts @@ -20,8 +20,6 @@ declare namespace zlib { * @name ErrorCode * @since 7 * @syscap SystemCapability.BundleManager.Zlib - * @import NA - * @permission NA * @deprecated since 9 */ export enum ErrorCode { @@ -33,8 +31,6 @@ declare namespace zlib { * @name CompressLevel * @since 7 * @syscap SystemCapability.BundleManager.Zlib - * @import NA - * @permission NA */ export enum CompressLevel { COMPRESS_LEVEL_NO_COMPRESSION = 0, @@ -47,8 +43,6 @@ declare namespace zlib { * @name CompressStrategy * @since 7 * @syscap SystemCapability.BundleManager.Zlib - * @import NA - * @permission NA */ export enum CompressStrategy { COMPRESS_STRATEGY_DEFAULT_STRATEGY = 0, @@ -62,8 +56,6 @@ declare namespace zlib { * @name MemLevel * @since 7 * @syscap SystemCapability.BundleManager.Zlib - * @import NA - * @permission NA */ export enum MemLevel { MEM_LEVEL_MIN = 1, @@ -75,8 +67,6 @@ declare namespace zlib { * @name Options * @since 7 * @syscap SystemCapability.BundleManager.Zlib - * @import NA - * @permission NA */ interface Options { level?: CompressLevel; diff --git a/api/@system.package.d.ts b/api/@system.package.d.ts index 548e4ec621..130b0a3979 100644 --- a/api/@system.package.d.ts +++ b/api/@system.package.d.ts @@ -55,7 +55,7 @@ export interface CheckPackageHasInstalledOptions { fail?: (data: any, code: number) => void; /** - * Called when the excution is completed. + * Called when the execution is completed. * @syscap SystemCapability.BundleManager.BundleFramework * @since 3 */ @@ -65,12 +65,11 @@ export interface CheckPackageHasInstalledOptions { /** * @syscap SystemCapability.BundleManager.BundleFramework * @since 3 - * @import package from '@system.package'; * @deprecated since 9 */ export default class Package { /** - * Checks whethers an application exists, or whether a native application has been installed. + * Checks whether an application exists, or whether a native application has been installed. * @param options Options * @syscap SystemCapability.BundleManager.BundleFramework * @deprecated since 9 diff --git a/api/bundle/PermissionDef.d.ts b/api/bundle/PermissionDef.d.ts index 0f5f91ba38..fcb7d7a70d 100644 --- a/api/bundle/PermissionDef.d.ts +++ b/api/bundle/PermissionDef.d.ts @@ -17,7 +17,6 @@ * @name Indicates the defined permission details in file config.json * @since 8 * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA * @systemapi * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.PermissionDef diff --git a/api/bundle/abilityInfo.d.ts b/api/bundle/abilityInfo.d.ts index 582105fe21..a37c9d8b43 100644 --- a/api/bundle/abilityInfo.d.ts +++ b/api/bundle/abilityInfo.d.ts @@ -21,7 +21,6 @@ import bundle from './../@ohos.bundle'; * @name Obtains configuration information about an ability * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.AbilityInfo */ diff --git a/api/bundle/applicationInfo.d.ts b/api/bundle/applicationInfo.d.ts index 6b24191948..8f9f27ded1 100644 --- a/api/bundle/applicationInfo.d.ts +++ b/api/bundle/applicationInfo.d.ts @@ -20,7 +20,6 @@ import { CustomizeData } from './customizeData'; * @name Obtains configuration information about an application * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.ApplicationInfo */ @@ -71,7 +70,8 @@ export interface ApplicationInfo { * @default Indicates the label id of the application * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * @deprecated since 9, use labelIndex + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager.ApplicationInfo.labelIndex */ readonly labelId: string; @@ -86,7 +86,8 @@ export interface ApplicationInfo { * @default Indicates the icon id of the application * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * @deprecated since 9, use iconIndex + * @deprecated since 9 + * @useinstead ohos.bundle.bundleManager.ApplicationInfo.iconIndex */ readonly iconId: string; diff --git a/api/bundle/bundleInfo.d.ts b/api/bundle/bundleInfo.d.ts index fe6cf36753..de3c304a3f 100644 --- a/api/bundle/bundleInfo.d.ts +++ b/api/bundle/bundleInfo.d.ts @@ -21,7 +21,6 @@ import { HapModuleInfo } from './hapModuleInfo'; * @name The scene which is used * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.UsedScene * @@ -46,7 +45,6 @@ export interface UsedScene { * @name Indicates the required permissions details defined in file config.json * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.ReqPermissionDetail */ @@ -77,7 +75,6 @@ export interface ReqPermissionDetail { * @name Obtains configuration information about a bundle * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.BundleInfo */ diff --git a/api/bundle/bundleInstaller.d.ts b/api/bundle/bundleInstaller.d.ts index 337ad6bd27..95997273a7 100644 --- a/api/bundle/bundleInstaller.d.ts +++ b/api/bundle/bundleInstaller.d.ts @@ -20,7 +20,6 @@ import bundle from './../@ohos.bundle'; * @name Provides parameters required for installing or uninstalling an application. * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA * @systemapi Hide this for inner system use * @deprecated since 9 * @useinstead ohos.bundle.installer#InstallParam @@ -58,7 +57,6 @@ export interface InstallParam { * @name Indicates the install or uninstall status * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA * @systemapi Hide this for inner system use * @deprecated since 9 */ @@ -85,7 +83,6 @@ export interface InstallStatus { * @name Offers install, upgrade, and remove bundles on the devices. * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA * @systemapi Hide this for inner system use * @deprecated since 9 * @useinstead ohos.bundle.installer#BundleInstaller diff --git a/api/bundle/customizeData.d.ts b/api/bundle/customizeData.d.ts index 762a082e1e..8eb7c2f5fa 100644 --- a/api/bundle/customizeData.d.ts +++ b/api/bundle/customizeData.d.ts @@ -17,7 +17,6 @@ * @name Indicates the custom metadata * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.Metadata * diff --git a/api/bundle/elementName.d.ts b/api/bundle/elementName.d.ts index 605f8e19ef..662559af6f 100644 --- a/api/bundle/elementName.d.ts +++ b/api/bundle/elementName.d.ts @@ -20,8 +20,6 @@ * @name Contains basic Ability information, which uniquely identifies an ability * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * - * @permission N/A * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.ElementName */ diff --git a/api/bundle/hapModuleInfo.d.ts b/api/bundle/hapModuleInfo.d.ts index cf1c3282e5..c544a57d25 100644 --- a/api/bundle/hapModuleInfo.d.ts +++ b/api/bundle/hapModuleInfo.d.ts @@ -19,7 +19,6 @@ import { AbilityInfo } from "./abilityInfo"; * @name Obtains configuration information about an module. * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.HapModuleInfo */ diff --git a/api/bundle/launcherAbilityInfo.d.ts b/api/bundle/launcherAbilityInfo.d.ts index 31438d20dd..62bfc257a5 100644 --- a/api/bundle/launcherAbilityInfo.d.ts +++ b/api/bundle/launcherAbilityInfo.d.ts @@ -23,8 +23,6 @@ import { ElementName } from './elementName' * @name Contains basic launcher Ability information, which uniquely identifies an LauncherAbilityInfo * @since 8 * @syscap SystemCapability.BundleManager.BundleFramework - * - * @permission N/A * @systemapi Hide this for inner system use * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.LauncherAbilityInfo @@ -34,8 +32,6 @@ export interface LauncherAbilityInfo { * @name Obtains application info information about an launcher ability. * @since 8 * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * */ readonly applicationInfo: ApplicationInfo; @@ -43,8 +39,6 @@ export interface LauncherAbilityInfo { * @name Obtains element name about an launcher ability. * @since 8 * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * */ readonly elementName : ElementName; @@ -52,8 +46,6 @@ export interface LauncherAbilityInfo { * @name Obtains labelId about an launcher ability. * @since 8 * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * */ readonly labelId: number; @@ -61,8 +53,6 @@ export interface LauncherAbilityInfo { * @name Obtains iconId about an launcher ability. * @since 8 * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * */ readonly iconId: number; @@ -70,8 +60,6 @@ export interface LauncherAbilityInfo { * @name Obtains userId about an launcher ability. * @since 8 * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * */ readonly userId: number; @@ -79,8 +67,6 @@ export interface LauncherAbilityInfo { * @name Obtains installTime about an launcher ability. * @since 8 * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA - * */ readonly installTime : number; } diff --git a/api/bundle/moduleInfo.d.ts b/api/bundle/moduleInfo.d.ts index 2f23150f40..0f504cb0bb 100644 --- a/api/bundle/moduleInfo.d.ts +++ b/api/bundle/moduleInfo.d.ts @@ -17,7 +17,6 @@ * @name Stores module information about an application. * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA * @deprecated since 9 * @useinstead ohos.bundle.bundleManager.HapModuleInfo */ diff --git a/api/bundle/remoteAbilityInfo.d.ts b/api/bundle/remoteAbilityInfo.d.ts index 176c28d969..59e0630bd0 100644 --- a/api/bundle/remoteAbilityInfo.d.ts +++ b/api/bundle/remoteAbilityInfo.d.ts @@ -20,8 +20,6 @@ import { ElementName } from './elementName'; * @since 8 * @syscap SystemCapability.BundleManager.DistributedBundleFramework * @systemapi - * - * @permission N/A * @deprecated since 9 * @useinstead ohos.bundle.distributedBundle.RemoteAbilityInfo */ @@ -32,14 +30,14 @@ export interface RemoteAbilityInfo { * @syscap SystemCapability.BundleManager.DistributedBundleFramework */ readonly elementName: ElementName; - + /** * @default Indicates the label of the ability * @since 8 * @syscap SystemCapability.BundleManager.DistributedBundleFramework */ readonly label: string; - + /** * @default Indicates the icon of the ability * @since 8 diff --git a/api/bundle/shortcutInfo.d.ts b/api/bundle/shortcutInfo.d.ts index cc3bf43326..747cebec72 100644 --- a/api/bundle/shortcutInfo.d.ts +++ b/api/bundle/shortcutInfo.d.ts @@ -18,104 +18,91 @@ * bundle name, target module name and ability class name. * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA * @systemapi Hide this for inner system use * @deprecated since 9 * @useinstead ohos.bundle.launcherBundleManager.ShortcutWant */ export interface ShortcutWant{ /** - * @default Indicates the target bundle of the shortcut want * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework */ readonly targetBundle: string; /** - * @default Indicates the target class of the shortcut want * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework */ readonly targetClass: string; } - + /** * @name Provides information about a shortcut, including the shortcut ID and label. * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * @permission NA * @deprecated since 9 * @useinstead ohos.bundle.launcherBundleManager.ShortcutInfo */ export interface ShortcutInfo { /** - * @default Indicates the ID of the application to which this shortcut belongs * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * + * */ readonly id: string; /** - * @default Indicates the name of the bundle containing the shortcut * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework */ readonly bundleName: string; /** - * @default Indicates the host ability of the shortcut * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework */ readonly hostAbility: string; /** - * @default Indicates the icon of the shortcut * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework */ readonly icon: string; /** - * @default Indicates the icon id of the shortcut * @since 8 * @syscap SystemCapability.BundleManager.BundleFramework */ readonly iconId: number; /** - * @default Indicates the label of the shortcut * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework */ readonly label: string; /** - * @default Indicates the label id of the shortcut * @since 8 * @syscap SystemCapability.BundleManager.BundleFramework */ readonly labelId: number; /** - * @default Indicates the disableMessage of the shortcut * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework */ readonly disableMessage: string; /** - * @default Indicates the wants of the shortcut * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework */ readonly wants: Array; /** - * @default Indicates whether the shortcut is static + * @default false * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework */ readonly isStatic?: boolean /** - * @default Indicates whether the shortcut is homeshortcut + * @default false * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework */ readonly isHomeShortcut?: boolean; /** - * @default Indicates whether the shortcut is enabled + * @default false * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework */ -- Gitee From b3d7dd8b9c71ce4677af3654e158d556f178271b Mon Sep 17 00:00:00 2001 From: zaki Date: Wed, 16 Nov 2022 19:51:14 +0800 Subject: [PATCH 338/438] fix jsdoc check problems in accessibility Signed-off-by: zaki Change-Id: I5dd0f98fdc4f650447595448a5f37272a04f6a28 --- api/@ohos.accessibility.d.ts | 17 ----------------- ...plication.AccessibilityExtensionAbility.d.ts | 2 +- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/api/@ohos.accessibility.d.ts b/api/@ohos.accessibility.d.ts index 8b5b372e0a..5ca5f8250e 100644 --- a/api/@ohos.accessibility.d.ts +++ b/api/@ohos.accessibility.d.ts @@ -21,7 +21,6 @@ import { Callback } from './basic'; * @name Accessibility * @since 7 * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @import basic,abilityInfo */ declare namespace accessibility { /** @@ -49,12 +48,6 @@ declare namespace accessibility { /** * The type of the accessibility event. - * @note windowsChange - * @note windowContentChange - * @note windowStateChange - * @note announcement - * @note notificationChange - * @note textTraversedAtMove * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ @@ -64,7 +57,6 @@ declare namespace accessibility { /** * The change type of the windowsChange event. - * @note It's used when received the {@code windowsChange} event. * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ @@ -79,12 +71,6 @@ declare namespace accessibility { /** * The ability that accessibility subsystem support. - * @note touchExplorer: Describes the capability to talkback. - * magnification: Describes the capability to request to control the display magnification. - * gesturesSimulation: Describes the capability to request to simulate the gesture. - * windowContent: Describes the capability to search for the content of the active window. - * filterKeyEvents: Describes the capability to request to filter key events. - * fingerprintGesture: Describes the capability to request to fingerprint gesture. * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ @@ -92,7 +78,6 @@ declare namespace accessibility { /** * The granularity of text move. - * @note The granularity of text move. * @syscap SystemCapability.BarrierFree.Accessibility.Core * @since 7 */ @@ -416,7 +401,6 @@ declare namespace accessibility { /** * The content list. - * @note * @since 7 */ contents?: Array; @@ -447,7 +431,6 @@ declare namespace accessibility { /** * The total of the items. - * @note talkback used it when scroll. * @since 7 */ itemCount?: number; diff --git a/api/@ohos.application.AccessibilityExtensionAbility.d.ts b/api/@ohos.application.AccessibilityExtensionAbility.d.ts index ad77b73993..7a6c8527d3 100644 --- a/api/@ohos.application.AccessibilityExtensionAbility.d.ts +++ b/api/@ohos.application.AccessibilityExtensionAbility.d.ts @@ -67,7 +67,7 @@ declare interface AccessibilityEvent { } /** - * Indicates the gusture type. + * Indicates the gesture type. * @since 9 * @syscap SystemCapability.BarrierFree.Accessibility.Core */ -- Gitee From bc77536d905cec4e9b9b9310760d403e111b055c Mon Sep 17 00:00:00 2001 From: wangkai Date: Thu, 17 Nov 2022 15:10:55 +0800 Subject: [PATCH 339/438] =?UTF-8?q?d.ts=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangkai --- api/@ohos.data.distributedData.d.ts | 52 +++++++++++++------------- api/@ohos.data.distributedKVStore.d.ts | 26 ++++++------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/api/@ohos.data.distributedData.d.ts b/api/@ohos.data.distributedData.d.ts index 9231cbc643..bef7ec29a3 100644 --- a/api/@ohos.data.distributedData.d.ts +++ b/api/@ohos.data.distributedData.d.ts @@ -16,7 +16,7 @@ import { AsyncCallback, Callback } from './basic'; /** - * Providers interfaces to creat a {@link KVManager} istances. + * Providers interfaces to creat a {@link KVManager} instance. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 7 * @deprecated since 9 @@ -202,7 +202,7 @@ declare namespace distributedData { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.ValueTypeB#YTE_ARRAY + * @useinstead ohos.data.distributedKVStore.ValueType#BYTE_ARRAY * */ BYTE_ARRAY = 3, @@ -410,7 +410,7 @@ declare namespace distributedData { */ enum KVStoreType { /** - * Device-collaborated database, as specified by {@code DeviceKVStore} + * Device-collaboration database, as specified by {@code DeviceKVStore} * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 7 * @deprecated since 9 @@ -522,7 +522,7 @@ declare namespace distributedData { */ interface Options { /** - * Indicates whether to createa database when the database file does not exist + * Indicates whether to create a database when the database file does not exist * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -555,7 +555,7 @@ declare namespace distributedData { */ autoSync?: boolean; /** - * Indicates setting the databse type + * Indicates setting the database type * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -628,7 +628,7 @@ declare namespace distributedData { */ mode: number; /** - * Indicates the skipsize of schema. + * Indicates the skip size of schema. * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 @@ -677,7 +677,7 @@ declare namespace distributedData { */ appendChild(child: FieldNode): boolean; /** - * Indicates the default value of fieldnode. + * Indicates the default value of field node. * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 @@ -788,9 +788,9 @@ declare namespace distributedData { /** * Moves the read position by a relative offset to the current position. * - * @param offset Indicates the relative offset to the current position. Anegative offset indicates moving backwards, and a - * positive offset indicates moving forewards. Forexample, if the current position is entry 1 and thisoffset is 2, - * the destination position will be entry 3; ifthe current position is entry 3 and this offset is -2, + * @param offset Indicates the relative offset to the current position. A negative offset indicates moving backwards, and a + * positive offset indicates moving forwards. For example, if the current position is entry 1 and this offset is 2, + * the destination position will be entry 3; if the current position is entry 3 and this offset is -2, * the destination position will be entry 1. The valid final position after moving forwards starts with 0. If the * final position is invalid, false will be returned. * @returns Returns true if the operation succeeds; return false otherwise. @@ -1193,8 +1193,8 @@ declare namespace distributedData { * Add device ID key prefix.Used by {@code DeviceKVStore}. * * @param deviceId Specify device id to query from. - * @return Returns the {@code Query} object with device ID prefix added. - * @throw Throws this exception if input is invalid. + * @returns Returns the {@code Query} object with device ID prefix added. + * @throws Throws this exception if input is invalid. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1202,12 +1202,12 @@ declare namespace distributedData { */ deviceId(deviceId:string):Query; /** - * Get a String that repreaents this {@code Query}. + * Get a String that represents this {@code Query}. * *

          The String would be parsed to DB query format. * The String length should be no longer than 500kb. * - * @return String representing this {@code Query}. + * @returns String representing this {@code Query}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 @@ -1283,7 +1283,7 @@ declare namespace distributedData { on(event: 'dataChange', type: SubscribeType, listener: Callback): void; /** - * Subscribes from the {@code KvStore} database based on the specified subscribeType and {@code KvStoreObserver}. + * Subscribe the {@code KvStore} database based on the specified subscribeType and {@code KvStoreObserver}. * * @throws Throws this exception if any of the following errors * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, @@ -1296,7 +1296,7 @@ declare namespace distributedData { on(event: 'syncComplete', syncCallback: Callback>): void; /** - * Unsubscribes from the {@code KvStore} database based on the specified subscribeType and {@code KvStoreObserver}. + * Unsubscribe the {@code KvStore} database based on the specified subscribeType and {@code KvStoreObserver}. * * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. * @throws Throws this exception if any of the following errors @@ -1539,7 +1539,7 @@ declare namespace distributedData { removeDeviceData(deviceId: string): Promise; /** - * Synchronizes the database to the specified devices with the specified delay allowed. + * Synchronize the database to the specified devices with the specified delay allowed. * * @param deviceIds Indicates the list of devices to which to synchronize the database. * @param mode Indicates the synchronization mode. The value can be {@code PUSH}, {@code PULL}, or {@code PUSH_PULL}. @@ -1556,7 +1556,7 @@ declare namespace distributedData { sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; /** - * Register Synchronizes SingleKvStore databases callback. + * Register a SingleKvStore database synchronization callback. *

          Sync result is returned through asynchronous callback. * * @param syncCallback Indicates the callback used to send the synchronization result to the caller. @@ -1569,7 +1569,7 @@ declare namespace distributedData { on(event: 'syncComplete', syncCallback: Callback>): void; /** - * UnRegister Synchronizes SingleKvStore databases callback. + * UnRegister the SingleKvStore database synchronization callback. * * @throws Throws this exception if no {@code SingleKvStore} database is available. * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -1627,7 +1627,7 @@ declare namespace distributedData { * * @param deviceId Indicates the device to be queried. * @param key Indicates the key of the value to be queried. - * @return Returns the value matching the given criteria. + * @returns Returns the value matching the given criteria. * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}, and {@code KEY_NOT_FOUND}. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore @@ -1793,7 +1793,7 @@ declare namespace distributedData { removeDeviceData(deviceId: string): Promise; /** - * Synchronizes {@code DeviceKVStore} databases. + * Synchronize the {@code DeviceKVStore} databases. * *

          This method returns immediately and sync result will be returned through asynchronous callback. * @@ -1812,7 +1812,7 @@ declare namespace distributedData { sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; /** - * Register Synchronizes DeviceKVStore databases callback. + * Register a DeviceKVStore database synchronization callback. * *

          Sync result is returned through asynchronous callback. * @@ -1826,7 +1826,7 @@ declare namespace distributedData { on(event: 'syncComplete', syncCallback: Callback>): void; /** - * UnRegister Synchronizes DeviceKVStore databases callback. + * UnRegister the DeviceKVStore database synchronization callback. * * @throws Throws this exception if no DeviceKVStore database is available. * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -1845,7 +1845,7 @@ declare namespace distributedData { * * @param config Indicates the {@link KVStore} configuration information, * including the user information and package name. - * @return Returns the {@code KVManager} instance. + * @returns Returns the {@code KVManager} instance. * @throws Throws exception if input is invalid. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 @@ -1873,7 +1873,7 @@ declare namespace distributedData { * @param storeId Identifies the {@code KVStore} database. * The value of this parameter must be unique for the same application, * and different applications can share the same value. - * @return Returns a {@code KVStore}, or {@code SingleKVStore}. + * @returns Returns a {@code KVStore}, or {@code SingleKVStore}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -1895,7 +1895,7 @@ declare namespace distributedData { * * @param kvStore Indicates the {@code KvStore} database to close. * @throws Throws this exception if any of the following errors - * occurs:{@code INVALID_ARGUMENT}, {@code ERVER_UNAVAILABLE}, + * occurs:{@code INVALID_ARGUMENT}, {@code SERVER_UNAVAILABLE}, * {@code STORE_NOT_OPEN}, {@code STORE_NOT_FOUND}, {@code DB_ERROR}, * {@code PERMISSION_DENIED}, and {@code IPC_ERROR}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core diff --git a/api/@ohos.data.distributedKVStore.d.ts b/api/@ohos.data.distributedKVStore.d.ts index 7eb0434464..3a47cffe72 100644 --- a/api/@ohos.data.distributedKVStore.d.ts +++ b/api/@ohos.data.distributedKVStore.d.ts @@ -19,7 +19,7 @@ import dataSharePredicates from './@ohos.data.dataSharePredicates'; import Context from './application/Context'; /** - * Provider interfaces to create a {@link KVManager} istances. + * Provider interfaces to create a {@link KVManager} instance. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ @@ -41,7 +41,7 @@ declare namespace distributedKVStore { /** * Indicates the ability or hap context * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @Note: if swap the area, you should close all the KV store and use the new Context to create the KVManager + * if swap the area, you should close all the KV store and use the new Context to create the KVManager * @since 9 */ context: Context; @@ -293,7 +293,7 @@ declare namespace distributedKVStore { */ enum KVStoreType { /** - * Device-collaborated database, as specified by {@code DeviceKVStore} + * Device-collaboration database, as specified by {@code DeviceKVStore} * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ @@ -576,9 +576,9 @@ declare namespace distributedKVStore { /** * Moves the read position by a relative offset to the current position. * - * @param {number} offset - Indicates the relative offset to the current position. Anegative offset indicates moving - * backwards, and a positive offset indicates moving forewards. Forexample, if the current position is entry 1 and - * thisoffset is 2, the destination position will be entry 3; ifthe current position is entry 3 and this offset is -2, + * @param {number} offset - Indicates the relative offset to the current position. A negative offset indicates moving + * backwards, and a positive offset indicates moving forwards. For example, if the current position is entry 1 and + * this offset is 2, the destination position will be entry 3; if the current position is entry 3 and this offset is -2, * the destination position will be entry 1. The valid final position after moving forwards starts with 0. If the * final position is invalid, false will be returned. * @returns Returns true if the operation succeeds; return false otherwise. @@ -918,19 +918,19 @@ declare namespace distributedKVStore { * Add device ID key prefix.Used by {@code DeviceKVStore}. * * @param {string} deviceId - Specify device id to query from. - * @return Returns the {@code Query} object with device ID prefix added. + * @returns Returns the {@code Query} object with device ID prefix added. * @throws {BusinessError} 401 - if parameter check failed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ deviceId(deviceId:string):Query; /** - * Get a String that repreaents this {@code Query}. + * Get a String that represents this {@code Query}. * *

          The String would be parsed to DB query format. * The String length should be no longer than 500kb. * - * @return String representing this {@code Query}. + * @returns String representing this {@code Query}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1607,7 +1607,7 @@ declare namespace distributedKVStore { setSyncParam(defaultAllowedDelayMs: number): Promise; /** - * Synchronizes the database to the specified devices with the specified delay allowed. + * Synchronize the database to the specified devices with the specified delay allowed. * * @permission ohos.permission.DISTRIBUTED_DATASYNC * @param {string[]} deviceIds - Indicates the list of devices to which to synchronize the database. @@ -1623,7 +1623,7 @@ declare namespace distributedKVStore { sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void /** - * Synchronizes the database to the specified devices with the specified delay allowed. + * Synchronize the database to the specified devices with the specified delay allowed. * * @permission ohos.permission.DISTRIBUTED_DATASYNC * @param {string[]} deviceIds - Indicates the list of devices to which to synchronize the database. @@ -1733,7 +1733,7 @@ declare namespace distributedKVStore { * @param {string} key - Indicates the key of the value to be queried. * @param {AsyncCallback} callback - * {boolean|string|number|Uint8Array}: the returned value specified by the deviceId and key. - * @return Returns the value matching the given criteria. + * @returns Returns the value matching the given criteria. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100004 - if the data not exist when query data. @@ -1750,7 +1750,7 @@ declare namespace distributedKVStore { * @param {string} key - Indicates the key of the value to be queried. * @returns {Promise} * {Uint8Array|string|boolean|number}: the returned value specified by the deviceId and key. - * @return Returns the value matching the given criteria. + * @returns Returns the value matching the given criteria. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100004 - if the data not exist when query data. -- Gitee From 491051310cd230fc72ec0bbf9ff6c063af62f0cb Mon Sep 17 00:00:00 2001 From: wangdongqi Date: Thu, 17 Nov 2022 15:18:21 +0800 Subject: [PATCH 340/438] Signed-off-by: wangdongqi Changes to be committed: --- api/@ohos.wallpaper.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.wallpaper.d.ts b/api/@ohos.wallpaper.d.ts index 09e94670c1..6cf00f33d0 100644 --- a/api/@ohos.wallpaper.d.ts +++ b/api/@ohos.wallpaper.d.ts @@ -76,7 +76,7 @@ declare namespace wallpaper { /** * Obtains a file of the wallpaper of the specified type. Returns the file descriptor. * @param wallpaperType Indicates the wallpaper type. - * @permission ohos.permission.GET_WALLPAPER. + * @permission ohos.permission.GET_WALLPAPER * ohos.permission.READ_USER_STORAGE. * @returns { Promise } the Promise returned by the function. * @since 8 @@ -89,7 +89,7 @@ declare namespace wallpaper { /** * Obtains a file of the wallpaper of the specified type. Returns the file descriptor. * @param wallpaperType Indicates the wallpaper type. - * @permission ohos.permission.GET_WALLPAPER. + * @permission ohos.permission.GET_WALLPAPER * @returns { number } the number returned by the function. * @throws {BusinessError} 401 - parameter error. * @throws {BusinessError} 201 - permission denied. -- Gitee From 31afa3ee35e3746a374b52d8b43b119c466c9ad1 Mon Sep 17 00:00:00 2001 From: yichengzhao Date: Thu, 17 Nov 2022 15:22:06 +0800 Subject: [PATCH 341/438] fix d.ts Signed-off-by: yichengzhao Change-Id: I40c204d968a25d404fcb2ab67a647193f5678022 --- api/@ohos.systemParameterV9.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.systemParameterV9.d.ts b/api/@ohos.systemParameterV9.d.ts index b4fee996db..aee1b8584e 100755 --- a/api/@ohos.systemParameterV9.d.ts +++ b/api/@ohos.systemParameterV9.d.ts @@ -127,4 +127,4 @@ declare namespace systemParameterV9 { function set(key: string, value: string): Promise; } -export default systemParameter; +export default systemParameterV9; -- Gitee From a9928f436ae6bd18181a69299b1f006bb91bda15 Mon Sep 17 00:00:00 2001 From: wanghang Date: Thu, 17 Nov 2022 07:57:39 +0000 Subject: [PATCH 342/438] IssueNo:#I61P3M Description:fix jsdoc Sig:SIG_ApplicaitonFramework Feature or Bugfix:Feature Binary Source:No Signed-off-by: wanghang Change-Id: I6d3b8c4aff15426b6742caa056eacdd7563716ef --- api/@ohos.bundle.bundleManager.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.bundle.bundleManager.d.ts b/api/@ohos.bundle.bundleManager.d.ts index 4899df4c73..dc16be6f29 100644 --- a/api/@ohos.bundle.bundleManager.d.ts +++ b/api/@ohos.bundle.bundleManager.d.ts @@ -159,7 +159,7 @@ import * as _ExtensionAbilityInfo from './bundleManager/extensionAbilityInfo'; */ GET_ABILITY_INFO_DEFAULT = 0x00000000, /** - * Used to obtain the abilityInfo containing disabled abilityInfo. + * Used to obtain the abilityInfo containing permission. * @syscap SystemCapability.BundleManager.BundleFramework.Core * @since 9 */ -- Gitee From 4a8c4de3a525736febd2e79c6882810eb47376dd Mon Sep 17 00:00:00 2001 From: duanweiling Date: Thu, 17 Nov 2022 16:49:05 +0800 Subject: [PATCH 343/438] =?UTF-8?q?js=20doc=E9=9D=9E=E6=B3=95=E6=A0=87?= =?UTF-8?q?=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: duanweiling --- api/@ohos.data.DataShareResultSet.d.ts | 54 ++++++------ api/@ohos.data.dataAbility.d.ts | 106 ++++++++++-------------- api/@ohos.data.dataSharePredicates.d.ts | 91 ++++++++++---------- api/@ohos.data.rdb.d.ts | 88 +++++++++----------- api/@system.storage.d.ts | 5 -- api/data/rdb/resultSet.d.ts | 92 +++++++------------- 6 files changed, 187 insertions(+), 249 deletions(-) mode change 100755 => 100644 api/data/rdb/resultSet.d.ts diff --git a/api/@ohos.data.DataShareResultSet.d.ts b/api/@ohos.data.DataShareResultSet.d.ts index f03f9547d8..2841c35093 100644 --- a/api/@ohos.data.DataShareResultSet.d.ts +++ b/api/@ohos.data.DataShareResultSet.d.ts @@ -74,9 +74,9 @@ export enum DataType { export default interface DataShareResultSet { /** * Obtains the names of all columns or keys in a result set. - * - * @note The column or key names are returned as a string array, in which the strings are in the same order + * The column or key names are returned as a string array, in which the strings are in the same order * as the columns or keys in the result set. + * * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi @@ -85,8 +85,8 @@ export default interface DataShareResultSet { /** * Obtains the number of columns or keys in the result set. + * The returned number is equal to the length of the string array returned by the columnCount method. * - * @note The returned number is equal to the length of the string array returned by the columnCount method. * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi @@ -119,7 +119,7 @@ export default interface DataShareResultSet { * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi - * @return Returns true if the result set is moved successfully; + * @returns Returns true if the result set is moved successfully; * returns false otherwise, for example, if the result set is empty. */ goToFirstRow(): boolean; @@ -130,7 +130,7 @@ export default interface DataShareResultSet { * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi - * @return Returns true if the result set is moved successfully; + * @returns Returns true if the result set is moved successfully; * returns false otherwise, for example, if the result set is empty. */ goToLastRow(): boolean; @@ -141,7 +141,7 @@ export default interface DataShareResultSet { * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi - * @return Returns true if the result set is moved successfully; + * @returns Returns true if the result set is moved successfully; * returns false otherwise, for example, if the result set is already in the last row. */ goToNextRow(): boolean; @@ -152,7 +152,7 @@ export default interface DataShareResultSet { * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi - * @return Returns true if the result set is moved successfully; + * @returns Returns true if the result set is moved successfully; * returns false otherwise, for example, if the result set is already in the first row. */ goToPreviousRow(): boolean; @@ -165,7 +165,7 @@ export default interface DataShareResultSet { * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @param offset Indicates the offset relative to the current position. - * @return Returns true if the result set is moved successfully and does not go beyond the range; + * @returns Returns true if the result set is moved successfully and does not go beyond the range; * returns false otherwise. */ goTo(offset: number): boolean; @@ -177,107 +177,107 @@ export default interface DataShareResultSet { * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @param position Indicates the index of the specified row, which starts from 1. - * @return Returns true if the result set is moved successfully; returns false otherwise. + * @returns Returns true if the result set is moved successfully; returns false otherwise. */ goToRow(position: number): boolean; /** * Obtains the value of the specified column or key in the current row as a byte array. + * The implementation class determines whether to throw an exception if the value of the specified * - * @note The implementation class determines whether to throw an exception if the value of the specified * column or key in the current row is null or the specified column or key is not of the Blob type. * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @param columnIndex Indicates the specified column index or key index, which starts from 0. - * @return Returns the value of the specified column or key as a byte array. + * @returns Returns the value of the specified column or key as a byte array. */ getBlob(columnIndex: number): Uint8Array; /** * Obtains the value of the specified column or key in the current row as string. + * The implementation class determines whether to throw an exception if the value of the specified * - * @note The implementation class determines whether to throw an exception if the value of the specified * column or key in the current row is null or the specified column or key is not of the string type. * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @param columnIndex Indicates the specified column index or key index, which starts from 0. - * @return Returns the value of the specified column or key as a string. + * @returns Returns the value of the specified column or key as a string. */ getString(columnIndex: number): string; /** * Obtains the value of the specified column or key in the current row as long. - * - * @note The implementation class determines whether to throw an exception if the value of the specified + * The implementation class determines whether to throw an exception if the value of the specified * column or key in the current row is null, the specified column or key is not of the long type. + * * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @param columnIndex Indicates the specified column index or key index, which starts from 0. - * @return Returns the value of the specified column or key as a long. + * @returns Returns the value of the specified column or key as a long. */ getLong(columnIndex: number): number; /** * Obtains the value of the specified column or key in the current row as double. + * The implementation class determines whether to throw an exception if the value of the specified * - * @note The implementation class determines whether to throw an exception if the value of the specified * column or key in the current row is null, the specified column or key is not of the double type. * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @param columnIndex Indicates the specified column index or key index, which starts from 0. - * @return Returns the value of the specified column or key as a double. + * @returns Returns the value of the specified column or key as a double. */ getDouble(columnIndex: number): number; /** * Closes the result set. + * Calling this method on the result set will release all of its resources and makes it ineffective. * - * @note Calling this method on the result set will release all of its resources and makes it ineffective. * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi - * @return Returns true if the result set is closed; returns false otherwise. + * @returns Returns true if the result set is closed; returns false otherwise. */ close(): void; /** * Obtains the column index or key index based on the specified column name or key name. + * The column name or key name is passed as an input parameter. * - * @note The column name or key name is passed as an input parameter. * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @param columnName Indicates the name of the specified column or key in the result set. - * @return Returns the index of the specified column or key. + * @returns Returns the index of the specified column or key. */ getColumnIndex(columnName: string): number; /** * Obtains the column name or key name based on the specified column index or key index. + * The column index or key index is passed as an input parameter. * - * @note The column index or key index is passed as an input parameter. * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @param columnIndex Indicates the index of the specified column or key in the result set. - * @return Returns the name of the specified column or key. + * @returns Returns the name of the specified column or key. */ getColumnName(columnIndex: number): string; /** * Obtains the dataType of the specified column or key. - * - * @note The implementation class determines whether to throw an exception if the value of the specified + * The implementation class determines whether to throw an exception if the value of the specified * column or key in the current row is null, the specified column or key is not in the data type. + * * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @param columnIndex Indicates the specified column index or key index, which starts from 0. - * @return Returns the dataType of the specified column or key. + * @returns Returns the dataType of the specified column or key. */ getDataType(columnIndex: number): DataType; } \ No newline at end of file diff --git a/api/@ohos.data.dataAbility.d.ts b/api/@ohos.data.dataAbility.d.ts index f2eb226ff8..7dd326bdc7 100644 --- a/api/@ohos.data.dataAbility.d.ts +++ b/api/@ohos.data.dataAbility.d.ts @@ -21,18 +21,17 @@ import rdb from './@ohos.data.rdb'; * * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core - * @import import data_dataAbility from '@ohos.data.dataAbility'; */ declare namespace dataAbility { /** * Create an RdbPredicates by table name and DataAbilityPredicates. + * This method is similar to = of the SQL statement. * - * @note This method is similar to = of the SQL statement. * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @param name Indicates the table name. * @param dataAbilityPredicates Indicates the dataAbility predicates. - * @return Returns an RdbPredicates. + * @returns Returns an RdbPredicates. */ function createRdbPredicates(name: string, dataAbilityPredicates: DataAbilityPredicates): rdb.RdbPredicates; @@ -41,174 +40,172 @@ declare namespace dataAbility { * * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core - * @import import data_dataAbility from '@ohos.data.dataAbility'; */ class DataAbilityPredicates { /** * Configures the DataAbilityPredicates to match the field whose data type is ValueType and value is equal * to a specified value. + * This method is similar to = of the SQL statement. * - * @note This method is similar to = of the SQL statement. * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @param field Indicates the column name in the database table. * @param value Indicates the value to match with the DataAbilityPredicates. - * @return Returns the DataAbilityPredicates that match the specified field. + * @returns Returns the DataAbilityPredicates that match the specified field. */ equalTo(field: string, value: ValueType): DataAbilityPredicates; /** * Configures the DataAbilityPredicates to match the field whose data type is ValueType and value is unequal to * a specified value. + * This method is similar to != of the SQL statement. * - * @note This method is similar to != of the SQL statement. * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @param field Indicates the column name in the database table. * @param value Indicates the value to match with the DataAbilityPredicates. - * @return Returns the DataAbilityPredicates that match the specified field. + * @returns Returns the DataAbilityPredicates that match the specified field. */ notEqualTo(field: string, value: ValueType): DataAbilityPredicates; /** * Adds a left parenthesis to the DataAbilityPredicates. + * This method is similar to ( of the SQL statement and needs to be used together with endWrap(). * - * @note This method is similar to ( of the SQL statement and needs to be used together with endWrap(). * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core - * @return Returns the DataAbilityPredicates with the left parenthesis. + * @returns Returns the DataAbilityPredicates with the left parenthesis. */ beginWrap(): DataAbilityPredicates; /** * Adds a right parenthesis to the DataAbilityPredicates. + * This method is similar to ) of the SQL statement and needs to be used together * - * @note This method is similar to ) of the SQL statement and needs to be used together * with beginWrap(). * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core - * @return Returns the DataAbilityPredicates with the right parenthesis. + * @returns Returns the DataAbilityPredicates with the right parenthesis. */ endWrap(): DataAbilityPredicates; /** * Adds an or condition to the DataAbilityPredicates. + * This method is similar to or of the SQL statement. * - * @note This method is similar to or of the SQL statement. * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core - * @return Returns the DataAbilityPredicates with the or condition. + * @returns Returns the DataAbilityPredicates with the or condition. */ or(): DataAbilityPredicates; /** * Adds an and condition to the DataAbilityPredicates. + * This method is similar to and of the SQL statement. * - * @note This method is similar to and of the SQL statement. * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core - * @return Returns the DataAbilityPredicates with the and condition. + * @returns Returns the DataAbilityPredicates with the and condition. */ and(): DataAbilityPredicates; /** * Configures the DataAbilityPredicates to match the field whose data type is string and value * contains a specified value. + * This method is similar to contains of the SQL statement. * - * @note This method is similar to contains of the SQL statement. * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @param field Indicates the column name in the database table. * @param value Indicates the value to match with the DataAbilityPredicates. - * @return Returns the DataAbilityPredicates that match the specified field. + * @returns Returns the DataAbilityPredicates that match the specified field. */ contains(field: string, value: string): DataAbilityPredicates; /** * Configures the DataAbilityPredicates to match the field whose data type is string and value starts * with a specified string. + * This method is similar to value% of the SQL statement. * - * @note This method is similar to value% of the SQL statement. * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @param field Indicates the column name in the database table. * @param value Indicates the value to match with the DataAbilityPredicates. - * @return Returns the DataAbilityPredicates that match the specified field. + * @returns Returns the DataAbilityPredicates that match the specified field. */ beginsWith(field: string, value: string): DataAbilityPredicates; /** * Configures the DataAbilityPredicates to match the field whose data type is string and value * ends with a specified string. + * This method is similar to %value of the SQL statement. * - * @note This method is similar to %value of the SQL statement. * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @param field Indicates the column name in the database table. * @param value Indicates the value to match with the DataAbilityPredicates. - * @return Returns the DataAbilityPredicates that match the specified field. + * @returns Returns the DataAbilityPredicates that match the specified field. */ endsWith(field: string, value: string): DataAbilityPredicates; /** * Configures the DataAbilityPredicates to match the fields whose value is null. + * This method is similar to is null of the SQL statement. * - * @note This method is similar to is null of the SQL statement. * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @param field Indicates the column name in the database table. - * @return Returns the DataAbilityPredicates that match the specified field. + * @returns Returns the DataAbilityPredicates that match the specified field. */ isNull(field: string): DataAbilityPredicates; /** * Configures the DataAbilityPredicates to match the specified fields whose value is not null. + * This method is similar to is not null of the SQL statement. * - * @note This method is similar to is not null of the SQL statement. * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @param field Indicates the column name in the database table. - * @return Returns the DataAbilityPredicates that match the specified field. + * @returns Returns the DataAbilityPredicates that match the specified field. */ isNotNull(field: string): DataAbilityPredicates; /** * Configures the DataAbilityPredicates to match the fields whose data type is string and value is * similar to a specified string. + * This method is similar to like of the SQL statement. * - * @note This method is similar to like of the SQL statement. * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @param field Indicates the column name in the database table. * @param value Indicates the value to match with the DataAbilityPredicates. The percent sign (%) in the value * is a wildcard (like * in a regular expression). - * @return Returns the DataAbilityPredicates that match the specified field. + * @returns Returns the DataAbilityPredicates that match the specified field. */ like(field: string, value: string): DataAbilityPredicates; /** * Configures DataAbilityPredicates to match the specified field whose data type is string and the value contains * a wildcard. + * Different from like, the input parameters of this method are case-sensitive. * - * @note Different from like, the input parameters of this method are case-sensitive. * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @param field Indicates the column name in the database table. * @param value Indicates the value to match with DataAbilityPredicates. - * @return Returns the SQL statement with the specified DataAbilityPredicates. + * @returns Returns the SQL statement with the specified DataAbilityPredicates. */ glob(field: string, value: string): DataAbilityPredicates; /** * Restricts the value of the field to the range between low value and high value. * - * @note N/A * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @param field Indicates the column name. * @param low Indicates the minimum value. * @param high Indicates the maximum value. - * @return Returns the SQL query statement with the specified DataAbilityPredicates. + * @returns Returns the SQL query statement with the specified DataAbilityPredicates. */ between(field: string, low: ValueType, high: ValueType): DataAbilityPredicates; @@ -216,61 +213,56 @@ declare namespace dataAbility { * Configures DataAbilityPredicates to match the specified field whose data type is int and value is * out of a given range. * - * @note N/A * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @param field Indicates the column name in the database table. * @param low Indicates the minimum value to match with DataAbilityPredicates}. * @param high Indicates the maximum value to match with DataAbilityPredicates}. - * @return Returns the SQL query statement with the specified DataAbilityPredicates. + * @returns Returns the SQL query statement with the specified DataAbilityPredicates. */ notBetween(field: string, low: ValueType, high: ValueType): DataAbilityPredicates; /** * Restricts the value of the field to be greater than the specified value. * - * @note N/A * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @param field Indicates the column name. * @param value Indicates the String field. - * @return Returns the SQL query statement with the specified DataAbilityPredicates. + * @returns Returns the SQL query statement with the specified DataAbilityPredicates. */ greaterThan(field: string, value: ValueType): DataAbilityPredicates; /** * Restricts the value of the field to be smaller than the specified value. * - * @note N/A * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @param field Indicates the column name. * @param value Indicates the String field. - * @return Returns the SQL query statement with the specified DataAbilityPredicates. + * @returns Returns the SQL query statement with the specified DataAbilityPredicates. */ lessThan(field: string, value: ValueType): DataAbilityPredicates; /** * Restricts the value of the field to be greater than or equal to the specified value. * - * @note N/A * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @param field Indicates the column name. * @param value Indicates the String field. - * @return Returns the SQL query statement with the specified DataAbilityPredicates. + * @returns Returns the SQL query statement with the specified DataAbilityPredicates. */ greaterThanOrEqualTo(field: string, value: ValueType): DataAbilityPredicates; /** * Restricts the value of the field to be smaller than or equal to the specified value. * - * @note N/A * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @param field Indicates the column name. * @param value Indicates the String field. - * @return Returns the SQL query statement with the specified DataAbilityPredicates. + * @returns Returns the SQL query statement with the specified DataAbilityPredicates. */ lessThanOrEqualTo(field: string, value: ValueType): DataAbilityPredicates; @@ -278,11 +270,10 @@ declare namespace dataAbility { * Restricts the ascending order of the return list. When there are several orders, * the one close to the head has the highest priority. * - * @note N/A * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @param field Indicates the column name for sorting the return list. - * @return Returns the SQL query statement with the specified DataAbilityPredicates. + * @returns Returns the SQL query statement with the specified DataAbilityPredicates. */ orderByAsc(field: string): DataAbilityPredicates; @@ -290,66 +281,62 @@ declare namespace dataAbility { * Restricts the descending order of the return list. When there are several orders, * the one close to the head has the highest priority. * - * @note N/A * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @param field Indicates the column name for sorting the return list. - * @return Returns the SQL query statement with the specified DataAbilityPredicates. + * @returns Returns the SQL query statement with the specified DataAbilityPredicates. */ orderByDesc(field: string): DataAbilityPredicates; /** * Restricts each row of the query result to be unique. * - * @note N/A * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core - * @return Returns the SQL query statement with the specified DataAbilityPredicates. + * @returns Returns the SQL query statement with the specified DataAbilityPredicates. */ distinct(): DataAbilityPredicates; /** * Restricts the max number of return records. * - * @note N/A * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @param value Indicates the max length of the return list. - * @return Returns the SQL query statement with the specified DataAbilityPredicates. + * @returns Returns the SQL query statement with the specified DataAbilityPredicates. * @throws IllegalPredicateException Throws this exception if DataAbilityPredicates are added to a wrong position. */ limitAs(value: number): DataAbilityPredicates; /** * Configures DataAbilityPredicates to specify the start position of the returned result. + * Use this method together with limit(int). * - * @note Use this method together with limit(int). * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @param rowOffset Indicates the start position of the returned result. The value is a positive integer. - * @return Returns the SQL query statement with the specified AbsPredicates. + * @returns Returns the SQL query statement with the specified AbsPredicates. */ offsetAs(rowOffset: number): DataAbilityPredicates; /** * Configures DataAbilityPredicates to group query results by specified columns. * - * @note N/A * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @param fields Indicates the specified columns by which query results are grouped. - * @return Returns the DataAbilityPredicates with the specified columns by which query results are grouped. + * @returns Returns the DataAbilityPredicates with the specified columns by which query results are grouped. */ groupBy(fields: Array): DataAbilityPredicates; /** * Configures DataAbilityPredicates to specify the index column. + * Before using this method, you need to create an index column. * - * @note Before using this method, you need to create an index column. * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @param indexName Indicates the name of the index column. - * @return Returns DataAbilityPredicates with the specified index column. + * @returns Returns DataAbilityPredicates with the specified index column. */ indexedBy(field: string): DataAbilityPredicates; @@ -357,12 +344,11 @@ declare namespace dataAbility { * Configures DataAbilityPredicates to match the specified field whose data type is ValueType array and values * are within a given range. * - * @note N/A * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @param field Indicates the column name in the database table. * @param values Indicates the values to match with DataAbilityPredicates. - * @return Returns DataAbilityPredicates that matches the specified field. + * @returns Returns DataAbilityPredicates that matches the specified field. */ in(field: string, value: Array): DataAbilityPredicates; @@ -370,12 +356,11 @@ declare namespace dataAbility { * Configures {@code DataAbilityPredicates} to match the specified field whose data type is String array and values * are out of a given range. * - * @note N/A * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @param field Indicates the column name in the database table. * @param values Indicates the values to match with DataAbilityPredicates. - * @return Returns DataAbilityPredicates that matches the specified field. + * @returns Returns DataAbilityPredicates that matches the specified field. */ notIn(field: string, value: Array): DataAbilityPredicates; } @@ -383,7 +368,6 @@ declare namespace dataAbility { * Indicates possible value types * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core - * @import import data_rdb from '@ohos.data.rdb'; */ type ValueType = number | string | boolean; } diff --git a/api/@ohos.data.dataSharePredicates.d.ts b/api/@ohos.data.dataSharePredicates.d.ts index f11e1c96bf..bb6997f643 100644 --- a/api/@ohos.data.dataSharePredicates.d.ts +++ b/api/@ohos.data.dataSharePredicates.d.ts @@ -22,188 +22,187 @@ declare namespace dataSharePredicates { * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi - * @import import data_dataShare from '@ohos.data.dataShare'; */ class DataSharePredicates { /** * Configures the DataSharePredicates to match the field whose data type is ValueType and value is equal * to a specified value. + * This method is similar to = of the SQL statement. * - * @note This method is similar to = of the SQL statement. * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @param field Indicates the column name in the database table. * @param value Indicates the value to match with the DataSharePredicates. - * @return Returns the DataSharePredicates that match the specified field. + * @returns Returns the DataSharePredicates that match the specified field. */ equalTo(field: string, value: ValueType): DataSharePredicates; /** * Configures the DataSharePredicates to match the field whose data type is ValueType and value is unequal to * a specified value. + * This method is similar to != of the SQL statement. * - * @note This method is similar to != of the SQL statement. * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @param field Indicates the column name in the database table. * @param value Indicates the value to match with the DataSharePredicates. - * @return Returns the DataSharePredicates that match the specified field. + * @returns Returns the DataSharePredicates that match the specified field. */ notEqualTo(field: string, value: ValueType): DataSharePredicates; /** * Adds a left parenthesis to the DataSharePredicates. + * This method is similar to ( of the SQL statement and needs to be used together with endWrap(). * - * @note This method is similar to ( of the SQL statement and needs to be used together with endWrap(). * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi - * @return Returns the DataSharePredicates with the left parenthesis. + * @returns Returns the DataSharePredicates with the left parenthesis. */ beginWrap(): DataSharePredicates; /** * Adds a right parenthesis to the DataSharePredicates. + * This method is similar to ) of the SQL statement and needs to be used together * - * @note This method is similar to ) of the SQL statement and needs to be used together * with beginWrap(). * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi - * @return Returns the DataSharePredicates with the right parenthesis. + * @returns Returns the DataSharePredicates with the right parenthesis. */ endWrap(): DataSharePredicates; /** * Adds an or condition to the DataSharePredicates. + * This method is similar to or of the SQL statement. * - * @note This method is similar to or of the SQL statement. * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi - * @return Returns the DataSharePredicates with the or condition. + * @returns Returns the DataSharePredicates with the or condition. */ or(): DataSharePredicates; /** * Adds an and condition to the DataSharePredicates. + * This method is similar to and of the SQL statement. * - * @note This method is similar to and of the SQL statement. * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi - * @return Returns the DataSharePredicates with the and condition. + * @returns Returns the DataSharePredicates with the and condition. */ and(): DataSharePredicates; /** * Configures the DataSharePredicates to match the field whose data type is string and value * contains a specified value. + * This method is similar to contains of the SQL statement. * - * @note This method is similar to contains of the SQL statement. * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @param field Indicates the column name in the database table. * @param value Indicates the value to match with the DataSharePredicates. - * @return Returns the DataSharePredicates that match the specified field. + * @returns Returns the DataSharePredicates that match the specified field. */ contains(field: string, value: string): DataSharePredicates; /** * Configures the DataSharePredicates to match the field whose data type is string and value starts * with a specified string. + * This method is similar to value% of the SQL statement. * - * @note This method is similar to value% of the SQL statement. * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @param field Indicates the column name in the database table. * @param value Indicates the value to match with the DataSharePredicates. - * @return Returns the DataSharePredicates that match the specified field. + * @returns Returns the DataSharePredicates that match the specified field. */ beginsWith(field: string, value: string): DataSharePredicates; /** * Configures the DataSharePredicates to match the field whose data type is string and value * ends with a specified string. + * This method is similar to %value of the SQL statement. * - * @note This method is similar to %value of the SQL statement. * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @param field Indicates the column name in the database table. * @param value Indicates the value to match with the DataSharePredicates. - * @return Returns the DataSharePredicates that match the specified field. + * @returns Returns the DataSharePredicates that match the specified field. */ endsWith(field: string, value: string): DataSharePredicates; /** * Configures the DataSharePredicates to match the fields whose value is null. + * This method is similar to is null of the SQL statement. * - * @note This method is similar to is null of the SQL statement. * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @param field Indicates the column name in the database table. - * @return Returns the DataSharePredicates that match the specified field. + * @returns Returns the DataSharePredicates that match the specified field. */ isNull(field: string): DataSharePredicates; /** * Configures the DataSharePredicates to match the specified fields whose value is not null. + * This method is similar to is not null of the SQL statement. * - * @note This method is similar to is not null of the SQL statement. * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @param field Indicates the column name in the database table. - * @return Returns the DataSharePredicates that match the specified field. + * @returns Returns the DataSharePredicates that match the specified field. */ isNotNull(field: string): DataSharePredicates; /** * Configures the DataSharePredicates to match the fields whose data type is string and value is * similar to a specified string. + * This method is similar to like of the SQL statement. * - * @note This method is similar to like of the SQL statement. * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @param field Indicates the column name in the database table. * @param value Indicates the value to match with the DataSharePredicates. The percent sign (%) in the value * is a wildcard (like * in a regular expression). - * @return Returns the DataSharePredicates that match the specified field. + * @returns Returns the DataSharePredicates that match the specified field. */ like(field: string, value: string): DataSharePredicates; /** * Configures the DataSharePredicates to match the fields whose data type is string and value is * similar to a specified string. + * This method is similar to unlike of the SQL statement. * - * @note This method is similar to unlike of the SQL statement. * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @param field Indicates the column name in the database table. * @param value Indicates the value to match with the DataSharePredicates. The percent sign (%) in the value * is a wildcard (like * in a regular expression). - * @return Returns the DataSharePredicates that match the specified field. + * @returns Returns the DataSharePredicates that match the specified field. */ unlike(field: string, value: string): DataSharePredicates; /** * Configures DataSharePredicates to match the specified field whose data type is string and the value contains * a wildcard. + * Different from like, the input parameters of this method are case-sensitive. * - * @note Different from like, the input parameters of this method are case-sensitive. * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @param field Indicates the column name in the database table. * @param value Indicates the value to match with DataSharePredicates. - * @return Returns the SQL statement with the specified DataSharePredicates. + * @returns Returns the SQL statement with the specified DataSharePredicates. */ glob(field: string, value: string): DataSharePredicates; @@ -216,7 +215,7 @@ declare namespace dataSharePredicates { * @param field Indicates the column name. * @param low Indicates the minimum value. * @param high Indicates the maximum value. - * @return Returns the SQL query statement with the specified DataSharePredicates. + * @returns Returns the SQL query statement with the specified DataSharePredicates. */ between(field: string, low: ValueType, high: ValueType): DataSharePredicates; @@ -230,7 +229,7 @@ declare namespace dataSharePredicates { * @param field Indicates the column name in the database table. * @param low Indicates the minimum value to match with DataSharePredicates. * @param high Indicates the maximum value to match with DataSharePredicates. - * @return Returns the SQL query statement with the specified DataSharePredicates. + * @returns Returns the SQL query statement with the specified DataSharePredicates. */ notBetween(field: string, low: ValueType, high: ValueType): DataSharePredicates; @@ -242,7 +241,7 @@ declare namespace dataSharePredicates { * @systemapi * @param field Indicates the column name. * @param value Indicates the String field. - * @return Returns the SQL query statement with the specified DataSharePredicates. + * @returns Returns the SQL query statement with the specified DataSharePredicates. */ greaterThan(field: string, value: ValueType): DataSharePredicates; @@ -254,7 +253,7 @@ declare namespace dataSharePredicates { * @systemapi * @param field Indicates the column name. * @param value Indicates the String field. - * @return Returns the SQL query statement with the specified DataSharePredicates. + * @returns Returns the SQL query statement with the specified DataSharePredicates. */ lessThan(field: string, value: ValueType): DataSharePredicates; @@ -266,7 +265,7 @@ declare namespace dataSharePredicates { * @systemapi * @param field Indicates the column name. * @param value Indicates the String field. - * @return Returns the SQL query statement with the specified DataSharePredicates. + * @returns Returns the SQL query statement with the specified DataSharePredicates. */ greaterThanOrEqualTo(field: string, value: ValueType): DataSharePredicates; @@ -278,7 +277,7 @@ declare namespace dataSharePredicates { * @systemapi * @param field Indicates the column name. * @param value Indicates the String field. - * @return Returns the SQL query statement with the specified DataSharePredicates. + * @returns Returns the SQL query statement with the specified DataSharePredicates. */ lessThanOrEqualTo(field: string, value: ValueType): DataSharePredicates; @@ -290,7 +289,7 @@ declare namespace dataSharePredicates { * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @param field Indicates the column name for sorting the return list. - * @return Returns the SQL query statement with the specified DataSharePredicates. + * @returns Returns the SQL query statement with the specified DataSharePredicates. */ orderByAsc(field: string): DataSharePredicates; @@ -302,7 +301,7 @@ declare namespace dataSharePredicates { * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @param field Indicates the column name for sorting the return list. - * @return Returns the SQL query statement with the specified DataSharePredicates. + * @returns Returns the SQL query statement with the specified DataSharePredicates. */ orderByDesc(field: string): DataSharePredicates; @@ -312,7 +311,7 @@ declare namespace dataSharePredicates { * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi - * @return Returns the SQL query statement with the specified DataSharePredicates. + * @returns Returns the SQL query statement with the specified DataSharePredicates. */ distinct(): DataSharePredicates; @@ -324,7 +323,7 @@ declare namespace dataSharePredicates { * @systemapi * @param total Represents the specified number of results. * @param offset Indicates the starting position. - * @return Returns the query object. + * @returns Returns the query object. */ limit(total: number, offset: number): DataSharePredicates; @@ -335,19 +334,19 @@ declare namespace dataSharePredicates { * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @param fields Indicates the specified columns by which query results are grouped. - * @return Returns the DataSharePredicates with the specified columns by which query results are grouped. + * @returns Returns the DataSharePredicates with the specified columns by which query results are grouped. */ groupBy(fields: Array): DataSharePredicates; /** * Configures {@code DataSharePredicates} to specify the index column. + * Before using this method, you need to create an index column. * - * @note Before using this method, you need to create an index column. * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @param field Indicates the name of the index column. - * @return Returns DataSharePredicates with the specified index column. + * @returns Returns DataSharePredicates with the specified index column. */ indexedBy(field: string): DataSharePredicates; @@ -360,7 +359,7 @@ declare namespace dataSharePredicates { * @systemapi * @param field Indicates the column name in the database table. * @param values Indicates the values to match with DataSharePredicates. - * @return Returns DataSharePredicates that matches the specified field. + * @returns Returns DataSharePredicates that matches the specified field. */ in(field: string, value: Array): DataSharePredicates; @@ -373,7 +372,7 @@ declare namespace dataSharePredicates { * @systemapi * @param field Indicates the column name in the database table. * @param values Indicates the values to match with DataSharePredicates. - * @return Returns DataSharePredicates that matches the specified field. + * @returns Returns DataSharePredicates that matches the specified field. */ notIn(field: string, value: Array): DataSharePredicates; @@ -384,7 +383,7 @@ declare namespace dataSharePredicates { * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @param prefix Represents the specified key prefix. - * @return Returns the query object. + * @returns Returns the query object. */ prefixKey(prefix: string): DataSharePredicates; @@ -395,7 +394,7 @@ declare namespace dataSharePredicates { * @syscap SystemCapability.DistributedDataManager.DataShare.Core * @systemapi * @param keys Represents the key names. - * @return Returns the query object. + * @returns Returns the query object. */ inKeys(keys: Array): DataSharePredicates; } diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index 28762906aa..eedc42c1e8 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -22,7 +22,6 @@ import dataSharePredicates from './@ohos.data.dataSharePredicates'; /** * Provides methods for rdbStore create and delete. * - * @import import data_rdb from '@ohos.data.rdb'; * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 */ @@ -238,7 +237,6 @@ declare namespace rdb * * This class provides methods for creating, querying, updating, and deleting RDBs. * - * @import import data_rdb from '@ohos.data.rdb'; * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 @@ -568,7 +566,6 @@ declare namespace rdb * * This class provides methods for creating, querying, updating, and deleting RDBs. * - * @import import data_rdb from '@ohos.data.rdb'; * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ @@ -1017,7 +1014,6 @@ declare namespace rdb /** * Indicates possible value types * - * @import import data_rdb from '@ohos.data.rdb'; * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 */ @@ -1026,7 +1022,6 @@ declare namespace rdb /** * Values in buckets are stored in key-value pairs * - * @import import data_rdb from '@ohos.data.rdb'; * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 */ @@ -1036,7 +1031,6 @@ declare namespace rdb /** * Manages relational database configurations. * - * @import import data_rdb from '@ohos.data.rdb'; * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 @@ -1049,7 +1043,6 @@ interface StoreConfig { /** * Manages relational database configurations. * - * @import import data_rdb from '@ohos.data.rdb'; * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ @@ -1057,7 +1050,6 @@ interface StoreConfigV9 { /** * The database name. * - * @import import data_rdb from '@ohos.data.rdb'; * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ @@ -1066,7 +1058,6 @@ interface StoreConfigV9 { /** * Specifies whether the database is encrypted. * - * @import import data_rdb from '@ohos.data.rdb'; * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ @@ -1075,7 +1066,6 @@ interface StoreConfigV9 { /** * Specifies whether the database is encrypted. * - * @import import data_rdb from '@ohos.data.rdb'; * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ @@ -1085,7 +1075,6 @@ interface StoreConfigV9 { /** * Manages relational database configurations. * - * @import import data_rdb from '@ohos.data.rdb'; * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 @@ -1105,8 +1094,8 @@ class RdbPredicates { /** * Sync data between devices. + * When query database, this function should not be called. * - * @note When query database, this function should not be called. * @param {Array} devices - Indicates specified remote devices. * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -1118,8 +1107,8 @@ class RdbPredicates { /** * Specify all remote devices which connect to local device when syncing distributed database. + * When query database, this function should not be called. * - * @note When query database, this function should not be called. * @returns {RdbPredicates} - the {@link RdbPredicates} self. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 @@ -1131,8 +1120,8 @@ class RdbPredicates { /** * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is equal * to a specified value. + * This method is similar to = of the SQL statement. * - * @note This method is similar to = of the SQL statement. * @param {string} field - Indicates the column name in the database table. * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. * @returns {RdbPredicates} - the {@link RdbPredicates} self. @@ -1146,8 +1135,8 @@ class RdbPredicates { /** * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is not equal to * a specified value. + * This method is similar to != of the SQL statement. * - * @note This method is similar to != of the SQL statement. * @param {string} field - Indicates the column name in the database table. * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. * @returns {RdbPredicates} - the {@link RdbPredicates} self. @@ -1160,8 +1149,8 @@ class RdbPredicates { /** * Adds a left parenthesis to the RdbPredicates. + * This method is similar to ( of the SQL statement and needs to be used together with endWrap(). * - * @note This method is similar to ( of the SQL statement and needs to be used together with endWrap(). * @returns {RdbPredicates} - the {@link RdbPredicates} with the left parenthesis. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 @@ -1172,8 +1161,8 @@ class RdbPredicates { /** * Adds a right parenthesis to the RdbPredicates. + * This method is similar to ) of the SQL statement and needs to be used together * - * @note This method is similar to ) of the SQL statement and needs to be used together * with beginWrap(). * @returns {RdbPredicates} - the {@link RdbPredicates} with the right parenthesis. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -1185,9 +1174,9 @@ class RdbPredicates { /** * Adds an or condition to the RdbPredicates. + * This method is similar to or of the SQL statement. * - * @note This method is similar to or of the SQL statement. - * @return Returns the {@link RdbPredicates} with the or condition. + * @returns Returns the {@link RdbPredicates} with the or condition. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 @@ -1197,9 +1186,9 @@ class RdbPredicates { /** * Adds an and condition to the RdbPredicates. + * This method is similar to or of the SQL statement. * - * @note This method is similar to or of the SQL statement. - * @return Returns the {@link RdbPredicates} with the or condition. + * @returns Returns the {@link RdbPredicates} with the or condition. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 @@ -1210,8 +1199,8 @@ class RdbPredicates { /** * Configures the RdbPredicates to match the field whose data type is string and value * contains a specified value. + * This method is similar to contains of the SQL statement. * - * @note This method is similar to contains of the SQL statement. * @param {string} field - Indicates the column name in the database table. * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. * @returns {RdbPredicates} - the {@link RdbPredicates} self. @@ -1225,8 +1214,8 @@ class RdbPredicates { /** * Configures the RdbPredicates to match the field whose data type is string and value starts * with a specified string. + * This method is similar to value% of the SQL statement. * - * @note This method is similar to value% of the SQL statement. * @param {string} field - Indicates the column name in the database table. * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. * @returns {RdbPredicates} - the {@link RdbPredicates} self. @@ -1240,8 +1229,8 @@ class RdbPredicates { /** * Configures the RdbPredicates to match the field whose data type is string and value * ends with a specified string. + * This method is similar to %value of the SQL statement. * - * @note This method is similar to %value of the SQL statement. * @param {string} field - Indicates the column name in the database table. * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. * @returns {RdbPredicates} - the {@link RdbPredicates} self. @@ -1254,8 +1243,8 @@ class RdbPredicates { /** * Configures the RdbPredicates to match the fields whose value is null. + * This method is similar to is null of the SQL statement. * - * @note This method is similar to is null of the SQL statement. * @param {string} field - Indicates the column name in the database table. * @returns {RdbPredicates} - the {@link RdbPredicates} self. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -1267,8 +1256,8 @@ class RdbPredicates { /** * Configures the RdbPredicates to match the specified fields whose value is not null. + * This method is similar to is not null of the SQL statement. * - * @note This method is similar to is not null of the SQL statement. * @param {string} field - Indicates the column name in the database table. * @returns {RdbPredicates} - the {@link RdbPredicates} self. * @throws {BusinessError} 401 - if the parameter type is incorrect. @@ -1282,8 +1271,8 @@ class RdbPredicates { /** * Configures the RdbPredicates to match the fields whose data type is string and value is * similar to a specified string. + * This method is similar to like of the SQL statement. * - * @note This method is similar to like of the SQL statement. * @param {string} field - Indicates the column name in the database table. * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. * @returns {RdbPredicates} - the {@link RdbPredicates} that match the specified field. @@ -1297,8 +1286,8 @@ class RdbPredicates { /** * Configures RdbPredicates to match the specified field whose data type is string and the value contains * a wildcard. + * Different from like, the input parameters of this method are case-sensitive. * - * @note Different from like, the input parameters of this method are case-sensitive. * @param {string} field - Indicates the column name in the database table. * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicates}. * @returns {RdbPredicates} - the SQL statement with the specified {@link RdbPredicates}. @@ -1442,8 +1431,8 @@ class RdbPredicates { /** * Configures RdbPredicatesV9 to specify the start position of the returned result. + * Use this method together with limit(int). * - * @note Use this method together with limit(int). * @param {number} rowOffset - Indicates the start position of the returned result. The value is a positive integer. * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -1467,8 +1456,8 @@ class RdbPredicates { /** * Configures RdbPredicatesV9 to specify the index column. + * Before using this method, you need to create an index column. * - * @note Before using this method, you need to create an index column. * @param {string} field - Indicates the name of the index column. * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -1510,7 +1499,6 @@ class RdbPredicates { /** * Manages relational database configurations. * - * @import import data_rdb from '@ohos.data.rdb'; * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ @@ -1527,8 +1515,8 @@ class RdbPredicatesV9 { /** * Sync data between devices. + * When query database, this function should not be called. * - * @note When query database, this function should not be called. * @param {Array} devices - Indicates specified remote devices. * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. * @throws {BusinessError} 401 - if the parameter type is incorrect. @@ -1539,8 +1527,8 @@ class RdbPredicatesV9 { /** * Specify all remote devices which connect to local device when syncing distributed database. + * When query database, this function should not be called. * - * @note When query database, this function should not be called. * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 @@ -1550,8 +1538,8 @@ class RdbPredicatesV9 { /** * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is equal * to a specified value. + * This method is similar to = of the SQL statement. * - * @note This method is similar to = of the SQL statement. * @param {string} field - Indicates the column name in the database table. * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. @@ -1564,8 +1552,8 @@ class RdbPredicatesV9 { /** * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is not equal to * a specified value. + * This method is similar to != of the SQL statement. * - * @note This method is similar to != of the SQL statement. * @param {string} field - Indicates the column name in the database table. * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. @@ -1577,8 +1565,8 @@ class RdbPredicatesV9 { /** * Adds a left parenthesis to the RdbPredicatesV9. + * This method is similar to ( of the SQL statement and needs to be used together with endWrap(). * - * @note This method is similar to ( of the SQL statement and needs to be used together with endWrap(). * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} with the left parenthesis. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 @@ -1587,8 +1575,8 @@ class RdbPredicatesV9 { /** * Adds a right parenthesis to the RdbPredicatesV9. + * This method is similar to ) of the SQL statement and needs to be used together * - * @note This method is similar to ) of the SQL statement and needs to be used together * with beginWrap(). * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} with the right parenthesis. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -1598,9 +1586,9 @@ class RdbPredicatesV9 { /** * Adds an or condition to the RdbPredicatesV9. + * This method is similar to or of the SQL statement. * - * @note This method is similar to or of the SQL statement. - * @return Returns the {@link RdbPredicatesV9} with the or condition. + * @returns Returns the {@link RdbPredicatesV9} with the or condition. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ @@ -1608,9 +1596,9 @@ class RdbPredicatesV9 { /** * Adds an and condition to the RdbPredicatesV9. + * This method is similar to or of the SQL statement. * - * @note This method is similar to or of the SQL statement. - * @return Returns the {@link RdbPredicatesV9} with the or condition. + * @returns Returns the {@link RdbPredicatesV9} with the or condition. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ @@ -1619,8 +1607,8 @@ class RdbPredicatesV9 { /** * Configures the RdbPredicatesV9 to match the field whose data type is string and value * contains a specified value. + * This method is similar to contains of the SQL statement. * - * @note This method is similar to contains of the SQL statement. * @param {string} field - Indicates the column name in the database table. * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. @@ -1633,8 +1621,8 @@ class RdbPredicatesV9 { /** * Configures the RdbPredicatesV9 to match the field whose data type is string and value starts * with a specified string. + * This method is similar to value% of the SQL statement. * - * @note This method is similar to value% of the SQL statement. * @param {string} field - Indicates the column name in the database table. * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. @@ -1647,8 +1635,8 @@ class RdbPredicatesV9 { /** * Configures the RdbPredicatesV9 to match the field whose data type is string and value * ends with a specified string. + * This method is similar to %value of the SQL statement. * - * @note This method is similar to %value of the SQL statement. * @param {string} field - Indicates the column name in the database table. * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. @@ -1660,8 +1648,8 @@ class RdbPredicatesV9 { /** * Configures the RdbPredicatesV9 to match the fields whose value is null. + * This method is similar to is null of the SQL statement. * - * @note This method is similar to is null of the SQL statement. * @param {string} field - Indicates the column name in the database table. * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. * @throws {BusinessError} 401 - if the parameter type is incorrect. @@ -1672,8 +1660,8 @@ class RdbPredicatesV9 { /** * Configures the RdbPredicatesV9 to match the specified fields whose value is not null. + * This method is similar to is not null of the SQL statement. * - * @note This method is similar to is not null of the SQL statement. * @param {string} field - Indicates the column name in the database table. * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} self. * @throws {BusinessError} 401 - if the parameter type is incorrect. @@ -1685,8 +1673,8 @@ class RdbPredicatesV9 { /** * Configures the RdbPredicatesV9 to match the fields whose data type is string and value is * similar to a specified string. + * This method is similar to like of the SQL statement. * - * @note This method is similar to like of the SQL statement. * @param {string} field - Indicates the column name in the database table. * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. * @returns {RdbPredicatesV9} - the {@link RdbPredicatesV9} that match the specified field. @@ -1699,8 +1687,8 @@ class RdbPredicatesV9 { /** * Configures RdbPredicatesV9 to match the specified field whose data type is string and the value contains * a wildcard. + * Different from like, the input parameters of this method are case-sensitive. * - * @note Different from like, the input parameters of this method are case-sensitive. * @param {string} field - Indicates the column name in the database table. * @param {ValueType} value - Indicates the value to match with the {@link RdbPredicatesV9}. * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. @@ -1832,8 +1820,8 @@ class RdbPredicatesV9 { /** * Configures RdbPredicatesV9 to specify the start position of the returned result. + * Use this method together with limit(int). * - * @note Use this method together with limit(int). * @param {number} rowOffset - Indicates the start position of the returned result. The value is a positive integer. * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. * @throws {BusinessError} 401 - if the parameter type is incorrect. @@ -1855,8 +1843,8 @@ class RdbPredicatesV9 { /** * Configures RdbPredicatesV9 to specify the index column. + * Before using this method, you need to create an index column. * - * @note Before using this method, you need to create an index column. * @param {string} field - Indicates the name of the index column. * @returns {RdbPredicatesV9} - the SQL statement with the specified {@link RdbPredicatesV9}. * @throws {BusinessError} 401 - if the parameter type is incorrect. diff --git a/api/@system.storage.d.ts b/api/@system.storage.d.ts index ad103508c8..0135d75cce 100644 --- a/api/@system.storage.d.ts +++ b/api/@system.storage.d.ts @@ -14,7 +14,6 @@ */ /** - * @import import storage from '@system.storage'; * @since 3 * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @deprecated since 6 @@ -65,7 +64,6 @@ export interface GetStorageOptions { } /** - * @import import storage from '@system.storage'; * @since 3 * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @deprecated since 6 @@ -115,7 +113,6 @@ export interface SetStorageOptions { } /** - * @import import storage from '@system.storage'; * @since 3 * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @deprecated since 6 @@ -148,7 +145,6 @@ export interface ClearStorageOptions { } /** - * @import import storage from '@system.storage'; * @since 3 * @deprecated since 6 * @FAModelOnly @@ -190,7 +186,6 @@ export interface DeleteStorageOptions { } /** - * @import import storage from '@system.storage'; * @since 3 * @syscap SystemCapability.DistributedDataManager.Preferences.Core * @deprecated since 6 diff --git a/api/data/rdb/resultSet.d.ts b/api/data/rdb/resultSet.d.ts old mode 100755 new mode 100644 index 8b080538ff..6a9c462376 --- a/api/data/rdb/resultSet.d.ts +++ b/api/data/rdb/resultSet.d.ts @@ -18,7 +18,6 @@ import { AsyncCallback } from '../../basic' /** * Provides methods for accessing a database result set generated by querying the database. * - * @import import data_rdb from '@ohos.data.rdb'; * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 @@ -28,9 +27,9 @@ import { AsyncCallback } from '../../basic' /** * Obtains the names of all columns in a result set. - * - * @note The column names are returned as a string array, in which the strings are in the same order + * The column names are returned as a string array, in which the strings are in the same order * as the columns in the result set. + * * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 @@ -40,9 +39,9 @@ import { AsyncCallback } from '../../basic' /** * Obtains the number of columns in the result set. - * - * @note The returned number is equal to the length of the string array returned by the + * The returned number is equal to the length of the string array returned by the * columnCount method. + * * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 @@ -53,7 +52,6 @@ import { AsyncCallback } from '../../basic' /** * Obtains the number of rows in the result set. * - * @note N/A * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 @@ -63,8 +61,8 @@ import { AsyncCallback } from '../../basic' /** * Obtains the current index of the result set. + * The result set index starts from 0. * - * @note The result set index starts from 0. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 @@ -75,7 +73,6 @@ import { AsyncCallback } from '../../basic' /** * Checks whether the result set is positioned at the first row. * - * @note N/A * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 @@ -86,7 +83,6 @@ import { AsyncCallback } from '../../basic' /** * Checks whether the result set is positioned at the last row. * - * @note N/A * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 @@ -97,7 +93,6 @@ import { AsyncCallback } from '../../basic' /** * Checks whether the result set is positioned after the last row. * - * @note N/A * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 @@ -109,7 +104,6 @@ import { AsyncCallback } from '../../basic' * returns whether the cursor is pointing to the position before the first * row. * - * @note N/A * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 @@ -122,7 +116,6 @@ import { AsyncCallback } from '../../basic' * * If the result set is closed by calling the close method, true will be returned. * - * @note N/A * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 @@ -132,8 +125,8 @@ import { AsyncCallback } from '../../basic' /** * Obtains the column index based on the specified column name. + * The column name is passed as an input parameter. * - * @note The column name is passed as an input parameter. * @param {string} columnName - Indicates the name of the specified column in the result set. * @returns {number} return the index of the specified column. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -145,8 +138,8 @@ import { AsyncCallback } from '../../basic' /** * Obtains the column name based on the specified column index. + * The column index is passed as an input parameter. * - * @note The column index is passed as an input parameter. * @param {number} columnIndex - Indicates the index of the specified column in the result set. * @returns {string} returns the name of the specified column. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -160,7 +153,6 @@ import { AsyncCallback } from '../../basic' * Go to the specified row of the result set forwards or backwards by an offset relative to its current position. * A positive offset indicates moving backwards, and a negative offset indicates moving forwards. * - * @note N/A * @param {number} offset - Indicates the offset relative to the current position. * @returns {string} returns true if the result set is moved successfully and does not go beyond the range; * returns false otherwise. @@ -174,7 +166,6 @@ import { AsyncCallback } from '../../basic' /** * Go to the specified row of the result set. * - * @note N/A * @param {number} rowIndex - Indicates the index of the specified row, which starts from 0. * @returns {boolean} returns true if the result set is moved successfully; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -187,7 +178,6 @@ import { AsyncCallback } from '../../basic' /** * Go to the first row of the result set. * - * @note N/A * @returns {boolean} returns true if the result set is moved successfully; * returns false otherwise, for example, if the result set is empty. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -200,7 +190,6 @@ import { AsyncCallback } from '../../basic' /** * Go to the last row of the result set. * - * @note N/A * @returns {boolean} returns true if the result set is moved successfully; * returns false otherwise, for example, if the result set is empty. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -213,7 +202,6 @@ import { AsyncCallback } from '../../basic' /** * Go to the next row of the result set. * - * @note N/A * @returns {boolean} returns true if the result set is moved successfully; * returns false otherwise, for example, if the result set is already in the last row. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -226,7 +214,6 @@ import { AsyncCallback } from '../../basic' /** * Go to the previous row of the result set. * - * @note N/A * @returns {boolean} returns true if the result set is moved successfully; * returns false otherwise, for example, if the result set is already in the first row. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -238,9 +225,9 @@ import { AsyncCallback } from '../../basic' /** * Obtains the value of the specified column in the current row as a byte array. - * - * @note The implementation class determines whether to throw an exception if the value of the specified column + * The implementation class determines whether to throw an exception if the value of the specified column * in the current row is null or the specified column is not of the Blob type. + * * @param {number} columnIndex - Indicates the specified column index, which starts from 0. * @returns {Uint8Array} returns the value of the specified column as a byte array. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -252,9 +239,9 @@ import { AsyncCallback } from '../../basic' /** * Obtains the value of the specified column in the current row as string. - * - * @note The implementation class determines whether to throw an exception if the value of the specified column + * The implementation class determines whether to throw an exception if the value of the specified column * in the current row is null or the specified column is not of the string type. + * * @param {number} columnIndex - Indicates the specified column index, which starts from 0. * @returns {string} returns the value of the specified column as a string. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -266,9 +253,9 @@ import { AsyncCallback } from '../../basic' /** * Obtains the value of the specified column in the current row as long. - * - * @note The implementation class determines whether to throw an exception if the value of the specified column + * The implementation class determines whether to throw an exception if the value of the specified column * in the current row is null, the specified column is not of the integer type. + * * @param {number} columnIndex - Indicates the specified column index, which starts from 0. * @returns {number} returns the value of the specified column as a long. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -280,9 +267,9 @@ import { AsyncCallback } from '../../basic' /** * Obtains the value of the specified column in the current row as double. - * - * @note The implementation class determines whether to throw an exception if the value of the specified column + * The implementation class determines whether to throw an exception if the value of the specified column * in the current row is null, the specified column is not of the double type. + * * @param {number} columnIndex - Indicates the specified column index, which starts from 0. * @returns {number} returns the value of the specified column as a double. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -295,7 +282,6 @@ import { AsyncCallback } from '../../basic' /** * Checks whether the value of the specified column in the current row is null. * - * @note N/A * @param {number} columnIndex - Indicates the specified column index, which starts from 0. * @returns {boolean} returns true if the value of the specified column in the current row is null; * returns false otherwise. @@ -308,8 +294,8 @@ import { AsyncCallback } from '../../basic' /** * Closes the result set. + * Calling this method on the result set will release all of its resources and makes it ineffective. * - * @note Calling this method on the result set will release all of its resources and makes it ineffective. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 7 * @deprecated since 9 @@ -321,7 +307,6 @@ import { AsyncCallback } from '../../basic' /** * Provides methods for accessing a database result set generated by querying the database. * - * @import import data_rdb from '@ohos.data.rdb'; * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ @@ -329,9 +314,9 @@ import { AsyncCallback } from '../../basic' /** * Obtains the names of all columns in a result set. - * - * @note The column names are returned as a string array, in which the strings are in the same order + * The column names are returned as a string array, in which the strings are in the same order * as the columns in the result set. + * * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ @@ -339,9 +324,9 @@ import { AsyncCallback } from '../../basic' /** * Obtains the number of columns in the result set. - * - * @note The returned number is equal to the length of the string array returned by the + * The returned number is equal to the length of the string array returned by the * columnCount method. + * * @since 9 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core */ @@ -350,7 +335,6 @@ import { AsyncCallback } from '../../basic' /** * Obtains the number of rows in the result set. * - * @note N/A * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ @@ -358,8 +342,8 @@ import { AsyncCallback } from '../../basic' /** * Obtains the current index of the result set. + * The result set index starts from 0. * - * @note The result set index starts from 0. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ @@ -368,7 +352,6 @@ import { AsyncCallback } from '../../basic' /** * Checks whether the result set is positioned at the first row. * - * @note N/A * @since 9 * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core */ @@ -377,7 +360,6 @@ import { AsyncCallback } from '../../basic' /** * Checks whether the result set is positioned at the last row. * - * @note N/A * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ @@ -386,7 +368,6 @@ import { AsyncCallback } from '../../basic' /** * Checks whether the result set is positioned after the last row. * - * @note N/A * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ @@ -395,7 +376,6 @@ import { AsyncCallback } from '../../basic' /** * Returns whether the cursor is pointing to the position before the first row. * - * @note N/A * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ @@ -406,7 +386,6 @@ import { AsyncCallback } from '../../basic' * * If the result set is closed by calling the close method, true will be returned. * - * @note N/A * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 */ @@ -414,8 +393,8 @@ import { AsyncCallback } from '../../basic' /** * Obtains the column index based on the specified column name. + * The column name is passed as an input parameter. * - * @note The column name is passed as an input parameter. * @param {string} columnName - Indicates the name of the specified column in the result set. * @returns {number} return the index of the specified column. * @throws {BusinessError} 14800013 - The column value is null or the column type is incompatible. @@ -427,8 +406,8 @@ import { AsyncCallback } from '../../basic' /** * Obtains the column name based on the specified column index. + * The column index is passed as an input parameter. * - * @note The column index is passed as an input parameter. * @param {number} columnIndex - Indicates the index of the specified column in the result set. * @returns {string} returns the name of the specified column. * @throws {BusinessError} 14800013 - The column value is null or the column type is incompatible. @@ -442,7 +421,6 @@ import { AsyncCallback } from '../../basic' * Go to the specified row of the result set forwards or backwards by an offset relative to its current position. * A positive offset indicates moving backwards, and a negative offset indicates moving forwards. * - * @note N/A * @param {number} offset - Indicates the offset relative to the current position. * @returns {string} returns true if the result set is moved successfully and does not go beyond the range; * returns false otherwise. @@ -456,7 +434,6 @@ import { AsyncCallback } from '../../basic' /** * Go to the specified row of the result set. * - * @note N/A * @param {number} rowIndex - Indicates the index of the specified row, which starts from 0. * @returns {boolean} returns true if the result set is moved successfully; returns false otherwise. * @throws {BusinessError} 14800012 - The result set is empty or the specified location is invalid. @@ -469,7 +446,6 @@ import { AsyncCallback } from '../../basic' /** * Go to the first row of the result set. * - * @note N/A * @returns {boolean} returns true if the result set is moved successfully; * returns false otherwise, for example, if the result set is empty. * @throws {BusinessError} 14800012 - The result set is empty or the specified location is invalid. @@ -481,7 +457,6 @@ import { AsyncCallback } from '../../basic' /** * Go to the last row of the result set. * - * @note N/A * @returns {boolean} returns true if the result set is moved successfully; * returns false otherwise, for example, if the result set is empty. * @throws {BusinessError} 14800012 - The result set is empty or the specified location is invalid. @@ -493,7 +468,6 @@ import { AsyncCallback } from '../../basic' /** * Go to the next row of the result set. * - * @note N/A * @returns {boolean} returns true if the result set is moved successfully; * returns false otherwise, for example, if the result set is already in the last row. * @throws {BusinessError} 14800012 - The result set is empty or the specified location is invalid. @@ -505,7 +479,6 @@ import { AsyncCallback } from '../../basic' /** * Go to the previous row of the result set. * - * @note N/A * @returns {boolean} returns true if the result set is moved successfully; * returns false otherwise, for example, if the result set is already in the first row. * @throws {BusinessError} 14800012 - The result set is empty or the specified location is invalid. @@ -516,9 +489,9 @@ import { AsyncCallback } from '../../basic' /** * Obtains the value of the specified column in the current row as a byte array. - * - * @note The implementation class determines whether to throw an exception if the value of the specified column + * The implementation class determines whether to throw an exception if the value of the specified column * in the current row is null or the specified column is not of the Blob type. + * * @param {number} columnIndex - Indicates the specified column index, which starts from 0. * @returns {Uint8Array} returns the value of the specified column as a byte array. * @throws {BusinessError} 14800013 - The column value is null or the column type is incompatible. @@ -530,9 +503,9 @@ import { AsyncCallback } from '../../basic' /** * Obtains the value of the specified column in the current row as string. - * - * @note The implementation class determines whether to throw an exception if the value of the specified column + * The implementation class determines whether to throw an exception if the value of the specified column * in the current row is null or the specified column is not of the string type. + * * @param {number} columnIndex - Indicates the specified column index, which starts from 0. * @returns {string} returns the value of the specified column as a string. * @throws {BusinessError} 14800013 - The column value is null or the column type is incompatible. @@ -544,9 +517,9 @@ import { AsyncCallback } from '../../basic' /** * Obtains the value of the specified column in the current row as long. - * - * @note The implementation class determines whether to throw an exception if the value of the specified column + * The implementation class determines whether to throw an exception if the value of the specified column * in the current row is null, the specified column is not of the integer type. + * * @param {number} columnIndex - Indicates the specified column index, which starts from 0. * @returns {number} returns the value of the specified column as a long. * @throws {BusinessError} 14800013 - The column value is null or the column type is incompatible. @@ -558,9 +531,9 @@ import { AsyncCallback } from '../../basic' /** * Obtains the value of the specified column in the current row as double. - * - * @note The implementation class determines whether to throw an exception if the value of the specified column + * The implementation class determines whether to throw an exception if the value of the specified column * in the current row is null, the specified column is not of the double type. + * * @param {number} columnIndex - Indicates the specified column index, which starts from 0. * @returns {number} returns the value of the specified column as a double. * @throws {BusinessError} 14800013 - The column value is null or the column type is incompatible. @@ -573,7 +546,6 @@ import { AsyncCallback } from '../../basic' /** * Checks whether the value of the specified column in the current row is null. * - * @note N/A * @param {number} columnIndex - Indicates the specified column index, which starts from 0. * @returns {boolean} returns true if the value of the specified column in the current row is null; * returns false otherwise. @@ -586,8 +558,8 @@ import { AsyncCallback } from '../../basic' /** * Closes the result set. + * Calling this method on the result set will release all of its resources and makes it ineffective. * - * @note Calling this method on the result set will release all of its resources and makes it ineffective. * @throws {BusinessError} 14800012 - The result set is empty or the specified location is invalid. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 9 -- Gitee From 78b490f6d987465cf330425cdd2166f486733ffe Mon Sep 17 00:00:00 2001 From: wangkai Date: Thu, 17 Nov 2022 17:30:52 +0800 Subject: [PATCH 344/438] 11_17_1 Signed-off-by: wangkai --- api/@ohos.data.distributedData.d.ts | 703 ++++++++++++++----------- api/@ohos.data.distributedKVStore.d.ts | 121 +++-- 2 files changed, 470 insertions(+), 354 deletions(-) diff --git a/api/@ohos.data.distributedData.d.ts b/api/@ohos.data.distributedData.d.ts index bef7ec29a3..7c303b80c7 100644 --- a/api/@ohos.data.distributedData.d.ts +++ b/api/@ohos.data.distributedData.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; +import {AsyncCallback, Callback} from './basic'; /** * Providers interfaces to creat a {@link KVManager} instance. @@ -61,16 +61,16 @@ declare namespace distributedData { * @deprecated since 9 */ interface UserInfo { - /** - * Indicates the user ID to set + /** + * Indicates the user ID to set * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 */ userId?: string; - /** - * Indicates the user type to set + /** + * Indicates the user type to set * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -86,8 +86,8 @@ declare namespace distributedData { * @deprecated since 9 */ enum UserType { - /** - * Indicates a user that logs in to different devices using the same account. + /** + * Indicates a user that logs in to different devices using the same account. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -170,8 +170,8 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.ValueType */ enum ValueType { - /** - * Indicates that the value type is string. + /** + * Indicates that the value type is string. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -180,7 +180,7 @@ declare namespace distributedData { STRING = 0, /** - * Indicates that the value type is int. + * Indicates that the value type is int. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -188,8 +188,8 @@ declare namespace distributedData { */ INTEGER = 1, - /** - * Indicates that the value type is float. + /** + * Indicates that the value type is float. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -197,8 +197,8 @@ declare namespace distributedData { */ FLOAT = 2, - /** - * Indicates that the value type is byte array. + /** + * Indicates that the value type is byte array. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -206,8 +206,8 @@ declare namespace distributedData { * */ BYTE_ARRAY = 3, - /** - * Indicates that the value type is boolean. + /** + * Indicates that the value type is boolean. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -215,8 +215,8 @@ declare namespace distributedData { * */ BOOLEAN = 4, - /** - * Indicates that the value type is double. + /** + * Indicates that the value type is double. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -294,15 +294,15 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.ChangeNotification */ interface ChangeNotification { - /** - * Indicates data addition records. + /** + * Indicates data addition records. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.ChangeNotification#insertEntries */ insertEntries: Entry[]; - /** + /** * Indicates data update records. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 @@ -310,8 +310,8 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.ChangeNotification#updateEntries */ updateEntries: Entry[]; - /** - * Indicates data deletion records. + /** + * Indicates data deletion records. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -337,7 +337,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SyncMode */ enum SyncMode { - /** + /** * Indicates that data is only pulled from the remote end. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 @@ -345,16 +345,16 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SyncMode#PULL_ONLY */ PULL_ONLY = 0, - /** - * Indicates that data is only pushed from the local end. + /** + * Indicates that data is only pushed from the local end. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SyncMode#PUSH_ONLY */ PUSH_ONLY = 1, - /** - * Indicates that data is pushed from the local end, and then pulled from the remote end. + /** + * Indicates that data is pushed from the local end, and then pulled from the remote end. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -372,26 +372,26 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SubscribeType */ enum SubscribeType { - /** - * Subscription to local data changes + /** + * Subscription to local data changes * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SubscribeType#SUBSCRIBE_TYPE_LOCAL - */ + */ SUBSCRIBE_TYPE_LOCAL = 0, - /** - * Subscription to remote data changes + /** + * Subscription to remote data changes * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SubscribeType#SUBSCRIBE_TYPE_REMOTE - */ + */ SUBSCRIBE_TYPE_REMOTE = 1, - /** - * Subscription to both local and remote data changes + /** + * Subscription to both local and remote data changes * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -409,8 +409,8 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVStoreType */ enum KVStoreType { - /** - * Device-collaboration database, as specified by {@code DeviceKVStore} + /** + * Device-collaboration database, as specified by {@code DeviceKVStore} * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 7 * @deprecated since 9 @@ -418,8 +418,8 @@ declare namespace distributedData { */ DEVICE_COLLABORATION = 0, - /** - * Single-version database, as specified by {@code SingleKVStore} + /** + * Single-version database, as specified by {@code SingleKVStore} * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -427,8 +427,8 @@ declare namespace distributedData { */ SINGLE_VERSION = 1, - /** - * Multi-version database, as specified by {@code MultiKVStore} + /** + * Multi-version database, as specified by {@code MultiKVStore} * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 7 * @deprecated since 9 @@ -571,7 +571,7 @@ declare namespace distributedData { */ securityLevel?: SecurityLevel; /** - * Indicates schema object + * Indicates schema object * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 * @deprecated since 9 @@ -582,9 +582,9 @@ declare namespace distributedData { /** * Represents the database schema. - * + * * You can create Schema objects and put them in Options when creating or opening the database. - * + * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 * @deprecated since 9 @@ -593,34 +593,35 @@ declare namespace distributedData { class Schema { /** * A constructor used to create a Schema instance. - * + * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Schema#constructor */ constructor() + /** * Indicates the root json object. - * + * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Schema#root */ - root: FieldNode; + root: FieldNode; /** * Indicates the string array of json. - * + * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Schema#indexes */ - indexes: Array; + indexes: Array; /** * Indicates the mode of schema. - * + * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 * @deprecated since 9 @@ -629,7 +630,7 @@ declare namespace distributedData { mode: number; /** * Indicates the skip size of schema. - * + * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 * @deprecated since 9 @@ -640,13 +641,13 @@ declare namespace distributedData { /** * Represents a node of a {@link Schema} instance. - * + * *

          Through the {@link Schema} instance, you can define the fields contained in the values stored in a database. - * + * *

          A FieldNode of the {@link Schema} instance is either a leaf or a non-leaf node. - * + * *

          The leaf node must have a value; the non-leaf node must have a child {@code FieldNode}. - * + * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 * @deprecated since 9 @@ -656,18 +657,19 @@ declare namespace distributedData { /** * A constructor used to create a FieldNode instance with the specified field. * name Indicates the field node name. - * + * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.FieldNode#constructor */ constructor(name: string) + /** * Adds a child node to this {@code FieldNode}. - * + * *

          Adding a child node makes this node a non-leaf node. Field value will be ignored if it has child node. - * + * * @param child The field node to append. * @returns Returns true if the child node is successfully added to this {@code FieldNode}; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore @@ -676,6 +678,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.FieldNode#appendChild */ appendChild(child: FieldNode): boolean; + /** * Indicates the default value of field node. * @@ -684,33 +687,33 @@ declare namespace distributedData { * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.FieldNode#default */ - default: string; - /** - * Indicates the nullable of database field. - * - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.FieldNode#nullable - */ - nullable: boolean; - /** - * Indicates the type of value. - * - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.FieldNode#type - */ - type: number; + default: string; + /** + * Indicates the nullable of database field. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.FieldNode#nullable + */ + nullable: boolean; + /** + * Indicates the type of value. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.FieldNode#type + */ + type: number; } /** * Provide methods to obtain the result set of the {@code KvStore} database. - * + * *

          The result set is created by using the {@code getResultSet} method in the {@code DeviceKVStore} class. This interface also provides * methods for moving the data read position in the result set. - * + * * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 7 * @deprecated since 9 @@ -719,7 +722,7 @@ declare namespace distributedData { interface KvStoreResultSet { /** * Obtains the number of lines in a result set. - * + * * @returns Returns the number of lines. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 @@ -727,9 +730,10 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#getCount */ getCount(): number; + /** * Obtains the current read position in a result set. - * + * * @returns Returns the current read position. The read position starts with 0. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 @@ -737,9 +741,10 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#getPosition */ getPosition(): number; + /** * Moves the read position to the first line. - * + * *

          If the result set is empty, false is returned. * * @returns Returns true if the operation succeeds; return false otherwise. @@ -749,9 +754,10 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#moveToFirst */ moveToFirst(): boolean; + /** * Moves the read position to the last line. - * + * *

          If the result set is empty, false is returned. * * @returns Returns true if the operation succeeds; return false otherwise. @@ -761,9 +767,10 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#moveToLast */ moveToLast(): boolean; + /** * Moves the read position to the next line. - * + * *

          If the result set is empty or the data in the last line is being read, false is returned. * * @returns Returns true if the operation succeeds; return false otherwise. @@ -773,9 +780,10 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#moveToNext */ moveToNext(): boolean; + /** * Moves the read position to the previous line. - * + * *

          If the result set is empty or the data in the first line is being read, false is returned. * * @returns Returns true if the operation succeeds; return false otherwise. @@ -785,9 +793,10 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#moveToPrevious */ moveToPrevious(): boolean; + /** * Moves the read position by a relative offset to the current position. - * + * * @param offset Indicates the relative offset to the current position. A negative offset indicates moving backwards, and a * positive offset indicates moving forwards. For example, if the current position is entry 1 and this offset is 2, * the destination position will be entry 3; if the current position is entry 3 and this offset is -2, @@ -800,9 +809,10 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#move */ move(offset: number): boolean; + /** * Moves the read position from 0 to an absolute position. - * + * * @param position Indicates the absolute position. * @returns Returns true if the operation succeeds; return false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -811,9 +821,10 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#moveToPosition */ moveToPosition(position: number): boolean; + /** * Checks whether the read position is the first line. - * + * * @returns Returns true if the read position is the first line; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 @@ -821,9 +832,10 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#isFirst */ isFirst(): boolean; + /** * Checks whether the read position is the last line. - * + * * @returns Returns true if the read position is the last line; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 @@ -831,9 +843,10 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#isLast */ isLast(): boolean; + /** * Checks whether the read position is before the last line. - * + * * @returns Returns true if the read position is before the first line; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 @@ -841,9 +854,10 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#isBeforeFirst */ isBeforeFirst(): boolean; + /** * Checks whether the read position is after the last line. - * + * * @returns Returns true if the read position is after the last line; returns false otherwise. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 @@ -851,9 +865,10 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVStoreResultSet#isAfterLast */ isAfterLast(): boolean; + /** * Obtains a key-value pair. - * + * * @returns Returns a key-value pair. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 @@ -886,6 +901,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#constructor */ constructor() + /** * Resets this {@code Query} object. * @@ -896,6 +912,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#reset */ reset(): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is equal to the specified long value. * @@ -908,7 +925,8 @@ declare namespace distributedData { * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Query#equalTo */ - equalTo(field: string, value: number|string|boolean): Query; + equalTo(field: string, value: number | string | boolean): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is not equal to the specified int value. * @@ -921,7 +939,8 @@ declare namespace distributedData { * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Query#notEqualTo */ - notEqualTo(field: string, value: number|string|boolean): Query; + notEqualTo(field: string, value: number | string | boolean): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is greater than or equal to the * specified int value. @@ -935,7 +954,8 @@ declare namespace distributedData { * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Query#greaterThan */ - greaterThan(field: string, value: number|string|boolean): Query; + greaterThan(field: string, value: number | string | boolean): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is less than the specified int value. * @@ -948,7 +968,8 @@ declare namespace distributedData { * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Query#lessThan */ - lessThan(field: string, value: number|string): Query; + lessThan(field: string, value: number | string): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is greater than or equal to the * specified int value. @@ -962,7 +983,8 @@ declare namespace distributedData { * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Query#greaterThanOrEqualTo */ - greaterThanOrEqualTo(field: string, value: number|string): Query; + greaterThanOrEqualTo(field: string, value: number | string): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is less than or equal to the * specified int value. @@ -976,7 +998,8 @@ declare namespace distributedData { * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Query#lessThanOrEqualTo */ - lessThanOrEqualTo(field: string, value: number|string): Query; + lessThanOrEqualTo(field: string, value: number | string): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is null. * @@ -989,6 +1012,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#isNull */ isNull(field: string): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is within the specified int value list. * @@ -1002,6 +1026,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#inNumber */ inNumber(field: string, valueList: number[]): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is within the specified string value list. * @@ -1015,6 +1040,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#inString */ inString(field: string, valueList: string[]): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is not within the specified int value list. * @@ -1028,6 +1054,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#notInNumber */ notInNumber(field: string, valueList: number[]): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is not within the specified string value list. * @@ -1041,6 +1068,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#notInString */ notInString(field: string, valueList: string[]): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is similar to the specified string value. * @@ -1054,6 +1082,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#like */ like(field: string, value: string): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is not similar to the specified string value. * @@ -1067,6 +1096,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#unlike */ unlike(field: string, value: string): Query; + /** * Constructs a {@code Query} object with the and condition. * @@ -1079,6 +1109,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#and */ and(): Query; + /** * Constructs a {@code Query} object with the or condition. * @@ -1091,6 +1122,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#or */ or(): Query; + /** * Constructs a {@code Query} object to sort the query results in ascending order. * @@ -1103,6 +1135,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#orderByAsc */ orderByAsc(field: string): Query; + /** * Constructs a {@code Query} object to sort the query results in descending order. * @@ -1115,6 +1148,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#orderByDesc */ orderByDesc(field: string): Query; + /** * Constructs a {@code Query} object to specify the number of results and the start position. * @@ -1127,6 +1161,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#limit */ limit(total: number, offset: number): Query; + /** * Creates a {@code query} condition with a specified field that is not null. * @@ -1139,6 +1174,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#isNotNull */ isNotNull(field: string): Query; + /** * Creates a query condition group with a left bracket. * @@ -1152,6 +1188,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#beginGroup */ beginGroup(): Query; + /** * Creates a query condition group with a right bracket. * @@ -1165,6 +1202,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#endGroup */ endGroup(): Query; + /** * Creates a query condition with a specified key prefix. * @@ -1177,6 +1215,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#prefixKey */ prefixKey(prefix: string): Query; + /** * Sets a specified index that will be preferentially used for query. * @@ -1189,31 +1228,33 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.Query#setSuggestIndex */ setSuggestIndex(index: string): Query; - /** - * Add device ID key prefix.Used by {@code DeviceKVStore}. - * - * @param deviceId Specify device id to query from. - * @returns Returns the {@code Query} object with device ID prefix added. - * @throws Throws this exception if input is invalid. + + /** + * Add device ID key prefix.Used by {@code DeviceKVStore}. + * + * @param deviceId Specify device id to query from. + * @returns Returns the {@code Query} object with device ID prefix added. + * @throws Throws this exception if input is invalid. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Query#deviceId - */ - deviceId(deviceId:string):Query; - /** - * Get a String that represents this {@code Query}. - * - *

          The String would be parsed to DB query format. - * The String length should be no longer than 500kb. - * - * @returns String representing this {@code Query}. + */ + deviceId(deviceId: string): Query; + + /** + * Get a String that represents this {@code Query}. + * + *

          The String would be parsed to DB query format. + * The String length should be no longer than 500kb. + * + * @returns String representing this {@code Query}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 8 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.Query#getSqlLike - */ - getSqlLike():string; + */ + getSqlLike(): string; } /** @@ -1248,6 +1289,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#put */ put(key: string, value: Uint8Array | string | number | boolean, callback: AsyncCallback): void; + put(key: string, value: Uint8Array | string | number | boolean): Promise; /** @@ -1264,6 +1306,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#delete */ delete(key: string, callback: AsyncCallback): void; + delete(key: string): Promise; /** @@ -1320,6 +1363,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#putBatch */ putBatch(entries: Entry[], callback: AsyncCallback): void; + putBatch(entries: Entry[]): Promise; /** @@ -1333,6 +1377,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#deleteBatch */ deleteBatch(keys: string[], callback: AsyncCallback): void; + deleteBatch(keys: string[]): Promise; /** @@ -1347,6 +1392,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#startTransaction */ startTransaction(callback: AsyncCallback): void; + startTransaction(): Promise; /** @@ -1360,6 +1406,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#commit */ commit(callback: AsyncCallback): void; + commit(): Promise; /** @@ -1372,6 +1419,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#rollback */ rollback(callback: AsyncCallback): void; + rollback(): Promise; /** @@ -1386,6 +1434,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#enableSync */ enableSync(enabled: boolean, callback: AsyncCallback): void; + enableSync(enabled: boolean): Promise; /** @@ -1402,6 +1451,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#setSyncRange */ setSyncRange(localLabels: string[], remoteSupportLabels: string[], callback: AsyncCallback): void; + setSyncRange(localLabels: string[], remoteSupportLabels: string[]): Promise; } @@ -1434,6 +1484,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#get */ get(key: string, callback: AsyncCallback): void; + get(key: string): Promise; /** @@ -1449,6 +1500,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#getEntries */ getEntries(keyPrefix: string, callback: AsyncCallback): void; + getEntries(keyPrefix: string): Promise; /** @@ -1464,6 +1516,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#getEntries */ getEntries(query: Query, callback: AsyncCallback): void; + getEntries(query: Query): Promise; /** @@ -1482,6 +1535,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#getResultSet */ getResultSet(keyPrefix: string, callback: AsyncCallback): void; + getResultSet(keyPrefix: string): Promise; /** @@ -1496,6 +1550,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#getResultSet */ getResultSet(query: Query, callback: AsyncCallback): void; + getResultSet(query: Query): Promise; /** @@ -1510,6 +1565,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#closeResultSet */ closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; + closeResultSet(resultSet: KvStoreResultSet): Promise; /** @@ -1525,6 +1581,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#getResultSize */ getResultSize(query: Query, callback: AsyncCallback): void; + getResultSize(query: Query): Promise; /** @@ -1536,6 +1593,7 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#removeDeviceData */ removeDeviceData(deviceId: string, callback: AsyncCallback): void; + removeDeviceData(deviceId: string): Promise; /** @@ -1553,7 +1611,7 @@ declare namespace distributedData { * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SingleKVStore#sync */ - sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; + sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; /** * Register a SingleKvStore database synchronization callback. @@ -1566,7 +1624,7 @@ declare namespace distributedData { * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SingleKVStore#on */ - on(event: 'syncComplete', syncCallback: Callback>): void; + on(event: 'syncComplete', syncCallback: Callback>): void; /** * UnRegister the SingleKvStore database synchronization callback. @@ -1577,35 +1635,37 @@ declare namespace distributedData { * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SingleKVStore#off */ - off(event: 'syncComplete', syncCallback?: Callback>): void; - - /** - * Sets the default delay allowed for database synchronization - * - * @param defaultAllowedDelayMs Indicates the default delay allowed for the database synchronization, in milliseconds. - * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, - * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.SingleKVStore#setSyncParam - */ - setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback): void; - setSyncParam(defaultAllowedDelayMs: number): Promise; - - /** - * Get the security level of the database. - * - * @returns SecurityLevel {@code SecurityLevel} the security level of the database. - * @throws Throws this exception if any of the following errors occurs:{@code SERVER_UNAVAILABLE}, - * {@code IPC_ERROR}, and {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.SingleKVStore#getSecurityLevel - */ - getSecurityLevel(callback: AsyncCallback): void; - getSecurityLevel(): Promise; + off(event: 'syncComplete', syncCallback?: Callback>): void; + + /** + * Sets the default delay allowed for database synchronization + * + * @param defaultAllowedDelayMs Indicates the default delay allowed for the database synchronization, in milliseconds. + * @throws Throws this exception if any of the following errors occurs:{@code INVALID_ARGUMENT}, + * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, and {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#setSyncParam + */ + setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback): void; + + setSyncParam(defaultAllowedDelayMs: number): Promise; + + /** + * Get the security level of the database. + * + * @returns SecurityLevel {@code SecurityLevel} the security level of the database. + * @throws Throws this exception if any of the following errors occurs:{@code SERVER_UNAVAILABLE}, + * {@code IPC_ERROR}, and {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#getSecurityLevel + */ + getSecurityLevel(callback: AsyncCallback): void; + + getSecurityLevel(): Promise; } /** @@ -1635,162 +1695,173 @@ declare namespace distributedData { * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.DeviceKVStore#get */ - get(deviceId: string, key: string, callback: AsyncCallback): void; - get(deviceId: string, key: string): Promise; - - /** - * Obtains all key-value pairs matching a specified device ID and key prefix. - * - * @param deviceId Identifies the device whose data is to be queried. - * @param keyPrefix Indicates the key prefix to match. - * @returns Returns the list of all key-value pairs meeting the given criteria. - * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, - * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getEntries - */ - getEntries(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; - getEntries(deviceId: string, keyPrefix: string): Promise; - - /** - * Obtains the list of key-value pairs matching the specified {@code Query} object. - * - * @param query Indicates the {@code Query} object. - * @returns Returns the list of key-value pairs matching the specified {@code Query} object. - * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, - * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getEntries - */ - getEntries(query: Query, callback: AsyncCallback): void; - getEntries(query: Query): Promise; - - /** - * Obtains the list of key-value pairs matching a specified device ID and {@code Query} object. - * - * @param deviceId Indicates the ID of the device to which the key-value pairs belong. - * @param query Indicates the {@code Query} object. - * @returns Returns the list of key-value pairs matching the specified {@code Query} object. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getEntries - */ - getEntries(deviceId: string, query: Query, callback: AsyncCallback): void; - getEntries(deviceId: string, query: Query): Promise; - - /** - * Obtains the {@code KvStoreResultSet} object matching the specified device ID and key prefix. - * - *

          The {@code KvStoreResultSet} object can be used to query all key-value pairs that meet the search criteria. Each {@code KvStore} - * instance can have a maximum of four {@code KvStoreResultSet} objects at the same time. If you have created four objects, - * calling this method will return a failure. Therefore, you are advised to call the closeResultSet method to close unnecessary - * {@code KvStoreResultSet} objects in a timely manner. - * - * @param deviceId Identifies the device whose data is to be queried. - * @param keyPrefix Indicates the key prefix to match. - * @returns Returns the {@code KvStoreResultSet} objects. - * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, - * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSet - */ - getResultSet(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; - getResultSet(deviceId: string, keyPrefix: string): Promise; - - /** - * Obtains the {@code KvStoreResultSet} object matching the specified {@code Query} object. - * - * @param query Indicates the {@code Query} object. - * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code Query} object. - * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, - * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSet - */ - getResultSet(query: Query, callback: AsyncCallback): void; - getResultSet(query: Query): Promise; - - /** - * Obtains the {@code KvStoreResultSet} object matching a specified device ID and {@code Query} object. - * - * @param deviceId Indicates the ID of the device to which the {@code KvStoreResultSet} object belongs. - * @param query Indicates the {@code Query} object. - * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code Query} object. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSet - */ - getResultSet(deviceId: string, query: Query, callback: AsyncCallback): void; - getResultSet(deviceId: string, query: Query): Promise; - - /** - * Closes a {@code KvStoreResultSet} object returned by getResultSet. - * - * @param resultSet Indicates the {@code KvStoreResultSet} object to close. - * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, - * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.DeviceKVStore#closeResultSet - */ - closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; - closeResultSet(resultSet: KvStoreResultSet): Promise; - - /** - * Obtains the number of results matching the specified {@code Query} object. - * - * @param query Indicates the {@code Query} object. - * @returns Returns the number of results matching the specified {@code Query} object. - * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, - * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSize - */ - getResultSize(query: Query, callback: AsyncCallback): void; - getResultSize(query: Query): Promise; - - /** - * Obtains the number of results matching a specified device ID and {@code Query} object. - * - * @param deviceId Indicates the ID of the device to which the results belong. - * @param query Indicates the {@code Query} object. - * @returns Returns the number of results matching the specified {@code Query} object. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSize - */ - getResultSize(deviceId: string, query: Query, callback: AsyncCallback): void; - getResultSize(deviceId: string, query: Query): Promise; - - /** - * Removes data of a specified device from the current database. This method is used to remove only the data - * synchronized from remote devices. This operation does not synchronize data to other databases or affect - * subsequent data synchronization. - * - * @param deviceId Identifies the device whose data is to be removed. The value cannot be the current device ID. - * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, - * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 8 - * @deprecated since 9 - * @useinstead ohos.data.distributedKVStore.DeviceKVStore#removeDeviceData - */ - removeDeviceData(deviceId: string, callback: AsyncCallback): void; - removeDeviceData(deviceId: string): Promise; + get(deviceId: string, key: string, callback: AsyncCallback): void; + + get(deviceId: string, key: string): Promise; + + /** + * Obtains all key-value pairs matching a specified device ID and key prefix. + * + * @param deviceId Identifies the device whose data is to be queried. + * @param keyPrefix Indicates the key prefix to match. + * @returns Returns the list of all key-value pairs meeting the given criteria. + * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, + * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getEntries + */ + getEntries(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; + + getEntries(deviceId: string, keyPrefix: string): Promise; + + /** + * Obtains the list of key-value pairs matching the specified {@code Query} object. + * + * @param query Indicates the {@code Query} object. + * @returns Returns the list of key-value pairs matching the specified {@code Query} object. + * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, + * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getEntries + */ + getEntries(query: Query, callback: AsyncCallback): void; + + getEntries(query: Query): Promise; + + /** + * Obtains the list of key-value pairs matching a specified device ID and {@code Query} object. + * + * @param deviceId Indicates the ID of the device to which the key-value pairs belong. + * @param query Indicates the {@code Query} object. + * @returns Returns the list of key-value pairs matching the specified {@code Query} object. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getEntries + */ + getEntries(deviceId: string, query: Query, callback: AsyncCallback): void; + + getEntries(deviceId: string, query: Query): Promise; + + /** + * Obtains the {@code KvStoreResultSet} object matching the specified device ID and key prefix. + * + *

          The {@code KvStoreResultSet} object can be used to query all key-value pairs that meet the search criteria. Each {@code KvStore} + * instance can have a maximum of four {@code KvStoreResultSet} objects at the same time. If you have created four objects, + * calling this method will return a failure. Therefore, you are advised to call the closeResultSet method to close unnecessary + * {@code KvStoreResultSet} objects in a timely manner. + * + * @param deviceId Identifies the device whose data is to be queried. + * @param keyPrefix Indicates the key prefix to match. + * @returns Returns the {@code KvStoreResultSet} objects. + * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, + * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSet + */ + getResultSet(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; + + getResultSet(deviceId: string, keyPrefix: string): Promise; + + /** + * Obtains the {@code KvStoreResultSet} object matching the specified {@code Query} object. + * + * @param query Indicates the {@code Query} object. + * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code Query} object. + * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, + * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSet + */ + getResultSet(query: Query, callback: AsyncCallback): void; + + getResultSet(query: Query): Promise; + + /** + * Obtains the {@code KvStoreResultSet} object matching a specified device ID and {@code Query} object. + * + * @param deviceId Indicates the ID of the device to which the {@code KvStoreResultSet} object belongs. + * @param query Indicates the {@code Query} object. + * @returns Returns the {@code KvStoreResultSet} object matching the specified {@code Query} object. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSet + */ + getResultSet(deviceId: string, query: Query, callback: AsyncCallback): void; + + getResultSet(deviceId: string, query: Query): Promise; + + /** + * Closes a {@code KvStoreResultSet} object returned by getResultSet. + * + * @param resultSet Indicates the {@code KvStoreResultSet} object to close. + * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, + * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#closeResultSet + */ + closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; + + closeResultSet(resultSet: KvStoreResultSet): Promise; + + /** + * Obtains the number of results matching the specified {@code Query} object. + * + * @param query Indicates the {@code Query} object. + * @returns Returns the number of results matching the specified {@code Query} object. + * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, + * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSize + */ + getResultSize(query: Query, callback: AsyncCallback): void; + + getResultSize(query: Query): Promise; + + /** + * Obtains the number of results matching a specified device ID and {@code Query} object. + * + * @param deviceId Indicates the ID of the device to which the results belong. + * @param query Indicates the {@code Query} object. + * @returns Returns the number of results matching the specified {@code Query} object. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSize + */ + getResultSize(deviceId: string, query: Query, callback: AsyncCallback): void; + + getResultSize(deviceId: string, query: Query): Promise; + + /** + * Removes data of a specified device from the current database. This method is used to remove only the data + * synchronized from remote devices. This operation does not synchronize data to other databases or affect + * subsequent data synchronization. + * + * @param deviceId Identifies the device whose data is to be removed. The value cannot be the current device ID. + * @throws Throws this exception if any of the following errors occurs: {@code INVALID_ARGUMENT}, + * {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, {@code DB_ERROR}. + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 8 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#removeDeviceData + */ + removeDeviceData(deviceId: string, callback: AsyncCallback): void; + + removeDeviceData(deviceId: string): Promise; /** * Synchronize the {@code DeviceKVStore} databases. @@ -1880,15 +1951,16 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVManager#getKVStore */ getKVStore(storeId: string, options: Options): Promise; + getKVStore(storeId: string, options: Options, callback: AsyncCallback): void; /** * Closes the {@code KvStore} database. - * + * *

          Warning: This method is not thread-safe. If you call this method to stop a KvStore database that is running, your * thread may crash. - * - *

          The {@code KvStore} database to close must be an object created by using the {@code getKvStore} method. Before using this + * + *

          The {@code KvStore} database to close must be an object created by using the {@code getKvStore} method. Before using this * method, release the resources created for the database, for example, {@code KvStoreResultSet} for {@code SingleKvStore}, * otherwise closing the database will fail. If you are attempting to close a database that is already closed, an error * will be returned. @@ -1904,18 +1976,19 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVManager#closeKVStore */ closeKVStore(appId: string, storeId: string, kvStore: KVStore, callback: AsyncCallback): void; + closeKVStore(appId: string, storeId: string, kvStore: KVStore): Promise; /** * Deletes the {@code KvStore} database identified by storeId. - * + * *

          Before using this method, close all {@code KvStore} instances in use that are identified by the same storeId. - * + * *

          You can use this method to delete a {@code KvStore} database not in use. After the database is deleted, all its data will be * lost. * * @param storeId Identifies the {@code KvStore} database to delete. - * @throws Throws this exception if any of the following errors + * @throws Throws this exception if any of the following errors * occurs: {@code INVALID_ARGUMENT}, * {@code SERVER_UNAVAILABLE}, {@code STORE_NOT_FOUND}, * {@code DB_ERROR}, {@code PERMISSION_DENIED}, and {@code IPC_ERROR}. @@ -1925,14 +1998,15 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVManager#deleteKVStore */ deleteKVStore(appId: string, storeId: string, callback: AsyncCallback): void; + deleteKVStore(appId: string, storeId: string): Promise; /** * Obtains the storeId of all {@code KvStore} databases that are created by using the {@code getKvStore} method and not deleted by * calling the {@code deleteKvStore} method. - * + * * @returns Returns the storeId of all created {@code KvStore} databases. - * @throws Throws this exception if any of the following errors + * @throws Throws this exception if any of the following errors * occurs: {@code SERVER_UNAVAILABLE}, {@code DB_ERROR}, * {@code PERMISSION_DENIED}, and {@code IPC_ERROR}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -1941,13 +2015,14 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVManager#getAllKVStoreId */ getAllKVStoreId(appId: string, callback: AsyncCallback): void; + getAllKVStoreId(appId: string): Promise; /** * register DeviceChangeCallback to get notification when device's status changed - * + * * @param deathCallback device change callback {@code DeviceChangeCallback} - * @throws exception maybe occurs. + * @throws exception maybe occurs. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 8 * @deprecated since 9 @@ -1957,7 +2032,7 @@ declare namespace distributedData { /** * unRegister DeviceChangeCallback and can not receive notification - * + * * @param deathCallback device change callback {@code DeviceChangeCallback} which has been registered. * @throws exception maybe occurs. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore diff --git a/api/@ohos.data.distributedKVStore.d.ts b/api/@ohos.data.distributedKVStore.d.ts index 3a47cffe72..2ee6c9b9e5 100644 --- a/api/@ohos.data.distributedKVStore.d.ts +++ b/api/@ohos.data.distributedKVStore.d.ts @@ -13,8 +13,8 @@ * limitations under the License. */ -import { AsyncCallback, Callback } from './basic'; -import { ValuesBucket } from './@ohos.data.ValuesBucket'; +import {AsyncCallback, Callback} from './basic'; +import {ValuesBucket} from './@ohos.data.ValuesBucket'; import dataSharePredicates from './@ohos.data.dataSharePredicates'; import Context from './application/Context'; @@ -106,43 +106,43 @@ declare namespace distributedKVStore { * @since 9 */ enum ValueType { - /** - * Indicates that the value type is string. + /** + * Indicates that the value type is string. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ STRING, /** - * Indicates that the value type is int. + * Indicates that the value type is int. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ INTEGER, - /** - * Indicates that the value type is float. + /** + * Indicates that the value type is float. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ FLOAT, - /** - * Indicates that the value type is byte array. + /** + * Indicates that the value type is byte array. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 * */ BYTE_ARRAY, - /** - * Indicates that the value type is boolean. + /** + * Indicates that the value type is boolean. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 * */ BOOLEAN, - /** - * Indicates that the value type is double. + /** + * Indicates that the value type is double. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -267,14 +267,14 @@ declare namespace distributedKVStore { * Subscription to local data changes * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 - */ + */ SUBSCRIBE_TYPE_LOCAL, /** * Subscription to remote data changes * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 - */ + */ SUBSCRIBE_TYPE_REMOTE, /** @@ -419,13 +419,14 @@ declare namespace distributedKVStore { * @since 9 */ constructor() + /** * Indicates the root json object. * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ - root: FieldNode; + root: FieldNode; /** * Indicates the string array of json. * @@ -471,6 +472,7 @@ declare namespace distributedKVStore { * @since 9 */ constructor(name: string) + /** * Adds a child node to this {@code FieldNode}. * @@ -483,27 +485,28 @@ declare namespace distributedKVStore { * @since 9 */ appendChild(child: FieldNode): boolean; + /** * Indicates the default value of field node. * * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ - default: string; - /** - * Indicates the nullable of database field. - * - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 - */ - nullable: boolean; - /** - * Indicates the type of value. - * - * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore - * @since 9 - */ - type: number; + default: string; + /** + * Indicates the nullable of database field. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + nullable: boolean; + /** + * Indicates the type of value. + * + * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore + * @since 9 + */ + type: number; } /** @@ -525,6 +528,7 @@ declare namespace distributedKVStore { * @since 9 */ getCount(): number; + /** * Obtains the current read position in a result set. * @@ -533,6 +537,7 @@ declare namespace distributedKVStore { * @since 9 */ getPosition(): number; + /** * Moves the read position to the first line. * @@ -543,6 +548,7 @@ declare namespace distributedKVStore { * @since 9 */ moveToFirst(): boolean; + /** * Moves the read position to the last line. * @@ -553,6 +559,7 @@ declare namespace distributedKVStore { * @since 9 */ moveToLast(): boolean; + /** * Moves the read position to the next line. * @@ -563,6 +570,7 @@ declare namespace distributedKVStore { * @since 9 */ moveToNext(): boolean; + /** * Moves the read position to the previous line. * @@ -573,6 +581,7 @@ declare namespace distributedKVStore { * @since 9 */ moveToPrevious(): boolean; + /** * Moves the read position by a relative offset to the current position. * @@ -587,6 +596,7 @@ declare namespace distributedKVStore { * @since 9 */ move(offset: number): boolean; + /** * Moves the read position from 0 to an absolute position. * @@ -597,6 +607,7 @@ declare namespace distributedKVStore { * @since 9 */ moveToPosition(position: number): boolean; + /** * Checks whether the read position is the first line. * @@ -605,6 +616,7 @@ declare namespace distributedKVStore { * @since 9 */ isFirst(): boolean; + /** * Checks whether the read position is the last line. * @@ -613,6 +625,7 @@ declare namespace distributedKVStore { * @since 9 */ isLast(): boolean; + /** * Checks whether the read position is before the last line. * @@ -621,6 +634,7 @@ declare namespace distributedKVStore { * @since 9 */ isBeforeFirst(): boolean; + /** * Checks whether the read position is after the last line. * @@ -629,6 +643,7 @@ declare namespace distributedKVStore { * @since 9 */ isAfterLast(): boolean; + /** * Obtains a key-value pair. * @@ -658,6 +673,7 @@ declare namespace distributedKVStore { * @since 9 */ constructor() + /** * Resets this {@code Query} object. * @@ -666,6 +682,7 @@ declare namespace distributedKVStore { * @since 9 */ reset(): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is equal to the specified long value. * @@ -677,6 +694,7 @@ declare namespace distributedKVStore { * @since 9 */ equalTo(field: string, value: number | string | boolean): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is not equal to the specified int value. * @@ -688,6 +706,7 @@ declare namespace distributedKVStore { * @since 9 */ notEqualTo(field: string, value: number | string | boolean): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is greater than or equal to the * specified int value. @@ -700,6 +719,7 @@ declare namespace distributedKVStore { * @since 9 */ greaterThan(field: string, value: number | string | boolean): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is less than the specified int value. * @@ -711,6 +731,7 @@ declare namespace distributedKVStore { * @since 9 */ lessThan(field: string, value: number | string): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is greater than or * equal to the specified int value. @@ -723,6 +744,7 @@ declare namespace distributedKVStore { * @since 9 */ greaterThanOrEqualTo(field: string, value: number | string): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is less than or equal to the * specified int value. @@ -735,6 +757,7 @@ declare namespace distributedKVStore { * @since 9 */ lessThanOrEqualTo(field: string, value: number | string): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is null. * @@ -745,6 +768,7 @@ declare namespace distributedKVStore { * @since 9 */ isNull(field: string): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is within the specified int value list. * @@ -756,6 +780,7 @@ declare namespace distributedKVStore { * @since 9 */ inNumber(field: string, valueList: number[]): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is within the specified string value list. * @@ -767,6 +792,7 @@ declare namespace distributedKVStore { * @since 9 */ inString(field: string, valueList: string[]): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is not within the specified int value list. * @@ -778,6 +804,7 @@ declare namespace distributedKVStore { * @since 9 */ notInNumber(field: string, valueList: number[]): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is not within the specified string value list. * @@ -789,6 +816,7 @@ declare namespace distributedKVStore { * @since 9 */ notInString(field: string, valueList: string[]): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is similar to the specified string value. * @@ -800,6 +828,7 @@ declare namespace distributedKVStore { * @since 9 */ like(field: string, value: string): Query; + /** * Constructs a {@code Query} object to query entries with the specified field whose value is not similar to the specified string value. * @@ -811,6 +840,7 @@ declare namespace distributedKVStore { * @since 9 */ unlike(field: string, value: string): Query; + /** * Constructs a {@code Query} object with the and condition. * @@ -821,6 +851,7 @@ declare namespace distributedKVStore { * @since 9 */ and(): Query; + /** * Constructs a {@code Query} object with the or condition. * @@ -831,6 +862,7 @@ declare namespace distributedKVStore { * @since 9 */ or(): Query; + /** * Constructs a {@code Query} object to sort the query results in ascending order. * @@ -841,6 +873,7 @@ declare namespace distributedKVStore { * @since 9 */ orderByAsc(field: string): Query; + /** * Constructs a {@code Query} object to sort the query results in descending order. * @@ -851,6 +884,7 @@ declare namespace distributedKVStore { * @since 9 */ orderByDesc(field: string): Query; + /** * Constructs a {@code Query} object to specify the number of results and the start position. * @@ -862,6 +896,7 @@ declare namespace distributedKVStore { * @since 9 */ limit(total: number, offset: number): Query; + /** * Creates a {@code Query} condition with a specified field that is not null. * @@ -872,6 +907,7 @@ declare namespace distributedKVStore { * @since 9 */ isNotNull(field: string): Query; + /** * Creates a query condition group with a left bracket. * @@ -883,6 +919,7 @@ declare namespace distributedKVStore { * @since 9 */ beginGroup(): Query; + /** * Creates a query condition group with a right bracket. * @@ -894,6 +931,7 @@ declare namespace distributedKVStore { * @since 9 */ endGroup(): Query; + /** * Creates a query condition with a specified key prefix. * @@ -904,6 +942,7 @@ declare namespace distributedKVStore { * @since 9 */ prefixKey(prefix: string): Query; + /** * Sets a specified index that will be preferentially used for query. * @@ -914,6 +953,7 @@ declare namespace distributedKVStore { * @since 9 */ setSuggestIndex(index: string): Query; + /** * Add device ID key prefix.Used by {@code DeviceKVStore}. * @@ -923,7 +963,8 @@ declare namespace distributedKVStore { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - deviceId(deviceId:string):Query; + deviceId(deviceId: string): Query; + /** * Get a String that represents this {@code Query}. * @@ -934,7 +975,7 @@ declare namespace distributedKVStore { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - getSqlLike():string; + getSqlLike(): string; } /** @@ -1398,7 +1439,7 @@ declare namespace distributedKVStore { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - backup(file:string, callback: AsyncCallback):void; + backup(file: string, callback: AsyncCallback): void; /** * Backs up a database in the specified filename. @@ -1411,7 +1452,7 @@ declare namespace distributedKVStore { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - backup(file:string): Promise; + backup(file: string): Promise; /** * Restores a database from a specified database file. @@ -1424,7 +1465,7 @@ declare namespace distributedKVStore { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - restore(file:string, callback: AsyncCallback):void; + restore(file: string, callback: AsyncCallback): void; /** * Restores a database from a specified database file. @@ -1437,7 +1478,7 @@ declare namespace distributedKVStore { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - restore(file:string): Promise; + restore(file: string): Promise; /** * Delete database backup files based on the specified filenames. @@ -1450,7 +1491,7 @@ declare namespace distributedKVStore { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - deleteBackup(files:Array, callback: AsyncCallback>):void; + deleteBackup(files: Array, callback: AsyncCallback>): void; /** * Delete database backup files based on the specified filenames. @@ -1462,7 +1503,7 @@ declare namespace distributedKVStore { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - deleteBackup(files:Array): Promise>; + deleteBackup(files: Array): Promise>; /** * Starts a transaction operation in the {@code SingleKVStore} database. @@ -1677,7 +1718,7 @@ declare namespace distributedKVStore { * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ - off(event:'dataChange', listener?: Callback): void; + off(event: 'dataChange', listener?: Callback): void; /** * Unregister the database synchronization callback. -- Gitee From f5fbfe085252b5baa82e56e5f57b20734b76f835 Mon Sep 17 00:00:00 2001 From: donglin Date: Thu, 17 Nov 2022 17:32:42 +0800 Subject: [PATCH 345/438] fix error Signed-off-by: donglin Change-Id: I8b76315f936f4ef722cd0130e8a96e69563b38c7 --- api/@internal/ets/lifecycle.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@internal/ets/lifecycle.d.ts b/api/@internal/ets/lifecycle.d.ts index 88a0bce3ec..f86b4ea5ee 100644 --- a/api/@internal/ets/lifecycle.d.ts +++ b/api/@internal/ets/lifecycle.d.ts @@ -14,7 +14,7 @@ */ import Want from "../../@ohos.application.Want"; -import ResultSet from "../../data/rdb/resultSet"; +import { ResultSet } from "../../data/rdb/resultSet"; import { AbilityInfo } from "../../bundle/abilityInfo"; import { DataAbilityResult } from "../../ability/dataAbilityResult"; import { DataAbilityOperation } from "../../ability/dataAbilityOperation"; -- Gitee From 83068aae0b7c50ba82c210c1c02241f41b22da08 Mon Sep 17 00:00:00 2001 From: liyufan Date: Thu, 17 Nov 2022 17:41:13 +0800 Subject: [PATCH 346/438] fix api import Signed-off-by: liyufan --- api/@ohos.telephony.radio.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.telephony.radio.d.ts b/api/@ohos.telephony.radio.d.ts index 75098eb1d8..e5cc3b93fc 100644 --- a/api/@ohos.telephony.radio.d.ts +++ b/api/@ohos.telephony.radio.d.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import {AsyncCallback} from "./basic"; +import {AsyncCallback, Callback} from "./basic"; /** * Provides interfaces for applications to obtain the network state, cell information, signal information, -- Gitee From f695efc91d897cb9e5f1724f2b0b4807f480204a Mon Sep 17 00:00:00 2001 From: zhufenghao Date: Thu, 17 Nov 2022 19:06:35 +0800 Subject: [PATCH 347/438] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dweb.d.ts=E5=92=8Cweb.?= =?UTF-8?q?webview.d.ts=E6=96=87=E4=BB=B6=E6=8B=BC=E5=86=99=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhufenghao --- api/@internal/component/ets/web.d.ts | 10 +- api/@ohos.web.webview.d.ts | 152 +++++++++++++-------------- 2 files changed, 81 insertions(+), 81 deletions(-) diff --git a/api/@internal/component/ets/web.d.ts b/api/@internal/component/ets/web.d.ts index 75c3663bbf..6dee9d2ab0 100644 --- a/api/@internal/component/ets/web.d.ts +++ b/api/@internal/component/ets/web.d.ts @@ -645,7 +645,7 @@ declare class WebContextMenuParam { /** * If the long-press location is the link returns the link's original URL. - * @return If relate to a link return unfilterend link url, else return null. + * @return If relate to a link return unfiltered link url, else return null. * * @since 9 */ @@ -688,7 +688,7 @@ declare class WebContextMenuResult { closeContextMenu(): void; /** - * If WebContextMenuParam has image content, this function will copy image ralated to this context menu. + * If WebContextMenuParam has image content, this function will copy image related to this context menu. * If WebContextMenuParam has no image content, this function will do nothing. * * @since 9 @@ -1829,10 +1829,10 @@ declare class WebAttribute extends CommonMethod { onHttpAuthRequest(callback: (event?: { handler: HttpAuthHandler, host: string, realm: string }) => boolean): WebAttribute; /** - * Triggered when the resouces loading is intercepted. - * @param callback The triggered callback when the resouces loading is intercepted. + * Triggered when the resources loading is intercepted. + * @param callback The triggered callback when the resources loading is intercepted. * - * @return If the response value is null, the Web will continue to load the resouces. Otherwise, the response value will be used + * @return If the response value is null, the Web will continue to load the resources. Otherwise, the response value will be used * @since 9 */ onInterceptRequest(callback: (event?: { request: WebResourceRequest}) => WebResourceResponse): WebAttribute; diff --git a/api/@ohos.web.webview.d.ts b/api/@ohos.web.webview.d.ts index 17ef1e3769..b678e138c4 100644 --- a/api/@ohos.web.webview.d.ts +++ b/api/@ohos.web.webview.d.ts @@ -148,8 +148,8 @@ declare namespace webview { * Delete the storage data with the origin. * * @param { string } origin - The origin which to be deleted. - * @throws { BusinessError } 401 - Invaild input parameter. - * @throws { BusinessError } 17100011 - Invaild permission origin. + * @throws { BusinessError } 401 - Invalid input parameter. + * @throws { BusinessError } 17100011 - Invalid permission origin. * @since 9 */ static deleteOrigin(origin : string): void; @@ -157,8 +157,8 @@ declare namespace webview { /** * Get current all the web storage origins. * - * @throws { BusinessError } 401 - Invaild input parameter. - * @throws { BusinessError } 17100012 - Invaild web storage origin. + * @throws { BusinessError } 401 - Invalid input parameter. + * @throws { BusinessError } 17100012 - Invalid web storage origin. * @since 9 */ static getOrigins() : Promise>; @@ -167,8 +167,8 @@ declare namespace webview { /** * Get the web storage quota with the origin. * @param { string } origin - The origin which to be inquired. - * @throws { BusinessError } 401 - Invaild input parameter. - * @throws { BusinessError } 17100011 - Invaild permission origin. + * @throws { BusinessError } 401 - Invalid input parameter. + * @throws { BusinessError } 17100011 - Invalid permission origin. * @since 9 */ static getOriginQuota(origin : string) : Promise; @@ -177,8 +177,8 @@ declare namespace webview { /** * Get the web storage quota with the origin. * @param { string } origin - The origin which to be inquired. - * @throws { BusinessError } 401 - Invaild input parameter. - * @throws { BusinessError } 17100011 - Invaild permission origin. + * @throws { BusinessError } 401 - Invalid input parameter. + * @throws { BusinessError } 17100011 - Invalid permission origin. * @since 9 */ static getOriginUsage(origin : string) : Promise ; @@ -211,7 +211,7 @@ declare namespace webview { * Get http authentication credentials. * @param { string } host - The host to which the credentials apply. * @param { string } realm - The realm to which the credentials apply. - * @throws { BusinessError } 401 - Invaild input parameter. + * @throws { BusinessError } 401 - Invalid input parameter. * @return { Array } Return an array containing username and password. * @since 9 */ @@ -223,7 +223,7 @@ declare namespace webview { * @param { string } realm - The realm to which the credentials apply. * @param { string } username - The username. * @param { string } password - The password. - * @throws { BusinessError } 401 - Invaild input parameter. + * @throws { BusinessError } 401 - Invalid input parameter. * * @since 9 */ @@ -289,8 +289,8 @@ declare namespace webview { /** * Allow geolocation permissions for specifies source. * @param { string } origin - Url source. - * @throws { BusinessError } 401 - Invaild input parameter. - * @throws { BusinessError } 17100011 - Invaild permission origin. + * @throws { BusinessError } 401 - Invalid input parameter. + * @throws { BusinessError } 17100011 - Invalid permission origin. * * @since 9 */ @@ -299,8 +299,8 @@ declare namespace webview { /** * Delete geolocation permissions for specifies source. * @param { string } origin - Url source. - * @throws { BusinessError } 401 - Invaild input parameter. - * @throws { BusinessError } 17100011 - Invaild permission origin. + * @throws { BusinessError } 401 - Invalid input parameter. + * @throws { BusinessError } 17100011 - Invalid permission origin. * * @since 9 */ @@ -318,8 +318,8 @@ declare namespace webview { * @param { string } origin - Url source. * @param { AsyncCallback } callback - Return to the specified source * geographic location permission status. - * @throws { BusinessError } 401 - Invaild input parameter. - * @throws { BusinessError } 17100011 - Invaild permission origin. + * @throws { BusinessError } 401 - Invalid input parameter. + * @throws { BusinessError } 17100011 - Invalid permission origin. * @return { Promise } Return whether there is a saved result. * * @since 9 @@ -331,7 +331,7 @@ declare namespace webview { * Get all stored geolocation permission url source. * @param { AsyncCallback } callback - Return all source information of * stored geographic location permission status. - * @throws { BusinessError } 401 - Invaild input parameter. + * @throws { BusinessError } 401 - Invalid input parameter. * @return { Promise> } Return whether there is a saved result. * * @since 9 @@ -350,8 +350,8 @@ declare namespace webview { * Gets all cookies for the given URL. * * @param { string } url - The URL for which the cookies are requested. - * @throws { BusinessError } 401 - Invaild input parameter. - * @throws { BusinessError } 17100002 - Invaild url. + * @throws { BusinessError } 401 - Invalid input parameter. + * @throws { BusinessError } 17100002 - Invalid url. * @returns The cookie value for the given URL. * * @since 9 @@ -363,9 +363,9 @@ declare namespace webview { * * @param { string } url - The URL for which the cookie is to be set. * @param { string } value - The cookie as a string, using the format of the 'Set-Cookie' HTTP response header. - * @throws { BusinessError } 401 - Invaild input parameter. - * @throws { BusinessError } 17100002 - Invaild url. - * @throws { BusinessError } 17100005 - Invaild cookie value. + * @throws { BusinessError } 401 - Invalid input parameter. + * @throws { BusinessError } 17100002 - Invalid url. + * @throws { BusinessError } 17100005 - Invalid cookie value. * * @since 9 */ @@ -375,7 +375,7 @@ declare namespace webview { * Save the cookies Asynchronously. * * @param { AsyncCallback } callback - Called after the cookies have been saved. - * @throws { BusinessError } 401 - Invaild input parameter. + * @throws { BusinessError } 401 - Invalid input parameter. * @return { Promise } A promise resolved after the cookies have been saved. * * @since 9 @@ -397,7 +397,7 @@ declare namespace webview { * By default this is set to be true. * * @param { boolean } accept - Whether the instance should send and accept cookies. - * @throws { BusinessError } 401 - Invaild input parameter. + * @throws { BusinessError } 401 - Invalid input parameter. * * @since 9 */ @@ -417,7 +417,7 @@ declare namespace webview { * By default this is set to be false. * * @param { boolean } accept - Whether the instance should send and accept thirdparty cookies. - * @throws { BusinessError } 401 - Invaild input parameter. + * @throws { BusinessError } 401 - Invalid input parameter. * * @since 9 */ @@ -461,7 +461,7 @@ declare namespace webview { /** * Post a message to other port. * @param { string } message - Message to send. - * @throws { BusinessError } 401 - Invaild input parameter. + * @throws { BusinessError } 401 - Invalid input parameter. * @throws { BusinessError } 17100010 - Can not post message using this port. * * @since 9 @@ -471,7 +471,7 @@ declare namespace webview { /** * Receive message from other port. * @param { (result: string) => void } callback - Callback function for receiving messages. - * @throws { BusinessError } 401 - Invaild input parameter. + * @throws { BusinessError } 401 - Invalid input parameter. * @throws { BusinessError } 17100006 - Can not register message event using this port. * * @since 9 @@ -489,7 +489,7 @@ declare namespace webview { * Checks whether the web page can go forward. * * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * @returns { boolean } True if the web page can go forward else false. * * @since 9 @@ -500,7 +500,7 @@ declare namespace webview { * Checks whether the web page can go back. * * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * @returns { boolean } True if the web page can go back else false. * * @since 9 @@ -511,9 +511,9 @@ declare namespace webview { * Checks whether the web page can go back or forward the given number of steps. * * @param { number } step - The number of steps. - * @throws { BusinessError } 401 - Invaild input parameter. + * @throws { BusinessError } 401 - Invalid input parameter. * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * @returns { boolean } True if the web page can go back else false. * * @since 9 @@ -524,7 +524,7 @@ declare namespace webview { * Goes forward in the history of the web page. * * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * * @since 9 */ @@ -534,7 +534,7 @@ declare namespace webview { * Goes back in the history of the web page. * * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * * @since 9 */ @@ -544,7 +544,7 @@ declare namespace webview { * Clears the history in the Web. * * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * @since 9 */ clearHistory(): void; @@ -553,7 +553,7 @@ declare namespace webview { * Let the Web active. * * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * @since 9 */ onActive(): void; @@ -562,7 +562,7 @@ declare namespace webview { * Let the Web inactive. * * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * @since 9 */ onInactive(): void; @@ -571,7 +571,7 @@ declare namespace webview { * Refreshes the current URL. * * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * @since 9 */ refresh(): void; @@ -587,10 +587,10 @@ declare namespace webview { * @param { string } [historyUrl] - History URL. When it is not empty, it can be managed by * history records to realize the back and forth function. * This property is invalid when baseUrl is empty. - * @throws { BusinessError } 401 - Invaild input parameter. + * @throws { BusinessError } 401 - Invalid input parameter. * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. - * @throws { BusinessError } 17100002 - Invaild url. + * The WebviewController must be associated with a Web component. + * @throws { BusinessError } 17100002 - Invalid url. * * @since 9 */ @@ -601,10 +601,10 @@ declare namespace webview { * * @param { string | Resource } url - The URL to load. * @param { Array } [headers] - Additional HTTP request header for URL. - * @throws { BusinessError } 401 - Invaild input parameter. + * @throws { BusinessError } 401 - Invalid input parameter. * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. - * @throws { BusinessError } 17100002 - Invaild url. + * The WebviewController must be associated with a Web component. + * @throws { BusinessError } 17100002 - Invalid url. * @throws { BusinessError } 17100003 - Invalid resource path or file type. * * @since 9 @@ -615,7 +615,7 @@ declare namespace webview { * Gets the type of HitTest. * * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * @returns { HitTestTypeV9 } The type of HitTest. * * @since 9 @@ -633,9 +633,9 @@ declare namespace webview { * @param { AsyncCallback } callback - called after the web archive has been stored. The parameter * will either be the filename under which the file was stored, * or empty if storing the file failed. - * @throws { BusinessError } 401 - Invaild input parameter. + * @throws { BusinessError } 401 - Invalid input parameter. * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * @throws { BusinessError } 17100003 - Invalid resource path or file type. * @returns { Promise } a promise resolved after the web archive has been stored. The parameter * will either be the filename under which the file was stored, or empty @@ -650,9 +650,9 @@ declare namespace webview { * Let the Web zoom by. * * @param { number } factor - The zoom factor. - * @throws { BusinessError } 401 - Invaild input parameter. + * @throws { BusinessError } 401 - Invalid input parameter. * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * @throws { BusinessError } 17100004 - Function not enable. * * @since 9 @@ -663,7 +663,7 @@ declare namespace webview { * Let the Web zoom in. * * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * @throws { BusinessError } 17100004 - Function not enable. * * @since 9 @@ -674,7 +674,7 @@ declare namespace webview { * Let the Web zoom out. * * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * @throws { BusinessError } 17100004 - Function not enable. * * @since 9 @@ -685,7 +685,7 @@ declare namespace webview { * Gets the hit test value of HitTest. * * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * @returns { HitTestValue } Return the element information of the clicked area. * * @since 9 @@ -696,7 +696,7 @@ declare namespace webview { * Gets the id for the current Web. * * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * @returns { number } Returns the index value of the current Web component. * * @since 9 @@ -707,7 +707,7 @@ declare namespace webview { * Gets the default user agent. * * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * @returns { string } Return user agent information. * * @since 9 @@ -718,7 +718,7 @@ declare namespace webview { * Gets the title of current Web page. * * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * @returns { string } Return to File Selector Title. * * @since 9 @@ -729,7 +729,7 @@ declare namespace webview { * Gets the content height of current Web page. * * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * @returns { number } Returns the page height of the current page. * * @since 9 @@ -740,9 +740,9 @@ declare namespace webview { * Goes forward or back backOrForward in the history of the web page. * * @param { number } step - Steps to go forward or backward. - * @throws { BusinessError } 401 - Invaild input parameter. + * @throws { BusinessError } 401 - Invalid input parameter. * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * * @since 9 */ @@ -752,7 +752,7 @@ declare namespace webview { * Gets the request focus. * * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * * @since 9 */ @@ -762,7 +762,7 @@ declare namespace webview { * Create web message ports * * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * @returns { Array } An array represent 2 WebMessagePort, then can use * those ports to communication with html pages. * @@ -776,9 +776,9 @@ declare namespace webview { * @param { string } name - Data name information to send. * @param { Array } ports - Port number array information to send. * @param { string } uri - URI to receive this information. - * @throws { BusinessError } 401 - Invaild input parameter. + * @throws { BusinessError } 401 - Invalid input parameter. * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * * @since 9 */ @@ -788,7 +788,7 @@ declare namespace webview { * Stops the current load. * * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * * @since 9 */ @@ -802,9 +802,9 @@ declare namespace webview { * object name called in the window. * @param { Array } methodList - Thr method of the application side JavaScript object participating * in the registration. - * @throws { BusinessError } 401 - Invaild input parameter. + * @throws { BusinessError } 401 - Invalid input parameter. * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * * @since 9 */ @@ -814,9 +814,9 @@ declare namespace webview { * Deletes a registered JavaScript object with given name. * * @param { string } name - The name of a registered JavaScript object to be deleted. - * @throws { BusinessError } 401 - Invaild input parameter. + * @throws { BusinessError } 401 - Invalid input parameter. * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * @throws { BusinessError } 17100008 - Cannot delete JavaScriptProxy. * * @since 9 @@ -828,9 +828,9 @@ declare namespace webview { * result will be notify through callback onSearchResultReceive. * * @param { string } searchString - String to be search. - * @throws { BusinessError } 401 - Invaild input parameter. + * @throws { BusinessError } 401 - Invalid input parameter. * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * * @since 9 */ @@ -840,7 +840,7 @@ declare namespace webview { * Clears the highlighting surrounding text matches created by searchAllAsync. * * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * * @since 9 */ @@ -850,9 +850,9 @@ declare namespace webview { * Highlights and scrolls to the next match search. * * @param { boolean } forward - Step of search is back or forward. - * @throws { BusinessError } 401 - Invaild input parameter. + * @throws { BusinessError } 401 - Invalid input parameter. * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * * @since 9 */ @@ -862,7 +862,7 @@ declare namespace webview { * Clears the ssl cache in the Web. * * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * * @since 9 */ @@ -872,7 +872,7 @@ declare namespace webview { * Clears the client authentication certificate cache in the Web. * * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * * @since 9 */ @@ -883,9 +883,9 @@ declare namespace webview { * * @param { string } script - JavaScript Script. * @param { AsyncCallback } callback - Callbacks execute JavaScript script results. - * @throws { BusinessError } 401 - Invaild input parameter. + * @throws { BusinessError } 401 - Invalid input parameter. * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * @returns { Promise } A promise is solved after the JavaScript script is executed. * This parameter will be the result of JavaScript script execution. * If the JavaScript script fails to execute or has no return value, @@ -900,7 +900,7 @@ declare namespace webview { * Gets the url of current Web page. * * @throws { BusinessError } 17100001 - Init error. - * The WebviewController must be associted with a Web component. + * The WebviewController must be associated with a Web component. * @returns { string } Return the url of the current page. * * @since 9 -- Gitee From 258e608bc7fe0de84fb0340abda00df9418947b1 Mon Sep 17 00:00:00 2001 From: duanweiling Date: Thu, 17 Nov 2022 20:40:08 +0800 Subject: [PATCH 348/438] erroe word and permission Signed-off-by: duanweiling --- api/@ohos.data.dataAbility.d.ts | 31 +++++----- api/@ohos.data.distributedDataObject.d.ts | 4 +- api/@ohos.data.rdb.d.ts | 72 +++++++++++------------ api/@ohos.data.storage.d.ts | 8 +-- 4 files changed, 58 insertions(+), 57 deletions(-) diff --git a/api/@ohos.data.dataAbility.d.ts b/api/@ohos.data.dataAbility.d.ts index 7dd326bdc7..670ef3d2f7 100644 --- a/api/@ohos.data.dataAbility.d.ts +++ b/api/@ohos.data.dataAbility.d.ts @@ -43,7 +43,7 @@ declare namespace dataAbility { */ class DataAbilityPredicates { /** - * Configures the DataAbilityPredicates to match the field whose data type is ValueType and value is equal + * Configure the DataAbilityPredicates to match the field whose data type is ValueType and value is equal * to a specified value. * This method is similar to = of the SQL statement. * @@ -56,8 +56,9 @@ declare namespace dataAbility { equalTo(field: string, value: ValueType): DataAbilityPredicates; /** - * Configures the DataAbilityPredicates to match the field whose data type is ValueType and value is unequal to + * Configure the DataAbilityPredicates to match the field whose data type is ValueType and value is unequal to * a specified value. + * Configure the data capability predicate to match a field where the data type is a value type and the value is not equal to the specified value. * This method is similar to != of the SQL statement. * * @since 7 @@ -110,7 +111,7 @@ declare namespace dataAbility { and(): DataAbilityPredicates; /** - * Configures the DataAbilityPredicates to match the field whose data type is string and value + * Configure the DataAbilityPredicates to match the field whose data type is string and value * contains a specified value. * This method is similar to contains of the SQL statement. * @@ -123,7 +124,7 @@ declare namespace dataAbility { contains(field: string, value: string): DataAbilityPredicates; /** - * Configures the DataAbilityPredicates to match the field whose data type is string and value starts + * Configure the DataAbilityPredicates to match the field whose data type is string and value starts * with a specified string. * This method is similar to value% of the SQL statement. * @@ -136,7 +137,7 @@ declare namespace dataAbility { beginsWith(field: string, value: string): DataAbilityPredicates; /** - * Configures the DataAbilityPredicates to match the field whose data type is string and value + * Configure the DataAbilityPredicates to match the field whose data type is string and value * ends with a specified string. * This method is similar to %value of the SQL statement. * @@ -149,7 +150,7 @@ declare namespace dataAbility { endsWith(field: string, value: string): DataAbilityPredicates; /** - * Configures the DataAbilityPredicates to match the fields whose value is null. + * Configure the DataAbilityPredicates to match the fields whose value is null. * This method is similar to is null of the SQL statement. * * @since 7 @@ -160,7 +161,7 @@ declare namespace dataAbility { isNull(field: string): DataAbilityPredicates; /** - * Configures the DataAbilityPredicates to match the specified fields whose value is not null. + * Configure the DataAbilityPredicates to match the specified fields whose value is not null. * This method is similar to is not null of the SQL statement. * * @since 7 @@ -171,7 +172,7 @@ declare namespace dataAbility { isNotNull(field: string): DataAbilityPredicates; /** - * Configures the DataAbilityPredicates to match the fields whose data type is string and value is + * Configure the DataAbilityPredicates to match the fields whose data type is string and value is * similar to a specified string. * This method is similar to like of the SQL statement. * @@ -185,7 +186,7 @@ declare namespace dataAbility { like(field: string, value: string): DataAbilityPredicates; /** - * Configures DataAbilityPredicates to match the specified field whose data type is string and the value contains + * Configure DataAbilityPredicates to match the specified field whose data type is string and the value contains * a wildcard. * Different from like, the input parameters of this method are case-sensitive. * @@ -210,7 +211,7 @@ declare namespace dataAbility { between(field: string, low: ValueType, high: ValueType): DataAbilityPredicates; /** - * Configures DataAbilityPredicates to match the specified field whose data type is int and value is + * Configure DataAbilityPredicates to match the specified field whose data type is int and value is * out of a given range. * * @since 7 @@ -309,7 +310,7 @@ declare namespace dataAbility { limitAs(value: number): DataAbilityPredicates; /** - * Configures DataAbilityPredicates to specify the start position of the returned result. + * Configure DataAbilityPredicates to specify the start position of the returned result. * Use this method together with limit(int). * * @since 7 @@ -320,7 +321,7 @@ declare namespace dataAbility { offsetAs(rowOffset: number): DataAbilityPredicates; /** - * Configures DataAbilityPredicates to group query results by specified columns. + * Configure DataAbilityPredicates to group query results by specified columns. * * @since 7 * @syscap SystemCapability.DistributedDataManager.DataShare.Core @@ -330,7 +331,7 @@ declare namespace dataAbility { groupBy(fields: Array): DataAbilityPredicates; /** - * Configures DataAbilityPredicates to specify the index column. + * Configure DataAbilityPredicates to specify the index column. * Before using this method, you need to create an index column. * * @since 7 @@ -341,7 +342,7 @@ declare namespace dataAbility { indexedBy(field: string): DataAbilityPredicates; /** - * Configures DataAbilityPredicates to match the specified field whose data type is ValueType array and values + * Configure DataAbilityPredicates to match the specified field whose data type is ValueType array and values * are within a given range. * * @since 7 @@ -353,7 +354,7 @@ declare namespace dataAbility { in(field: string, value: Array): DataAbilityPredicates; /** - * Configures {@code DataAbilityPredicates} to match the specified field whose data type is String array and values + * Configure {@code DataAbilityPredicates} to match the specified field whose data type is String array and values * are out of a given range. * * @since 7 diff --git a/api/@ohos.data.distributedDataObject.d.ts b/api/@ohos.data.distributedDataObject.d.ts index c42521376c..55715e51aa 100644 --- a/api/@ohos.data.distributedDataObject.d.ts +++ b/api/@ohos.data.distributedDataObject.d.ts @@ -212,7 +212,7 @@ declare namespace distributedDataObject { /* * Change object session. * - * @permission ohos.permission.DISTRIBUTED_DATASYNC. + * @permission ohos.permission.DISTRIBUTED_DATASYNC * @param {string} sessionId - sessionId The sessionId to be joined, if empty, leave all session. * @param {AsyncCallback} callback - the callback of setSessionId. * @throws {BusinessError} 201 - the permissions check failed. @@ -227,7 +227,7 @@ declare namespace distributedDataObject { /* * Change object session. * - * @permission ohos.permission.DISTRIBUTED_DATASYNC. + * @permission ohos.permission.DISTRIBUTED_DATASYNC * @param {string} sessionId - sessionId The sessionId to be joined, if empty, leave all session. * @returns {Promise} - the promise returned by the function. * @throws {BusinessError} 201 - the permissions check failed. diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts index eedc42c1e8..8e7a2b49b1 100644 --- a/api/@ohos.data.rdb.d.ts +++ b/api/@ohos.data.rdb.d.ts @@ -424,7 +424,7 @@ declare namespace rdb executeSql(sql: string, bindArgs ?: Array): Promise; /** - * Begin Transaction before excute your sql. + * Begin Transaction before execute your sql. * * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 @@ -434,7 +434,7 @@ declare namespace rdb beginTransaction(): void; /** - * Commit the the sql you have excuted. + * Commit the the sql you have executed. * * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 @@ -444,7 +444,7 @@ declare namespace rdb commit(): void; /** - * Roll back the sql you have already excuted. + * Roll back the sql you have already executed. * * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @since 8 @@ -841,7 +841,7 @@ declare namespace rdb executeSql(sql: string, bindArgs ?: Array): Promise; /** - * BeginTransaction before excute your sql. + * BeginTransaction before execute your sql. * * @throws {BusinessError} 401 - if the parameter type is incorrect. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core @@ -1118,7 +1118,7 @@ class RdbPredicates { inAllDevices(): RdbPredicates; /** - * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is equal + * Configure the RdbPredicatesV9 to match the field whose data type is ValueType and value is equal * to a specified value. * This method is similar to = of the SQL statement. * @@ -1133,7 +1133,7 @@ class RdbPredicates { equalTo(field: string, value: ValueType): RdbPredicates; /** - * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is not equal to + * Configure the RdbPredicatesV9 to match the field whose data type is ValueType and value is not equal to * a specified value. * This method is similar to != of the SQL statement. * @@ -1197,7 +1197,7 @@ class RdbPredicates { and(): RdbPredicates; /** - * Configures the RdbPredicates to match the field whose data type is string and value + * Configure the RdbPredicates to match the field whose data type is string and value * contains a specified value. * This method is similar to contains of the SQL statement. * @@ -1212,7 +1212,7 @@ class RdbPredicates { contains(field: string, value: string): RdbPredicates; /** - * Configures the RdbPredicates to match the field whose data type is string and value starts + * Configure the RdbPredicates to match the field whose data type is string and value starts * with a specified string. * This method is similar to value% of the SQL statement. * @@ -1227,7 +1227,7 @@ class RdbPredicates { beginsWith(field: string, value: string): RdbPredicates; /** - * Configures the RdbPredicates to match the field whose data type is string and value + * Configure the RdbPredicates to match the field whose data type is string and value * ends with a specified string. * This method is similar to %value of the SQL statement. * @@ -1242,7 +1242,7 @@ class RdbPredicates { endsWith(field: string, value: string): RdbPredicates; /** - * Configures the RdbPredicates to match the fields whose value is null. + * Configure the RdbPredicates to match the fields whose value is null. * This method is similar to is null of the SQL statement. * * @param {string} field - Indicates the column name in the database table. @@ -1255,7 +1255,7 @@ class RdbPredicates { isNull(field: string): RdbPredicates; /** - * Configures the RdbPredicates to match the specified fields whose value is not null. + * Configure the RdbPredicates to match the specified fields whose value is not null. * This method is similar to is not null of the SQL statement. * * @param {string} field - Indicates the column name in the database table. @@ -1269,7 +1269,7 @@ class RdbPredicates { isNotNull(field: string): RdbPredicates; /** - * Configures the RdbPredicates to match the fields whose data type is string and value is + * Configure the RdbPredicates to match the fields whose data type is string and value is * similar to a specified string. * This method is similar to like of the SQL statement. * @@ -1284,7 +1284,7 @@ class RdbPredicates { like(field: string, value: string): RdbPredicates; /** - * Configures RdbPredicates to match the specified field whose data type is string and the value contains + * Configure RdbPredicates to match the specified field whose data type is string and the value contains * a wildcard. * Different from like, the input parameters of this method are case-sensitive. * @@ -1299,7 +1299,7 @@ class RdbPredicates { glob(field: string, value: string): RdbPredicates; /** - * Configures RdbPredicates to match the specified field whose data type is string and the value contains + * Configure RdbPredicates to match the specified field whose data type is string and the value contains * a wildcard. * * @param {string} field - Indicates the column name. @@ -1314,7 +1314,7 @@ class RdbPredicates { between(field: string, low: ValueType, high: ValueType): RdbPredicates; /** - * Configures RdbPredicates to match the specified field whose data type is int and value is + * Configure RdbPredicates to match the specified field whose data type is int and value is * out of a given range. * * @param {string} field - Indicates the column name in the database table. @@ -1430,7 +1430,7 @@ class RdbPredicates { limitAs(value: number): RdbPredicates; /** - * Configures RdbPredicatesV9 to specify the start position of the returned result. + * Configure RdbPredicatesV9 to specify the start position of the returned result. * Use this method together with limit(int). * * @param {number} rowOffset - Indicates the start position of the returned result. The value is a positive integer. @@ -1443,7 +1443,7 @@ class RdbPredicates { offsetAs(rowOffset: number): RdbPredicates; /** - * Configures RdbPredicatesV9 to group query results by specified columns. + * Configure RdbPredicatesV9 to group query results by specified columns. * * @param {Array} fields - Indicates the specified columns by which query results are grouped. * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. @@ -1455,7 +1455,7 @@ class RdbPredicates { groupBy(fields: Array): RdbPredicates; /** - * Configures RdbPredicatesV9 to specify the index column. + * Configure RdbPredicatesV9 to specify the index column. * Before using this method, you need to create an index column. * * @param {string} field - Indicates the name of the index column. @@ -1468,7 +1468,7 @@ class RdbPredicates { indexedBy(field: string): RdbPredicates; /** - * Configures RdbPredicatesV9 to match the specified field whose data type is ValueType array and values + * Configure RdbPredicatesV9 to match the specified field whose data type is ValueType array and values * are within a given range. * * @param {string} field - Indicates the column name in the database table. @@ -1482,7 +1482,7 @@ class RdbPredicates { in(field: string, value: Array): RdbPredicates; /** - * Configures RdbPredicatesV9 to match the specified field whose data type is ValueType array and values + * Configure RdbPredicatesV9 to match the specified field whose data type is ValueType array and values * are out of a given range. * * @param {string} field - Indicates the column name in the database table. @@ -1536,7 +1536,7 @@ class RdbPredicatesV9 { inAllDevices(): RdbPredicatesV9; /** - * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is equal + * Configure the RdbPredicatesV9 to match the field whose data type is ValueType and value is equal * to a specified value. * This method is similar to = of the SQL statement. * @@ -1550,7 +1550,7 @@ class RdbPredicatesV9 { equalTo(field: string, value: ValueType): RdbPredicatesV9; /** - * Configures the RdbPredicatesV9 to match the field whose data type is ValueType and value is not equal to + * Configure the RdbPredicatesV9 to match the field whose data type is ValueType and value is not equal to * a specified value. * This method is similar to != of the SQL statement. * @@ -1605,7 +1605,7 @@ class RdbPredicatesV9 { and(): RdbPredicatesV9; /** - * Configures the RdbPredicatesV9 to match the field whose data type is string and value + * Configure the RdbPredicatesV9 to match the field whose data type is string and value * contains a specified value. * This method is similar to contains of the SQL statement. * @@ -1619,7 +1619,7 @@ class RdbPredicatesV9 { contains(field: string, value: string): RdbPredicatesV9; /** - * Configures the RdbPredicatesV9 to match the field whose data type is string and value starts + * Configure the RdbPredicatesV9 to match the field whose data type is string and value starts * with a specified string. * This method is similar to value% of the SQL statement. * @@ -1633,7 +1633,7 @@ class RdbPredicatesV9 { beginsWith(field: string, value: string): RdbPredicatesV9; /** - * Configures the RdbPredicatesV9 to match the field whose data type is string and value + * Configure the RdbPredicatesV9 to match the field whose data type is string and value * ends with a specified string. * This method is similar to %value of the SQL statement. * @@ -1647,7 +1647,7 @@ class RdbPredicatesV9 { endsWith(field: string, value: string): RdbPredicatesV9; /** - * Configures the RdbPredicatesV9 to match the fields whose value is null. + * Configure the RdbPredicatesV9 to match the fields whose value is null. * This method is similar to is null of the SQL statement. * * @param {string} field - Indicates the column name in the database table. @@ -1659,7 +1659,7 @@ class RdbPredicatesV9 { isNull(field: string): RdbPredicatesV9; /** - * Configures the RdbPredicatesV9 to match the specified fields whose value is not null. + * Configure the RdbPredicatesV9 to match the specified fields whose value is not null. * This method is similar to is not null of the SQL statement. * * @param {string} field - Indicates the column name in the database table. @@ -1671,7 +1671,7 @@ class RdbPredicatesV9 { isNotNull(field: string): RdbPredicatesV9; /** - * Configures the RdbPredicatesV9 to match the fields whose data type is string and value is + * Configure the RdbPredicatesV9 to match the fields whose data type is string and value is * similar to a specified string. * This method is similar to like of the SQL statement. * @@ -1685,7 +1685,7 @@ class RdbPredicatesV9 { like(field: string, value: string): RdbPredicatesV9; /** - * Configures RdbPredicatesV9 to match the specified field whose data type is string and the value contains + * Configure RdbPredicatesV9 to match the specified field whose data type is string and the value contains * a wildcard. * Different from like, the input parameters of this method are case-sensitive. * @@ -1699,7 +1699,7 @@ class RdbPredicatesV9 { glob(field: string, value: string): RdbPredicatesV9; /** - * Configures RdbPredicatesV9 to match the specified field whose data type is string and the value contains + * Configure RdbPredicatesV9 to match the specified field whose data type is string and the value contains * a wildcard. * * @param {string} field - Indicates the column name. @@ -1713,7 +1713,7 @@ class RdbPredicatesV9 { between(field: string, low: ValueType, high: ValueType): RdbPredicatesV9; /** - * Configures RdbPredicatesV9 to match the specified field whose data type is int and value is + * Configure RdbPredicatesV9 to match the specified field whose data type is int and value is * out of a given range. * * @param {string} field - Indicates the column name in the database table. @@ -1819,7 +1819,7 @@ class RdbPredicatesV9 { limitAs(value: number): RdbPredicatesV9; /** - * Configures RdbPredicatesV9 to specify the start position of the returned result. + * Configure RdbPredicatesV9 to specify the start position of the returned result. * Use this method together with limit(int). * * @param {number} rowOffset - Indicates the start position of the returned result. The value is a positive integer. @@ -1831,7 +1831,7 @@ class RdbPredicatesV9 { offsetAs(rowOffset: number): RdbPredicatesV9; /** - * Configures RdbPredicatesV9 to group query results by specified columns. + * Configure RdbPredicatesV9 to group query results by specified columns. * * @param {Array} fields - Indicates the specified columns by which query results are grouped. * @returns {RdbPredicatesV9} - the SQL query statement with the specified {@link RdbPredicatesV9}. @@ -1842,7 +1842,7 @@ class RdbPredicatesV9 { groupBy(fields: Array): RdbPredicatesV9; /** - * Configures RdbPredicatesV9 to specify the index column. + * Configure RdbPredicatesV9 to specify the index column. * Before using this method, you need to create an index column. * * @param {string} field - Indicates the name of the index column. @@ -1854,7 +1854,7 @@ class RdbPredicatesV9 { indexedBy(field: string): RdbPredicatesV9; /** - * Configures RdbPredicatesV9 to match the specified field whose data type is ValueType array and values + * Configure RdbPredicatesV9 to match the specified field whose data type is ValueType array and values * are within a given range. * * @param {string} field - Indicates the column name in the database table. @@ -1867,7 +1867,7 @@ class RdbPredicatesV9 { in(field: string, value: Array): RdbPredicatesV9; /** - * Configures RdbPredicatesV9 to match the specified field whose data type is ValueType array and values + * Configure RdbPredicatesV9 to match the specified field whose data type is ValueType array and values * are out of a given range. * * @param {string} field - Indicates the column name in the database table. diff --git a/api/@ohos.data.storage.d.ts b/api/@ohos.data.storage.d.ts index 86b8edd9de..80b5597a56 100644 --- a/api/@ohos.data.storage.d.ts +++ b/api/@ohos.data.storage.d.ts @@ -48,7 +48,7 @@ declare namespace storage { * storage file. * *

          When deleting the {@link Storage} instance, you must release all references - * of the instance. In addition, do not use the instance to perform data operations. Otherwise, data inconsistency + * of the instance. In addition, do not use the instance to perform data operations. Otherwise, inconsistent data * will occur. * * @param path Indicates the path of storage file @@ -65,7 +65,7 @@ declare namespace storage { * from the cache. * *

          When deleting the {@link Storage} instance, you must release all references - * of the instance. In addition, do not use the instance to perform data operations. Otherwise, data inconsistency + * of the instance. In addition, do not use the instance to perform data operations. Otherwise, inconsistent data * will occur. * * @param path Indicates the path of storage file. @@ -82,7 +82,7 @@ declare namespace storage { * *

          The storage data is stored in a file, which matches only one {@link Storage} instance in the memory. * You can use getStorage to obtain the {@link Storage} instance matching - * the file that stores storage data, and use emoveStorageFromCache + * the file that stores storage data, and use removeStorageFromCache * to remove the {@link Storage} instance from the memory. * * @syscap SystemCapability.DistributedDataManager.Preferences.Core @@ -190,7 +190,7 @@ declare namespace storage { on(type: 'change', callback: Callback): void; /** - * Unregisters an existing observer. + * Unregister an existing observer. * * @param callback Indicates the registered callback. * @throws BusinessError if invoked failed -- Gitee From 803abbf9a70b4c6d06aacca18f2d3edeb59a7ca4 Mon Sep 17 00:00:00 2001 From: duanweiling Date: Thu, 17 Nov 2022 21:09:35 +0800 Subject: [PATCH 349/438] unknow deprecated Signed-off-by: duanweiling --- api/@system.storage.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/@system.storage.d.ts b/api/@system.storage.d.ts index 0135d75cce..14eb618379 100644 --- a/api/@system.storage.d.ts +++ b/api/@system.storage.d.ts @@ -196,6 +196,7 @@ export default class Storage { * Reads the stored content. * @param options Options. * @deprecated since 6 + * @useinstead ohos.preferences.preferences.get * @FAModelOnly */ static get(options: GetStorageOptions): void; @@ -204,6 +205,7 @@ export default class Storage { * Modifies the stored content. * @param options Options. * @deprecated since 6 + * @useinstead ohos.preferences.preferences.set * @FAModelOnly */ static set(options: SetStorageOptions): void; @@ -212,6 +214,7 @@ export default class Storage { * Clears the stored content. * @param options Options. * @deprecated since 6 + * @useinstead ohos.preferences.preferences.clear * @FAModelOnly */ static clear(options?: ClearStorageOptions): void; @@ -220,6 +223,7 @@ export default class Storage { * Deletes the stored content. * @param options Options. * @deprecated since 6 + * @useinstead ohos.preferences.preferences.delete * @FAModelOnly */ static delete(options: DeleteStorageOptions): void; -- Gitee From 5503c49254166bb4e9ecd05a97b9afc3aaef826b Mon Sep 17 00:00:00 2001 From: duanweiling Date: Thu, 17 Nov 2022 21:16:42 +0800 Subject: [PATCH 350/438] unknow deprecated1 Signed-off-by: duanweiling --- api/@system.storage.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/api/@system.storage.d.ts b/api/@system.storage.d.ts index 14eb618379..ee70b15efe 100644 --- a/api/@system.storage.d.ts +++ b/api/@system.storage.d.ts @@ -205,7 +205,6 @@ export default class Storage { * Modifies the stored content. * @param options Options. * @deprecated since 6 - * @useinstead ohos.preferences.preferences.set * @FAModelOnly */ static set(options: SetStorageOptions): void; -- Gitee From 96047d26d425cc744553acd82e37b9dd27d1386d Mon Sep 17 00:00:00 2001 From: dboy190 Date: Thu, 17 Nov 2022 21:47:16 +0800 Subject: [PATCH 351/438] fix test bugs Signed-off-by: dboy190 --- api/@ohos.data.distributedData.d.ts | 108 +++++--- api/@ohos.data.distributedKVStore.d.ts | 358 ++++++++++++++++++++----- 2 files changed, 359 insertions(+), 107 deletions(-) diff --git a/api/@ohos.data.distributedData.d.ts b/api/@ohos.data.distributedData.d.ts index 7c303b80c7..0c17584892 100644 --- a/api/@ohos.data.distributedData.d.ts +++ b/api/@ohos.data.distributedData.d.ts @@ -1289,7 +1289,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#put */ put(key: string, value: Uint8Array | string | number | boolean, callback: AsyncCallback): void; - put(key: string, value: Uint8Array | string | number | boolean): Promise; /** @@ -1306,7 +1305,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#delete */ delete(key: string, callback: AsyncCallback): void; - delete(key: string): Promise; /** @@ -1352,6 +1350,20 @@ declare namespace distributedData { */ off(event: 'dataChange', listener?: Callback): void; + /** + * UnRegister the {@code KvStore} database synchronization callback. + * + * @param syncCallback Indicates the callback used to send the synchronization result to caller. + * @throws Throws this exception if any of the following errors + * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, + * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#off + */ + off(event: 'syncComplete', syncCallback?: Callback>): void; + /** * Inserts key-value pairs into the {@code KvStore} database in batches. * @@ -1363,7 +1375,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#putBatch */ putBatch(entries: Entry[], callback: AsyncCallback): void; - putBatch(entries: Entry[]): Promise; /** @@ -1377,7 +1388,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#deleteBatch */ deleteBatch(keys: string[], callback: AsyncCallback): void; - deleteBatch(keys: string[]): Promise; /** @@ -1392,7 +1402,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#startTransaction */ startTransaction(callback: AsyncCallback): void; - startTransaction(): Promise; /** @@ -1406,7 +1415,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#commit */ commit(callback: AsyncCallback): void; - commit(): Promise; /** @@ -1419,7 +1427,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#rollback */ rollback(callback: AsyncCallback): void; - rollback(): Promise; /** @@ -1434,7 +1441,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#enableSync */ enableSync(enabled: boolean, callback: AsyncCallback): void; - enableSync(enabled: boolean): Promise; /** @@ -1451,7 +1457,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#setSyncRange */ setSyncRange(localLabels: string[], remoteSupportLabels: string[], callback: AsyncCallback): void; - setSyncRange(localLabels: string[], remoteSupportLabels: string[]): Promise; } @@ -1484,7 +1489,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#get */ get(key: string, callback: AsyncCallback): void; - get(key: string): Promise; /** @@ -1500,7 +1504,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#getEntries */ getEntries(keyPrefix: string, callback: AsyncCallback): void; - getEntries(keyPrefix: string): Promise; /** @@ -1516,7 +1519,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#getEntries */ getEntries(query: Query, callback: AsyncCallback): void; - getEntries(query: Query): Promise; /** @@ -1535,7 +1537,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#getResultSet */ getResultSet(keyPrefix: string, callback: AsyncCallback): void; - getResultSet(keyPrefix: string): Promise; /** @@ -1550,7 +1551,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#getResultSet */ getResultSet(query: Query, callback: AsyncCallback): void; - getResultSet(query: Query): Promise; /** @@ -1565,7 +1565,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#closeResultSet */ closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; - closeResultSet(resultSet: KvStoreResultSet): Promise; /** @@ -1581,7 +1580,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#getResultSize */ getResultSize(query: Query, callback: AsyncCallback): void; - getResultSize(query: Query): Promise; /** @@ -1593,7 +1591,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#removeDeviceData */ removeDeviceData(deviceId: string, callback: AsyncCallback): void; - removeDeviceData(deviceId: string): Promise; /** @@ -1613,6 +1610,21 @@ declare namespace distributedData { */ sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; + /** + * Register a {@code KvStoreObserver} for the database. When data in the distributed database changes, the callback + * in the {@code KvStoreObserver} will be invoked. + * + * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. + * @param listener Indicates the observer of data change events in the distributed database. + * @throws Throws this exception if no {@code SingleKvStore} database is available. + * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#on + */ + on(event: 'dataChange', type: SubscribeType, listener: Callback): void; + /** * Register a SingleKvStore database synchronization callback. *

          Sync result is returned through asynchronous callback. @@ -1626,6 +1638,20 @@ declare namespace distributedData { */ on(event: 'syncComplete', syncCallback: Callback>): void; + /** + * Unsubscribe the SingleKvStore database based on the specified subscribeType and {@code KvStoreObserver}. + * + * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. + * @throws Throws this exception if any of the following errors + * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, + * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.SingleKVStore#off + */ + off(event: 'dataChange', listener?: Callback): void; + /** * UnRegister the SingleKvStore database synchronization callback. * @@ -1649,7 +1675,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#setSyncParam */ setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback): void; - setSyncParam(defaultAllowedDelayMs: number): Promise; /** @@ -1664,7 +1689,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.SingleKVStore#getSecurityLevel */ getSecurityLevel(callback: AsyncCallback): void; - getSecurityLevel(): Promise; } @@ -1696,7 +1720,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.DeviceKVStore#get */ get(deviceId: string, key: string, callback: AsyncCallback): void; - get(deviceId: string, key: string): Promise; /** @@ -1713,7 +1736,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getEntries */ getEntries(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; - getEntries(deviceId: string, keyPrefix: string): Promise; /** @@ -1729,7 +1751,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getEntries */ getEntries(query: Query, callback: AsyncCallback): void; - getEntries(query: Query): Promise; /** @@ -1744,7 +1765,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getEntries */ getEntries(deviceId: string, query: Query, callback: AsyncCallback): void; - getEntries(deviceId: string, query: Query): Promise; /** @@ -1766,7 +1786,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSet */ getResultSet(deviceId: string, keyPrefix: string, callback: AsyncCallback): void; - getResultSet(deviceId: string, keyPrefix: string): Promise; /** @@ -1782,7 +1801,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSet */ getResultSet(query: Query, callback: AsyncCallback): void; - getResultSet(query: Query): Promise; /** @@ -1797,7 +1815,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSet */ getResultSet(deviceId: string, query: Query, callback: AsyncCallback): void; - getResultSet(deviceId: string, query: Query): Promise; /** @@ -1812,7 +1829,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.DeviceKVStore#closeResultSet */ closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void; - closeResultSet(resultSet: KvStoreResultSet): Promise; /** @@ -1828,7 +1844,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSize */ getResultSize(query: Query, callback: AsyncCallback): void; - getResultSize(query: Query): Promise; /** @@ -1843,7 +1858,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.DeviceKVStore#getResultSize */ getResultSize(deviceId: string, query: Query, callback: AsyncCallback): void; - getResultSize(deviceId: string, query: Query): Promise; /** @@ -1860,7 +1874,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.DeviceKVStore#removeDeviceData */ removeDeviceData(deviceId: string, callback: AsyncCallback): void; - removeDeviceData(deviceId: string): Promise; /** @@ -1882,6 +1895,23 @@ declare namespace distributedData { */ sync(deviceIds: string[], mode: SyncMode, delayMs?: number): void; + /** + * Register a {@code KvStoreObserver} for the database. When data in the distributed database changes, the + * callback in the {@code KvStoreObserver} will be invoked. + * + * @param type Indicates the subscription type, which is defined in {@code SubscribeType}. + * @param listener Indicates the observer of data change events in the distributed database. + * @throws Throws this exception if any of the following errors + * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, + * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#on + */ + on(event: 'dataChange', type: SubscribeType, listener: Callback): void; + + /** * Register a DeviceKVStore database synchronization callback. * @@ -1896,6 +1926,20 @@ declare namespace distributedData { */ on(event: 'syncComplete', syncCallback: Callback>): void; + /** + * Unsubscribe the DeviceKVStore database based on the specified subscribeType and {@code KvStoreObserver}. + * + * @param listener Indicates the data change observer registered by {#subscribe(SubscribeType, KvStoreObserver)}. + * @throws Throws this exception if any of the following errors + * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, + * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + * @deprecated since 9 + * @useinstead ohos.data.distributedKVStore.DeviceKVStore#off + */ + off(event: 'dataChange', listener?: Callback): void; + /** * UnRegister the DeviceKVStore database synchronization callback. * @@ -1951,7 +1995,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVManager#getKVStore */ getKVStore(storeId: string, options: Options): Promise; - getKVStore(storeId: string, options: Options, callback: AsyncCallback): void; /** @@ -1976,7 +2019,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVManager#closeKVStore */ closeKVStore(appId: string, storeId: string, kvStore: KVStore, callback: AsyncCallback): void; - closeKVStore(appId: string, storeId: string, kvStore: KVStore): Promise; /** @@ -1998,7 +2040,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVManager#deleteKVStore */ deleteKVStore(appId: string, storeId: string, callback: AsyncCallback): void; - deleteKVStore(appId: string, storeId: string): Promise; /** @@ -2015,7 +2056,6 @@ declare namespace distributedData { * @useinstead ohos.data.distributedKVStore.KVManager#getAllKVStoreId */ getAllKVStoreId(appId: string, callback: AsyncCallback): void; - getAllKVStoreId(appId: string): Promise; /** diff --git a/api/@ohos.data.distributedKVStore.d.ts b/api/@ohos.data.distributedKVStore.d.ts index 2ee6c9b9e5..9f076e0da9 100644 --- a/api/@ohos.data.distributedKVStore.d.ts +++ b/api/@ohos.data.distributedKVStore.d.ts @@ -163,6 +163,7 @@ declare namespace distributedKVStore { * @since 9 */ type: ValueType; + /** * Indicates the value * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -184,6 +185,7 @@ declare namespace distributedKVStore { * @since 9 */ key: string; + /** * Indicates the value * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -209,18 +211,21 @@ declare namespace distributedKVStore { * @since 9 */ insertEntries: Entry[]; + /** * Indicates data update records. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ updateEntries: Entry[]; + /** * Indicates data deletion records. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ deleteEntries: Entry[]; + /** * Indicates the device id which brings the data change. * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -242,12 +247,14 @@ declare namespace distributedKVStore { * @since 9 */ PULL_ONLY, + /** * Indicates that data is only pushed from the local end. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ PUSH_ONLY, + /** * Indicates that data is pushed from the local end, and then pulled from the remote end. * @syscap SystemCapability.DistributedDataManager.KVStore.Core @@ -364,18 +371,21 @@ declare namespace distributedKVStore { * @since 9 */ createIfMissing?: boolean; + /** * Indicates whether database files to be encrypted * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ encrypt?: boolean; + /** * Indicates whether to back up database files * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ backup?: boolean; + /** * Indicates whether database files are automatically synchronized * @permission ohos.permission.DISTRIBUTED_DATASYNC @@ -383,18 +393,21 @@ declare namespace distributedKVStore { * @since 9 */ autoSync?: boolean; + /** * Indicates the database type * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ kvStoreType?: KVStoreType; + /** * Indicates the database security level * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ securityLevel: SecurityLevel; + /** * Indicates the database schema * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore @@ -427,6 +440,7 @@ declare namespace distributedKVStore { * @since 9 */ root: FieldNode; + /** * Indicates the string array of json. * @@ -434,6 +448,7 @@ declare namespace distributedKVStore { * @since 9 */ indexes: Array; + /** * Indicates the mode of schema. * @@ -441,6 +456,7 @@ declare namespace distributedKVStore { * @since 9 */ mode: number; + /** * Indicates the skip size of schema. * @@ -493,6 +509,7 @@ declare namespace distributedKVStore { * @since 9 */ default: string; + /** * Indicates the nullable of database field. * @@ -500,6 +517,7 @@ declare namespace distributedKVStore { * @since 9 */ nullable: boolean; + /** * Indicates the type of value. * @@ -1003,7 +1021,7 @@ declare namespace distributedKVStore { * @param {AsyncCallback} callback - the callback of put. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1020,7 +1038,7 @@ declare namespace distributedKVStore { * @returns {Promise} the promise returned by the function. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1033,7 +1051,7 @@ declare namespace distributedKVStore { * @param {AsyncCallback} callback - the callback of putBatch. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1046,7 +1064,7 @@ declare namespace distributedKVStore { * @returns {Promise} the promise returned by the function. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1059,7 +1077,7 @@ declare namespace distributedKVStore { * @param {AsyncCallback} callback - the callback of putBatch. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @systemapi * @since 9 @@ -1073,7 +1091,7 @@ declare namespace distributedKVStore { * @returns {Promise} the promise returned by the function. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @systemapi * @since 9 @@ -1088,8 +1106,7 @@ declare namespace distributedKVStore { * @param {AsyncCallback} callback - the callback of delete. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100004 - if the data not exist when delete data. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1103,8 +1120,7 @@ declare namespace distributedKVStore { * @returns {Promise} the promise returned by the function. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100004 - if the data not exist when delete data. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1117,8 +1133,7 @@ declare namespace distributedKVStore { * @param {AsyncCallback} callback - the callback of delete. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100004 - if the data not exist when delete data. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.DataShare.Provider * @systemapi * @since 9 @@ -1132,8 +1147,7 @@ declare namespace distributedKVStore { * @returns {Promise} the promise returned by the function. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100004 - if the data not exist when delete data. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.DataShare.Provider * @systemapi * @since 9 @@ -1147,8 +1161,7 @@ declare namespace distributedKVStore { * @param {AsyncCallback} callback - the callback of deleteBatch. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100004 - if the data not exist when delete data. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1161,8 +1174,7 @@ declare namespace distributedKVStore { * @returns {Promise} the promise returned by the function. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100004 - if the data not exist when delete data. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1176,7 +1188,7 @@ declare namespace distributedKVStore { * @param {string} deviceId - Identifies the device whose data is to be removed and the value cannot be the current device ID. * @param {AsyncCallback} callback - the callback of removeDeviceData. * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ @@ -1190,7 +1202,7 @@ declare namespace distributedKVStore { * @param {string} deviceId - Identifies the device whose data is to be removed and the value cannot be the current device ID. * @returns {Promise} the promise returned by the function. * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ @@ -1205,7 +1217,7 @@ declare namespace distributedKVStore { * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100004 - if the data not exist when query data. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1220,7 +1232,7 @@ declare namespace distributedKVStore { * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100004 - if the data not exist when query data. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1230,11 +1242,11 @@ declare namespace distributedKVStore { * Obtains all key-value pairs that match a specified key prefix. * * @param {string} keyPrefix - Indicates the key prefix to match. - \* @param {AsyncCallback} callback - {Entry[]}: the list of all key-value pairs + * @param {AsyncCallback} callback - {Entry[]}: the list of all key-value pairs * that match the specified key prefix. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1248,7 +1260,7 @@ declare namespace distributedKVStore { * specified key prefix. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1262,8 +1274,7 @@ declare namespace distributedKVStore { * matching the specified {@code Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100005 - if not support the operation. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1277,8 +1288,7 @@ declare namespace distributedKVStore { * specified {@code Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100005 - if not support the operation. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1296,7 +1306,7 @@ declare namespace distributedKVStore { * object matching the specified keyPrefix. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1314,7 +1324,7 @@ declare namespace distributedKVStore { * object matching the specified keyPrefix. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1328,7 +1338,7 @@ declare namespace distributedKVStore { * object matching the specified {@code Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1342,7 +1352,7 @@ declare namespace distributedKVStore { * object matching the specified {@code Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1356,7 +1366,7 @@ declare namespace distributedKVStore { * object matching the specified {@code dataSharePredicates.DataSharePredicates} object. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.DataShare.Provider * @systemapi * @since 9 @@ -1371,7 +1381,7 @@ declare namespace distributedKVStore { * object matching the specified {@code dataSharePredicates.DataSharePredicates} object. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.DataShare.Provider * @systemapi * @since 9 @@ -1408,7 +1418,7 @@ declare namespace distributedKVStore { * specified {@code Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1422,7 +1432,7 @@ declare namespace distributedKVStore { * {@code Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1434,8 +1444,7 @@ declare namespace distributedKVStore { * @param {string} file - Indicates the database backup filename. * @param {AsyncCallback} callback - the callback of backup. * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100005 - if not support the operation. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1447,8 +1456,7 @@ declare namespace distributedKVStore { * @param {string} file - Indicates the database backup filename. * @returns {Promise} the promise returned by the function. * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100005 - if not support the operation. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1460,8 +1468,7 @@ declare namespace distributedKVStore { * @param {string} file - Indicates the database backup filename. * @param {AsyncCallback} callback - the callback of restore. * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100005 - if not support the operation. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1473,8 +1480,7 @@ declare namespace distributedKVStore { * @param {string} file - Indicates the database backup filename. * @returns {Promise} the promise returned by the function. * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100005 - if not support the operation. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1511,7 +1517,7 @@ declare namespace distributedKVStore { *

          After the database transaction is started, you can submit or roll back the operation. * * @param {AsyncCallback} callback - the callback of startTransaction. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1523,7 +1529,7 @@ declare namespace distributedKVStore { *

          After the database transaction is started, you can submit or roll back the operation. * * @returns {Promise} the promise returned by the function. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1533,7 +1539,7 @@ declare namespace distributedKVStore { * Submits a transaction operation in the {@code SingleKVStore} database. * * @param {AsyncCallback} callback - the callback of commit. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1543,7 +1549,7 @@ declare namespace distributedKVStore { * Submits a transaction operation in the {@code SingleKVStore} database. * * @returns {Promise} the promise returned by the function. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1553,7 +1559,7 @@ declare namespace distributedKVStore { * Rolls back a transaction operation in the {@code SingleKVStore} database. * * @param {AsyncCallback} callback - the callback of rollback. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1563,7 +1569,7 @@ declare namespace distributedKVStore { * Rolls back a transaction operation in the {@code SingleKVStore} database. * * @returns {Promise} the promise returned by the function. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1689,7 +1695,7 @@ declare namespace distributedKVStore { * object indicates the data change events in the distributed database. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100001 - if the database has been subscribed over the max subscription time limit. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1714,7 +1720,7 @@ declare namespace distributedKVStore { * @param {Callback} listener - {ChangeNotification}: the {@code ChangeNotification} * object indicates the data change events in the distributed database. * @throws {BusinessError} 401 - if parameter check failed. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1737,7 +1743,7 @@ declare namespace distributedKVStore { * * @param {AsyncCallback} callback - {SecurityLevel}: the {@code SecurityLevel} * object indicates the security level of the database. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1748,7 +1754,7 @@ declare namespace distributedKVStore { * * @returns {Promise} {SecurityLevel}: the {@code SecurityLevel} object indicates * the security level of the database. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.Core * @since 9 */ @@ -1768,7 +1774,37 @@ declare namespace distributedKVStore { */ interface DeviceKVStore extends SingleKVStore { /** - * Obtains the {@code String} value matching a specified device ID and key. + * Obtains the value matching the local device ID and specified key. + * + * @param {string} key - Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. + * @param {AsyncCallback} callback - + * {Uint8Array|string|boolean|number}: the returned value specified by the local device ID and specified key. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the data not exist when query data. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + get(key: string, callback: AsyncCallback): void; + + /** + * Obtains the value matching the local device ID and specified key. + * + * @param {string} key - Indicates the key. The length must be less than {@code MAX_KEY_LENGTH}. + * @returns {Promise} + * {Uint8Array|string|boolean|number}: the returned value specified by the local device ID and specified key. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100004 - if the data not exist when query data. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + get(key: string): Promise; + + /** + * Obtains the value matching a specified device ID and key. * * @param {string} deviceId - Indicates the device to be queried. * @param {string} key - Indicates the key of the value to be queried. @@ -1778,14 +1814,14 @@ declare namespace distributedKVStore { * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100004 - if the data not exist when query data. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ get(deviceId: string, key: string, callback: AsyncCallback): void; /** - * Obtains the {@code String} value matching a specified device ID and key. + * Obtains the value matching a specified device ID and key. * * @param {string} deviceId - Indicates the device to be queried. * @param {string} key - Indicates the key of the value to be queried. @@ -1795,12 +1831,40 @@ declare namespace distributedKVStore { * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. * @throws {BusinessError} 15100004 - if the data not exist when query data. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ get(deviceId: string, key: string): Promise; + /** + * Obtains all key-value pairs that match the local device ID and specified key prefix. + * + * @param {string} keyPrefix - Indicates the key prefix to match. + * @param {AsyncCallback} callback - {Entry[]}: the list of all key-value pairs + * that match the local device ID and specified key prefix. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + getEntries(keyPrefix: string, callback: AsyncCallback): void; + + /** + * Obtains all key-value pairs that match the local device ID and specified key prefix. + * + * @param {string} keyPrefix - Indicates the key prefix to match. + * @returns {Promise} {Entry[]}: the list of all key-value pairs that match the + * local device ID and specified key prefix. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + getEntries(keyPrefix: string): Promise; + /** * Obtains all key-value pairs matching a specified device ID and key prefix. * @@ -1811,7 +1875,7 @@ declare namespace distributedKVStore { * @returns Returns the list of all key-value pairs meeting the given criteria. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ @@ -1827,12 +1891,40 @@ declare namespace distributedKVStore { * @returns Returns the list of all key-value pairs meeting the given criteria. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ getEntries(deviceId: string, keyPrefix: string): Promise; + /** + * Obtains the list of key-value pairs matching the local device ID and specified {@code Query} object. + * + * @param {Query} query - Indicates the {@code Query} object. + * @param {AsyncCallback} callback - {Entry[]}: the list of all key-value pairs + * matching the local device ID and specified {@code Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + getEntries(query: Query, callback: AsyncCallback): void; + + /** + * Obtains the list of key-value pairs matching the local device ID and specified {@code Query} object. + * + * @param {Query} query - Indicates the {@code Query} object. + * @returns {Promise} {Entry[]}: the list of all key-value pairs matching the local device ID and + * specified {@code Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + getEntries(query: Query): Promise; + /** * Obtains the list of key-value pairs matching a specified device ID and {@code Query} object. * @@ -1842,8 +1934,7 @@ declare namespace distributedKVStore { * matching the specified deviceId and {@code Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100005 - if not support the operation. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ @@ -1858,13 +1949,48 @@ declare namespace distributedKVStore { * specified deviceId and {@code Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100005 - if not support the operation. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ getEntries(deviceId: string, query: Query): Promise; + /** + * Obtains the result set with the local device ID and specified prefix from a {@code SingleKVStore} database. + * The {@code KVStoreResultSet} object can be used to query all key-value pairs that meet the search criteria. + * Each {@code SingleKVStore} instance can have a maximum of four {@code KVStoreResultSet} objects at the same time. + * If you have created four objects, calling this method will return a failure. Therefore, you are advised to + * call the closeResultSet method to close unnecessary {@code KVStoreResultSet} objects in a timely manner. + * + * @param {string} keyPrefix - Indicates the key prefix to match. + * @param {AsyncCallback} callback - {KVStoreResultSet}: the {@code KVStoreResultSet} + * object matching the local device ID and specified keyPrefix. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + getResultSet(keyPrefix: string, callback: AsyncCallback): void; + + /** + * Obtains the result set with the local device ID and specified prefix from a {@code SingleKVStore} database. + * The {@code KVStoreResultSet} object can be used to query all key-value pairs that meet the search criteria. + * Each {@code SingleKVStore} instance can have a maximum of four {@code KVStoreResultSet} objects at the same time. + * If you have created four objects, calling this method will return a failure. Therefore, you are advised to + * call the closeResultSet method to close unnecessary {@code KVStoreResultSet} objects in a timely manner. + * + * @param {string} keyPrefix - Indicates the key prefix to match. + * @returns {Promise} {KVStoreResultSet}: the {@code KVStoreResultSet} + * object matching the local device ID and specified keyPrefix. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + getResultSet(keyPrefix: string): Promise; + /** * Obtains the {@code KVStoreResultSet} object matching the specified device ID and key prefix. * @@ -1879,7 +2005,7 @@ declare namespace distributedKVStore { * object matching the specified deviceId and keyPrefix. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ @@ -1899,12 +2025,40 @@ declare namespace distributedKVStore { * object matching the specified deviceId and keyPrefix. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ getResultSet(deviceId: string, keyPrefix: string): Promise; + /** + * Obtains the {@code KVStoreResultSet} object matching the local device ID and specified {@code Query} object. + * + * @param {Query} query - Indicates the {@code Query} object. + * @param {AsyncCallback} callback - {KVStoreResultSet}: the {@code KVStoreResultSet} + * object matching the local device ID and specified {@code Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + getResultSet(query: Query, callback: AsyncCallback): void; + + /** + * Obtains the {@code KVStoreResultSet} object matching the local device ID and specified {@code Query} object. + * + * @param {Query} query - Indicates the {@code Query} object. + * @returns {Promise} {KVStoreResultSet}: the {@code KVStoreResultSet} + * object matching the local device ID and specified {@code Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + getResultSet(query: Query): Promise; + /** * Obtains the {@code KVStoreResultSet} object matching a specified device ID and {@code Query} object. * @@ -1914,7 +2068,7 @@ declare namespace distributedKVStore { * object matching the specified deviceId and {@code Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ @@ -1929,12 +2083,42 @@ declare namespace distributedKVStore { * object matching the specified deviceId and {@code Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ getResultSet(deviceId: string, query: Query): Promise; + /** + * Obtains the KVStoreResultSet object matching the local device ID and specified predicate object. + * + * @param {dataSharePredicates.DataSharePredicates} predicates - Indicates the datasharePredicates. + * @param {AsyncCallback} callback - {KVStoreResultSet}: the {@code KVStoreResultSet} + * object matching the local device ID and specified {@code dataSharePredicates.DataSharePredicates} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.DataShare.Provider + * @systemapi + * @since 9 + */ + getResultSet(predicates: dataSharePredicates.DataSharePredicates, callback: AsyncCallback): void; + + /** + * Obtains the KVStoreResultSet object matching the local device ID and specified predicate object. + * + * @param {dataSharePredicates.DataSharePredicates} predicates - Indicates the datasharePredicates. + * @returns {Promise} {KVStoreResultSet}: the {@code KVStoreResultSet} + * object matching the local device ID and specified {@code dataSharePredicates.DataSharePredicates} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.DataShare.Provider + * @systemapi + * @since 9 + */ + getResultSet(predicates: dataSharePredicates.DataSharePredicates): Promise; + /** * Obtains the KVStoreResultSet object matching a specified Device ID and Predicate object. * @@ -1944,7 +2128,7 @@ declare namespace distributedKVStore { * object matching the specified deviceId and {@code dataSharePredicates.DataSharePredicates} object. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.DataShare.Provider * @systemapi * @since 9 @@ -1960,13 +2144,41 @@ declare namespace distributedKVStore { * object matching the specified deviceId and {@code dataSharePredicates.DataSharePredicates} object. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.DataShare.Provider * @systemapi * @since 9 */ getResultSet(deviceId: string, predicates: dataSharePredicates.DataSharePredicates): Promise; + /** + * Obtains the number of results matching the local device ID and specified {@code Query} object. + * + * @param {Query} query - Indicates the {@code Query} object. + * @param {AsyncCallback} callback - {number}: the number of results matching the + * local device ID and specified {@code Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + getResultSize(query: Query, callback: AsyncCallback): void; + + /** + * Obtains the number of results matching the local device ID and specified {@code Query} object. + * + * @param {Query} query - Indicates the {@code Query} object. + * @returns {Promise} {number}: the number of results matching the local device ID and specified + * {@code Query} object. + * @throws {BusinessError} 401 - if parameter check failed. + * @throws {BusinessError} 15100003 - if the database is corrupted. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. + * @syscap SystemCapability.DistributedDataManager.KVStore.Core + * @since 9 + */ + getResultSize(query: Query): Promise; + /** * Obtains the number of results matching a specified device ID and {@code Query} object. * @@ -1976,7 +2188,7 @@ declare namespace distributedKVStore { * specified deviceId and {@code Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ @@ -1991,7 +2203,7 @@ declare namespace distributedKVStore { * deviceId and {@code Query} object. * @throws {BusinessError} 401 - if parameter check failed. * @throws {BusinessError} 15100003 - if the database is corrupted. - * @throws {BusinessError} 15100006 - if the database or result set has been closed. + * @throws {BusinessError} 15100005 - if the database or result set has been closed. * @syscap SystemCapability.DistributedDataManager.KVStore.DistributedKVStore * @since 9 */ -- Gitee From 25817eb60d9c3ae22bb6dc9dd50f959a62f43ca2 Mon Sep 17 00:00:00 2001 From: fulizhong Date: Thu, 17 Nov 2022 10:51:24 +0800 Subject: [PATCH 352/438] modify file Signed-off-by: FULIZHONG Signed-off-by: fulizhong --- api/@ohos.multimedia.media.d.ts | 81 +++++++++++++-------------------- 1 file changed, 32 insertions(+), 49 deletions(-) diff --git a/api/@ohos.multimedia.media.d.ts b/api/@ohos.multimedia.media.d.ts index c6ab1c2835..00c4ce706e 100644 --- a/api/@ohos.multimedia.media.d.ts +++ b/api/@ohos.multimedia.media.d.ts @@ -19,15 +19,13 @@ import audio from "./@ohos.multimedia.audio"; /** * @name media * @since 6 - * @import import media from '@ohos.multimedia.media' */ declare namespace media { /** * Creates an AudioPlayer instance. * @since 6 * @syscap SystemCapability.Multimedia.Media.AudioPlayer - * @import import media from '@ohos.multimedia.media' - * @return Returns an AudioPlayer instance if the operation is successful; returns null otherwise. + * @returns Returns an AudioPlayer instance if the operation is successful; returns null otherwise. */ function createAudioPlayer(): AudioPlayer; @@ -35,8 +33,7 @@ declare namespace media { * Creates an AudioRecorder instance. * @since 6 * @syscap SystemCapability.Multimedia.Media.AudioRecorder - * @import import media from '@ohos.multimedia.media' - * @return Returns an AudioRecorder instance if the operation is successful; returns null otherwise. + * @returns Returns an AudioRecorder instance if the operation is successful; returns null otherwise. */ function createAudioRecorder(): AudioRecorder; @@ -44,7 +41,6 @@ declare namespace media { * Creates an VideoPlayer instance. * @since 8 * @syscap SystemCapability.Multimedia.Media.VideoPlayer - * @import import media from '@ohos.multimedia.media' * @param callback Callback used to return AudioPlayer instance if the operation is successful; returns null otherwise. */ function createVideoPlayer(callback: AsyncCallback): void; @@ -52,8 +48,7 @@ declare namespace media { * Creates an VideoPlayer instance. * @since 8 * @syscap SystemCapability.Multimedia.Media.VideoPlayer - * @import import media from '@ohos.multimedia.media' - * @return A Promise instance used to return VideoPlayer instance if the operation is successful; returns null otherwise. + * @returns A Promise instance used to return VideoPlayer instance if the operation is successful; returns null otherwise. */ function createVideoPlayer() : Promise; @@ -61,7 +56,6 @@ declare namespace media { * Creates an VideoRecorder instance. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @import import media from '@ohos.multimedia.media' * @param callback Callback used to return AudioPlayer instance if the operation is successful; returns null otherwise. * @throws { BusinessError } 5400101 - No memory. Return by callback. * @systemapi @@ -71,8 +65,7 @@ declare namespace media { * Creates an VideoRecorder instance. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @import import media from '@ohos.multimedia.media' - * @return A Promise instance used to return VideoRecorder instance if the operation is successful; returns null otherwise. + * @returns A Promise instance used to return VideoRecorder instance if the operation is successful; returns null otherwise. * @throws { BusinessError } 5400101 - No memory. Return by promise. * @systemapi */ @@ -82,7 +75,6 @@ declare namespace media { * Enumerates ErrorCode types, return in BusinessError::code * @since 8 * @syscap SystemCapability.Multimedia.Media.Core - * @import import media from '@ohos.multimedia.media' */ enum MediaErrorCode { /** @@ -160,7 +152,6 @@ declare namespace media { * Enumerates buffering info type, for network playback. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core - * @import import media from '@ohos.multimedia.media' */ enum BufferingInfoType { /** @@ -202,7 +193,7 @@ declare namespace media { fd: number /** - * The offset into the file where the data to be readed, in bytes. Defaultly, + * The offset into the file where the data to be read, in bytes. By default, * the offset is zero. * @since 9 * @syscap SystemCapability.Multimedia.Media.Core @@ -210,7 +201,7 @@ declare namespace media { offset?: number /** - * The length in bytes of the data to be readed. Defaultly, the length is the + * The length in bytes of the data to be read. By default, the length is the * rest of bytes in the file from the offset. * @since 9 * @syscap SystemCapability.Multimedia.Media.Core @@ -222,7 +213,6 @@ declare namespace media { * Describes audio playback states. * @since 6 * @syscap SystemCapability.Multimedia.Media.AudioPlayer - * @import import media from '@ohos.multimedia.media' */ type AudioState = 'idle' | 'playing' | 'paused' | 'stopped' | 'error'; @@ -295,7 +285,7 @@ declare namespace media { * get all track infos in MediaDescription, should be called after data loaded callback.. * @since 8 * @syscap SystemCapability.Multimedia.Media.AudioPlayer - * @return A Promise instance used to return the track info in MediaDescription. + * @returns A Promise instance used to return the track info in MediaDescription. */ getTrackDescription() : Promise>; @@ -402,8 +392,8 @@ declare namespace media { * Enumerates audio encoding formats, it will be deprecated after API8, use @CodecMimeType to replace. * @since 6 * @syscap SystemCapability.Multimedia.Media.AudioRecorder - * @import import media from '@ohos.multimedia.media' * @deprecated since 8 + * @useinstead ohos.multimedia.media/media.CodecMimeType */ enum AudioEncoder { /** @@ -446,8 +436,8 @@ declare namespace media { * Enumerates audio output formats, it will be deprecated after API8, use @ContainerFormatType to replace. * @since 6 * @syscap SystemCapability.Multimedia.Media.AudioRecorder - * @import import media from '@ohos.multimedia.media' * @deprecated since 8 + * @useinstead ohos.multimedia.media/media.ContainerFormatType */ enum AudioOutputFormat { /** @@ -519,6 +509,7 @@ declare namespace media { * @since 6 * @syscap SystemCapability.Multimedia.Media.AudioRecorder * @deprecated since 8 + * @useinstead ohos.multimedia.media/media.AudioRecorderConfig.audioEncoderMime */ audioEncoder?: AudioEncoder; @@ -549,6 +540,7 @@ declare namespace media { * @since 6 * @syscap SystemCapability.Multimedia.Media.AudioRecorder * @deprecated since 8 + * @useinstead ohos.multimedia.media/media.AudioRecorderConfig.fileFormat */ format?: AudioOutputFormat; @@ -697,7 +689,7 @@ declare namespace media { * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder * @param config Recording parameters. - * @return A Promise instance used to return when prepare completed. + * @returns A Promise instance used to return when prepare completed. * @permission ohos.permission.MICROPHONE * @throws { BusinessError } 201 - Permission denied. Return by promise. * @throws { BusinessError } 401 - Parameter error. Return by promise. @@ -721,7 +713,7 @@ declare namespace media { * get input surface. it must be called between prepare completed and start. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @return A Promise instance used to return the input surface id in string. + * @returns A Promise instance used to return the input surface id in string. * @throws { BusinessError } 5400102 - Operate not permit. Return by promise. * @throws { BusinessError } 5400103 - IO error. Return by promise. * @throws { BusinessError } 5400105 - Service died. Return by promise. @@ -743,7 +735,7 @@ declare namespace media { * Starts video recording. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @return A Promise instance used to return when start completed. + * @returns A Promise instance used to return when start completed. * @throws { BusinessError } 5400102 - Operate not permit. Return by promise. * @throws { BusinessError } 5400103 - IO error. Return by promise. * @throws { BusinessError } 5400105 - Service died. Return by promise. @@ -765,7 +757,7 @@ declare namespace media { * Pauses video recording. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @return A Promise instance used to return when pause completed. + * @returns A Promise instance used to return when pause completed. * @throws { BusinessError } 5400102 - Operate not permit. Return by promise. * @throws { BusinessError } 5400103 - IO error. Return by promise. * @throws { BusinessError } 5400105 - Service died. Return by promise. @@ -787,7 +779,7 @@ declare namespace media { * Resumes video recording. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @return A Promise instance used to return when resume completed. + * @returns A Promise instance used to return when resume completed. * @throws { BusinessError } 5400102 - Operate not permit. Return by promise. * @throws { BusinessError } 5400103 - IO error. Return by promise. * @throws { BusinessError } 5400105 - Service died. Return by promise. @@ -809,7 +801,7 @@ declare namespace media { * Stops video recording. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @return A Promise instance used to return when stop completed. + * @returns A Promise instance used to return when stop completed. * @throws { BusinessError } 5400102 - Operate not permit. Return by promise. * @throws { BusinessError } 5400103 - IO error. Return by promise. * @throws { BusinessError } 5400105 - Service died. Return by promise. @@ -829,7 +821,7 @@ declare namespace media { * Releases resources used for video recording. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @return A Promise instance used to return when release completed. + * @returns A Promise instance used to return when release completed. * @throws { BusinessError } 5400105 - Service died. Return by callback. * @systemapi */ @@ -852,7 +844,7 @@ declare namespace media { * you must call prepare() to set the recording configurations for another recording. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @return A Promise instance used to return when reset completed. + * @returns A Promise instance used to return when reset completed. * @throws { BusinessError } 5400103 - IO error. Return by promise. * @throws { BusinessError } 5400105 - Service died. Return by promise. * @systemapi @@ -929,7 +921,6 @@ declare namespace media { * instance. * @since 8 * @syscap SystemCapability.Multimedia.Media.VideoPlayer - * @import import media from '@ohos.multimedia.media' */ interface VideoPlayer { /** @@ -937,7 +928,7 @@ declare namespace media { * @since 8 * @syscap SystemCapability.Multimedia.Media.VideoPlayer * @param surfaceId surface id, video player will use this id get a surface instance. - * @return A Promise instance used to return when release output buffer completed. + * @returns A Promise instance used to return when release output buffer completed. */ setDisplaySurface(surfaceId: string, callback: AsyncCallback): void; /** @@ -945,7 +936,7 @@ declare namespace media { * @since 8 * @syscap SystemCapability.Multimedia.Media.VideoPlayer * @param surfaceId surface id, video player will use this id get a surface instance. - * @return A Promise instance used to return when release output buffer completed. + * @returns A Promise instance used to return when release output buffer completed. */ setDisplaySurface(surfaceId: string): Promise; /** @@ -959,7 +950,7 @@ declare namespace media { * prepare video playback, it will request resource for playing. * @since 8 * @syscap SystemCapability.Multimedia.Media.VideoPlayer - * @return A Promise instance used to return when prepare completed. + * @returns A Promise instance used to return when prepare completed. */ prepare(): Promise; /** @@ -973,7 +964,7 @@ declare namespace media { * Starts video playback. * @since 8 * @syscap SystemCapability.Multimedia.Media.VideoPlayer - * @return A Promise instance used to return when start completed. + * @returns A Promise instance used to return when start completed. */ play(): Promise; /** @@ -987,7 +978,7 @@ declare namespace media { * Pauses video playback. * @since 8 * @syscap SystemCapability.Multimedia.Media.VideoPlayer - * @return A Promise instance used to return when pause completed. + * @returns A Promise instance used to return when pause completed. */ pause(): Promise; /** @@ -1001,7 +992,7 @@ declare namespace media { * Stops video playback. * @since 8 * @syscap SystemCapability.Multimedia.Media.VideoPlayer - * @return A Promise instance used to return when stop completed. + * @returns A Promise instance used to return when stop completed. */ stop(): Promise; /** @@ -1015,7 +1006,7 @@ declare namespace media { * Resets video playback, it will release the resource. * @since 8 * @syscap SystemCapability.Multimedia.Media.VideoPlayer - * @return A Promise instance used to return when reset completed. + * @returns A Promise instance used to return when reset completed. */ reset(): Promise; /** @@ -1044,7 +1035,7 @@ declare namespace media { * @syscap SystemCapability.Multimedia.Media.VideoPlayer * @param timeMs Playback position to jump * @param mode seek mode, see @SeekMode . - * @return A Promise instance used to return when seek completed + * @returns A Promise instance used to return when seek completed * and return the seeking position result. */ seek(timeMs: number, mode?:SeekMode): Promise; @@ -1061,7 +1052,7 @@ declare namespace media { * @since 8 * @syscap SystemCapability.Multimedia.Media.VideoPlayer * @param vol Relative volume. The value ranges from 0.00 to 1.00. The value 1 indicates the maximum volume (100%). - * @return A Promise instance used to return when set volume completed. + * @returns A Promise instance used to return when set volume completed. */ setVolume(vol: number): Promise; /** @@ -1075,7 +1066,7 @@ declare namespace media { * Releases resources used for video playback. * @since 8 * @syscap SystemCapability.Multimedia.Media.VideoPlayer - * @return A Promise instance used to return when release completed. + * @returns A Promise instance used to return when release completed. */ release(): Promise; /** @@ -1090,7 +1081,7 @@ declare namespace media { * get all track infos in MediaDescription, should be called after data loaded callback.. * @since 8 * @syscap SystemCapability.Multimedia.Media.VideoPlayer - * @return A Promise instance used to return the track info in MediaDescription. + * @returns A Promise instance used to return the track info in MediaDescription. */ getTrackDescription() : Promise>; @@ -1161,7 +1152,7 @@ declare namespace media { audioInterruptMode ?: audio.InterruptMode; /** - * video scale type. Defaultly, the {@link #VIDEO_SCALE_TYPE_FIT} will be used, for more + * video scale type. By default, the {@link #VIDEO_SCALE_TYPE_FIT} will be used, for more * information, refer to {@link #VideoScaleType} * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoPlayer @@ -1181,7 +1172,7 @@ declare namespace media { * @since 8 * @syscap SystemCapability.Multimedia.Media.VideoPlayer * @param speed playback speed, see @PlaybackSpeed . - * @return A Promise instance used to return actually speed. + * @returns A Promise instance used to return actually speed. */ setSpeed(speed:number): Promise; @@ -1244,7 +1235,6 @@ declare namespace media { * Enumerates video scale type. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoPlayer - * @import import media from '@ohos.multimedia.media' */ enum VideoScaleType { /** @@ -1270,7 +1260,6 @@ declare namespace media { * Enumerates container format type(The abbreviation for 'container format type' is CFT). * @since 8 * @syscap SystemCapability.Multimedia.Media.Core - * @import import media from '@ohos.multimedia.media' */ enum ContainerFormatType { /** @@ -1292,7 +1281,6 @@ declare namespace media { * Enumerates media data type. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core - * @import import media from '@ohos.multimedia.media' */ enum MediaType { /** @@ -1313,7 +1301,6 @@ declare namespace media { * Enumerates media description key. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core - * @import import media from '@ohos.multimedia.media' */ enum MediaDescriptionKey { /** @@ -1479,7 +1466,6 @@ declare namespace media { * Enumerates audio source type for recorder. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @import import media from '@ohos.multimedia.media' * @systemapi */ enum AudioSourceType { @@ -1503,7 +1489,6 @@ declare namespace media { * Enumerates video source type for recorder. * @since 9 * @syscap SystemCapability.Multimedia.Media.VideoRecorder - * @import import media from '@ohos.multimedia.media' * @systemapi */ enum VideoSourceType { @@ -1595,7 +1580,6 @@ declare namespace media { * Enumerates seek mode. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core - * @import import media from '@ohos.multimedia.media' */ enum SeekMode { /** @@ -1616,7 +1600,6 @@ declare namespace media { * Enumerates Codec MIME types. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core - * @import import media from '@ohos.multimedia.media' */ enum CodecMimeType { /** -- Gitee From ea86ea33b1cb52532ff0e69a2531bc613214ef04 Mon Sep 17 00:00:00 2001 From: sunyaozu Date: Fri, 18 Nov 2022 10:32:11 +0800 Subject: [PATCH 353/438] update intl and i18n dts Signed-off-by: sunyaozu --- api/@ohos.i18n.d.ts | 166 ++++++++++++++++++++++---------------------- api/@ohos.intl.d.ts | 28 ++++---- 2 files changed, 97 insertions(+), 97 deletions(-) diff --git a/api/@ohos.i18n.d.ts b/api/@ohos.i18n.d.ts index f30ba8bdf1..75c85d0322 100644 --- a/api/@ohos.i18n.d.ts +++ b/api/@ohos.i18n.d.ts @@ -28,7 +28,7 @@ declare namespace i18n { * @param country The locale whose country or region name will be displayed. * @param locale The locale used to display the country or region. * @param sentenceCase Specifies whether the country or region name is displayed in sentence case. - * @return Returns the country or region name localized for display on a given locale. + * @returns Returns the country or region name localized for display on a given locale. * @since 7 * @deprecated since 9 * @useinstead ohos.System.getDisplayCountry @@ -42,7 +42,7 @@ export function getDisplayCountry(country: string, locale: string, sentenceCase? * @param language The locale whose language name will be displayed. * @param locale The locale used to display the language. * @param sentenceCase Specifies whether the language name is displayed in sentence case. - * @return Returns the language name localized for display on a given locale. + * @returns Returns the language name localized for display on a given locale. * @since 7 * @deprecated since 9 * @useinstead ohos.System.getDisplayLanguage @@ -53,7 +53,7 @@ export function getDisplayLanguage(language: string, locale: string, sentenceCas * Obtains the language currently used by the system. * * @syscap SystemCapability.Global.I18n - * @return Returns the language currently used by the system. + * @returns Returns the language currently used by the system. * @since 7 * @deprecated since 9 * @useinstead ohos.System.getSystemLanguage @@ -64,7 +64,7 @@ export function getSystemLanguage(): string; * Obtains the region currently used by the system. * * @syscap SystemCapability.Global.I18n - * @return Returns the region currently used by the system. + * @returns Returns the region currently used by the system. * @since 7 * @deprecated since 9 * @useinstead ohos.System.getSystemRegion @@ -75,7 +75,7 @@ export function getSystemRegion(): string; * Obtains the locale currently used by the system. * * @syscap SystemCapability.Global.I18n - * @return Returns the locale currently used by the system. + * @returns Returns the locale currently used by the system. * @since 7 * @deprecated since 9 * @useinstead ohos.System.getSystemLocale @@ -98,7 +98,7 @@ export class System { * @param sentenceCase Specifies whether the country or region name is displayed in sentence case. * @throws {BusinessError} 401 - check param failed * @throws {BusinessError} 890001 - param value not valid - * @return Returns the country or region name localized for display on a given locale. + * @returns Returns the country or region name localized for display on a given locale. * @since 9 */ static getDisplayCountry(country: string, locale: string, sentenceCase?: boolean): string; @@ -112,7 +112,7 @@ export class System { * @param sentenceCase Specifies whether the language name is displayed in sentence case. * @throws {BusinessError} 401 - check param failed * @throws {BusinessError} 890001 - param value not valid - * @return Returns the language name localized for display on a given locale. + * @returns Returns the language name localized for display on a given locale. * @since 9 */ static getDisplayLanguage(language: string, locale: string, sentenceCase?: boolean): string; @@ -121,7 +121,7 @@ export class System { * Obtains all languages supported by the system. * * @syscap SystemCapability.Global.I18n - * @return Returns all languages supported by the system. + * @returns Returns all languages supported by the system. * @since 9 */ static getSystemLanguages(): Array; @@ -133,7 +133,7 @@ export class System { * @param language The language used to get the list of regions. * @throws {BusinessError} 401 - check param failed * @throws {BusinessError} 890001 - param value not valid - * @return Returns all countries or regions supported by the system in the language. + * @returns Returns all countries or regions supported by the system in the language. * @since 9 */ static getSystemCountries(language: string): Array; @@ -146,7 +146,7 @@ export class System { * @param region The region code. * @throws {BusinessError} 401 - check param failed * @throws {BusinessError} 890001 - param value not valid - * @return Returns whether the current language or region is recommended. + * @returns Returns whether the current language or region is recommended. * @since 9 */ static isSuggested(language: string, region?: string): boolean; @@ -155,7 +155,7 @@ export class System { * Obtains the language currently used by the system. * * @syscap SystemCapability.Global.I18n - * @return Returns the language currently used by the system. + * @returns Returns the language currently used by the system. * @since 9 */ static getSystemLanguage(): string; @@ -177,7 +177,7 @@ export class System { * Obtains the region currently used by the system. * * @syscap SystemCapability.Global.I18n - * @return Returns the region currently used by the system. + * @returns Returns the region currently used by the system. * @since 9 */ static getSystemRegion(): string; @@ -200,7 +200,7 @@ export class System { * Obtains the locale currently used by the system. * * @syscap SystemCapability.Global.I18n - * @return Returns the locale currently used by the system. + * @returns Returns the locale currently used by the system. * @since 9 */ static getSystemLocale(): string; @@ -223,7 +223,7 @@ export class System { * Check out whether system is 24-hour system. * * @syscap SystemCapability.Global.I18n - * @return Returns a boolean represent whether system is 24-hour system. + * @returns Returns a boolean represent whether system is 24-hour system. * @since 9 */ static is24HourClock(): boolean; @@ -275,7 +275,7 @@ export class System { * Access the system preferred language list. * * @syscap SystemCapability.Global.I18n - * @return Returns a string Array represent the preferred language list. + * @returns Returns a string Array represent the preferred language list. * @since 9 */ static getPreferredLanguageList(): Array; @@ -284,7 +284,7 @@ export class System { * Get the first preferred language of system. * * @syscap SystemCapability.Global.I18n - * @return Returns a string represent the first preferred language of system. + * @returns Returns a string represent the first preferred language of system. * @since 9 */ static getFirstPreferredLanguage(): string; @@ -293,7 +293,7 @@ export class System { * Get the preferred language of App. * * @syscap SystemCapability.Global.I18n - * @return Returns a string represent the preferred language of App. + * @returns Returns a string represent the preferred language of App. * @since 9 */ static getAppPreferredLanguage(): string; @@ -316,7 +316,7 @@ export class System { * Get whether to use local digit. * * @syscap SystemCapability.Global.I18n - * @return Returns a boolean represents whether to use local digit. + * @returns Returns a boolean represents whether to use local digit. * @since 9 */ static getUsingLocalDigit(): boolean; @@ -373,7 +373,7 @@ export interface Util { * * @syscap SystemCapability.Global.I18n * @param { string } locale - Information of the locale - * @return Returns the string of 'y', 'L', 'd' joined by '-'. + * @returns Returns the string of 'y', 'L', 'd' joined by '-'. * @since 9 */ static getDateOrder(locale: string): string; @@ -437,11 +437,11 @@ export class PhoneNumberFormat { constructor(country: string, options?: PhoneNumberFormatOptions); /** - * Judges whether phone number is valid. + * Judge whether phone number is valid. * * @syscap SystemCapability.Global.I18n - * @param number Indicates the input phone number to be judged. - * @return Returns a boolean indicates whether the input phone number is valid. + * @param number Indicates the input phone number. + * @returns Returns a boolean indicates whether the input phone number is valid. * @since 8 */ isValidNumber(number: string): boolean; @@ -451,7 +451,7 @@ export class PhoneNumberFormat { * * @syscap SystemCapability.Global.I18n * @param number Indicates the input phone number to be formatted. - * @return Returns the formatted phone number. + * @returns Returns the formatted phone number. * @since 8 */ format(number: string): string; @@ -462,7 +462,7 @@ export class PhoneNumberFormat { * @syscap SystemCapability.Global.I18n * @param number input phone number. * @param locale locale ID. - * @return Returns a string represents phone number's location. + * @returns Returns a string represents phone number's location. * @since 9 */ getLocationName(number: string, locale: string): string; @@ -475,7 +475,7 @@ export class PhoneNumberFormat { * @param locale The locale used to get calendar. * @param type If type is not specified, get locale's default Calendar, else get the specified type of Calendar. * such as buddhist, chinese, coptic, ethiopic, hebrew, gregory, indian, islamic_civil, islamic_tbla, islamic_umalqura, - * japanese, persion. + * japanese, persian. * @since 8 */ export function getCalendar(locale: string, type?: string): Calendar; @@ -526,7 +526,7 @@ export class Calendar { * Get the timezone id of this calendar instance. * * @syscap SystemCapability.Global.I18n - * @return Returns the timezone id of this calendar. + * @returns Returns the timezone id of this calendar. * @since 8 */ getTimeZone(): string; @@ -535,7 +535,7 @@ export class Calendar { * Get the start day of a week. 1 indicates Sunday, 7 indicates Saturday. * * @syscap SystemCapability.Global.I18n - * @return Returns start day of a week. + * @returns Returns start day of a week. * @since 8 */ getFirstDayOfWeek(): number; @@ -553,7 +553,7 @@ export class Calendar { * Get the minimal days of a week, which is needed for the first day of a year. * * @syscap SystemCapability.Global.I18n - * @return Returns the minimal days of a week. + * @returns Returns the minimal days of a week. * @since 8 */ getMinimalDaysInFirstWeek(): number; @@ -574,7 +574,7 @@ export class Calendar { * @param field Field values such as era, year, month, week_of_year, week_of_month, date, day_of_year, day_of_week * day_of_week_in_month, hour, hour_of_day, minute, second, millisecond, zone_offset, dst_offset, year_woy, * dow_local, extended_year, julian_day, milliseconds_in_day, is_leap_month. - * @return Return the associated value. + * @returns Return the associated value. * @since 8 */ get(field: string): number; @@ -584,7 +584,7 @@ export class Calendar { * * @syscap SystemCapability.Global.I18n * @param locale Locale used to get the localized name for this calendar. - * @return Returns the localized name of this calendar. + * @returns Returns the localized name of this calendar. * @since 8 */ getDisplayName(locale: string): string; @@ -595,7 +595,7 @@ export class Calendar { * * @syscap SystemCapability.Global.I18n * @param date Date object whose attribute is desired. - * @return Returns whether the date is a weekend day. + * @returns Returns whether the date is a weekend day. * @since 8 */ isWeekend(date?: Date): boolean; @@ -606,7 +606,7 @@ export class Calendar { * * @syscap SystemCapability.Global.I18n * @param locale The locale to be used. - * @return Returns true representing the locale is an RTL locale + * @returns Returns true representing the locale is an RTL locale * * @since 7 */ @@ -617,7 +617,7 @@ export function isRTL(locale: string): boolean; * * @syscap SystemCapability.Global.I18n * @param locale the returned BreakIterator will adapt the rule, specified by the locale, to break text. - * @return Returns a newly constructed BreakIterator object. + * @returns Returns a newly constructed BreakIterator object. * @since 8 */ export function getLineInstance(locale: string): BreakIterator; @@ -633,7 +633,7 @@ export class BreakIterator { * Obtains the current position of the BreakIterator instance. * * @syscap SystemCapability.Global.I18n - * @return Returns the current position of the BreakIterator instance. + * @returns Returns the current position of the BreakIterator instance. * @since 8 */ current(): number; @@ -643,7 +643,7 @@ export class BreakIterator { * processed text. * * @syscap SystemCapability.Global.I18n - * @return Returns the index of the first break point. + * @returns Returns the index of the first break point. * @since 8 */ first(): number; @@ -653,26 +653,26 @@ export class BreakIterator { * last character of the processed text. * * @syscap SystemCapability.Global.I18n - * @return Returns the index of the last break point. + * @returns Returns the index of the last break point. * @since 8 */ last(): number; /** - * Set the BreakItertor's position to the nth break point from the current break point. + * Set the BreakIterator's position to the nth break point from the current break point. * * @syscap SystemCapability.Global.I18n * @param index indicates the number of break points to advance. If index is not given, n is treated as 1. - * @return Returns the index of the BreakIterator after moving. If there is not enough break points, returns -1. + * @returns Returns the index of the BreakIterator after moving. If there is not enough break points, returns -1. * @since 8 */ next(index?: number): number; /** - * Set the BreakItertor's position to the break point preceding the current break point. + * Set the BreakIterator's position to the break point preceding the current break point. * * @syscap SystemCapability.Global.I18n - * @return Returns the index of the BreakIterator after moving. If there is not enough break points, returns -1. + * @returns Returns the index of the BreakIterator after moving. If there is not enough break points, returns -1. * @since 8 */ previous(): number; @@ -690,7 +690,7 @@ export class BreakIterator { * Set the BreakIterator's position to the first break point following the specified offset. * * @syscap SystemCapability.Global.I18n - * @return Returns the index of the BreakIterator after moving. If there is not enough break points, returns -1. + * @returns Returns the index of the BreakIterator after moving. If there is not enough break points, returns -1. * @since 8 */ following(offset: number): number; @@ -699,7 +699,7 @@ export class BreakIterator { * Obtains the text being processed. * * @syscap SystemCapability.Global.I18n - * @return Returns the text that is processed by the BreakIterator. + * @returns Returns the text that is processed by the BreakIterator. * @since 8 */ getLineBreakText(): string; @@ -711,7 +711,7 @@ export class BreakIterator { * * @syscap SystemCapability.Global.I18n * @param offset The offset to be checked. - * @return Returns true if the offset is a break point. + * @returns Returns true if the offset is a break point. * @since 8 */ isBoundary(offset: number): boolean; @@ -723,7 +723,7 @@ export class BreakIterator { * @syscap SystemCapability.Global.I18n * @param locale Indicates a character string containing the locale information, including * the language and optionally the script and region, for the NumberFormat object. - * @return Returns IndexUtil object. + * @returns Returns IndexUtil object. * @since 8 */ export function getInstance(locale?:string): IndexUtil; @@ -740,7 +740,7 @@ export class IndexUtil { * Get a list of labels for use as a UI index * * @syscap SystemCapability.Global.I18n - * @return Returns a list of labels + * @returns Returns a list of labels * @since 8 */ getIndexList(): Array; @@ -778,7 +778,7 @@ export class Character { * * @syscap SystemCapability.Global.I18n * @param char the character to be tested - * @return Returns true if the character is a digit character + * @returns Returns true if the character is a digit character * @since 8 * @deprecated since 9 * @useinstead Unicode.isDigit @@ -790,7 +790,7 @@ export class Character { * * @syscap SystemCapability.Global.I18n * @param char the character to be tested - * @return Returns true if the character is a space character + * @returns Returns true if the character is a space character * @since 8 * @deprecated since 9 * @useinstead Unicode.isSpaceChar @@ -802,7 +802,7 @@ export class Character { * * @syscap SystemCapability.Global.I18n * @param char the character to be tested - * @return Returns true if the character is a whitespace character + * @returns Returns true if the character is a whitespace character * @since 8 * @deprecated since 9 * @useinstead Unicode.isWhitespace @@ -814,7 +814,7 @@ export class Character { * * @syscap SystemCapability.Global.I18n * @param char the character to be tested - * @return Returns true if the character is a RTL character + * @returns Returns true if the character is a RTL character * @since 8 * @deprecated since 9 * @useinstead Unicode.isRTL @@ -826,7 +826,7 @@ export class Character { * * @syscap SystemCapability.Global.I18n * @param char the character to be tested - * @return Returns true if the character is a Ideographic character + * @returns Returns true if the character is a Ideographic character * @since 8 * @deprecated since 9 * @useinstead Unicode.isIdeograph @@ -838,7 +838,7 @@ export class Character { * * @syscap SystemCapability.Global.I18n * @param char the character to be tested - * @return Returns true if the character is a Letter + * @returns Returns true if the character is a Letter * @since 8 * @deprecated since 9 * @useinstead Unicode.isLetter @@ -850,7 +850,7 @@ export class Character { * * @syscap SystemCapability.Global.I18n * @param char the character to be tested - * @return Returns true if the character is a LowerCase character + * @returns Returns true if the character is a LowerCase character * @since 8 * @deprecated since 9 * @useinstead Unicode.isLowerCase @@ -862,7 +862,7 @@ export class Character { * * @syscap SystemCapability.Global.I18n * @param char the character to be tested - * @return Returns true if the character is a UpperCase character + * @returns Returns true if the character is a UpperCase character * @since 8 * @deprecated since 9 * @useinstead Unicode.isUpperCase @@ -874,7 +874,7 @@ export class Character { * * @syscap SystemCapability.Global.I18n * @param char the character to be tested - * @return Returns the general category of the specified character. + * @returns Returns the general category of the specified character. * @since 8 * @deprecated since 9 * @useinstead Unicode.getType @@ -894,7 +894,7 @@ export class Character { * * @syscap SystemCapability.Global.I18n * @param { string } char - the character to be tested - * @return Returns true if the character is a digit character + * @returns Returns true if the character is a digit character * @since 9 */ static isDigit(char: string): boolean; @@ -904,7 +904,7 @@ export class Character { * * @syscap SystemCapability.Global.I18n * @param { string } char - the character to be tested - * @return Returns true if the character is a space character + * @returns Returns true if the character is a space character * @since 9 */ static isSpaceChar(char: string): boolean; @@ -914,7 +914,7 @@ export class Character { * * @syscap SystemCapability.Global.I18n * @param { string } char - the character to be tested - * @return Returns true if the character is a whitespace character + * @returns Returns true if the character is a whitespace character * @since 9 */ static isWhitespace(char: string): boolean; @@ -924,7 +924,7 @@ export class Character { * * @syscap SystemCapability.Global.I18n * @param { string } char - the character to be tested - * @return Returns true if the character is a RTL character + * @returns Returns true if the character is a RTL character * @since 9 */ static isRTL(char: string): boolean; @@ -934,7 +934,7 @@ export class Character { * * @syscap SystemCapability.Global.I18n * @param { string } char - the character to be tested - * @return Returns true if the character is a Ideographic character + * @returns Returns true if the character is a Ideographic character * @since 9 */ static isIdeograph(char: string): boolean; @@ -944,7 +944,7 @@ export class Character { * * @syscap SystemCapability.Global.I18n * @param { string } char - the character to be tested - * @return Returns true if the character is a Letter + * @returns Returns true if the character is a Letter * @since 9 */ static isLetter(char: string): boolean; @@ -954,7 +954,7 @@ export class Character { * * @syscap SystemCapability.Global.I18n * @param { string } char - the character to be tested - * @return Returns true if the character is a LowerCase character + * @returns Returns true if the character is a LowerCase character * @since 9 */ static isLowerCase(char: string): boolean; @@ -964,7 +964,7 @@ export class Character { * * @syscap SystemCapability.Global.I18n * @param { string } char - the character to be tested - * @return Returns true if the character is a UpperCase character + * @returns Returns true if the character is a UpperCase character * @since 9 */ static isUpperCase(char: string): boolean; @@ -974,7 +974,7 @@ export class Character { * * @syscap SystemCapability.Global.I18n * @param { string } char - the character to be tested - * @return Returns the general category of the specified character. + * @returns Returns the general category of the specified character. * @since 9 */ static getType(char: string): string; @@ -984,7 +984,7 @@ export class Character { * check out whether system is 24-hour system. * * @syscap SystemCapability.Global.I18n - * @return Returns a boolean represent whether system is 24-hour system. + * @returns Returns a boolean represent whether system is 24-hour system. * @since 7 * @deprecated since 9 * @useinstead ohos.System.is24HourClock @@ -997,7 +997,7 @@ export class Character { * @permission ohos.permission.UPDATE_CONFIGURATION * @syscap SystemCapability.Global.I18n * @param option represent the boolean to be set. - * @return Returns a boolean represent whether setting 24-hour system success. + * @returns Returns a boolean represent whether setting 24-hour system success. * @since 7 * @deprecated since 9 * @useinstead ohos.System.set24HourClock @@ -1011,7 +1011,7 @@ export class Character { * @syscap SystemCapability.Global.I18n * @param language the language to be added. * @param index the position of preferred language list to be inserted. - * @return Returns a boolean represent whether language added success. + * @returns Returns a boolean represent whether language added success. * @since 8 * @deprecated since 9 * @useinstead ohos.System.addPreferredLanguage @@ -1024,7 +1024,7 @@ export function addPreferredLanguage(language: string, index?: number): boolean; * @permission ohos.permission.UPDATE_CONFIGURATION * @syscap SystemCapability.Global.I18n * @param index the position of removed language in preferred language list. - * @return Returns a boolean represent whether removed success. + * @returns Returns a boolean represent whether removed success. * @since 8 * @deprecated since 9 * @useinstead ohos.System.removePreferredLanguage @@ -1035,7 +1035,7 @@ export function removePreferredLanguage(index: number): boolean; * Access the system preferred language list. * * @syscap SystemCapability.Global.I18n - * @return Returns a string Array represent the preferred language list. + * @returns Returns a string Array represent the preferred language list. * @since 8 * @deprecated since 9 * @useinstead ohos.System.getPreferredLanguageList @@ -1046,7 +1046,7 @@ export function getPreferredLanguageList(): Array; * Get the first preferred language of system. * * @syscap SystemCapability.Global.I18n - * @return Returns a string represent the first preferred language of system. + * @returns Returns a string represent the first preferred language of system. * @since 8 * @deprecated since 9 * @useinstead ohos.System.getFirstPreferredLanguage @@ -1058,7 +1058,7 @@ export function getFirstPreferredLanguage(): string; * * @syscap SystemCapability.Global.I18n * @param zoneID TimeZone ID used to create TimeZone Object. - * @return Returns a TimeZone object corresponds to zoneID. + * @returns Returns a TimeZone object corresponds to zoneID. * @since 7 */ export function getTimeZone(zoneID?: string): TimeZone; @@ -1074,7 +1074,7 @@ export class TimeZone { * Get the id of the TimeZone object. * * @syscap SystemCapability.Global.I18n - * @return Returns a string represents the timezone id. + * @returns Returns a string represents the timezone id. * @since 7 */ getID(): string; @@ -1084,8 +1084,8 @@ export class TimeZone { * * @syscap SystemCapability.Global.I18n * @param locale the locale tag use to display timezone object's name. - * @param isDST wether conside daylight saving time when display timezone object's name. - * @return Returns a string represents the display name. + * @param isDST wether consider daylight saving time when display timezone object's name. + * @returns Returns a string represents the display name. * @since 7 */ getDisplayName(locale?: string, isDST?: boolean): string; @@ -1094,7 +1094,7 @@ export class TimeZone { * Get the raw offset of the TimeZone object. * * @syscap SystemCapability.Global.I18n - * @return Returns a number represents the raw offset. + * @returns Returns a number represents the raw offset. * @since 7 */ getRawOffset(): number; @@ -1104,7 +1104,7 @@ export class TimeZone { * * @syscap SystemCapability.Global.I18n * @date Indicates a date use to compute offset. - * @return Returns a number represents the offset with date. + * @returns Returns a number represents the offset with date. * @since 7 */ getOffset(date?: number): number; @@ -1113,7 +1113,7 @@ export class TimeZone { * Get available TimeZone ID list. * * @syscap SystemCapability.Global.I18n - * @return Returns a string array represents the available TimeZone ID list. + * @returns Returns a string array represents the available TimeZone ID list. * @since 9 */ static getAvailableIDs(): Array; @@ -1122,7 +1122,7 @@ export class TimeZone { * Get available Zone City ID list. * * @syscap SystemCapability.Global.I18n - * @return Returns a string array represents the available Zone City ID list. + * @returns Returns a string array represents the available Zone City ID list. * @since 9 */ static getAvailableZoneCityIDs(): Array; @@ -1133,7 +1133,7 @@ export class TimeZone { * @syscap SystemCapability.Global.I18n * @param cityID Zone City ID. * @param locale locale used to display city name. - * @return Returns a string represents the display name of City in locale. + * @returns Returns a string represents the display name of City in locale. * @since 9 */ static getCityDisplayName(cityID: string, locale: string): string; @@ -1143,7 +1143,7 @@ export class TimeZone { * * @syscap SystemCapability.Global.I18n * @param cityID Zone City ID. - * @return Returns a TimeZone Object from city ID. + * @returns Returns a TimeZone Object from city ID. * @since 9 */ static getTimezoneFromCity(cityID: string): TimeZone; @@ -1160,7 +1160,7 @@ export class Transliterator { * Get a string array of all available transliterator ids. * * @syscap SystemCapability.Global.I18n - * @return Returns a string array of all available transliterator ids. + * @returns Returns a string array of all available transliterator ids. * @since 9 */ static getAvailableIDs(): string[]; @@ -1169,10 +1169,10 @@ export class Transliterator { * Get a Transliterator that is specified by id name. * * @syscap SystemCapability.Global.I18n - * @param id specified the type of Transliterator. id is formed by source and dest. Transliterator will tranliste + * @param id specified the type of Transliterator. id is formed by source and dest. Transliterator will transliterate * the input string from source format to the dest format. For example, a Simplified Chinese to Latn * Transliterator will transform the text written in Chinese to Latn characters. - * @return Returns Transliterator that is specified by id name. + * @returns Returns Transliterator that is specified by id name. * @since 9 */ static getInstance(id: string): Transliterator; @@ -1182,7 +1182,7 @@ export class Transliterator { * * @syscap SystemCapability.Global.I18n * @param id text to be transliterated. - * @return Returns the output text that is tranlisterated from source format to the dest format. + * @returns Returns the output text that is transliterated from source format to the dest format. * @since 9 */ transform(text: string): string; diff --git a/api/@ohos.intl.d.ts b/api/@ohos.intl.d.ts index 38e51ec9b2..fa8569eb60 100755 --- a/api/@ohos.intl.d.ts +++ b/api/@ohos.intl.d.ts @@ -211,7 +211,7 @@ export class Locale { * Convert the locale information to string. * * @syscap SystemCapability.Global.I18n - * @return Returns locale information in string form. + * @returns Returns locale information in string form. * @since 6 */ toString(): string; @@ -220,7 +220,7 @@ export class Locale { * Maximize the locale's base information. * * @syscap SystemCapability.Global.I18n - * @return Returns maximized locale. + * @returns Returns maximized locale. * @since 6 */ maximize(): Locale; @@ -229,7 +229,7 @@ export class Locale { * Minimize the locale's base information. * * @syscap SystemCapability.Global.I18n - * @return Returns minimized locale. + * @returns Returns minimized locale. * @since 6 */ minimize(): Locale; @@ -540,7 +540,7 @@ export class DateTimeFormat { * * @syscap SystemCapability.Global.I18n * @param date Indicates the Date object to be formatted. - * @return Returns a date string formatted based on the specified locale. + * @returns Returns a date string formatted based on the specified locale. * @since 6 */ format(date: Date): string; @@ -551,7 +551,7 @@ export class DateTimeFormat { * @syscap SystemCapability.Global.I18n * @param startDate Indicates the start date of the date range. * @param endDate Indicates the end date of the date range. - * @return Returns a date string formatted based on the specified locale. + * @returns Returns a date string formatted based on the specified locale. * @since 6 */ formatRange(startDate: Date, endDate: Date): string; @@ -560,7 +560,7 @@ export class DateTimeFormat { * Obtains the options of the DateTimeFormat object. * * @syscap SystemCapability.Global.I18n - * @return Returns the options of the DateTimeFormat object. + * @returns Returns the options of the DateTimeFormat object. * @since 6 */ resolvedOptions(): DateTimeOptions; @@ -871,7 +871,7 @@ export class NumberFormat { * * @syscap SystemCapability.Global.I18n * @param number Indicates the number to be formatted. - * @return Returns a number string formatted based on the specified locale. + * @returns Returns a number string formatted based on the specified locale. * @since 6 */ format(number: number): string; @@ -880,7 +880,7 @@ export class NumberFormat { * Obtains the options of the NumberFormat object. * * @syscap SystemCapability.Global.I18n - * @return Returns the options of the NumberFormat object. + * @returns Returns the options of the NumberFormat object. * @since 6 */ resolvedOptions(): NumberOptions; @@ -1056,7 +1056,7 @@ export class Collator { * @syscap SystemCapability.Global.I18n * @param first The first string to compare. * @param second The second string to compare. - * @return Returns a number indicating how first compare to second: + * @returns Returns a number indicating how first compare to second: * a negative value if string1 comes before string2; * a positive value if string1 comes after string2; * 0 if they are considered equal. @@ -1065,11 +1065,11 @@ export class Collator { compare(first: string, second: string): number; /** - * Returns a new object with properties reflecting the locale and collation options computed + * Returns a new object with properties that reflect the locale and collation options computed * during initialization of the object. * * @syscap SystemCapability.Global.I18n - * @return Returns a CollatorOptions object reflecting the properties of this object. + * @returns Returns a CollatorOptions object with properties that reflect the properties of this object. * @since 8 */ resolvedOptions(): CollatorOptions; @@ -1240,7 +1240,7 @@ export class PluralRules { * * @syscap SystemCapability.Global.I18n * @param n The number to get a plural rule for. - * @return A string representing the pluralization category of the number, + * @returns A string representing the pluralization category of the number, * can be one of zero, one, two, few, many or other. * @since 8 */ @@ -1404,11 +1404,11 @@ export class RelativeTimeFormat { formatToParts(value: number, unit: string): Array; /** - * Returns a new object with properties reflecting the locale and formatting options computed during + * Returns a new object with properties that reflect the locale and formatting options computed during * initialization of the object. * * @syscap SystemCapability.Global.I18n - * @returns RelativeTimeFormatOptions which reflecting the locale and formatting options of the object. + * @returns RelativeTimeFormatOptions which reflect the locale and formatting options of the object. * @since 8 */ resolvedOptions(): RelativeTimeFormatResolvedOptions; -- Gitee From e2a62cd71140e496fac24f68ea4c6db154a45e10 Mon Sep 17 00:00:00 2001 From: li-yaoyao777 Date: Fri, 18 Nov 2022 11:24:38 +0800 Subject: [PATCH 354/438] =?UTF-8?q?=E6=95=B4=E6=94=B9ts=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=A7=84=E8=8C=83=E6=89=AB=E6=8F=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-yaoyao777 --- api/@ohos.sensor.d.ts | 2 +- api/@ohos.vibrator.d.ts | 2 +- api/@system.sensor.d.ts | 34 +++++++++++----------------------- api/@system.vibrator.d.ts | 2 -- 4 files changed, 13 insertions(+), 27 deletions(-) diff --git a/api/@ohos.sensor.d.ts b/api/@ohos.sensor.d.ts index b7f99aab63..77104ecfae 100644 --- a/api/@ohos.sensor.d.ts +++ b/api/@ohos.sensor.d.ts @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { AsyncCallback, Callback } from "./basic"; /** @@ -19,7 +20,6 @@ import { AsyncCallback, Callback } from "./basic"; * * @since 8 * @syscap SystemCapability.Sensors.Sensor - * @import import sensor from '@ohos.sensor' */ declare namespace sensor { /** diff --git a/api/@ohos.vibrator.d.ts b/api/@ohos.vibrator.d.ts index 83f8d961c1..07a4a25934 100755 --- a/api/@ohos.vibrator.d.ts +++ b/api/@ohos.vibrator.d.ts @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { AsyncCallback } from './basic'; /** @@ -19,7 +20,6 @@ import { AsyncCallback } from './basic'; * * @since 8 * @syscap SystemCapability.Sensors.MiscDevice - * @import import vibrator from '@ohos.vibrator' */ declare namespace vibrator { /** diff --git a/api/@system.sensor.d.ts b/api/@system.sensor.d.ts index e5d7ecca4b..cc34a63edc 100644 --- a/api/@system.sensor.d.ts +++ b/api/@system.sensor.d.ts @@ -15,7 +15,6 @@ /** * @syscap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; * @permission ohos.permission.ACCELEROMETER * @since 3 * @deprecated since 8 @@ -42,10 +41,10 @@ export interface AccelerometerResponse { /** * @syscap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; * @permission ohos.permission.ACCELEROMETER * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor#SensorId.LINEAR_ACCELEROMETER */ export interface subscribeAccelerometerOptions { /** @@ -74,7 +73,6 @@ export interface subscribeAccelerometerOptions { /** * @syscap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; * @since 3 * @deprecated since 8 */ @@ -88,9 +86,9 @@ export interface CompassResponse { /** * @syscap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor#SensorId.getGeomagneticInfo */ export interface SubscribeCompassOptions { /** @@ -108,7 +106,6 @@ export interface SubscribeCompassOptions { /** * @syscap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; * @since 3 * @deprecated since 8 */ @@ -122,9 +119,9 @@ export interface ProximityResponse { /** * @syscap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor#SensorId.PROXIMITY */ export interface SubscribeProximityOptions { /** @@ -142,7 +139,6 @@ export interface SubscribeProximityOptions { /** * @syscap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; * @since 3 * @deprecated since 8 */ @@ -156,9 +152,9 @@ export interface LightResponse { /** * @syscap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor#SensorId.AMBIENT_LIGHT */ export interface SubscribeLightOptions { /** @@ -176,7 +172,6 @@ export interface SubscribeLightOptions { /** * @syscap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; * @permission ohos.permission.ACTIVITY_MOTION * @since 3 * @deprecated since 8 @@ -192,10 +187,10 @@ export interface StepCounterResponse { /** * @syscap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; * @permission ohos.permission.ACTIVITY_MOTION * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor#SensorId.PEDOMETER */ export interface SubscribeStepCounterOptions { /** @@ -213,7 +208,6 @@ export interface SubscribeStepCounterOptions { /** * @syscap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; * @since 3 * @deprecated since 8 */ @@ -227,9 +221,9 @@ export interface BarometerResponse { /** * @syscap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor#SensorId.BAROMETER */ export interface SubscribeBarometerOptions { /** @@ -247,7 +241,6 @@ export interface SubscribeBarometerOptions { /** * @syscap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; * @permission ohos.permission.READ_HEALTH_DATA * @since 3 * @deprecated since 8 @@ -263,10 +256,10 @@ export interface HeartRateResponse { /** * @syscap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; * @permission ohos.permission.READ_HEALTH_DATA * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor#SensorId.HEART_RATE */ export interface SubscribeHeartRateOptions { /** @@ -284,7 +277,6 @@ export interface SubscribeHeartRateOptions { /** * @syscap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; * @since 3 * @deprecated since 8 */ @@ -298,9 +290,9 @@ export interface OnBodyStateResponse { /** * @syscap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor#SensorId.WEAR_DETECTION */ export interface SubscribeOnBodyStateOptions { /** @@ -318,7 +310,6 @@ export interface SubscribeOnBodyStateOptions { /** * @syscap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; * @since 3 * @deprecated since 8 */ @@ -328,7 +319,6 @@ export interface GetOnBodyStateOptions { * @since 3 */ success: (data: OnBodyStateResponse) => void; - /** * Called when the sensor wearing state fails to be obtained * @since 3 @@ -344,7 +334,6 @@ export interface GetOnBodyStateOptions { /** * @syscap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; * @since 6 * @deprecated since 8 */ @@ -370,9 +359,9 @@ export interface DeviceOrientationResponse { /** * @syscap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; * @since 6 * @deprecated since 8 + * @useinstead ohos.sensor#SensorId.ROTATION_VECTOR */ export interface SubscribeDeviceOrientationOptions { /** @@ -401,7 +390,6 @@ export interface SubscribeDeviceOrientationOptions { /** * @syscap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; * @permission ohos.permission.GYROSCOPE * @since 6 * @deprecated since 8 @@ -428,10 +416,10 @@ export interface GyroscopeResponse { /** * @syscap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; * @permission ohos.permission.GYROSCOPE * @since 6 * @deprecated since 8 + * @useinstead ohos.sensor#SensorId.GYROSCOPE */ export interface SubscribeGyroscopeOptions { /** @@ -460,7 +448,6 @@ export interface SubscribeGyroscopeOptions { /** * @syscap SystemCapability.Sensors.Sensor - * @import import sensor from '@system.sensor'; * @since 6 * @deprecated since 8 */ @@ -529,6 +516,7 @@ export default class Sensor { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor#SensorId.AMBIENT_LIGHT */ static subscribeLight(options: SubscribeLightOptions): void; diff --git a/api/@system.vibrator.d.ts b/api/@system.vibrator.d.ts index f8fd9d1be2..683f0253cb 100644 --- a/api/@system.vibrator.d.ts +++ b/api/@system.vibrator.d.ts @@ -15,7 +15,6 @@ /** * @syscap SystemCapability.Sensors.MiscDevice - * @import import vibrator from '@system.vibrator'; * @permission ohos.permission.VIBRATE * @since 3 * @deprecated since 8 @@ -49,7 +48,6 @@ export interface VibrateOptions { /** * @syscap SystemCapability.Sensors.MiscDevice - * @import import vibrator from '@system.vibrator'; * @permission ohos.permission.VIBRATE * @since 3 * @deprecated since 8 -- Gitee From 5bf66c4b55f163723f4296e36e131a112031eea1 Mon Sep 17 00:00:00 2001 From: liwuli Date: Fri, 18 Nov 2022 10:45:51 +0800 Subject: [PATCH 355/438] fix misspell words error Signed-off-by: liwuli --- api/@ohos.enterprise.adminManager.d.ts | 30 +++++++++++------------ api/@ohos.enterprise.dateTimeManager.d.ts | 8 +++--- api/@ohos.enterprise.deviceInfo.d.ts | 4 +-- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/api/@ohos.enterprise.adminManager.d.ts b/api/@ohos.enterprise.adminManager.d.ts index 81ac5b888b..8458d5afcb 100644 --- a/api/@ohos.enterprise.adminManager.d.ts +++ b/api/@ohos.enterprise.adminManager.d.ts @@ -104,7 +104,7 @@ declare namespace adminManager { * @param { AdminType } type - type indicates the type of administrator to set. * @param { AsyncCallback } callback - the callback of enableAdmin. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. - * @throws { BusinessError } 9200004 - failed to enable the adminstrator application of the device. + * @throws { BusinessError } 9200004 - failed to enable the administrator application of the device. * @throws { BusinessError } 9200007 - the system ability work abnormally. * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. @@ -125,7 +125,7 @@ declare namespace adminManager { * @param { number } userId - userId indicates the user ID. * @param { AsyncCallback } callback - the callback of enableAdmin. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. - * @throws { BusinessError } 9200004 - failed to enable the adminstrator application of the device. + * @throws { BusinessError } 9200004 - failed to enable the administrator application of the device. * @throws { BusinessError } 9200007 - the system ability work abnormally. * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. @@ -146,7 +146,7 @@ declare namespace adminManager { * @param { number } [userId] - userId indicates the user ID or do not pass user ID. * @returns { Promise } the promise returned by the enableAdmin. * @throws { BusinessError } 9200003 - the administrator ability component is invalid. - * @throws { BusinessError } 9200004 - failed to enable the adminstrator application of the device. + * @throws { BusinessError } 9200004 - failed to enable the administrator application of the device. * @throws { BusinessError } 9200007 - the system ability work abnormally. * @throws { BusinessError } 201 - the application does not have permission to call this function. * @throws { BusinessError } 401 - invalid input parameter. @@ -259,7 +259,7 @@ declare namespace adminManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function isAdminEnabled(admin: Want, userId: number, callback: AsyncCallback): void; @@ -272,7 +272,7 @@ declare namespace adminManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function isAdminEnabled(admin: Want, userId?: number): Promise; @@ -285,7 +285,7 @@ declare namespace adminManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function getEnterpriseInfo(admin: Want, callback: AsyncCallback): void; @@ -298,7 +298,7 @@ declare namespace adminManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function getEnterpriseInfo(admin: Want): Promise; @@ -315,7 +315,7 @@ declare namespace adminManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback): void; @@ -332,7 +332,7 @@ declare namespace adminManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise; @@ -344,7 +344,7 @@ declare namespace adminManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function isSuperAdmin(bundleName: String, callback: AsyncCallback): void; @@ -356,7 +356,7 @@ declare namespace adminManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function isSuperAdmin(bundleName: String): Promise; @@ -373,7 +373,7 @@ declare namespace adminManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function subscribeManagedEvent(admin: Want, managedEvents: Array, callback: AsyncCallback): void; @@ -390,7 +390,7 @@ declare namespace adminManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function subscribeManagedEvent(admin: Want, managedEvents: Array): Promise; @@ -407,7 +407,7 @@ declare namespace adminManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function unsubscribeManagedEvent(admin: Want, managedEvents: Array, callback: AsyncCallback): void; @@ -424,7 +424,7 @@ declare namespace adminManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function unsubscribeManagedEvent(admin: Want, managedEvents: Array): Promise; diff --git a/api/@ohos.enterprise.dateTimeManager.d.ts b/api/@ohos.enterprise.dateTimeManager.d.ts index c9186257c5..2a7da62ded 100644 --- a/api/@ohos.enterprise.dateTimeManager.d.ts +++ b/api/@ohos.enterprise.dateTimeManager.d.ts @@ -30,7 +30,7 @@ declare namespace dateTimeManager { * This function can be called by a super administrator. * @permission ohos.permission.ENTERPRISE_SET_DATETIME * @param { Want } admin - admin indicates the administrator ability information. - * @param { number } time - time indicates rhe target time stamp (ms). + * @param { number } time - time indicates the target time stamp (ms). * @param { AsyncCallback } callback - the callback of setDateTime. * @throws { BusinessError } 9200001 - the application is not an administrator of the device. * @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device. @@ -38,7 +38,7 @@ declare namespace dateTimeManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function setDateTime(admin: Want, time: number, callback: AsyncCallback): void; @@ -48,7 +48,7 @@ declare namespace dateTimeManager { * This function can be called by a super administrator. * @permission ohos.permission.ENTERPRISE_SET_DATETIME * @param { Want } admin - admin indicates the administrator ability information. - * @param { number } time - time indicates rhe target time stamp (ms). + * @param { number } time - time indicates the target time stamp (ms). * @returns { Promise } the promise returned by the setDateTime. * @throws { BusinessError } 9200001 - the application is not an administrator of the device. * @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device. @@ -56,7 +56,7 @@ declare namespace dateTimeManager { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function setDateTime(admin: Want, time: number): Promise; diff --git a/api/@ohos.enterprise.deviceInfo.d.ts b/api/@ohos.enterprise.deviceInfo.d.ts index b1ebb9170a..c549b541c3 100644 --- a/api/@ohos.enterprise.deviceInfo.d.ts +++ b/api/@ohos.enterprise.deviceInfo.d.ts @@ -37,7 +37,7 @@ declare namespace deviceInfo { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function getDeviceSerial(admin: Want, callback: AsyncCallback): void; @@ -54,7 +54,7 @@ declare namespace deviceInfo { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly + * @StageModelOnly * @since 9 */ function getDeviceSerial(admin: Want): Promise; -- Gitee From 1ca293c3db659e2dfcc70138bfb8e972a4ab36b3 Mon Sep 17 00:00:00 2001 From: duanweiling Date: Fri, 18 Nov 2022 11:45:34 +0800 Subject: [PATCH 356/438] js api Signed-off-by: duanweiling --- api/@ohos.data.storage.d.ts | 40 ++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/api/@ohos.data.storage.d.ts b/api/@ohos.data.storage.d.ts index 80b5597a56..37be8a4c2d 100644 --- a/api/@ohos.data.storage.d.ts +++ b/api/@ohos.data.storage.d.ts @@ -20,7 +20,7 @@ import { AsyncCallback, Callback } from './basic'; * * @name storage * @since 6 - * @deprecated since 9, please use @ohos.data.preferences instead. + * @deprecated since 9 * @syscap SystemCapability.DistributedDataManager.Preferences.Core * */ @@ -35,7 +35,8 @@ declare namespace storage { * @return Returns the {@link Storage} instance matching the specified storage file name. * @throws BusinessError if invoked failed * @since 6 - * @deprecated since 9, please use @ohos.data.preferences instead. + * @deprecated since 9 + * @useinstead ohos.preferences.preferences.getPreferences */ function getStorageSync(path: string): Storage; @@ -54,7 +55,8 @@ declare namespace storage { * @param path Indicates the path of storage file * @throws BusinessError if invoked failed * @since 6 - * @deprecated since 9, please use @ohos.data.preferences instead. + * @deprecated since 9 + * @useinstead ohos.preferences.preferences.deletePreferences */ function deleteStorageSync(path: string): void; function deleteStorage(path: string, callback: AsyncCallback): void; @@ -71,7 +73,8 @@ declare namespace storage { * @param path Indicates the path of storage file. * @throws BusinessError if invoked failed * @since 6 - * @deprecated since 9, please use @ohos.data.preferences instead. + * @deprecated since 9 + * @useinstead ohos.preferences.preferences.removePreferencesFromCache */ function removeStorageFromCacheSync(path: string): void; function removeStorageFromCache(path: string, callback: AsyncCallback): void; @@ -88,7 +91,7 @@ declare namespace storage { * @syscap SystemCapability.DistributedDataManager.Preferences.Core * * @since 6 - * @deprecated since 9, please use @ohos.data.preferences instead. + * @deprecated since 9 */ interface Storage { /** @@ -101,7 +104,8 @@ declare namespace storage { * @return Returns the value matching the specified key if it is found; returns the default value otherwise. * @throws BusinessError if invoked failed * @since 6 - * @deprecated since 9, please use @ohos.data.preferences instead. + * @deprecated since 9 + * @useinstead ohos.preferences.preferences.get */ getSync(key: string, defValue: ValueType): ValueType; get(key: string, defValue: ValueType, callback: AsyncCallback): void; @@ -115,7 +119,8 @@ declare namespace storage { * returns {@code false} otherwise. * @throws BusinessError if invoked failed * @since 6 - * @deprecated since 9, please use @ohos.data.preferences instead. + * @deprecated since 9 + * @useinstead ohos.preferences.preferences.has */ hasSync(key: string): boolean; has(key: string, callback: AsyncCallback): boolean; @@ -132,7 +137,9 @@ declare namespace storage { * MAX_KEY_LENGTH. * @throws BusinessError if invoked failed * @since 6 - * @deprecated since 9, please use @ohos.data.preferences instead. + * @deprecated since 9 + * @deprecated since 9 + * @useinstead ohos.preferences.preferences.put */ putSync(key: string, value: ValueType): void; put(key: string, value: ValueType, callback: AsyncCallback): void; @@ -148,7 +155,8 @@ declare namespace storage { * MAX_KEY_LENGTH. * @throws BusinessError if invoked failed * @since 6 - * @deprecated since 9, please use @ohos.data.preferences instead. + * @deprecated since 9 + * @useinstead ohos.preferences.preferences.delete */ deleteSync(key: string): void; delete(key: string, callback: AsyncCallback): void; @@ -162,7 +170,8 @@ declare namespace storage { * * @throws BusinessError if invoked failed * @since 6 - * @deprecated since 9, please use @ohos.data.preferences instead. + * @deprecated since 9 + * @useinstead ohos.preferences.preferences.clear */ clearSync(): void; clear(callback: AsyncCallback): void; @@ -173,7 +182,8 @@ declare namespace storage { * * @throws BusinessError if invoked failed * @since 6 - * @deprecated since 9, please use @ohos.data.preferences instead. + * @deprecated since 9 + * @useinstead ohos.preferences.preferences.flush */ flushSync(): void; flush(callback: AsyncCallback): void; @@ -185,7 +195,8 @@ declare namespace storage { * @param callback Indicates the callback when storage changes. * @throws BusinessError if invoked failed * @since 6 - * @deprecated since 9, please use @ohos.data.preferences instead. + * @deprecated since 9 + * @useinstead ohos.preferences.preferences.on */ on(type: 'change', callback: Callback): void; @@ -195,7 +206,8 @@ declare namespace storage { * @param callback Indicates the registered callback. * @throws BusinessError if invoked failed * @since 6 - * @deprecated since 9, please use @ohos.data.preferences instead. + * @deprecated since 9 + * @useinstead ohos.preferences.preferences.off */ off(type: 'change', callback: Callback): void; } @@ -211,7 +223,7 @@ declare namespace storage { * @syscap SystemCapability.DistributedDataManager.Preferences.Core * * @since 6 - * @deprecated since 9, please use @ohos.data.preferences instead. + * @deprecated since 9 */ interface StorageObserver { /** -- Gitee From 2037119f7f119ef2fce54abea6b5253187feb996 Mon Sep 17 00:00:00 2001 From: li-yaoyao777 Date: Fri, 18 Nov 2022 15:25:28 +0800 Subject: [PATCH 357/438] =?UTF-8?q?=E6=95=B4=E6=94=B9api=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-yaoyao777 --- api/@ohos.sensor.d.ts | 146 ++++++++++++++++++++-------------------- api/@system.sensor.d.ts | 42 +++++++++--- 2 files changed, 104 insertions(+), 84 deletions(-) diff --git a/api/@ohos.sensor.d.ts b/api/@ohos.sensor.d.ts index 77104ecfae..f97828c251 100644 --- a/api/@ohos.sensor.d.ts +++ b/api/@ohos.sensor.d.ts @@ -824,7 +824,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.ACCELEROMETER + * @useinstead sensor#eventSensorId.ACCELEROMETER */ function on(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: Callback, options?: Options): void; @@ -837,7 +837,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.ACCELEROMETER_UNCALIBRATED + * @useinstead sensor#event:SensorId.ACCELEROMETER_UNCALIBRATED */ function on(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, callback: Callback, options?: Options): void; @@ -849,7 +849,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.AMBIENT_LIGHT + * @useinstead sensor#event:SensorId.AMBIENT_LIGHT */ function on(type: SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: Callback, options?: Options): void; @@ -861,7 +861,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.AMBIENT_TEMPERATURE + * @useinstead sensor#event:SensorId.AMBIENT_TEMPERATURE */ function on(type: SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, callback: Callback, options?: Options): void; @@ -873,7 +873,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.BAROMETER + * @useinstead sensor#event:SensorId.BAROMETER */ function on(type: SensorType.SENSOR_TYPE_ID_BAROMETER, callback: Callback, options?: Options): void; @@ -885,7 +885,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.GRAVITY + * @useinstead sensor#event:SensorId.GRAVITY */ function on(type: SensorType.SENSOR_TYPE_ID_GRAVITY, callback: Callback, options?: Options): void; @@ -898,7 +898,7 @@ declare namespace sensor { * @permission ohos.permission.GYROSCOPE * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.GYROSCOPE + * @useinstead sensor#event:SensorId.GYROSCOPE */ function on(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: Callback, options?: Options): void; @@ -911,7 +911,7 @@ declare namespace sensor { * @permission ohos.permission.GYROSCOPE * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.GYROSCOPE_UNCALIBRATED + * @useinstead sensor#event:SensorId.GYROSCOPE_UNCALIBRATED */ function on(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback: Callback, options?: Options): void; @@ -923,7 +923,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.HALL + * @useinstead sensor#event:SensorId.HALL */ function on(type: SensorType.SENSOR_TYPE_ID_HALL, callback: Callback, options?: Options): void; @@ -936,7 +936,7 @@ declare namespace sensor { * @permission ohos.permission.HEALTH_DATA * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.HEART_RATE + * @useinstead sensor#event:SensorId.HEART_RATE */ function on(type: SensorType.SENSOR_TYPE_ID_HEART_RATE, callback: Callback, options?: Options): void; @@ -948,7 +948,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.HUMIDITY + * @useinstead sensor#event:SensorId.HUMIDITY */ function on(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: Callback, options?: Options): void; @@ -961,7 +961,7 @@ declare namespace sensor { * @permission ohos.permission.ACCELEROMETER * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.LINEAR_ACCELEROMETER + * @useinstead sensor#event:SensorId.LINEAR_ACCELEROMETER */ function on(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback: Callback, options?: Options): void; @@ -973,7 +973,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.MAGNETIC_FIELD + * @useinstead sensor#event:SensorId.MAGNETIC_FIELD */ function on(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: Callback, options?: Options): void; @@ -985,7 +985,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.MAGNETIC_FIELD_UNCALIBRATED + * @useinstead sensor#event:SensorId.MAGNETIC_FIELD_UNCALIBRATED */ function on(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, callback: Callback, options?: Options): void; @@ -997,7 +997,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.ORIENTATION + * @useinstead sensor#event:SensorId.ORIENTATION */ function on(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: Callback, options?: Options): void; @@ -1010,7 +1010,7 @@ declare namespace sensor { * @permission ohos.permission.ACTIVITY_MOTION * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.PEDOMETER + * @useinstead sensor#event:SensorId.PEDOMETER */ function on(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: Callback, options?: Options): void; @@ -1023,7 +1023,7 @@ declare namespace sensor { * @permission ohos.permission.ACTIVITY_MOTION * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.PEDOMETER_DETECTION + * @useinstead sensor#event:SensorId.PEDOMETER_DETECTION */ function on(type: SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback: Callback, options?: Options): void; @@ -1035,7 +1035,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.PROXIMITY + * @useinstead sensor#event:SensorId.PROXIMITY */ function on(type: SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: Callback, options?: Options): void; @@ -1047,7 +1047,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.ROTATION_VECTOR + * @useinstead sensor#event:SensorId.ROTATION_VECTOR */ function on(type: SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback: Callback, options?: Options): void; @@ -1059,7 +1059,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.SIGNIFICANT_MOTION + * @useinstead sensor#event:SensorId.SIGNIFICANT_MOTION */ function on(type: SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback: Callback, options?: Options): void; @@ -1071,7 +1071,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.WEAR_DETECTION + * @useinstead sensor#event:SensorId.WEAR_DETECTION */ function on(type: SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: Callback, options?: Options): void; @@ -1083,7 +1083,7 @@ declare namespace sensor { * @permission ohos.permission.ACCELEROMETER * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.ACCELEROMETER + * @useinstead sensor#event:SensorId.ACCELEROMETER */ function once(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: Callback): void; @@ -1094,7 +1094,7 @@ declare namespace sensor { * @permission ohos.permission.ACCELEROMETER * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.ACCELEROMETER_UNCALIBRATED + * @useinstead sensor#event:SensorId.ACCELEROMETER_UNCALIBRATED */ function once(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, callback: Callback): void; @@ -1104,7 +1104,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.AMBIENT_LIGHT + * @useinstead sensor#event:SensorId.AMBIENT_LIGHT */ function once(type: SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: Callback): void; @@ -1114,7 +1114,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.AMBIENT_TEMPERATURE + * @useinstead sensor#event:SensorId.AMBIENT_TEMPERATURE */ function once(type: SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, callback: Callback): void; @@ -1124,7 +1124,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.BAROMETER + * @useinstead sensor#event:SensorId.BAROMETER */ function once(type: SensorType.SENSOR_TYPE_ID_BAROMETER, callback: Callback): void; @@ -1134,7 +1134,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.GRAVITY + * @useinstead sensor#event:SensorId.GRAVITY */ function once(type: SensorType.SENSOR_TYPE_ID_GRAVITY, callback: Callback): void; @@ -1145,7 +1145,7 @@ declare namespace sensor { * @permission ohos.permission.GYROSCOPE * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.GYROSCOPE + * @useinstead sensor#event:SensorId.GYROSCOPE */ function once(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: Callback): void; @@ -1156,7 +1156,7 @@ declare namespace sensor { * @permission ohos.permission.GYROSCOPE * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.GYROSCOPE_UNCALIBRATED + * @useinstead sensor#event:SensorId.GYROSCOPE_UNCALIBRATED */ function once(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback: Callback): void; @@ -1166,7 +1166,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.HALL + * @useinstead sensor#event:SensorId.HALL */ function once(type: SensorType.SENSOR_TYPE_ID_HALL, callback: Callback): void; @@ -1177,7 +1177,7 @@ declare namespace sensor { * @permission ohos.permission.HEART_RATE * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.HEART_RATE + * @useinstead sensor#event:SensorId.HEART_RATE */ function once(type: SensorType.SENSOR_TYPE_ID_HEART_RATE, callback: Callback): void; @@ -1187,7 +1187,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.HUMIDITY + * @useinstead sensor#event:SensorId.HUMIDITY */ function once(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: Callback): void; @@ -1198,7 +1198,7 @@ declare namespace sensor { * @permission ohos.permission.ACCELERATION * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.LINEAR_ACCELEROMETER + * @useinstead sensor#event:SensorId.LINEAR_ACCELEROMETER */ function once(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback: Callback): void; @@ -1208,7 +1208,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.MAGNETIC_FIELD + * @useinstead sensor#event:SensorId.MAGNETIC_FIELD */ function once(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: Callback): void; @@ -1218,7 +1218,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.MAGNETIC_FIELD_UNCALIBRATED + * @useinstead sensor#event:SensorId.MAGNETIC_FIELD_UNCALIBRATED */ function once(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, callback: Callback): void; @@ -1228,7 +1228,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.ORIENTATION + * @useinstead sensor#event:SensorId.ORIENTATION */ function once(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: Callback): void; @@ -1239,7 +1239,7 @@ declare namespace sensor { * @permission ohos.permission.ACTIVITY_MOTION * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.PEDOMETER + * @useinstead sensor#event:SensorId.PEDOMETER */ function once(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: Callback): void; @@ -1250,7 +1250,7 @@ declare namespace sensor { * @permission ohos.permission.ACTIVITY_MOTION * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.PEDOMETER_DETECTION + * @useinstead sensor#event:SensorId.PEDOMETER_DETECTION */ function once(type: SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback: Callback): void; @@ -1260,7 +1260,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.PROXIMITY + * @useinstead sensor#event:SensorId.PROXIMITY */ function once(type: SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: Callback): void; @@ -1270,7 +1270,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.ROTATION_VECTOR + * @useinstead sensor#event:SensorId.ROTATION_VECTOR */ function once(type: SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback: Callback): void; @@ -1280,7 +1280,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.SIGNIFICANT_MOTION + * @useinstead sensor#event:SensorId.SIGNIFICANT_MOTION */ function once(type: SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback: Callback): void; @@ -1290,7 +1290,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.WEAR_DETECTION + * @useinstead sensor#event:SensorId.WEAR_DETECTION */ function once(type: SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: Callback): void; @@ -1301,7 +1301,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.ACCELEROMETER + * @useinstead sensor#event:SensorId.ACCELEROMETER */ function off(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback?: Callback): void; @@ -1312,7 +1312,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.ACCELEROMETER_UNCALIBRATED + * @useinstead sensor#event:SensorId.ACCELEROMETER_UNCALIBRATED */ function off(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, callback?: Callback): void; @@ -1323,7 +1323,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.AMBIENT_LIGHT + * @useinstead sensor#event:SensorId.AMBIENT_LIGHT */ function off(type: SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback?: Callback): void; @@ -1333,7 +1333,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.AMBIENT_TEMPERATURE + * @useinstead sensor#event:SensorId.AMBIENT_TEMPERATURE */ function off(type: SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, callback?: Callback): void; @@ -1343,7 +1343,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.BAROMETER + * @useinstead sensor#event:SensorId.BAROMETER */ function off(type: SensorType.SENSOR_TYPE_ID_BAROMETER, callback?: Callback): void; @@ -1353,7 +1353,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.GRAVITY + * @useinstead sensor#event:SensorId.GRAVITY */ function off(type: SensorType.SENSOR_TYPE_ID_GRAVITY, callback?: Callback): void; @@ -1364,7 +1364,7 @@ declare namespace sensor { * @permission ohos.permission.GYROSCOPE * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.GYROSCOPE + * @useinstead sensor#event:SensorId.GYROSCOPE */ function off(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback?: Callback): void; @@ -1375,7 +1375,7 @@ declare namespace sensor { * @permission ohos.permission.GYROSCOPE * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.GYROSCOPE_UNCALIBRATED + * @useinstead sensor#event:SensorId.GYROSCOPE_UNCALIBRATED */ function off(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback?: Callback): void; @@ -1385,7 +1385,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.HALL + * @useinstead sensor#event:SensorId.HALL */ function off(type: SensorType.SENSOR_TYPE_ID_HALL, callback?: Callback): void; @@ -1396,7 +1396,7 @@ declare namespace sensor { * @permission ohos.permission.HEALTH_DATA * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.HEART_RATE + * @useinstead sensor#event:SensorId.HEART_RATE */ function off(type: SensorType.SENSOR_TYPE_ID_HEART_RATE, callback?: Callback): void; @@ -1406,7 +1406,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.HUMIDITY + * @useinstead sensor#event:SensorId.HUMIDITY */ function off(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback?: Callback): void; @@ -1417,7 +1417,7 @@ declare namespace sensor { * @permission ohos.permission.ACCELEROMETER * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.LINEAR_ACCELEROMETER + * @useinstead sensor#event:SensorId.LINEAR_ACCELEROMETER */ function off(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback?: Callback): void; @@ -1427,7 +1427,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.MAGNETIC_FIELD + * @useinstead sensor#event:SensorId.MAGNETIC_FIELD */ function off(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback?: Callback): void; @@ -1437,7 +1437,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.MAGNETIC_FIELD_UNCALIBRATED + * @useinstead sensor#event:SensorId.MAGNETIC_FIELD_UNCALIBRATED */ function off(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, callback?: Callback): void; @@ -1447,7 +1447,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.ORIENTATION + * @useinstead sensor#event:SensorId.ORIENTATION */ function off(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback?: Callback): void; @@ -1458,7 +1458,7 @@ declare namespace sensor { * @permission ohos.permission.ACTIVITY_MOTION * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.PEDOMETER + * @useinstead sensor#event:SensorId.PEDOMETER */ function off(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback?: Callback): void; @@ -1469,7 +1469,7 @@ declare namespace sensor { * @permission ohos.permission.ACTIVITY_MOTION * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.PEDOMETER_DETECTION + * @useinstead sensor#event:SensorId.PEDOMETER_DETECTION */ function off(type: SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback?: Callback): void; @@ -1479,7 +1479,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.PROXIMITY + * @useinstead sensor#event:SensorId.PROXIMITY */ function off(type: SensorType.SENSOR_TYPE_ID_PROXIMITY, callback?: Callback): void; @@ -1489,7 +1489,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.ROTATION_VECTOR + * @useinstead sensor#event:SensorId.ROTATION_VECTOR */ function off(type: SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback?: Callback): void; @@ -1499,7 +1499,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.SIGNIFICANT_MOTION + * @useinstead sensor#event:SensorId.SIGNIFICANT_MOTION */ function off(type: SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback?: Callback): void; @@ -1509,7 +1509,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId.WEAR_DETECTION + * @useinstead sensor#event:SensorId.WEAR_DETECTION */ function off(type: SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback?: Callback): void; @@ -1593,7 +1593,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.getGeomagneticInfo + * @useinstead sensor#getGeomagneticInfo */ function getGeomagneticField(locationOptions: LocationOptions, timeMillis: number, callback: AsyncCallback): void; function getGeomagneticField(locationOptions: LocationOptions, timeMillis: number): Promise; @@ -1622,7 +1622,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.getDeviceAltitude + * @useinstead sensor#getDeviceAltitude */ function getAltitude(seaPressure: number, currentPressure: number, callback: AsyncCallback): void; function getAltitude(seaPressure: number, currentPressure: number): Promise; @@ -1649,7 +1649,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.getInclination + * @useinstead sensor#getInclination */ function getGeomagneticDip(inclinationMatrix: Array, callback: AsyncCallback): void; function getGeomagneticDip(inclinationMatrix: Array): Promise; @@ -1676,7 +1676,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.getAngleVariation + * @useinstead sensor#getAngleVariation */ function getAngleModify(currentRotationMatrix: Array, preRotationMatrix: Array, callback: AsyncCallback>): void; @@ -1705,7 +1705,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.getRotationMatrix + * @useinstead sensor#getRotationMatrix */ function createRotationMatrix(rotationVector: Array, callback: AsyncCallback>): void; function createRotationMatrix(rotationVector: Array): Promise>; @@ -1749,7 +1749,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.transformRotationMatrix + * @useinstead sensor#transformRotationMatrix */ function transformCoordinateSystem(inRotationVector: Array, coordinates: CoordinatesOptions, callback: AsyncCallback>): void; @@ -1778,7 +1778,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.getQuaternion + * @useinstead sensor#getQuaternion */ function createQuaternion(rotationVector: Array, callback: AsyncCallback>): void; function createQuaternion(rotationVector: Array): Promise>; @@ -1804,7 +1804,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.getOrientation + * @useinstead sensor#getOrientation */ function getDirection(rotationMatrix: Array, callback: AsyncCallback>): void; function getDirection(rotationMatrix: Array): Promise>; @@ -1841,7 +1841,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.getRotationMatrix + * @useinstead sensor#getRotationMatrix */ function createRotationMatrix(gravity: Array, geomagnetic: Array, callback: AsyncCallback): void; function createRotationMatrix(gravity: Array, geomagnetic: Array,): Promise; @@ -1874,7 +1874,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead ohos.sensor.SensorId + * @useinstead sensor#event:SensorId */ enum SensorType { SENSOR_TYPE_ID_ACCELEROMETER = 1, /**< Acceleration sensor */ diff --git a/api/@system.sensor.d.ts b/api/@system.sensor.d.ts index cc34a63edc..72fad98d1e 100644 --- a/api/@system.sensor.d.ts +++ b/api/@system.sensor.d.ts @@ -44,7 +44,7 @@ export interface AccelerometerResponse { * @permission ohos.permission.ACCELEROMETER * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor#SensorId.LINEAR_ACCELEROMETER + * @useinstead ohos.sensor/sensor#SensorId.LINEAR_ACCELEROMETER */ export interface subscribeAccelerometerOptions { /** @@ -88,7 +88,7 @@ export interface CompassResponse { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor#SensorId.getGeomagneticInfo + * @useinstead ohos.sensor/sensor#SensorId.getGeomagneticInfo */ export interface SubscribeCompassOptions { /** @@ -121,7 +121,7 @@ export interface ProximityResponse { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor#SensorId.PROXIMITY + * @useinstead ohos.sensor/sensor#SensorId.PROXIMITY */ export interface SubscribeProximityOptions { /** @@ -154,7 +154,7 @@ export interface LightResponse { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor#SensorId.AMBIENT_LIGHT + * @useinstead ohos.sensor/sensor#SensorId.AMBIENT_LIGHT */ export interface SubscribeLightOptions { /** @@ -190,7 +190,7 @@ export interface StepCounterResponse { * @permission ohos.permission.ACTIVITY_MOTION * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor#SensorId.PEDOMETER + * @useinstead ohos.sensor/sensor#SensorId.PEDOMETER */ export interface SubscribeStepCounterOptions { /** @@ -223,7 +223,7 @@ export interface BarometerResponse { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor#SensorId.BAROMETER + * @useinstead ohos.sensor/sensor#SensorId.BAROMETER */ export interface SubscribeBarometerOptions { /** @@ -259,7 +259,7 @@ export interface HeartRateResponse { * @permission ohos.permission.READ_HEALTH_DATA * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor#SensorId.HEART_RATE + * @useinstead ohos.sensor/sensor#SensorId.HEART_RATE */ export interface SubscribeHeartRateOptions { /** @@ -292,7 +292,7 @@ export interface OnBodyStateResponse { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor#SensorId.WEAR_DETECTION + * @useinstead ohos.sensor/sensor#SensorId.WEAR_DETECTION */ export interface SubscribeOnBodyStateOptions { /** @@ -312,6 +312,7 @@ export interface SubscribeOnBodyStateOptions { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#SensorId.WEAR_DETECTION */ export interface GetOnBodyStateOptions { /** @@ -361,7 +362,7 @@ export interface DeviceOrientationResponse { * @syscap SystemCapability.Sensors.Sensor * @since 6 * @deprecated since 8 - * @useinstead ohos.sensor#SensorId.ROTATION_VECTOR + * @useinstead ohos.sensor/sensor#SensorId.ROTATION_VECTOR */ export interface SubscribeDeviceOrientationOptions { /** @@ -419,7 +420,7 @@ export interface GyroscopeResponse { * @permission ohos.permission.GYROSCOPE * @since 6 * @deprecated since 8 - * @useinstead ohos.sensor#SensorId.GYROSCOPE + * @useinstead ohos.sensor/sensor#SensorId.GYROSCOPE */ export interface SubscribeGyroscopeOptions { /** @@ -460,6 +461,7 @@ export default class Sensor { * @permission ohos.permission.ACCELEROMETER * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#event:SensorId.ACCELEROMETER */ static subscribeAccelerometer(options: subscribeAccelerometerOptions): void; @@ -469,6 +471,7 @@ export default class Sensor { * @permission ohos.permission.ACCELEROMETER * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#event:SensorId.ACCELEROMETER */ static unsubscribeAccelerometer(): void; @@ -479,6 +482,7 @@ export default class Sensor { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#event:SensorId.MAGNETIC_FIELD */ static subscribeCompass(options: SubscribeCompassOptions): void; @@ -487,6 +491,7 @@ export default class Sensor { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#event:SensorId.MAGNETIC_FIELD */ static unsubscribeCompass(): void; @@ -497,6 +502,7 @@ export default class Sensor { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#event:SensorId.PROXIMITY */ static subscribeProximity(options: SubscribeProximityOptions): void; @@ -506,6 +512,7 @@ export default class Sensor { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#event:SensorId.PROXIMITY */ static unsubscribeProximity(): void; @@ -516,7 +523,7 @@ export default class Sensor { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor#SensorId.AMBIENT_LIGHT + * @useinstead ohos.sensor/sensor#event:SensorId.AMBIENT_LIGHT */ static subscribeLight(options: SubscribeLightOptions): void; @@ -525,6 +532,7 @@ export default class Sensor { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#event:SensorId.AMBIENT_LIGHT */ static unsubscribeLight(): void; @@ -536,6 +544,7 @@ export default class Sensor { * @permission ohos.permission.ACTIVITY_MOTION * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#event:SensorId.PEDOMETER */ static subscribeStepCounter(options: SubscribeStepCounterOptions): void; @@ -545,6 +554,7 @@ export default class Sensor { * @permission ohos.permission.ACTIVITY_MOTION * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#event:SensorId.PEDOMETER */ static unsubscribeStepCounter(): void; @@ -555,6 +565,7 @@ export default class Sensor { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#event:SensorId.BAROMETER */ static subscribeBarometer(options: SubscribeBarometerOptions): void; @@ -563,6 +574,7 @@ export default class Sensor { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#event:SensorId.BAROMETER */ static unsubscribeBarometer(): void; @@ -574,6 +586,7 @@ export default class Sensor { * @permission ohos.permission.READ_HEALTH_DATA * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#event:SensorId.HEART_RATE */ static subscribeHeartRate(options: SubscribeHeartRateOptions): void; @@ -583,6 +596,7 @@ export default class Sensor { * @permission ohos.permission.READ_HEALTH_DATA * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#event:SensorId.HEART_RATE */ static unsubscribeHeartRate(): void; @@ -593,6 +607,7 @@ export default class Sensor { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#event:SensorId.WEAR_DETECTION */ static subscribeOnBodyState(options: SubscribeOnBodyStateOptions): void; @@ -610,6 +625,7 @@ export default class Sensor { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#event:SensorId.WEAR_DETECTION */ static getOnBodyState(options: GetOnBodyStateOptions): void; @@ -620,6 +636,7 @@ export default class Sensor { * @syscap SystemCapability.Sensors.Sensor * @since 6 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#event:SensorId.ROTATION_VECTOR */ static subscribeDeviceOrientation(options: SubscribeDeviceOrientationOptions): void; @@ -628,6 +645,7 @@ export default class Sensor { * @syscap SystemCapability.Sensors.Sensor * @since 6 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#event:SensorId.ROTATION_VECTOR */ static unsubscribeDeviceOrientation(): void; @@ -639,6 +657,7 @@ export default class Sensor { * @permission ohos.permission.GYROSCOPE * @since 6 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#event:SensorId.GYROSCOPE */ static subscribeGyroscope(options: SubscribeGyroscopeOptions): void; @@ -648,6 +667,7 @@ export default class Sensor { * @permission ohos.permission.GYROSCOPE * @since 6 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#event:SensorId.GYROSCOPE */ static unsubscribeGyroscope(): void; } -- Gitee From 515c9386266b870af086fc24b677f45429e901aa Mon Sep 17 00:00:00 2001 From: li-yaoyao777 Date: Fri, 18 Nov 2022 15:33:13 +0800 Subject: [PATCH 358/438] =?UTF-8?q?=E6=95=B4=E6=94=B9api=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-yaoyao777 --- api/@ohos.sensor.d.ts | 2 +- api/@system.sensor.d.ts | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/api/@ohos.sensor.d.ts b/api/@ohos.sensor.d.ts index f97828c251..24aef957af 100644 --- a/api/@ohos.sensor.d.ts +++ b/api/@ohos.sensor.d.ts @@ -824,7 +824,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead sensor#eventSensorId.ACCELEROMETER + * @useinstead sensor#event:SensorId.ACCELEROMETER */ function on(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: Callback, options?: Options): void; diff --git a/api/@system.sensor.d.ts b/api/@system.sensor.d.ts index 72fad98d1e..84ef37a154 100644 --- a/api/@system.sensor.d.ts +++ b/api/@system.sensor.d.ts @@ -44,7 +44,7 @@ export interface AccelerometerResponse { * @permission ohos.permission.ACCELEROMETER * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#SensorId.LINEAR_ACCELEROMETER + * @useinstead ohos.sensor/sensor#event:SensorId.ACCELEROMETER */ export interface subscribeAccelerometerOptions { /** @@ -88,7 +88,7 @@ export interface CompassResponse { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#SensorId.getGeomagneticInfo + * @useinstead ohos.sensor/sensor#eventSensorId.getGeomagneticInfo */ export interface SubscribeCompassOptions { /** @@ -121,7 +121,7 @@ export interface ProximityResponse { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#SensorId.PROXIMITY + * @useinstead ohos.sensor/sensor#eventSensorId.PROXIMITY */ export interface SubscribeProximityOptions { /** @@ -154,7 +154,7 @@ export interface LightResponse { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#SensorId.AMBIENT_LIGHT + * @useinstead ohos.sensor/sensor#eventSensorId.AMBIENT_LIGHT */ export interface SubscribeLightOptions { /** @@ -190,7 +190,7 @@ export interface StepCounterResponse { * @permission ohos.permission.ACTIVITY_MOTION * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#SensorId.PEDOMETER + * @useinstead ohos.sensor/sensor#eventSensorId.PEDOMETER */ export interface SubscribeStepCounterOptions { /** @@ -223,7 +223,7 @@ export interface BarometerResponse { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#SensorId.BAROMETER + * @useinstead ohos.sensor/sensor#eventSensorId.BAROMETER */ export interface SubscribeBarometerOptions { /** @@ -259,7 +259,7 @@ export interface HeartRateResponse { * @permission ohos.permission.READ_HEALTH_DATA * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#SensorId.HEART_RATE + * @useinstead ohos.sensor/sensor#eventSensorId.HEART_RATE */ export interface SubscribeHeartRateOptions { /** @@ -292,7 +292,7 @@ export interface OnBodyStateResponse { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#SensorId.WEAR_DETECTION + * @useinstead ohos.sensor/sensor#event:SensorId.WEAR_DETECTION */ export interface SubscribeOnBodyStateOptions { /** @@ -312,7 +312,7 @@ export interface SubscribeOnBodyStateOptions { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#SensorId.WEAR_DETECTION + * @useinstead ohos.sensor/sensor#eventSensorId.WEAR_DETECTION */ export interface GetOnBodyStateOptions { /** @@ -362,7 +362,7 @@ export interface DeviceOrientationResponse { * @syscap SystemCapability.Sensors.Sensor * @since 6 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#SensorId.ROTATION_VECTOR + * @useinstead ohos.sensor/sensor#eventSensorId.ROTATION_VECTOR */ export interface SubscribeDeviceOrientationOptions { /** @@ -420,7 +420,7 @@ export interface GyroscopeResponse { * @permission ohos.permission.GYROSCOPE * @since 6 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#SensorId.GYROSCOPE + * @useinstead ohos.sensor/sensor#eventSensorId.GYROSCOPE */ export interface SubscribeGyroscopeOptions { /** -- Gitee From a32c989018ac63e6249a22738c1fab216f3e3c9c Mon Sep 17 00:00:00 2001 From: li-yaoyao777 Date: Fri, 18 Nov 2022 15:37:09 +0800 Subject: [PATCH 359/438] =?UTF-8?q?=E6=95=B4=E6=94=B9api=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-yaoyao777 --- api/@system.sensor.d.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/api/@system.sensor.d.ts b/api/@system.sensor.d.ts index 84ef37a154..5dfddc1cba 100644 --- a/api/@system.sensor.d.ts +++ b/api/@system.sensor.d.ts @@ -88,7 +88,7 @@ export interface CompassResponse { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#eventSensorId.getGeomagneticInfo + * @useinstead ohos.sensor/sensor#event:SensorId.getGeomagneticInfo */ export interface SubscribeCompassOptions { /** @@ -121,7 +121,7 @@ export interface ProximityResponse { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#eventSensorId.PROXIMITY + * @useinstead ohos.sensor/sensor#event:SensorId.PROXIMITY */ export interface SubscribeProximityOptions { /** @@ -154,7 +154,7 @@ export interface LightResponse { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#eventSensorId.AMBIENT_LIGHT + * @useinstead ohos.sensor/sensor#event:SensorId.AMBIENT_LIGHT */ export interface SubscribeLightOptions { /** @@ -190,7 +190,7 @@ export interface StepCounterResponse { * @permission ohos.permission.ACTIVITY_MOTION * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#eventSensorId.PEDOMETER + * @useinstead ohos.sensor/sensor#event:eventSensorId.PEDOMETER */ export interface SubscribeStepCounterOptions { /** @@ -223,7 +223,7 @@ export interface BarometerResponse { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#eventSensorId.BAROMETER + * @useinstead ohos.sensor/sensor#event:eventSensorId.BAROMETER */ export interface SubscribeBarometerOptions { /** @@ -259,7 +259,7 @@ export interface HeartRateResponse { * @permission ohos.permission.READ_HEALTH_DATA * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#eventSensorId.HEART_RATE + * @useinstead ohos.sensor/sensor#event:eventSensorId.HEART_RATE */ export interface SubscribeHeartRateOptions { /** @@ -312,7 +312,7 @@ export interface SubscribeOnBodyStateOptions { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#eventSensorId.WEAR_DETECTION + * @useinstead ohos.sensor/sensor#event:SensorId.WEAR_DETECTION */ export interface GetOnBodyStateOptions { /** @@ -362,7 +362,7 @@ export interface DeviceOrientationResponse { * @syscap SystemCapability.Sensors.Sensor * @since 6 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#eventSensorId.ROTATION_VECTOR + * @useinstead ohos.sensor/sensor#event:SensorId.ROTATION_VECTOR */ export interface SubscribeDeviceOrientationOptions { /** @@ -420,7 +420,7 @@ export interface GyroscopeResponse { * @permission ohos.permission.GYROSCOPE * @since 6 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#eventSensorId.GYROSCOPE + * @useinstead ohos.sensor/sensor#event:SensorId.GYROSCOPE */ export interface SubscribeGyroscopeOptions { /** -- Gitee From 80e5f30f073c10b67ad7e737ed7218006606e4e4 Mon Sep 17 00:00:00 2001 From: jackd320 Date: Fri, 18 Nov 2022 08:51:08 +0000 Subject: [PATCH 360/438] Signed-off-by: jackd320 Signed-off-by: jackd320 --- api/@ohos.update.d.ts | 48 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/api/@ohos.update.d.ts b/api/@ohos.update.d.ts index 53df49e001..42def9ce56 100644 --- a/api/@ohos.update.d.ts +++ b/api/@ohos.update.d.ts @@ -28,6 +28,8 @@ declare namespace update { * * @param upgradeInfo indicates client app and business type * @return online update handler to perform online update + * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ function getOnlineUpdater(upgradeInfo: UpgradeInfo): Updater; @@ -36,6 +38,8 @@ declare namespace update { * Get restore handler. * * @return restore handler to perform factory reset + * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ function getRestorer(): Restorer; @@ -44,6 +48,8 @@ declare namespace update { * Get local update handler. * * @return local update handler to perform local update + * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ function getLocalUpdater(): LocalUpdater; @@ -60,6 +66,8 @@ declare namespace update { * Check new version. * * @permission ohos.permission.UPDATE_SYSTEM + * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ checkNewVersion(callback: AsyncCallback): void; @@ -69,6 +77,8 @@ declare namespace update { * Get new version. * * @permission ohos.permission.UPDATE_SYSTEM + * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ getNewVersionInfo(callback: AsyncCallback): void; @@ -78,6 +88,8 @@ declare namespace update { * Get new version description. * * @permission ohos.permission.UPDATE_SYSTEM + * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ getNewVersionDescription(versionDigestInfo: VersionDigestInfo, descriptionOptions: DescriptionOptions, callback: AsyncCallback>): void; @@ -87,6 +99,8 @@ declare namespace update { * Get current version. * * @permission ohos.permission.UPDATE_SYSTEM + * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ getCurrentVersionInfo(callback: AsyncCallback): void; @@ -96,6 +110,8 @@ declare namespace update { * Get current version description. * * @permission ohos.permission.UPDATE_SYSTEM + * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ getCurrentVersionDescription(descriptionOptions: DescriptionOptions, callback: AsyncCallback>): void; @@ -105,6 +121,8 @@ declare namespace update { * Get task info. * * @permission ohos.permission.UPDATE_SYSTEM + * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ getTaskInfo(callback: AsyncCallback): void; @@ -115,6 +133,8 @@ declare namespace update { * apps should listen to task update event * * @permission ohos.permission.UPDATE_SYSTEM + * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ download(versionDigestInfo: VersionDigestInfo, downloadOptions: DownloadOptions, callback: AsyncCallback): void; @@ -125,6 +145,8 @@ declare namespace update { * apps should listen to task update event * * @permission ohos.permission.UPDATE_SYSTEM + * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ resumeDownload(versionDigestInfo: VersionDigestInfo, resumeDownloadOptions: ResumeDownloadOptions, callback: AsyncCallback): void; @@ -135,6 +157,8 @@ declare namespace update { * apps should listen to task update event * * @permission ohos.permission.UPDATE_SYSTEM + * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ pauseDownload(versionDigestInfo: VersionDigestInfo, pauseDownloadOptions: PauseDownloadOptions, callback: AsyncCallback): void; @@ -145,6 +169,8 @@ declare namespace update { * apps should listen to task update event * * @permission ohos.permission.UPDATE_SYSTEM + * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ upgrade(versionDigestInfo: VersionDigestInfo, upgradeOptions: UpgradeOptions, callback: AsyncCallback): void; @@ -154,6 +180,8 @@ declare namespace update { * clear error during upgrade. * * @permission ohos.permission.UPDATE_SYSTEM + * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ clearError(versionDigestInfo: VersionDigestInfo, clearOptions: ClearOptions, callback: AsyncCallback): void; @@ -163,6 +191,8 @@ declare namespace update { * Get current upgrade policy. * * @permission ohos.permission.UPDATE_SYSTEM + * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ getUpgradePolicy(callback: AsyncCallback): void; @@ -172,6 +202,8 @@ declare namespace update { * Set upgrade policy. * * @permission ohos.permission.UPDATE_SYSTEM + * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ setUpgradePolicy(policy: UpgradePolicy, callback: AsyncCallback): void; @@ -181,6 +213,8 @@ declare namespace update { * terminate upgrade task. * * @permission ohos.permission.UPDATE_SYSTEM + * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ terminateUpgrade(callback: AsyncCallback): void; @@ -189,6 +223,8 @@ declare namespace update { /** * Subscribe task update events * + * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ on(eventClassifyInfo: EventClassifyInfo, taskCallback: UpgradeTaskCallback): void; @@ -196,6 +232,8 @@ declare namespace update { /** * Unsubscribe task update events * + * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ off(eventClassifyInfo: EventClassifyInfo, taskCallback?: UpgradeTaskCallback): void; @@ -213,6 +251,8 @@ declare namespace update { * Reboot and clean user data. * * @permission ohos.permission.FACTORY_RESET + * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ factoryReset(callback: AsyncCallback): void; @@ -231,6 +271,8 @@ declare namespace update { * Verify local update package. * * @permission ohos.permission.UPDATE_SYSTEM + * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ verifyUpgradePackage(upgradeFile: UpgradeFile, certsFile: string, callback: AsyncCallback): void; @@ -241,6 +283,8 @@ declare namespace update { * apps should listen to task update event * * @permission ohos.permission.UPDATE_SYSTEM + * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ applyNewVersion(upgradeFiles: Array, callback: AsyncCallback): void; @@ -249,6 +293,8 @@ declare namespace update { /** * Subscribe task update events * + * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ on(eventClassifyInfo: EventClassifyInfo, taskCallback: UpgradeTaskCallback): void; @@ -256,6 +302,8 @@ declare namespace update { /** * Unsubscribe task update events * + * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ off(eventClassifyInfo: EventClassifyInfo, taskCallback?: UpgradeTaskCallback): void; -- Gitee From 4d8f4345da9a3225c59bfe995458dd60c8892de2 Mon Sep 17 00:00:00 2001 From: li-yaoyao777 Date: Fri, 18 Nov 2022 16:54:55 +0800 Subject: [PATCH 361/438] =?UTF-8?q?=E6=95=B4=E6=94=B9api=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-yaoyao777 --- api/@system.sensor.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/@system.sensor.d.ts b/api/@system.sensor.d.ts index 5dfddc1cba..fe87e39d74 100644 --- a/api/@system.sensor.d.ts +++ b/api/@system.sensor.d.ts @@ -362,7 +362,7 @@ export interface DeviceOrientationResponse { * @syscap SystemCapability.Sensors.Sensor * @since 6 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#event:SensorId.ROTATION_VECTOR + * @useinstead ohos.sensor/sensor#event:SensorId.ORIENTATION */ export interface SubscribeDeviceOrientationOptions { /** @@ -636,7 +636,7 @@ export default class Sensor { * @syscap SystemCapability.Sensors.Sensor * @since 6 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#event:SensorId.ROTATION_VECTOR + * @useinstead ohos.sensor/sensor#event:SensorId.ORIENTATION */ static subscribeDeviceOrientation(options: SubscribeDeviceOrientationOptions): void; @@ -645,7 +645,7 @@ export default class Sensor { * @syscap SystemCapability.Sensors.Sensor * @since 6 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#event:SensorId.ROTATION_VECTOR + * @useinstead ohos.sensor/sensor#event:SensorId.ORIENTATION */ static unsubscribeDeviceOrientation(): void; -- Gitee From eabb9d9296783d7ff44a2b5893b8b939f3896a75 Mon Sep 17 00:00:00 2001 From: li-yaoyao777 Date: Fri, 18 Nov 2022 17:16:56 +0800 Subject: [PATCH 362/438] =?UTF-8?q?=E6=95=B4=E6=94=B9api=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-yaoyao777 --- api/@ohos.vibrator.d.ts | 6 +++--- api/@system.vibrator.d.ts | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/api/@ohos.vibrator.d.ts b/api/@ohos.vibrator.d.ts index 07a4a25934..7063ef7885 100755 --- a/api/@ohos.vibrator.d.ts +++ b/api/@ohos.vibrator.d.ts @@ -29,7 +29,7 @@ declare namespace vibrator { * @permission ohos.permission.VIBRATE * @since 8 * @deprecated since 9 - * @useinstead ohos.vibrator.startVibration + * @useinstead vibrator#startVibration */ function vibrate(duration: number, callback?: AsyncCallback): void; function vibrate(duration: number): Promise; @@ -41,7 +41,7 @@ declare namespace vibrator { * @permission ohos.permission.VIBRATE * @since 8 * @deprecated since 9 - * @useinstead ohos.vibrator.startVibration + * @useinstead vibrator#startVibration */ function vibrate(effectId: EffectId): Promise; function vibrate(effectId: EffectId, callback?: AsyncCallback): void; @@ -83,7 +83,7 @@ declare namespace vibrator { * @permission ohos.permission.VIBRATE * @since 8 * @deprecated since 9 - * @useinstead ohos.vibrator.stopVibration + * @useinstead vibrator#stopVibration */ function stop(stopMode: VibratorStopMode): Promise; function stop(stopMode: VibratorStopMode, callback?: AsyncCallback): void; diff --git a/api/@system.vibrator.d.ts b/api/@system.vibrator.d.ts index 683f0253cb..80294b71da 100644 --- a/api/@system.vibrator.d.ts +++ b/api/@system.vibrator.d.ts @@ -51,6 +51,7 @@ export interface VibrateOptions { * @permission ohos.permission.VIBRATE * @since 3 * @deprecated since 8 + * @useinstead ohos.vibrate/vibrate#event:startVibration */ export default class Vibrator { /** -- Gitee From 39739e147f2b8006b0fd387708d7a9a8cd060af4 Mon Sep 17 00:00:00 2001 From: yqhan Date: Fri, 18 Nov 2022 15:10:15 +0800 Subject: [PATCH 363/438] Modify syntax issues with ohos.worker.d.ts issue: https://gitee.com/openharmony/interface_sdk-js/issues/I61W78 Signed-off-by: yqhan --- api/@ohos.worker.d.ts | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/api/@ohos.worker.d.ts b/api/@ohos.worker.d.ts index f1e54446fa..40570f2fd2 100644 --- a/api/@ohos.worker.d.ts +++ b/api/@ohos.worker.d.ts @@ -118,6 +118,20 @@ export interface MessageEvent extends Event { readonly data: T; } +/** + * Saves the data transferred between worker thread and host thread. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + export interface MessageEvents extends Event { + /** + * Data transferred when an exception occurs. + * @since 9 + * @syscap SystemCapability.Utils.Lang + */ + readonly data; +} + /** * Specifies the object whose ownership need to be transferred during data transfer. * The object must be ArrayBuffer. @@ -422,7 +436,7 @@ export interface ThreadWorkerGlobalScope extends GlobalScope { * @since 9 * @syscap SystemCapability.Utils.Lang */ - onmessage?: (this: ThreadWorkerGlobalScope, ev: MessageEvent) => void; + onmessage?: (this: ThreadWorkerGlobalScope, ev: MessageEvents) => void; /** * The onmessage attribute of parentPort specifies the event handler @@ -435,7 +449,7 @@ export interface ThreadWorkerGlobalScope extends GlobalScope { * @since 9 * @syscap SystemCapability.Utils.Lang */ - onmessageerror?: (this: ThreadWorkerGlobalScope, ev: MessageEvent) => void; + onmessageerror?: (this: ThreadWorkerGlobalScope, ev: MessageEvents) => void; /** * Close the worker thread to stop the worker from receiving messages @@ -527,7 +541,7 @@ declare namespace worker { * @since 9 * @syscap SystemCapability.Utils.Lang */ - onmessage?: (event: MessageEvent) => void; + onmessage?: (event: MessageEvents) => void; /** * The onmessage attribute of the worker specifies the event handler * when the worker receives a message that cannot be serialized. @@ -538,7 +552,7 @@ declare namespace worker { * @since 9 * @syscap SystemCapability.Utils.Lang */ - onmessageerror?: (event: MessageEvent) => void; + onmessageerror?: (event: MessageEvents) => void; /** * Sends a message to the worker thread. * The data is transferred using the structured clone algorithm. @@ -643,6 +657,13 @@ declare namespace worker { removeAllListener(): void; } + /** + * The Worker class contains all Worker functions. + * @since 7 + * @deprecated since 9 + * @useinstead ohos.worker.ThreadWorker + * @syscap SystemCapability.Utils.Lang + */ class Worker implements EventTarget { /** * Creates a worker instance -- Gitee From 3ca318a2d3fd2e67b92d862ecd63f39d991093e9 Mon Sep 17 00:00:00 2001 From: bi-hu Date: Thu, 17 Nov 2022 19:58:57 +0800 Subject: [PATCH 364/438] Modify d.ts in xml and process Signed-off-by: bi-hu https://gitee.com/openharmony/interface_sdk-js/issues/I61RLA --- api/@ohos.convertxml.d.ts | 4 +- api/@ohos.process.d.ts | 72 +++++----- api/@ohos.uri.d.ts | 10 +- api/@ohos.url.d.ts | 39 +++--- api/@ohos.util.d.ts | 282 +++++++++++++++++++------------------- api/@ohos.xml.d.ts | 10 +- 6 files changed, 207 insertions(+), 210 deletions(-) diff --git a/api/@ohos.convertxml.d.ts b/api/@ohos.convertxml.d.ts index bf0cbe1192..d77c980e64 100644 --- a/api/@ohos.convertxml.d.ts +++ b/api/@ohos.convertxml.d.ts @@ -153,7 +153,7 @@ declare namespace xml { * @syscap SystemCapability.Utils.Lang * @param xml The xml text to be converted. * @param option Option Inputted by user to set. - * @return Returns a JavaScript object converting from XML text. + * @returns Returns a JavaScript object converting from XML text. */ convert(xml: string, options?: ConvertOptions) : Object; @@ -163,7 +163,7 @@ declare namespace xml { * @syscap SystemCapability.Utils.Lang * @param xml The xml text to be converted. * @param option Option Inputted by user to set. - * @return Returns a JavaScript object converting from XML text. + * @returns Returns a JavaScript object converting from XML text. * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200002 - Invalid xml string. */ diff --git a/api/@ohos.process.d.ts b/api/@ohos.process.d.ts index 875e6dd2c1..7da4212ef4 100644 --- a/api/@ohos.process.d.ts +++ b/api/@ohos.process.d.ts @@ -34,7 +34,7 @@ declare namespace process { * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use - * @return Return the pid of the current process. + * @returns Return the pid of the current process. */ readonly pid: number; @@ -43,7 +43,7 @@ declare namespace process { * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use - * @return Return the pid of the current child process. + * @returns Return the pid of the current child process. */ readonly ppid: number; @@ -52,7 +52,7 @@ declare namespace process { * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use - * @return Return the exit code of the current child process. + * @returns Return the exit code of the current child process. */ readonly exitCode: number; @@ -61,7 +61,7 @@ declare namespace process { * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use - * @return Return whether the current process signal is sent successfully. + * @returns Return whether the current process signal is sent successfully. */ readonly killed: boolean; @@ -70,7 +70,7 @@ declare namespace process { * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use - * @return Return the target process exit code. + * @returns Return the target process exit code. */ wait(): Promise; @@ -79,7 +79,7 @@ declare namespace process { * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use - * @return Return subprocess standard outpute. + * @returns Return subprocess standard output. */ getOutput(): Promise; @@ -88,7 +88,7 @@ declare namespace process { * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use - * @return Return subprocess standard error output. + * @returns Return subprocess standard error output. */ getErrorOutput(): Promise; @@ -123,7 +123,7 @@ declare namespace process { * @since 9 * @syscap SystemCapability.Utils.Lang * @param v An id. - * @return Return a boolean whether the specified uid belongs to a particular application. + * @returns Return a boolean whether the specified uid belongs to a particular application. * @throws {BusinessError} 401 - The type of v must be number. */ isAppUid(v: number): boolean; @@ -133,7 +133,7 @@ declare namespace process { * @since 9 * @syscap SystemCapability.Utils.Lang * @param v Process name. - * @return Return the uid based on the specified user name. + * @returns Return the uid based on the specified user name. * @throws {BusinessError} 401 - The type of v must be string. */ getUidForName(v: string): number; @@ -143,7 +143,7 @@ declare namespace process { * @since 9 * @syscap SystemCapability.Utils.Lang * @param v The tid of the process. - * @return Return the thread priority based on the specified tid. + * @returns Return the thread priority based on the specified tid. * @throws {BusinessError} 401 - The type of v must be number. */ getThreadPriority(v: number): number; @@ -153,7 +153,7 @@ declare namespace process { * @since 9 * @syscap SystemCapability.Utils.Lang * @param name Parameters defined by the system configuration. - * @return Return the system configuration at runtime. + * @returns Return the system configuration at runtime. * @throws {BusinessError} 401 - The type of name must be number. */ getSystemConfig(name: number): number; @@ -163,7 +163,7 @@ declare namespace process { * @since 9 * @syscap SystemCapability.Utils.Lang * @param name Parameters defined by the system environment variables. - * @Returns the system value for environment variables. + * @returns Return the system value for environment variables. * @throws {BusinessError} 401 - The type of name must be string. */ getEnvironmentVar(name: string): string; @@ -183,7 +183,7 @@ declare namespace process { * @syscap SystemCapability.Utils.Lang * @param signal Signal sent. * @param pid Send signal to target pid. - * @return Return the result of the signal. + * @returns Return the result of the signal. * @throws {BusinessError} 401 - if the input parameters are invalid. */ kill(signal: number, pid: number): boolean; @@ -194,7 +194,7 @@ declare namespace process { * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use - * @return Return the numeric valid group ID of the process. + * @returns Return the numeric valid group ID of the process. */ const egid: number; @@ -203,7 +203,7 @@ declare namespace process { * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use - * @return Return the numeric valid user identity of the process. + * @returns Return the numeric valid user identity of the process. */ const euid: number; @@ -212,7 +212,7 @@ declare namespace process { * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use - * @return Return the numeric group if of the process. + * @returns Return the numeric group if of the process. */ const gid: number @@ -220,7 +220,7 @@ declare namespace process { * Returns the digital user id of the process * @since 7 * @syscap SystemCapability.Utils.Lang - * @return Return the digital user id of the process. + * @returns Return the digital user id of the process. */ const uid: number; @@ -229,7 +229,7 @@ declare namespace process { * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use - * @return Return an array with supplementary group id. + * @returns Return an array with supplementary group id. */ const groups: number[]; @@ -237,7 +237,7 @@ declare namespace process { * Return pid is The pid of the current process * @since 7 * @syscap SystemCapability.Utils.Lang - * @return Return The pid of the current process. + * @returns Return The pid of the current process. */ const pid: number; @@ -246,7 +246,7 @@ declare namespace process { * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use - * @return Return The pid of the current child process. + * @returns Return The pid of the current child process. */ const ppid: number; @@ -254,7 +254,7 @@ declare namespace process { * Returns the tid of the current thread. * @since 8 * @syscap SystemCapability.Utils.Lang - * @return Return the tid of the current thread. + * @returns Return the tid of the current thread. */ const tid: number; @@ -262,7 +262,7 @@ declare namespace process { * Returns a boolean whether the process is isolated. * @since 8 * @syscap SystemCapability.Utils.Lang - * @return Return boolean whether the process is isolated. + * @returns Return boolean whether the process is isolated. */ function isIsolatedProcess(): boolean; @@ -273,7 +273,7 @@ declare namespace process { * @useinstead ohos.process.ProcessManager.isAppUid * @syscap SystemCapability.Utils.Lang * @param v An id. - * @return Return a boolean whether the specified uid belongs to a particular application. + * @returns Return a boolean whether the specified uid belongs to a particular application. */ function isAppUid(v: number): boolean; @@ -281,7 +281,7 @@ declare namespace process { * Returns a boolean whether the process is running in a 64-bit environment. * @since 8 * @syscap SystemCapability.Utils.Lang - * @return Return a boolean whether the process is running in a 64-bit environment. + * @returns Return a boolean whether the process is running in a 64-bit environment. */ function is64Bit(): boolean; @@ -292,7 +292,7 @@ declare namespace process { * @useinstead ohos.process.ProcessManager.getUidForName * @syscap SystemCapability.Utils.Lang * @param v Process name. - * @return Return the uid based on the specified user name. + * @returns Return the uid based on the specified user name. */ function getUidForName(v: string): number; @@ -303,7 +303,7 @@ declare namespace process { * @useinstead ohos.process.ProcessManager.getThreadPriority * @syscap SystemCapability.Utils.Lang * @param v The tid of the process. - * @return Return the thread priority based on the specified tid. + * @returns Return the thread priority based on the specified tid. */ function getThreadPriority(v: number): number; @@ -311,7 +311,7 @@ declare namespace process { * Returns the elapsed real time (in milliseconds) taken from the start of the system to the start of the process. * @since 8 * @syscap SystemCapability.Utils.Lang - * @return Return the start of the system to the start of the process. + * @returns Return the start of the system to the start of the process. */ function getStartRealtime(): number; @@ -319,7 +319,7 @@ declare namespace process { * Returns the cpu time (in milliseconds) from the time when the process starts to the current time. * @since 8 * @syscap SystemCapability.Utils.Lang - * @return Return the cpu time (in milliseconds) from the time when the process starts to the current time. + * @returns Return the cpu time (in milliseconds) from the time when the process starts to the current time. */ function getPastCpuTime(): number; @@ -330,7 +330,7 @@ declare namespace process { * @useinstead ohos.process.ProcessManager.getSystemConfig * @syscap SystemCapability.Utils.Lang * @param name Parameters defined by the system configuration. - * @return Return the system configuration at runtime. + * @returns Return the system configuration at runtime. */ function getSystemConfig(name: number): number; @@ -341,13 +341,13 @@ declare namespace process { * @useinstead ohos.process.ProcessManager.getEnvironmentVar * @syscap SystemCapability.Utils.Lang * @param name Parameters defined by the system environment variables. - * @Returns the system value for environment variables. + * @returns Return the system value for environment variables. */ function getEnvironmentVar(name: string): string; type EventListener = (evt: Object) => void; /** - * Return a child process object and spawns a new ChildProcess to run the command + * Return a child process object and spawns a new ChildProcess to run the command. * @since 7 * @syscap SystemCapability.Utils.Lang * @param command String of the shell commands executed by the child process. @@ -355,7 +355,7 @@ declare namespace process { * process, killSignal is the signal sent when the child process reaches timeout, and maxBuffer is the size of the * maximum buffer area for standard input and output. * @systemapi Hide this for inner system use - * @return Return a child process object. + * @returns Return a child process object. */ function runCmd(command: string, options?: { timeout?: number, killSignal?: number | string, maxBuffer?: number }): ChildProcess; @@ -383,7 +383,7 @@ declare namespace process { * @syscap SystemCapability.Utils.Lang * @param type Remove the type of registered event. * @systemapi Hide this for inner system use - * @return Return removed result. + * @returns Return removed result. */ function off(type: string): boolean; @@ -402,7 +402,7 @@ declare namespace process { * @since 7 * @syscap SystemCapability.Utils.Lang * @systemapi Hide this for inner system use - * @return Return the current work directory. + * @returns Return the current work directory. */ function cwd(): string; @@ -419,7 +419,7 @@ declare namespace process { * Returns the running time of the system * @since 7 * @syscap SystemCapability.Utils.Lang - * @return Return the running time of the system. + * @returns Return the running time of the system. */ function uptime(): number; @@ -431,7 +431,7 @@ declare namespace process { * @syscap SystemCapability.Utils.Lang * @param signal Signal sent. * @param pid Send signal to target pid. - * @return Return the result of the signal. + * @returns Return the result of the signal. */ function kill(signal: number, pid: number): boolean; } diff --git a/api/@ohos.uri.d.ts b/api/@ohos.uri.d.ts index 7778407067..585008714b 100644 --- a/api/@ohos.uri.d.ts +++ b/api/@ohos.uri.d.ts @@ -40,7 +40,7 @@ declare namespace uri { * Returns the serialized URI as a string. * @since 8 * @syscap SystemCapability.Utils.Lang - * @return Returns the serialized URI as a string. + * @returns Returns the serialized URI as a string. */ toString(): string; @@ -51,7 +51,7 @@ declare namespace uri { * @useinstead ohos.uri.URI.equalsTo * @syscap SystemCapability.Utils.Lang * @param other URI object to be compared - * @return boolean Tests whether this URI is equivalent to other URI objects. + * @returns boolean Tests whether this URI is equivalent to other URI objects. */ equals(other: URI): boolean; @@ -60,7 +60,7 @@ declare namespace uri { * @since 9 * @syscap SystemCapability.Utils.Lang * @param other URI object to be compared - * @return boolean Tests whether this URI is equivalent to other URI objects. + * @returns boolean Tests whether this URI is equivalent to other URI objects. * @throws {BusinessError} 10200002 - The type of other must be URI. */ equalsTo(other: URI): boolean; @@ -69,7 +69,7 @@ declare namespace uri { * Indicates whether this URI is an absolute URI. * @since 8 * @syscap SystemCapability.Utils.Lang - * @return boolean Indicates whether the URI is an absolute URI (whether the scheme component is defined). + * @returns boolean Indicates whether the URI is an absolute URI (whether the scheme component is defined). */ checkIsAbsolute(): boolean; @@ -77,7 +77,7 @@ declare namespace uri { * Normalize the path of this URI. * @since 8 * @syscap SystemCapability.Utils.Lang - * @return URI Used to normalize the path of this URI and return a URI object whose path has been normalized. + * @returns URI Used to normalize the path of this URI and return a URI object whose path has been normalized. */ normalize(): URI; diff --git a/api/@ohos.url.d.ts b/api/@ohos.url.d.ts index 80d25e6c6d..60658249a4 100644 --- a/api/@ohos.url.d.ts +++ b/api/@ohos.url.d.ts @@ -70,7 +70,7 @@ declare namespace url { * @useinstead ohos.url.URLParams.getAll * @syscap SystemCapability.Utils.Lang * @param name Specifies the name of a key value. - * @return string[] Returns all key-value pairs with the specified name. + * @returns string[] Returns all key-value pairs with the specified name. */ getAll(name: string): string[]; @@ -81,7 +81,7 @@ declare namespace url { * @deprecated since 9 * @useinstead ohos.url.URLParams.entries * @syscap SystemCapability.Utils.Lang - * @return Returns an iterator for ES6. + * @returns Returns an iterator for ES6. */ entries(): IterableIterator<[string, string]>; @@ -105,7 +105,7 @@ declare namespace url { * @useinstead ohos.url.URLParams.get * @syscap SystemCapability.Utils.Lang * @param name Specifies the name of a key-value pair. - * @return Returns the first value found by name. If no value is found, null is returned. + * @returns Returns the first value found by name. If no value is found, null is returned. */ get(name: string): string | null; @@ -116,7 +116,7 @@ declare namespace url { * @useinstead ohos.url.URLParams.has * @syscap SystemCapability.Utils.Lang * @param name Specifies the name of a key-value pair. - * @return Returns a Boolean value that indicates whether a found + * @returns Returns a Boolean value that indicates whether a found */ has(name: string): boolean; @@ -149,7 +149,7 @@ declare namespace url { * @deprecated since 9 * @useinstead ohos.url.URLParams.keys * @syscap SystemCapability.Utils.Lang - * @return Returns an ES6 Iterator over the names of each name-value pair. + * @returns Returns an ES6 Iterator over the names of each name-value pair. */ keys(): IterableIterator; @@ -159,7 +159,7 @@ declare namespace url { * @deprecated since 9 * @useinstead ohos.url.URLParams.values * @syscap SystemCapability.Utils.Lang - * @return Returns an ES6 Iterator over the values of each name-value pair. + * @returns Returns an ES6 Iterator over the values of each name-value pair. */ values(): IterableIterator; @@ -170,7 +170,7 @@ declare namespace url { * @deprecated since 9 * @useinstead ohos.url.URLParams.[Symbol.iterator] * @syscap SystemCapability.Utils.Lang - * @return Returns an ES6 iterator. Each item of the iterator is a JavaScript Array. + * @returns Returns an ES6 iterator. Each item of the iterator is a JavaScript Array. * The first item of Array is name, and the second item of Array is value. */ [Symbol.iterator](): IterableIterator<[string, string]>; @@ -181,7 +181,7 @@ declare namespace url { * @deprecated since 9 * @useinstead ohos.url.URLParams.toString * @syscap SystemCapability.Utils.Lang - * @return Returns a search parameter serialized as a string, percent-encoded if necessary. + * @returns Returns a search parameter serialized as a string, percent-encoded if necessary. */ toString(): string; } @@ -230,7 +230,7 @@ declare namespace url { * @since 9 * @syscap SystemCapability.Utils.Lang * @param name Specifies the name of a key value. - * @return string[] Returns all key-value pairs with the specified name. + * @returns string[] Returns all key-value pairs with the specified name. * @throws {BusinessError} 401 - The type of name must be string. */ getAll(name: string): string[]; @@ -240,7 +240,7 @@ declare namespace url { * The first item of Array is name, and the second item of Array is value. * @since 9 * @syscap SystemCapability.Utils.Lang - * @return Returns an iterator for ES6. + * @returns Returns an iterator for ES6. */ entries(): IterableIterator<[string, string]>; @@ -261,7 +261,7 @@ declare namespace url { * @since 9 * @syscap SystemCapability.Utils.Lang * @param name Specifies the name of a key-value pair. - * @return Returns the first value found by name. If no value is found, null is returned. + * @returns Returns the first value found by name. If no value is found, null is returned. * @throws {BusinessError} 401 - The type of name must be string. */ get(name: string): string | null; @@ -271,7 +271,7 @@ declare namespace url { * @since 9 * @syscap SystemCapability.Utils.Lang * @param name Specifies the name of a key-value pair. - * @return Returns a Boolean value that indicates whether a found + * @returns Returns a Boolean value that indicates whether a found * @throws {BusinessError} 401 - The type of name must be string. */ has(name: string): boolean; @@ -300,7 +300,7 @@ declare namespace url { * Returns an iterator allowing to go through all keys contained in this object. * @since 9 * @syscap SystemCapability.Utils.Lang - * @return Returns an ES6 Iterator over the names of each name-value pair. + * @returns Returns an ES6 Iterator over the names of each name-value pair. */ keys(): IterableIterator; @@ -308,7 +308,7 @@ declare namespace url { * Returns an iterator allowing to go through all values contained in this object. * @since 9 * @syscap SystemCapability.Utils.Lang - * @return Returns an ES6 Iterator over the values of each name-value pair. + * @returns Returns an ES6 Iterator over the values of each name-value pair. */ values(): IterableIterator; @@ -317,7 +317,7 @@ declare namespace url { * pairs contained in this object. * @since 9 * @syscap SystemCapability.Utils.Lang - * @return Returns an ES6 iterator. Each item of the iterator is a JavaScript Array. + * @returns Returns an ES6 iterator. Each item of the iterator is a JavaScript Array. * The first item of Array is name, and the second item of Array is value. */ [Symbol.iterator](): IterableIterator<[string, string]>; @@ -326,7 +326,7 @@ declare namespace url { * Returns a query string suitable for use in a URL. * @since 9 * @syscap SystemCapability.Utils.Lang - * @return Returns a search parameter serialized as a string, percent-encoded if necessary. + * @returns Returns a search parameter serialized as a string, percent-encoded if necessary. */ toString(): string; } @@ -369,7 +369,7 @@ declare namespace url { * Returns the serialized URL as a string. * @since 7 * @syscap SystemCapability.Utils.Lang - * @return Returns the serialized URL as a string. + * @returns Returns the serialized URL as a string. */ toString(): string; @@ -377,7 +377,7 @@ declare namespace url { * Returns the serialized URL as a string. * @since 7 * @syscap SystemCapability.Utils.Lang - * @return Returns the serialized URL as a string. + * @returns Returns the serialized URL as a string. */ toJSON(): string; @@ -457,9 +457,6 @@ declare namespace url { * the URL instance. To replace the entire query parameter for a URL, use url.searchsetter. * @since 7 * @syscap SystemCapability.Utils.Lang - * @note Be careful when modifying with .searchParams, because the URLSearchParams - * object uses different rules to determine which characters to - * percent-encode according to the WHATWG specification. */ readonly searchParams: URLSearchParams; diff --git a/api/@ohos.util.d.ts b/api/@ohos.util.d.ts index 71a15492b2..a5f95ed44f 100644 --- a/api/@ohos.util.d.ts +++ b/api/@ohos.util.d.ts @@ -44,7 +44,7 @@ declare namespace util { * @syscap SystemCapability.Utils.Lang * @param format Styled string * @param args Data to be formatted - * @return Return the character string formatted in a specific format + * @returns Return the character string formatted in a specific format */ function printf(format: string, ...args: Object[]): string; @@ -69,7 +69,7 @@ declare namespace util { * @syscap SystemCapability.Utils.Lang * @param format Styled string * @param args Data to be formatted - * @return Return the character string formatted in a specific format + * @returns Return the character string formatted in a specific format * @throws {BusinessError} 401 - if the input parameters are invalid. */ function format(format: string, ...args: Object[]): string; @@ -81,7 +81,7 @@ declare namespace util { * @useinstead ohos.util.errnoToString * @syscap SystemCapability.Utils.Lang * @param errno The error code generated by an error in the system - * @return Return the string name of a system errno + * @returns Return the string name of a system errno */ function getErrorString(errno: number): string; @@ -90,7 +90,7 @@ declare namespace util { * @since 9 * @syscap SystemCapability.Utils.Lang * @param errno The error code generated by an error in the system - * @return Return the string name of a system errno + * @returns Return the string name of a system errno * @throws {BusinessError} 401 - The type of errno must be number. */ function errnoToString(errno: number): string; @@ -111,7 +111,7 @@ declare namespace util { * @since 9 * @syscap SystemCapability.Utils.Lang * @param original Asynchronous function - * @return Return a function that returns promises + * @returns Return a function that returns promises * @throws {BusinessError} 401 - The type of original must be Function. */ function promisify(original: (err: Object, value: Object) => void): Function; @@ -124,7 +124,7 @@ declare namespace util { * @useinstead ohos.util.promisify * @syscap SystemCapability.Utils.Lang * @param original Asynchronous function - * @return Return a version that returns promises + * @returns Return a version that returns promises */ function promiseWrapper(original: (err: Object, value: Object) => void): Object; @@ -133,7 +133,7 @@ declare namespace util { * @since 9 * @syscap SystemCapability.Utils.Lang * @param entropyCache Whether to generate the UUID with using the cache. Default: true. - * @return Return a string representing this UUID. + * @returns Return a string representing this UUID. * @throws {BusinessError} 401 - The type of entropyCache must be boolean. */ function randomUUID(entropyCache?: boolean): string; @@ -143,7 +143,7 @@ declare namespace util { * @since 9 * @syscap SystemCapability.Utils.Lang * @param entropyCache Whether to generate the UUID with using the cache. Default: true. - * @return Return a Uint8Array representing this UUID. + * @returns Return a Uint8Array representing this UUID. * @throws {BusinessError} 401 - The type of entropyCache must be boolean. */ function randomBinaryUUID(entropyCache?: boolean): Uint8Array; @@ -153,7 +153,7 @@ declare namespace util { * @since 9 * @syscap SystemCapability.Utils.Lang * @param uuid String that specifies a UUID - * @return Return a Uint8Array representing this UUID. Throw SyntaxError if parsing fails. + * @returns Return a Uint8Array representing this UUID. Throw SyntaxError if parsing fails. * @throws {BusinessError} 401 - The type of uuid must be string. */ function parseUUID(uuid: string): Uint8Array; @@ -225,7 +225,7 @@ declare namespace util { * @useinstead ohos.util.decodeWithStream * @syscap SystemCapability.Utils.Lang * @param input Decoded numbers in accordance with the format - * @return Return decoded text + * @returns Return decoded text */ decode(input: Uint8Array, options?: { stream?: false }): string; @@ -234,7 +234,7 @@ declare namespace util { * @since 9 * @syscap SystemCapability.Utils.Lang * @param input Decoded numbers in accordance with the format - * @return Return decoded text + * @returns Return decoded text * @throws {BusinessError} 401 - if the input parameters are invalid. */ decodeWithStream(input: Uint8Array, options?: { stream?: boolean }): string; @@ -277,7 +277,7 @@ declare namespace util { * @useinstead ohos.util.encodeInto * @syscap SystemCapability.Utils.Lang * @param input The string to be encoded. - * @return Returns the encoded text. + * @returns Returns the encoded text. */ encode(input?: string): Uint8Array; @@ -286,7 +286,7 @@ declare namespace util { * @since 9 * @syscap SystemCapability.Utils.Lang * @param input The string to be encoded. - * @return Returns the encoded text. + * @returns Returns the encoded text. * @throws {BusinessError} 401 - The type of input must be string. */ encodeInto(input?: string): Uint8Array; @@ -299,7 +299,7 @@ declare namespace util { * @syscap SystemCapability.Utils.Lang * @param input The string to be encoded. * @param dest Decoded numbers in accordance with the format - * @return Returns Returns the object, where read represents + * @returns Returns Returns the object, where read represents * the number of characters that have been encoded, and written * represents the number of bytes occupied by the encoded characters. */ @@ -314,7 +314,7 @@ declare namespace util { * @syscap SystemCapability.Utils.Lang * @param input The string to be encoded. * @param dest Decoded numbers in accordance with the format - * @return Returns Returns the object, where read represents + * @returns Returns Returns the object, where read represents * the number of characters that have been encoded, and written * represents the number of bytes occupied by the encoded characters. * @throws {BusinessError} 401 - if the input parameters are invalid. @@ -364,7 +364,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param rationalString String Expression of Rational Numbers - * @return Returns a RationalNumber object generated based on the given string. + * @returns Returns a RationalNumber object generated based on the given string. * @throws {BusinessError} 401 - The type of rationalString must be string. */ static createRationalFromString(rationalString: string): RationalNumber​; @@ -376,7 +376,7 @@ declare namespace util { * @useinstead ohos.util.compare * @syscap SystemCapability.Utils.Lang * @param another An object of other rational numbers - * @return Returns 0 or 1, or -1, depending on the comparison. + * @returns Returns 0 or 1, or -1, depending on the comparison. */ compareTo(another :RationalNumber): number; @@ -385,7 +385,7 @@ declare namespace util { * @since 9 * @syscap SystemCapability.Utils.Lang * @param another An object of other rational numbers - * @return Returns 0 or 1, or -1, depending on the comparison. + * @returns Returns 0 or 1, or -1, depending on the comparison. * @throws {BusinessError} 401 - The type of another must be RationalNumber. */ compare(another :RationalNumber): number; @@ -395,7 +395,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param obj An object - * @return Returns true if the given object is the same as the current object; Otherwise, false is returned. + * @returns Returns true if the given object is the same as the current object; Otherwise, false is returned. */ equals(obj: Object): boolean; @@ -403,7 +403,7 @@ declare namespace util { * Gets integer and floating-point values of a rational number object. * @since 8 * @syscap SystemCapability.Utils.Lang - * @return Returns the integer and floating-point values of a rational number object. + * @returns Returns the integer and floating-point values of a rational number object. */ valueOf(): number; @@ -415,7 +415,7 @@ declare namespace util { * @syscap SystemCapability.Utils.Lang * @param number1 Is an integer. * @param number2 Is an integer. - * @return Returns the greatest common divisor of two integers, integer type. + * @returns Returns the greatest common divisor of two integers, integer type. */ static getCommonDivisor(number1: number, number2: number): number; @@ -425,7 +425,7 @@ declare namespace util { * @syscap SystemCapability.Utils.Lang * @param number1 Is an integer. * @param number2 Is an integer. - * @return Returns the greatest common divisor of two integers, integer type. + * @returns Returns the greatest common divisor of two integers, integer type. * @throws {BusinessError} 401 - if the input parameters are invalid. */ static getCommonFactor(number1: number, number2: number): number; @@ -434,7 +434,7 @@ declare namespace util { * Gets the denominator of the current object. * @since 8 * @syscap SystemCapability.Utils.Lang - * @return Returns the denominator of the current object. + * @returns Returns the denominator of the current object. */ getDenominator(): number; @@ -442,7 +442,7 @@ declare namespace util { * Gets the numerator​ of the current object. * @since 8 * @syscap SystemCapability.Utils.Lang - * @return Returns the numerator​ of the current object. + * @returns Returns the numerator​ of the current object. */ getNumerator(): number; @@ -450,7 +450,7 @@ declare namespace util { * Checks whether the current RationalNumber object represents an infinite value. * @since 8 * @syscap SystemCapability.Utils.Lang - * @return If the denominator is not 0, true is returned. Otherwise, false is returned. + * @returns If the denominator is not 0, true is returned. Otherwise, false is returned. */ isFinite(): boolean; @@ -458,7 +458,7 @@ declare namespace util { * Checks whether the current RationalNumber object represents a Not-a-Number (NaN) value. * @since 8 * @syscap SystemCapability.Utils.Lang - * @return If both the denominator and numerator are 0, true is returned. Otherwise, false is returned. + * @returns If both the denominator and numerator are 0, true is returned. Otherwise, false is returned. */ isNaN(): boolean; @@ -466,7 +466,7 @@ declare namespace util { * Checks whether the current RationalNumber object represents the value 0. * @since 8 * @syscap SystemCapability.Utils.Lang - * @return If the value represented by the current object is 0, true is returned. Otherwise, false is returned. + * @returns If the value represented by the current object is 0, true is returned. Otherwise, false is returned. */ isZero(): boolean; @@ -474,7 +474,7 @@ declare namespace util { * Obtains a string representation of the current RationalNumber object. * @since 8 * @syscap SystemCapability.Utils.Lang - * @return Returns a string representation of the current RationalNumber object. + * @returns Returns a string representation of the current RationalNumber object. */ toString(): string; } @@ -513,7 +513,7 @@ declare namespace util { * @deprecated since 9 * @useinstead ohos.util.LRUCache.toString * @syscap SystemCapability.Utils.Lang - * @return Returns the string representation of the object and outputs the string representation of the object. + * @returns Returns the string representation of the object and outputs the string representation of the object. */ toString(): string @@ -523,7 +523,7 @@ declare namespace util { * @deprecated since 9 * @useinstead ohos.util.LRUCache.length * @syscap SystemCapability.Utils.Lang - * @return Returns the total number of values in the current buffer. + * @returns Returns the total number of values in the current buffer. */ length: number @@ -533,7 +533,7 @@ declare namespace util { * @deprecated since 9 * @useinstead ohos.util.LRUCache.getCapacity * @syscap SystemCapability.Utils.Lang - * @return Returns the capacity of the current buffer. + * @returns Returns the capacity of the current buffer. */ getCapacity(): number; @@ -552,7 +552,7 @@ declare namespace util { * @deprecated since 9 * @useinstead ohos.util.LRUCache.getCreateCount * @syscap SystemCapability.Utils.Lang - * @return Returns the number of times createDefault(java.lang.Object) returned a value. + * @returns Returns the number of times createDefault(java.lang.Object) returned a value. */ getCreateCount(): number; @@ -562,7 +562,7 @@ declare namespace util { * @deprecated since 9 * @useinstead ohos.util.LRUCache.getMissCount * @syscap SystemCapability.Utils.Lang - * @return Returns the number of times that the queried values are not matched. + * @returns Returns the number of times that the queried values are not matched. */ getMissCount(): number; @@ -572,7 +572,7 @@ declare namespace util { * @deprecated since 9 * @useinstead ohos.util.LRUCache.getRemovalCount * @syscap SystemCapability.Utils.Lang - * @return Returns the number of times that values are evicted from the buffer. + * @returns Returns the number of times that values are evicted from the buffer. */ getRemovalCount(): number; @@ -582,7 +582,7 @@ declare namespace util { * @deprecated since 9 * @useinstead ohos.util.LRUCache.getMatchCount * @syscap SystemCapability.Utils.Lang - * @return Returns the number of times that the queried values are successfully matched. + * @returns Returns the number of times that the queried values are successfully matched. */ getMatchCount(): number; @@ -592,7 +592,7 @@ declare namespace util { * @deprecated since 9 * @useinstead ohos.util.LRUCache.getPutCount * @syscap SystemCapability.Utils.Lang - * @return Returns the number of times that values are added to the buffer. + * @returns Returns the number of times that values are added to the buffer. */ getPutCount(): number; @@ -602,7 +602,7 @@ declare namespace util { * @deprecated since 9 * @useinstead ohos.util.LRUCache.isEmpty * @syscap SystemCapability.Utils.Lang - * @return Returns true if the current buffer contains no value. + * @returns Returns true if the current buffer contains no value. */ isEmpty(): boolean; @@ -613,7 +613,7 @@ declare namespace util { * @useinstead ohos.util.LRUCache.get * @syscap SystemCapability.Utils.Lang * @param key Indicates the key to query. - * @return Returns the value associated with the key if the specified key is present in the buffer; returns null otherwise. + * @returns Returns the value associated with the key if the specified key is present in the buffer; returns null otherwise. */ get(key: K): V | undefined; @@ -625,7 +625,7 @@ declare namespace util { * @syscap SystemCapability.Utils.Lang * @param key Indicates the key to add. * @param value Indicates the value associated with the key to add. - * @return Returns the value associated with the added key; returns the original value if the key to add already exists. + * @returns Returns the value associated with the added key; returns the original value if the key to add already exists. */ put(key: K, value: V): V; @@ -635,7 +635,7 @@ declare namespace util { * @deprecated since 9 * @useinstead ohos.util.LRUCache.values * @syscap SystemCapability.Utils.Lang - * @return Returns the list of all values in the current buffer in ascending order, from the most recently accessed to least recently accessed. + * @returns Returns the list of all values in the current buffer in ascending order, from the most recently accessed to least recently accessed. */ values(): V[]; @@ -645,7 +645,7 @@ declare namespace util { * @deprecated since 9 * @useinstead ohos.util.LRUCache.keys * @syscap SystemCapability.Utils.Lang - * @return Returns a list of keys sorted from most recently accessed to least recently accessed. + * @returns Returns a list of keys sorted from most recently accessed to least recently accessed. */ keys(): K[]; @@ -656,7 +656,7 @@ declare namespace util { * @useinstead ohos.util.LRUCache.remove * @syscap SystemCapability.Utils.Lang * @param key Indicates the key to delete. - * @return Returns an Optional object containing the deleted key-value pair; returns an empty Optional object if the key does not exist. + * @returns Returns an Optional object containing the deleted key-value pair; returns an empty Optional object if the key does not exist. */ remove(key: K): V | undefined; @@ -680,7 +680,7 @@ declare namespace util { * @useinstead ohos.util.LRUCache.contains * @syscap SystemCapability.Utils.Lang * @param key Indicates the key to check. - * @return Returns true if the buffer contains the specified key. + * @returns Returns true if the buffer contains the specified key. */ contains(key: K): boolean; @@ -691,7 +691,7 @@ declare namespace util { * @useinstead ohos.util.LRUCache.createDefault * @syscap SystemCapability.Utils.Lang * @param key Indicates the missed key. - * @return Returns the value associated with the key. + * @returns Returns the value associated with the key. */ createDefault(key: K): V; @@ -701,7 +701,7 @@ declare namespace util { * @deprecated since 9 * @useinstead ohos.util.LRUCache.entries * @syscap SystemCapability.Utils.Lang - * @return Returns an array of key-value pairs for the enumeratable properties of the given object itself. + * @returns Returns an array of key-value pairs for the enumeratable properties of the given object itself. */ entries(): IterableIterator<[K, V]>; @@ -711,7 +711,7 @@ declare namespace util { * @deprecated since 9 * @useinstead ohos.util.LRUCache.[Symbol.iterator] * @syscap SystemCapability.Utils.Lang - * @return Returns a two - dimensional array in the form of key - value pairs. + * @returns Returns a two - dimensional array in the form of key - value pairs. */ [Symbol.iterator](): IterableIterator<[K, V]>; } @@ -743,7 +743,7 @@ declare namespace util { * Returns a string representation of the object. * @since 9 * @syscap SystemCapability.Utils.Lang - * @return Returns the string representation of the object and outputs the string representation of the object. + * @returns Returns the string representation of the object and outputs the string representation of the object. */ toString(): string @@ -751,7 +751,7 @@ declare namespace util { * Obtains a list of all values in the current buffer. * @since 9 * @syscap SystemCapability.Utils.Lang - * @return Returns the total number of values in the current buffer. + * @returns Returns the total number of values in the current buffer. */ length: number @@ -759,7 +759,7 @@ declare namespace util { * Obtains the capacity of the current buffer. * @since 9 * @syscap SystemCapability.Utils.Lang - * @return Returns the capacity of the current buffer. + * @returns Returns the capacity of the current buffer. */ getCapacity(): number; @@ -774,7 +774,7 @@ declare namespace util { * Obtains the number of times createDefault(Object) returned a value. * @since 9 * @syscap SystemCapability.Utils.Lang - * @return Returns the number of times createDefault(java.lang.Object) returned a value. + * @returns Returns the number of times createDefault(java.lang.Object) returned a value. */ getCreateCount(): number; @@ -782,7 +782,7 @@ declare namespace util { * Obtains the number of times that the queried values are not matched. * @since 9 * @syscap SystemCapability.Utils.Lang - * @return Returns the number of times that the queried values are not matched. + * @returns Returns the number of times that the queried values are not matched. */ getMissCount(): number; @@ -790,7 +790,7 @@ declare namespace util { * Obtains the number of times that values are evicted from the buffer. * @since 9 * @syscap SystemCapability.Utils.Lang - * @return Returns the number of times that values are evicted from the buffer. + * @returns Returns the number of times that values are evicted from the buffer. */ getRemovalCount(): number; @@ -798,7 +798,7 @@ declare namespace util { * Obtains the number of times that the queried values are successfully matched. * @since 9 * @syscap SystemCapability.Utils.Lang - * @return Returns the number of times that the queried values are successfully matched. + * @returns Returns the number of times that the queried values are successfully matched. */ getMatchCount(): number; @@ -806,7 +806,7 @@ declare namespace util { * Obtains the number of times that values are added to the buffer. * @since 9 * @syscap SystemCapability.Utils.Lang - * @return Returns the number of times that values are added to the buffer. + * @returns Returns the number of times that values are added to the buffer. */ getPutCount(): number; @@ -814,7 +814,7 @@ declare namespace util { * Checks whether the current buffer is empty. * @since 9 * @syscap SystemCapability.Utils.Lang - * @return Returns true if the current buffer contains no value. + * @returns Returns true if the current buffer contains no value. */ isEmpty(): boolean; @@ -823,7 +823,7 @@ declare namespace util { * @since 9 * @syscap SystemCapability.Utils.Lang * @param key Indicates the key to query. - * @return Returns the value associated with the key if the specified key is present in the buffer; returns null otherwise. + * @returns Returns the value associated with the key if the specified key is present in the buffer; returns null otherwise. * @throws {BusinessError} 401 - The type of key must be object. */ get(key: K): V | undefined; @@ -834,7 +834,7 @@ declare namespace util { * @syscap SystemCapability.Utils.Lang * @param key Indicates the key to add. * @param value Indicates the value associated with the key to add. - * @return Returns the value associated with the added key; returns the original value if the key to add already exists. + * @returns Returns the value associated with the added key; returns the original value if the key to add already exists. * @throws {BusinessError} 401 - if the input parameters are invalid. */ put(key: K, value: V): V; @@ -843,7 +843,7 @@ declare namespace util { * Obtains a list of all values in the current buffer. * @since 9 * @syscap SystemCapability.Utils.Lang - * @return Returns the list of all values in the current buffer in ascending order, from the most recently accessed to least recently accessed. + * @returns Returns the list of all values in the current buffer in ascending order, from the most recently accessed to least recently accessed. */ values(): V[]; @@ -851,7 +851,7 @@ declare namespace util { * Obtains a list of keys for the values in the current buffer. * since 9 * @syscap SystemCapability.Utils.Lang - * @return Returns a list of keys sorted from most recently accessed to least recently accessed. + * @returns Returns a list of keys sorted from most recently accessed to least recently accessed. */ keys(): K[]; @@ -860,7 +860,7 @@ declare namespace util { * @since 9 * @syscap SystemCapability.Utils.Lang * @param key Indicates the key to delete. - * @return Returns an Optional object containing the deleted key-value pair; returns an empty Optional object if the key does not exist. + * @returns Returns an Optional object containing the deleted key-value pair; returns an empty Optional object if the key does not exist. * @throws {BusinessError} 401 - The type of key must be object. */ remove(key: K): V | undefined; @@ -882,7 +882,7 @@ declare namespace util { * @since 9 * @syscap SystemCapability.Utils.Lang * @param key Indicates the key to check. - * @return Returns true if the buffer contains the specified key. + * @returns Returns true if the buffer contains the specified key. * @throws {BusinessError} 401 - The type of key must be object. */ contains(key: object): boolean; @@ -892,7 +892,7 @@ declare namespace util { * @since 9 * @syscap SystemCapability.Utils.Lang * @param key Indicates the missed key. - * @return Returns the value associated with the key. + * @returns Returns the value associated with the key. * @throws {BusinessError} 401 - The type of key must be object. */ createDefault(key: K): V; @@ -901,7 +901,7 @@ declare namespace util { * Returns an array of key-value pairs of enumeratable properties of a given object. * @since 9 * @syscap SystemCapability.Utils.Lang - * @return Returns an array of key-value pairs for the enumeratable properties of the given object itself. + * @returns Returns an array of key-value pairs for the enumeratable properties of the given object itself. */ entries(): IterableIterator<[K, V]>; @@ -909,7 +909,7 @@ declare namespace util { * Specifies the default iterator for an object. * @since 9 * @syscap SystemCapability.Utils.Lang - * @return Returns a two - dimensional array in the form of key - value pairs. + * @returns Returns a two - dimensional array in the form of key - value pairs. */ [Symbol.iterator](): IterableIterator<[K, V]>; } @@ -919,7 +919,7 @@ declare namespace util { * The comparison function is used by the scope. * @since 8 * @syscap SystemCapability.Utils.Lang - * @return Returns whether the current object is greater than or equal to the input object. + * @returns Returns whether the current object is greater than or equal to the input object. */ compareTo(other: ScopeComparable): boolean; } @@ -956,7 +956,7 @@ declare namespace util { * @deprecated since 9 * @useinstead ohos.util.ScopeHelper.toString * @syscap SystemCapability.Utils.Lang - * @return Returns a string representation of the current range object. + * @returns Returns a string representation of the current range object. */ toString(): string; @@ -967,7 +967,7 @@ declare namespace util { * @useinstead ohos.util.ScopeHelper.intersect * @syscap SystemCapability.Utils.Lang * @param range A Scope range object - * @return Returns the intersection of a given range and the current range. + * @returns Returns the intersection of a given range and the current range. */ intersect(range: Scope): Scope; @@ -979,7 +979,7 @@ declare namespace util { * @syscap SystemCapability.Utils.Lang * @param lowerObj A ScopeType value * @param upperObj A ScopeType value - * @return Returns the intersection of the current range and the range specified by the given lower and upper bounds. + * @returns Returns the intersection of the current range and the range specified by the given lower and upper bounds. */ intersect(lowerObj: ScopeType, upperObj: ScopeType): Scope; @@ -989,7 +989,7 @@ declare namespace util { * @deprecated since 9 * @useinstead ohos.util.ScopeHelper.getUpper * @syscap SystemCapability.Utils.Lang - * @return Returns the upper bound of the current range. + * @returns Returns the upper bound of the current range. */ getUpper(): ScopeType; @@ -999,7 +999,7 @@ declare namespace util { * @deprecated since 9 * @useinstead ohos.util.ScopeHelper.getLower * @syscap SystemCapability.Utils.Lang - * @return Returns the lower bound of the current range. + * @returns Returns the lower bound of the current range. */ getLower(): ScopeType; @@ -1011,7 +1011,7 @@ declare namespace util { * @syscap SystemCapability.Utils.Lang * @param lowerObj A ScopeType value * @param upperObj A ScopeType value - * @return Returns the smallest range that includes the current range and the given lower and upper bounds. + * @returns Returns the smallest range that includes the current range and the given lower and upper bounds. */ expand(lowerObj: ScopeType, upperObj: ScopeType): Scope; @@ -1022,7 +1022,7 @@ declare namespace util { * @useinstead ohos.util.ScopeHelper.expand * @syscap SystemCapability.Utils.Lang * @param range A Scope range object - * @return Returns the smallest range that includes the current range and a given range. + * @returns Returns the smallest range that includes the current range and a given range. */ expand(range: Scope): Scope; @@ -1033,7 +1033,7 @@ declare namespace util { * @useinstead ohos.util.ScopeHelper.expand * @syscap SystemCapability.Utils.Lang * @param value A ScopeType value - * @return Returns the smallest range that includes the current range and a given value. + * @returns Returns the smallest range that includes the current range and a given value. */ expand(value: ScopeType): Scope; @@ -1044,7 +1044,7 @@ declare namespace util { * @useinstead ohos.util.ScopeHelper.contains * @syscap SystemCapability.Utils.Lang * @param value A ScopeType value - * @return If the value is within the current range return true,otherwise return false. + * @returns If the value is within the current range return true,otherwise return false. */ contains(value: ScopeType): boolean; @@ -1055,7 +1055,7 @@ declare namespace util { * @useinstead ohos.util.ScopeHelper.contains * @syscap SystemCapability.Utils.Lang * @param range A Scope range - * @return If the current range is within the given range return true,otherwise return false. + * @returns If the current range is within the given range return true,otherwise return false. */ contains(range: Scope): boolean; @@ -1066,7 +1066,7 @@ declare namespace util { * @useinstead ohos.util.ScopeHelper.clamp * @syscap SystemCapability.Utils.Lang * @param value A ScopeType value - * @return Returns a ScopeType object that a given value is clamped to the current range.. + * @returns Returns a ScopeType object that a given value is clamped to the current range.. */ clamp(value: ScopeType): ScopeType; } @@ -1091,7 +1091,7 @@ declare namespace util { * Obtains a string representation of the current range. * @since 9 * @syscap SystemCapability.Utils.Lang - * @return Returns a string representation of the current range object. + * @returns Returns a string representation of the current range object. */ toString(): string; @@ -1100,7 +1100,7 @@ declare namespace util { * @since 9 * @syscap SystemCapability.Utils.Lang * @param range A Scope range object - * @return Returns the intersection of a given range and the current range. + * @returns Returns the intersection of a given range and the current range. * @throws {BusinessError} 401 - The type of range must be ScopeHelper. */ intersect(range: ScopeHelper): ScopeHelper; @@ -1111,7 +1111,7 @@ declare namespace util { * @syscap SystemCapability.Utils.Lang * @param lowerObj A ScopeType value * @param upperObj A ScopeType value - * @return Returns the intersection of the current range and the range specified by the given lower and upper bounds. + * @returns Returns the intersection of the current range and the range specified by the given lower and upper bounds. * @throws {BusinessError} 401 - if the input parameters are invalid. */ intersect(lowerObj: ScopeType, upperObj: ScopeType): ScopeHelper; @@ -1120,7 +1120,7 @@ declare namespace util { * Obtains the upper bound of the current range. * @since 9 * @syscap SystemCapability.Utils.Lang - * @return Returns the upper bound of the current range. + * @returns Returns the upper bound of the current range. */ getUpper(): ScopeType; @@ -1128,7 +1128,7 @@ declare namespace util { * Obtains the lower bound of the current range. * @since 9 * @syscap SystemCapability.Utils.Lang - * @return Returns the lower bound of the current range. + * @returns Returns the lower bound of the current range. */ getLower(): ScopeType; @@ -1138,7 +1138,7 @@ declare namespace util { * @syscap SystemCapability.Utils.Lang * @param lowerObj A ScopeType value * @param upperObj A ScopeType value - * @return Returns the smallest range that includes the current range and the given lower and upper bounds. + * @returns Returns the smallest range that includes the current range and the given lower and upper bounds. * @throws {BusinessError} 401 - if the input parameters are invalid. */ expand(lowerObj: ScopeType, upperObj: ScopeType): ScopeHelper; @@ -1148,7 +1148,7 @@ declare namespace util { * @since 9 * @syscap SystemCapability.Utils.Lang * @param range A Scope range object - * @return Returns the smallest range that includes the current range and a given range. + * @returns Returns the smallest range that includes the current range and a given range. * @throws {BusinessError} 401 - The type of range must be ScopeHelper. */ expand(range: ScopeHelper): ScopeHelper; @@ -1158,7 +1158,7 @@ declare namespace util { * @since 9 * @syscap SystemCapability.Utils.Lang * @param value A ScopeType value - * @return Returns the smallest range that includes the current range and a given value. + * @returns Returns the smallest range that includes the current range and a given value. * @throws {BusinessError} 401 - The type of value must be object. */ expand(value: ScopeType): ScopeHelper; @@ -1168,7 +1168,7 @@ declare namespace util { * @since 9 * @syscap SystemCapability.Utils.Lang * @param value A ScopeType value - * @return If the value is within the current range return true,otherwise return false. + * @returns If the value is within the current range return true,otherwise return false. * @throws {BusinessError} 401 - The type of value must be object. */ contains(value: ScopeType): boolean; @@ -1178,7 +1178,7 @@ declare namespace util { * @since 9 * @syscap SystemCapability.Utils.Lang * @param range A Scope range - * @return If the current range is within the given range return true,otherwise return false. + * @returns If the current range is within the given range return true,otherwise return false. * @throws {BusinessError} 401 - The type of range must be ScopeHelper. */ contains(range: ScopeHelper): boolean; @@ -1188,7 +1188,7 @@ declare namespace util { * @since 9 * @syscap SystemCapability.Utils.Lang * @param value A ScopeType value - * @return Returns a ScopeType object that a given value is clamped to the current range. + * @returns Returns a ScopeType object that a given value is clamped to the current range. * @throws {BusinessError} 401 - The type of value must be object. */ clamp(value: ScopeType): ScopeType; @@ -1210,7 +1210,7 @@ declare namespace util { * @useinstead ohos.util.Base64Helper.constructor * @syscap SystemCapability.Utils.Lang * @param No input parameter is required. - * @return No return value. + * @returns No return value. */ constructor(); @@ -1221,7 +1221,7 @@ declare namespace util { * @useinstead ohos.util.Base64Helper.encodeSync * @syscap SystemCapability.Utils.Lang * @param src A Uint8Array value - * @return Return the encoded new Uint8Array. + * @returns Return the encoded new Uint8Array. */ encodeSync(src: Uint8Array): Uint8Array; @@ -1232,7 +1232,7 @@ declare namespace util { * @useinstead ohos.util.Base64Helper.encodeToStringSync * @syscap SystemCapability.Utils.Lang * @param src A Uint8Array value - * @return Return the encoded string. + * @returns Return the encoded string. */ encodeToStringSync(src: Uint8Array): string; @@ -1243,7 +1243,7 @@ declare namespace util { * @useinstead ohos.util.Base64Helper.decodeSync * @syscap SystemCapability.Utils.Lang * @param src A Uint8Array value or value A string value - * @return Return the decoded Uint8Array. + * @returns Return the decoded Uint8Array. */ decodeSync(src: Uint8Array | string): Uint8Array; @@ -1254,7 +1254,7 @@ declare namespace util { * @useinstead ohos.util.Base64Helper.encode * @syscap SystemCapability.Utils.Lang * @param src A Uint8Array value - * @return Return the encodes asynchronous new Uint8Array. + * @returns Return the encodes asynchronous new Uint8Array. */ encode(src: Uint8Array): Promise; @@ -1265,7 +1265,7 @@ declare namespace util { * @useinstead ohos.util.Base64Helper.encodeToString * @syscap SystemCapability.Utils.Lang * @param src A Uint8Array value - * @return Returns the encoded asynchronous string. + * @returns Returns the encoded asynchronous string. */ encodeToString(src: Uint8Array): Promise; @@ -1276,7 +1276,7 @@ declare namespace util { * @useinstead ohos.util.Base64Helper.decode * @syscap SystemCapability.Utils.Lang * @param src A Uint8Array value or value A string value - * @return Return the decoded asynchronous Uint8Array. + * @returns Return the decoded asynchronous Uint8Array. */ decode(src: Uint8Array | string): Promise; } @@ -1293,7 +1293,7 @@ declare namespace util { * @since 9 * @syscap SystemCapability.Utils.Lang * @param No input parameter is required. - * @return No return value. + * @returns No return value. */ constructor(); @@ -1302,7 +1302,7 @@ declare namespace util { * @since 9 * @syscap SystemCapability.Utils.Lang * @param src A Uint8Array value - * @return Return the encoded new Uint8Array. + * @returns Return the encoded new Uint8Array. * @throws {BusinessError} 401 - The type of src must be Uint8Array. */ encodeSync(src: Uint8Array): Uint8Array; @@ -1312,7 +1312,7 @@ declare namespace util { * @since 9 * @syscap SystemCapability.Utils.Lang * @param src A Uint8Array value - * @return Return the encoded string. + * @returns Return the encoded string. * @throws {BusinessError} 401 - The type of src must be Uint8Array. */ encodeToStringSync(src: Uint8Array): string; @@ -1322,7 +1322,7 @@ declare namespace util { * @since 9 * @syscap SystemCapability.Utils.Lang * @param src A Uint8Array value or value A string value - * @return Return the decoded Uint8Array. + * @returns Return the decoded Uint8Array. * @throws {BusinessError} 401 - The type of src must be Uint8Array or string. */ decodeSync(src: Uint8Array | string): Uint8Array; @@ -1332,7 +1332,7 @@ declare namespace util { * @since 9 * @syscap SystemCapability.Utils.Lang * @param src A Uint8Array value - * @return Return the encodes asynchronous new Uint8Array. + * @returns Return the encodes asynchronous new Uint8Array. * @throws {BusinessError} 401 - The type of src must be Uint8Array. */ encode(src: Uint8Array): Promise; @@ -1342,7 +1342,7 @@ declare namespace util { * @since 9 * @syscap SystemCapability.Utils.Lang * @param src A Uint8Array value - * @return Returns the encoded asynchronous string. + * @returns Returns the encoded asynchronous string. * @throws {BusinessError} 401 - The type of src must be Uint8Array. */ encodeToString(src: Uint8Array): Promise; @@ -1353,7 +1353,7 @@ declare namespace util { * @since 9 * @syscap SystemCapability.Utils.Lang * @param src A Uint8Array value or value A string value - * @return Return the decoded asynchronous Uint8Array. + * @returns Return the decoded asynchronous Uint8Array. * @throws {BusinessError} 401 - The type of src must be Uint8Array or string. */ decode(src: Uint8Array | string): Promise; @@ -1370,7 +1370,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param No input parameter is required. - * @return No return value. + * @returns No return value. */ constructor(); /** @@ -1378,7 +1378,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A ArrayBuffer or SharedArrayBuffer value - * @Returns true if the value is a built-in ArrayBuffer or SharedArrayBuffer instance.. + * @returns Returns true if the value is a built-in ArrayBuffer or SharedArrayBuffer instance. */ isAnyArrayBuffer(value: Object): boolean; /** @@ -1386,7 +1386,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A included in the isAnyArrayBuffer value - * @return Returns true if the value is an instance of one of the ArrayBuffer views, such as typed array objects or DataView. Equivalent to ArrayBuffer.isView(). + * @returns Returns true if the value is an instance of one of the ArrayBuffer views, such as typed array objects or DataView. Equivalent to ArrayBuffer.isView(). */ isArrayBufferView(value: Object): boolean; /** @@ -1394,7 +1394,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A arguments value - * @return Returns true if the value is an arguments object. + * @returns Returns true if the value is an arguments object. */ isArgumentsObject(value: Object): boolean; /** @@ -1402,7 +1402,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A arraybuffer value - * @return Returns true if the value is a built-in ArrayBuffer instance. This does not include SharedArrayBuffer instances. Usually, it is desirable to test for both; See isAnyArrayBuffer() for that. + * @returns Returns true if the value is a built-in ArrayBuffer instance. This does not include SharedArrayBuffer instances. Usually, it is desirable to test for both; See isAnyArrayBuffer() for that. */ isArrayBuffer(value: Object): boolean; /** @@ -1410,7 +1410,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A async function value - * @return Returns true if the value is an async function. This only reports back what the JavaScript engine is seeing; in particular, the return value may not match the original source code if a transpilation tool was used. + * @returns Returns true if the value is an async function. This only reports back what the JavaScript engine is seeing; in particular, the return value may not match the original source code if a transpilation tool was used. */ isAsyncFunction(value: Object): boolean; /** @@ -1418,7 +1418,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A BigInt64Array value - * @return Returns true if the value is a BigInt64Array instance. + * @returns Returns true if the value is a BigInt64Array instance. */ isBigInt64Array(value: Object): boolean; /** @@ -1426,7 +1426,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A BigUint64Array value - * @return Returns true if the value is a BigUint64Array instance. + * @returns Returns true if the value is a BigUint64Array instance. */ isBigUint64Array(value: Object): boolean; /** @@ -1434,7 +1434,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A boolean object value - * @return Returns true if the value is a boolean object, e.g. created by new Boolean(). + * @returns Returns true if the value is a boolean object, e.g. created by new Boolean(). */ isBooleanObject(value: Object): boolean; /** @@ -1442,7 +1442,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A boxed primitive object value - * @return Returns true if the value is any boxed primitive object, e.g. created by new Boolean(), new String() or Object(Symbol()). + * @returns Returns true if the value is any boxed primitive object, e.g. created by new Boolean(), new String() or Object(Symbol()). */ isBoxedPrimitive(value: Object): boolean; /** @@ -1450,7 +1450,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A DataView value - * @return Returns true if the value is a built-in DataView instance. + * @returns Returns true if the value is a built-in DataView instance. */ isDataView(value: Object): boolean; /** @@ -1458,7 +1458,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A Date value - * @return Returns true if the value is a built-in Date instance. + * @returns Returns true if the value is a built-in Date instance. */ isDate(value: Object): boolean; /** @@ -1466,7 +1466,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A External value - * @return Returns true if the value is a native External value. + * @returns Returns true if the value is a native External value. */ isExternal(value: Object): boolean; /** @@ -1474,7 +1474,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A Float32Array value - * @return Returns true if the value is a built-in Float32Array instance. + * @returns Returns true if the value is a built-in Float32Array instance. */ isFloat32Array(value: Object): boolean; /** @@ -1482,7 +1482,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A Float64Array value - * @return Returns true if the value is a built-in Float64Array instance. + * @returns Returns true if the value is a built-in Float64Array instance. */ isFloat64Array(value: Object): boolean; /** @@ -1490,7 +1490,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A generator function value - * @return Returns true if the value is a generator function. This only reports back what the JavaScript engine is seeing; in particular, the return value may not match the original source code if a transpilation tool was used. + * @returns Returns true if the value is a generator function. This only reports back what the JavaScript engine is seeing; in particular, the return value may not match the original source code if a transpilation tool was used. */ isGeneratorFunction(value: Object): boolean; /** @@ -1498,7 +1498,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A generator object value - * @return Returns true if the value is a generator object as returned from a built-in generator function. This only reports back what the JavaScript engine is seeing; in particular, the return value may not match the original source code if a transpilation tool was used. + * @returns Returns true if the value is a generator object as returned from a built-in generator function. This only reports back what the JavaScript engine is seeing; in particular, the return value may not match the original source code if a transpilation tool was used. */ isGeneratorObject(value: Object): boolean; /** @@ -1506,7 +1506,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A Int8Array value - * @return Returns true if the value is a built-in Int8Array instance. + * @returns Returns true if the value is a built-in Int8Array instance. */ isInt8Array(value: Object): boolean; /** @@ -1514,7 +1514,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A Int16Array value - * @return Returns true if the value is a built-in Int16Array instance. + * @returns Returns true if the value is a built-in Int16Array instance. */ isInt16Array(value: Object): boolean; /** @@ -1522,7 +1522,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A Int32Array value - * @return Returns true if the value is a built-in Int32Array instance. + * @returns Returns true if the value is a built-in Int32Array instance. */ isInt32Array(value: Object): boolean; /** @@ -1530,7 +1530,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A Map value - * @return Returns true if the value is a built-in Map instance. + * @returns Returns true if the value is a built-in Map instance. */ isMap(value: Object): boolean; /** @@ -1538,7 +1538,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A Map iterator value - * @return Returns true if the value is an iterator returned for a built-in Map instance. + * @returns Returns true if the value is an iterator returned for a built-in Map instance. */ isMapIterator(value: Object): boolean; /** @@ -1546,7 +1546,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A Module Namespace Object value - * @return Returns true if the value is an instance of a Module Namespace Object. + * @returns Returns true if the value is an instance of a Module Namespace Object. */ isModuleNamespaceObject(value: Object): boolean; /** @@ -1554,7 +1554,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A Error value - * @return Returns true if the value is an instance of a built-in Error type. + * @returns Returns true if the value is an instance of a built-in Error type. */ isNativeError(value: Object): boolean; /** @@ -1562,7 +1562,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A number object value - * @return Returns true if the value is a number object, e.g. created by new Number(). + * @returns Returns true if the value is a number object, e.g. created by new Number(). */ isNumberObject(value: Object): boolean; /** @@ -1570,7 +1570,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A Promise value - * @return Returns true if the value is a built-in Promise. + * @returns Returns true if the value is a built-in Promise. */ isPromise(value: Object): boolean; /** @@ -1578,7 +1578,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A Proxy value - * @return Returns true if the value is a Proxy instance. + * @returns Returns true if the value is a Proxy instance. */ isProxy(value: Object): boolean; /** @@ -1586,7 +1586,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A regular expression object value - * @return Returns true if the value is a regular expression object. + * @returns Returns true if the value is a regular expression object. */ isRegExp(value: Object): boolean; /** @@ -1594,7 +1594,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A Set instance value - * @return Returns true if the value is a built-in Set instance. + * @returns Returns true if the value is a built-in Set instance. */ isSet(value: Object): boolean; /** @@ -1602,7 +1602,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A Set iterator value - * @return Returns true if the value is an iterator returned for a built-in Set instance. + * @returns Returns true if the value is an iterator returned for a built-in Set instance. */ isSetIterator(value: Object): boolean; /** @@ -1610,7 +1610,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A SharedArrayBuffer instance value - * @return Returns true if the value is a built-in SharedArrayBuffer instance. This does not include ArrayBuffer instances. Usually, it is desirable to test for both; See isAnyArrayBuffer() for that. + * @returns Returns true if the value is a built-in SharedArrayBuffer instance. This does not include ArrayBuffer instances. Usually, it is desirable to test for both; See isAnyArrayBuffer() for that. */ isSharedArrayBuffer(value: Object): boolean; /** @@ -1618,7 +1618,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A String object value - * @return Returns true if the value is a string object, e.g. created by new String(). + * @returns Returns true if the value is a string object, e.g. created by new String(). */ isStringObject(value: Object): boolean; /** @@ -1626,7 +1626,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A symbol object value - * @return Returns true if the value is a symbol object, created by calling Object() on a Symbol primitive. + * @returns Returns true if the value is a symbol object, created by calling Object() on a Symbol primitive. */ isSymbolObject(value: Object): boolean; /** @@ -1634,7 +1634,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A TypedArray instance value - * @return Returns true if the value is a built-in TypedArray instance. + * @returns Returns true if the value is a built-in TypedArray instance. */ isTypedArray(value: Object): boolean; /** @@ -1642,7 +1642,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A Uint8Array value - * @return Returns true if the value is a built-in Uint8Array instance. + * @returns Returns true if the value is a built-in Uint8Array instance. */ isUint8Array(value: Object): boolean; /** @@ -1650,7 +1650,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A Uint8ClampedArray value - * @return Returns true if the value is a built-in Uint8ClampedArray instance. + * @returns Returns true if the value is a built-in Uint8ClampedArray instance. */ isUint8ClampedArray(value: Object): boolean; /** @@ -1658,7 +1658,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A Uint16Array value - * @return Returns true if the value is a built-in Uint16Array instance. + * @returns Returns true if the value is a built-in Uint16Array instance. */ isUint16Array(value: Object): boolean; /** @@ -1666,7 +1666,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A Uint32Array value - * @return Returns true if the value is a built-in Uint32Array instance. + * @returns Returns true if the value is a built-in Uint32Array instance. */ isUint32Array(value: Object): boolean; /** @@ -1674,7 +1674,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A WeakMap value - * @return Returns true if the value is a built-in WeakMap instance. + * @returns Returns true if the value is a built-in WeakMap instance. */ isWeakMap(value: Object): boolean; /** @@ -1682,7 +1682,7 @@ declare namespace util { * @since 8 * @syscap SystemCapability.Utils.Lang * @param value A WeakSet value - * @return Returns true if the value is a built-in WeakSet instance. + * @returns Returns true if the value is a built-in WeakSet instance. */ isWeakSet(value: Object): boolean; } diff --git a/api/@ohos.xml.d.ts b/api/@ohos.xml.d.ts index 49916703c6..3eb9f401b1 100644 --- a/api/@ohos.xml.d.ts +++ b/api/@ohos.xml.d.ts @@ -32,7 +32,7 @@ declare namespace xml { /** * A parameterized constructor used to create a new XmlSerializer instance. * As the input parameter of the constructor function, init supports three types. - * The input parameter is an Arrarybuff. + * The input parameter is an Arrarybuffer. * The input parameter is a DataView. * The input parameter is an encoding format of string type. * @throws {BusinessError} 401 - if the input parameters are invalid. @@ -67,7 +67,7 @@ declare namespace xml { setDeclaration(): void; /** - * Writes a elemnet start tag with the given name. + * Writes a element start tag with the given name. * @since 8 * @syscap SystemCapability.Utils.Lang * @param name Name of the element. @@ -285,7 +285,7 @@ declare namespace xml { * @syscap SystemCapability.Utils.Lang * @param name The current tag name. * @param value The current tag value. - * @return Returns a Boolean variable for whether parse continually. + * @returns Returns a Boolean variable for whether parse continually. */ tagValueCallbackFunction?: (name: string, value: string) => boolean; @@ -295,7 +295,7 @@ declare namespace xml { * @syscap SystemCapability.Utils.Lang * @param name The current attribute name. * @param value The current attribute value. - * @return Returns a Boolean variable for whether parse continually. + * @returns Returns a Boolean variable for whether parse continually. */ attributeValueCallbackFunction?: (name: string, value: string) => boolean; @@ -305,7 +305,7 @@ declare namespace xml { * @syscap SystemCapability.Utils.Lang * @param eventType The current token eventtype. * @param value The current token parseinfo. - * @return Returns a Boolean variable for whether parse continually. + * @returns Returns a Boolean variable for whether parse continually. */ tokenValueCallbackFunction?: (eventType: EventType, value: ParseInfo) => boolean; } -- Gitee From 7c9975e9a97cfb54d0d8ce58e56aba19fc1d7667 Mon Sep 17 00:00:00 2001 From: jackd320 Date: Fri, 18 Nov 2022 10:15:03 +0000 Subject: [PATCH 365/438] Signed-off-by: jackd320 Signed-off-by: jackd320 --- api/@ohos.update.d.ts | 56 ++++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/api/@ohos.update.d.ts b/api/@ohos.update.d.ts index 42def9ce56..6fa8e80005 100644 --- a/api/@ohos.update.d.ts +++ b/api/@ohos.update.d.ts @@ -28,7 +28,7 @@ declare namespace update { * * @param upgradeInfo indicates client app and business type * @return online update handler to perform online update - * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ @@ -38,7 +38,7 @@ declare namespace update { * Get restore handler. * * @return restore handler to perform factory reset - * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ @@ -48,7 +48,7 @@ declare namespace update { * Get local update handler. * * @return local update handler to perform local update - * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ @@ -66,7 +66,7 @@ declare namespace update { * Check new version. * * @permission ohos.permission.UPDATE_SYSTEM - * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ @@ -77,9 +77,8 @@ declare namespace update { * Get new version. * * @permission ohos.permission.UPDATE_SYSTEM - * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 11500104 - IPC error. - * @since 9 */ getNewVersionInfo(callback: AsyncCallback): void; getNewVersionInfo(): Promise; @@ -88,7 +87,8 @@ declare namespace update { * Get new version description. * * @permission ohos.permission.UPDATE_SYSTEM - * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ @@ -99,7 +99,7 @@ declare namespace update { * Get current version. * * @permission ohos.permission.UPDATE_SYSTEM - * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ @@ -110,7 +110,8 @@ declare namespace update { * Get current version description. * * @permission ohos.permission.UPDATE_SYSTEM - * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ @@ -121,7 +122,7 @@ declare namespace update { * Get task info. * * @permission ohos.permission.UPDATE_SYSTEM - * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ @@ -133,7 +134,8 @@ declare namespace update { * apps should listen to task update event * * @permission ohos.permission.UPDATE_SYSTEM - * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ @@ -145,7 +147,8 @@ declare namespace update { * apps should listen to task update event * * @permission ohos.permission.UPDATE_SYSTEM - * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ @@ -157,7 +160,8 @@ declare namespace update { * apps should listen to task update event * * @permission ohos.permission.UPDATE_SYSTEM - * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ @@ -169,7 +173,8 @@ declare namespace update { * apps should listen to task update event * * @permission ohos.permission.UPDATE_SYSTEM - * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ @@ -180,7 +185,8 @@ declare namespace update { * clear error during upgrade. * * @permission ohos.permission.UPDATE_SYSTEM - * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ @@ -191,7 +197,7 @@ declare namespace update { * Get current upgrade policy. * * @permission ohos.permission.UPDATE_SYSTEM - * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ @@ -202,7 +208,7 @@ declare namespace update { * Set upgrade policy. * * @permission ohos.permission.UPDATE_SYSTEM - * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ @@ -213,7 +219,7 @@ declare namespace update { * terminate upgrade task. * * @permission ohos.permission.UPDATE_SYSTEM - * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ @@ -223,7 +229,7 @@ declare namespace update { /** * Subscribe task update events * - * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ @@ -232,7 +238,7 @@ declare namespace update { /** * Unsubscribe task update events * - * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ @@ -251,7 +257,7 @@ declare namespace update { * Reboot and clean user data. * * @permission ohos.permission.FACTORY_RESET - * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ @@ -271,7 +277,7 @@ declare namespace update { * Verify local update package. * * @permission ohos.permission.UPDATE_SYSTEM - * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ @@ -283,7 +289,7 @@ declare namespace update { * apps should listen to task update event * * @permission ohos.permission.UPDATE_SYSTEM - * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ @@ -293,7 +299,7 @@ declare namespace update { /** * Subscribe task update events * - * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ @@ -302,7 +308,7 @@ declare namespace update { /** * Unsubscribe task update events * - * @throws { BusinessError } 11500100 - Execute fail. + * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ -- Gitee From 0b3667f2e61c2ecee6c36b3541fcf85c5c3a1505 Mon Sep 17 00:00:00 2001 From: dboy190 Date: Fri, 18 Nov 2022 19:24:05 +0800 Subject: [PATCH 366/438] fix since history problem Signed-off-by: dboy190 --- api/@ohos.data.distributedData.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/@ohos.data.distributedData.d.ts b/api/@ohos.data.distributedData.d.ts index 0c17584892..e21dc7b043 100644 --- a/api/@ohos.data.distributedData.d.ts +++ b/api/@ohos.data.distributedData.d.ts @@ -1358,7 +1358,7 @@ declare namespace distributedData { * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since 8 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SingleKVStore#off */ @@ -1619,7 +1619,7 @@ declare namespace distributedData { * @throws Throws this exception if no {@code SingleKvStore} database is available. * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since 8 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SingleKVStore#on */ @@ -1646,7 +1646,7 @@ declare namespace distributedData { * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since 8 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.SingleKVStore#off */ @@ -1905,7 +1905,7 @@ declare namespace distributedData { * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since 8 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.DeviceKVStore#on */ @@ -1934,7 +1934,7 @@ declare namespace distributedData { * occurs: {@code SERVER_UNAVAILABLE}, {@code IPC_ERROR}, * {@code DB_ERROR}, and {@code STORE_ALREADY_SUBSCRIBE}. * @syscap SystemCapability.DistributedDataManager.KVStore.Core - * @since 9 + * @since 8 * @deprecated since 9 * @useinstead ohos.data.distributedKVStore.DeviceKVStore#off */ -- Gitee From 13ccf0adbc630d249262d7b032a0cbb37281ff52 Mon Sep 17 00:00:00 2001 From: xuyong Date: Sat, 19 Nov 2022 11:22:22 +0800 Subject: [PATCH 367/438] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=E5=8D=95=E8=AF=8D=E6=8B=BC=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuyong --- api/@ohos.hiSysEvent.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.hiSysEvent.d.ts b/api/@ohos.hiSysEvent.d.ts index ec97d25b51..625d69b69f 100644 --- a/api/@ohos.hiSysEvent.d.ts +++ b/api/@ohos.hiSysEvent.d.ts @@ -281,7 +281,7 @@ declare namespace hiSysEvent { */ interface Querier { /** - * handle query result, the query result will be send in serval times. + * handle query result, the query result will be send in severval times. * * @syscap SystemCapability.HiviewDFX.HiSysEvent * @systemapi hide for inner use -- Gitee From ab99f563f758bcf4789edcf8cc3f72e7c2c7a711 Mon Sep 17 00:00:00 2001 From: li-yaoyao777 Date: Mon, 21 Nov 2022 10:09:48 +0800 Subject: [PATCH 368/438] =?UTF-8?q?=E6=95=B4=E6=94=B9api=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-yaoyao777 --- api/@system.vibrator.d.ts | 65 --------------------------------------- 1 file changed, 65 deletions(-) diff --git a/api/@system.vibrator.d.ts b/api/@system.vibrator.d.ts index 80294b71da..e69de29bb2 100644 --- a/api/@system.vibrator.d.ts +++ b/api/@system.vibrator.d.ts @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2020 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. - */ - -/** - * @syscap SystemCapability.Sensors.MiscDevice - * @permission ohos.permission.VIBRATE - * @since 3 - * @deprecated since 8 - */ -export interface VibrateOptions { - /** - * Vibration mode. The value long indicates long vibration, and short indicates short vibration. - * The default value is long. - * @since 3 - */ - mode?: "long" | "short"; - - /** - * Called when success to trigger vibration. - * @since 3 - */ - success: () => void; - - /** - * Called when fail to trigger vibration. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; -} - -/** - * @syscap SystemCapability.Sensors.MiscDevice - * @permission ohos.permission.VIBRATE - * @since 3 - * @deprecated since 8 - * @useinstead ohos.vibrate/vibrate#event:startVibration - */ -export default class Vibrator { - /** - * Triggers vibration. - * @param options Options. - * @permission ohos.permission.VIBRATE - * @since 3 - * @deprecated since 8 - */ - static vibrate(options?: VibrateOptions): void; -} -- Gitee From 08f6bcf1e58ed11ec4dcee678300946d555e03c4 Mon Sep 17 00:00:00 2001 From: li-yaoyao777 Date: Mon, 21 Nov 2022 10:29:10 +0800 Subject: [PATCH 369/438] =?UTF-8?q?=E6=95=B4=E6=94=B9api=E6=89=AB=E6=8F=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-yaoyao777 --- api/@system.vibrator.d.ts | 67 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/api/@system.vibrator.d.ts b/api/@system.vibrator.d.ts index e69de29bb2..462e1d9401 100644 --- a/api/@system.vibrator.d.ts +++ b/api/@system.vibrator.d.ts @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2020 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. + */ + +/** + * @syscap SystemCapability.Sensors.MiscDevice + * @permission ohos.permission.VIBRATE + * @since 3 + * @deprecated since 8 + */ + export interface VibrateOptions { + /** + * Vibration mode. The value long indicates long vibration, and short indicates short vibration. + * The default value is long. + * @since 3 + */ + mode?: "long" | "short"; + + /** + * Called when success to trigger vibration. + * @since 3 + */ + success: () => void; + + /** + * Called when fail to trigger vibration. + * @since 3 + */ + fail?: (data: string, code: number) => void; + + /** + * Called when the execution is completed. + * @since 3 + */ + complete?: () => void; + } + + /** + * @syscap SystemCapability.Sensors.MiscDevice + * @permission ohos.permission.VIBRATE + * @since 3 + * @deprecated since 8 + * @useinstead ohos.vibrator/vibrator + */ + export default class Vibrator { + /** + * Triggers vibration. + * @param options Options. + * @permission ohos.permission.VIBRATE + * @since 3 + * @deprecated since 8 + * @useinstead ohos.vibrator/vibrator#startVibration + */ + static vibrate(options?: VibrateOptions): void; + } + \ No newline at end of file -- Gitee From f02d68457384dc0476f59e8806dfac0ef8ec1bc6 Mon Sep 17 00:00:00 2001 From: li-yaoyao777 Date: Mon, 21 Nov 2022 10:34:17 +0800 Subject: [PATCH 370/438] =?UTF-8?q?=E6=95=B4=E6=94=B9api=E6=89=AB=E6=8F=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-yaoyao777 --- api/@system.vibrator.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api/@system.vibrator.d.ts b/api/@system.vibrator.d.ts index 462e1d9401..f35234bbfc 100644 --- a/api/@system.vibrator.d.ts +++ b/api/@system.vibrator.d.ts @@ -63,5 +63,4 @@ * @useinstead ohos.vibrator/vibrator#startVibration */ static vibrate(options?: VibrateOptions): void; - } - \ No newline at end of file + } \ No newline at end of file -- Gitee From b68167e10979852ff3296f7f005e37ea6f5b179b Mon Sep 17 00:00:00 2001 From: huweiqi Date: Wed, 16 Nov 2022 09:28:27 +0000 Subject: [PATCH 371/438] modify userFileManager and mediaLibrary describe the error Signed-off-by: huweiqi Change-Id: I8ea350625f61f07f5f1d70d22d0d284514296084 --- api/@ohos.filemanagement.userFileManager.d.ts | 67 +++++++++--------- api/@ohos.multimedia.mediaLibrary.d.ts | 68 +++++++++---------- 2 files changed, 63 insertions(+), 72 deletions(-) diff --git a/api/@ohos.filemanagement.userFileManager.d.ts b/api/@ohos.filemanagement.userFileManager.d.ts index 2789f87741..d141676249 100644 --- a/api/@ohos.filemanagement.userFileManager.d.ts +++ b/api/@ohos.filemanagement.userFileManager.d.ts @@ -23,7 +23,6 @@ import dataSharePredicates from './@ohos.data.dataSharePredicates'; * @since 9 * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core - * @import Import userFileManager from '@ohos.filemanagement.userFileManager' */ declare namespace userFileManager { /** @@ -33,7 +32,7 @@ declare namespace userFileManager { * @syscap SystemCapability.FileManagement.UserFileManager.Core * @StageModelOnly * @param context Hap context information - * @return Instance of UserFileManager + * @returns Instance of UserFileManager */ function getUserFileMgr(context: Context): UserFileManager; @@ -86,7 +85,6 @@ declare namespace userFileManager { * @since 9 * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core - * @import Import userFileManager from '@ohos.filemanagement.userFileManager' */ interface FileAsset { /** @@ -111,7 +109,7 @@ declare namespace userFileManager { */ displayName: string; /** - * Return the fileasset member parameter. + * Return the fileAsset member parameter. * @since 9 * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core @@ -119,7 +117,7 @@ declare namespace userFileManager { */ get(member: string): MemberType; /** - * Set the fileasset member parameter. + * Set the fileAsset member parameter. * @since 9 * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core @@ -187,7 +185,7 @@ declare namespace userFileManager { * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.READ_IMAGEVIDEO or ohos.permission.READ_AUDIO - * @param callback Callback used to return the thumbnail's pixelmap. + * @param callback Callback used to return the thumbnail's pixelMap. */ getThumbnail(callback: AsyncCallback): void; /** @@ -197,7 +195,7 @@ declare namespace userFileManager { * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.READ_IMAGEVIDEO or ohos.permission.READ_AUDIO * @param size Thumbnail's size - * @param callback Callback used to return the thumbnail's pixelmap. + * @param callback Callback used to return the thumbnail's pixelMap. */ getThumbnail(size: image.Size, callback: AsyncCallback): void; /** @@ -486,7 +484,6 @@ declare namespace userFileManager { * @since 9 * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core - * @import Import userFileManager from '@ohos.filemanagement.userFileManager' */ interface FetchResult { /** @@ -494,7 +491,7 @@ declare namespace userFileManager { * @since 9 * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core - * @return Total number of files. + * @returns Total number of files. */ getCount(): number; /** @@ -502,9 +499,9 @@ declare namespace userFileManager { * @since 9 * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core - * @return Whether the file is the last one. + * @returns Whether the file is the last one. * You need to check whether the file is the last one before calling getNextObject, - * which returns the next file only when True is returned for this method. + * which returns the next file only when False is returned for this method. */ isAfterLast(): boolean; /** @@ -527,14 +524,14 @@ declare namespace userFileManager { * @since 9 * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core - * @return A Promise instance used to return the file in the format of a T instance. + * @returns A Promise instance used to return the file in the format of a T instance. */ getFirstObject(): Promise; /** * Obtains the next T in the file retrieval result. * This method uses a callback to return the file. * Before calling this method, you must use isAfterLast() to check whether the result set points to the last row. - * This method returns the next file only when True is returned for isAfterLast(). + * This method returns the next file only when False is returned for isAfterLast(). * @since 9 * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core @@ -545,11 +542,11 @@ declare namespace userFileManager { * Obtains the next T in the file retrieval result. * This method uses a promise to return the file. * Before calling this method, you must use isAfterLast() to check whether the result set points to the last row. - * This method returns the next file only when True is returned for isAfterLast(). + * This method returns the next file only when False is returned for isAfterLast(). * @since 9 * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core - * @return A Promise instance used to return the file in the format of a T instance. + * @returns A Promise instance used to return the file in the format of a T instance. */ getNextObject(): Promise; /** @@ -565,7 +562,7 @@ declare namespace userFileManager { * @since 9 * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core - * @return A Promise instance used to return the file in the format of a T instance. + * @returns A Promise instance used to return the file in the format of a T instance. */ getLastObject(): Promise; /** @@ -587,7 +584,7 @@ declare namespace userFileManager { * @syscap SystemCapability.FileManagement.UserFileManager.Core * @param index Index of the file to obtain. * @throws {BusinessError} 13900020 - if type index is not number - * @return A Promise instance used to return the file in the format of a T instance. + * @returns A Promise instance used to return the file in the format of a T instance. */ getPositionObject(index: number): Promise; } @@ -641,7 +638,7 @@ declare namespace userFileManager { * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.READ_IMAGEVIDEO - * @param type Detemined which kinds of asset to retrive. + * @param type Determined which kinds of asset to retrive. * @param options Retrieval options. * @throws {BusinessError} 13900020 - if type options is not FetchOptions * @param callback Callback used to return the files in the format of a FetchResult instance. @@ -653,10 +650,10 @@ declare namespace userFileManager { * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.READ_IMAGEVIDEO - * @param type Detemined which kinds of asset to retrive. + * @param type Determined which kinds of asset to retrive. * @param options Retrieval options. * @throws {BusinessError} 13900020 - if type options is not FetchOptions - * @return A Promise instance used to return the files in the format of a FetchResult instance. + * @returns A Promise instance used to return the files in the format of a FetchResult instance. */ getPhotoAssets(options: FetchOptions): Promise>; } @@ -713,10 +710,10 @@ declare namespace userFileManager { * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.READ_IMAGEVIDEO - * @param type Detemined which kinds of asset to retrive. + * @param type Determined which kinds of asset to retrive. * @param options Retrieval options. * @throws {BusinessError} 13900020 - if type options is not FetchOptions - * @return A promise instance used to return the files in the format of a FetchResult instance + * @returns A promise instance used to return the files in the format of a FetchResult instance */ getPhotoAssets(options: FetchOptions): Promise>; /** @@ -750,7 +747,7 @@ declare namespace userFileManager { * @permission ohos.permission.WRITE_IMAGEVIDEO * @param displayName File name * @param albumUri Album uri is optional, asset will put into the default album without albumUri - * @return A Promise instance used to return the FileAsset + * @returns A Promise instance used to return the FileAsset * @throws {BusinessError} 13900020 - if type displayName or albumUri is not string * @systemapi * @since 9 @@ -774,7 +771,7 @@ declare namespace userFileManager { * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.READ_IMAGEVIDEO * @param options Retrieval options. - * @return A Promise instance used to return an album array. + * @returns A Promise instance used to return an album array. * @throws {BusinessError} 13900020 - if type options is not AlbumFetchOptions */ getPhotoAlbums(options: AlbumFetchOptions): Promise>; @@ -794,7 +791,7 @@ declare namespace userFileManager { * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.READ_IMAGEVIDEO * @param type Private album type - * @return A Promise instance used to return a private album FetchResult. + * @returns A Promise instance used to return a private album FetchResult. * @throws {BusinessError} 13900020 - if type type is not PrivateAlbumType * @systemapi * @since 9 @@ -817,10 +814,10 @@ declare namespace userFileManager { * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.READ_AUDIO - * @param type Detemined which kinds of asset to retrive. + * @param type Determined which kinds of asset to retrive. * @param options Retrieval options. * @throws {BusinessError} 13900020 - if type options is not FetchOptions - * @return A promise instance used to return the files in the format of a FetchResult instance + * @returns A promise instance used to return the files in the format of a FetchResult instance */ getAudioAssets(options: FetchOptions): Promise>; /** @@ -841,12 +838,12 @@ declare namespace userFileManager { * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.READ_IMAGEVIDEO and ohos.permission.WRITE_IMAGEVIDEO or ohos.permission.READ_AUDIO and ohos.permission.WRITE_AUDIO * @param uri Uri of asset - * @return A Promise instance, no value returned + * @returns A Promise instance, no value returned * @throws {BusinessError} 13900020 - if type uri is not string */ delete(uri: string): Promise; /** - * Turn on mornitor the data changes + * Turn on monitor the data changes * @since 9 * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core @@ -855,7 +852,7 @@ declare namespace userFileManager { */ on(type: ChangeEvent, callback: Callback): void; /** - * Turn off mornitor the data changes + * Turn off monitor the data changes * @since 9 * @systemapi * @syscap SystemCapability.FileManagement.UserFileManager.Core @@ -876,7 +873,7 @@ declare namespace userFileManager { * @since 9 * @syscap SystemCapability.FileManagement.UserFileManager.DistributedCore * @systemapi - * @return Promise used to return the list of the active peer devices' information + * @returns Promise used to return the list of the active peer devices' information */ getActivePeers(): Promise>; /** @@ -892,7 +889,7 @@ declare namespace userFileManager { * @since 9 * @syscap SystemCapability.FileManagement.UserFileManager.DistributedCore * @systemapi - * @return Promise used to return the list of the all the peer devices' information + * @returns Promise used to return the list of the all the peer devices' information */ getAllPeers(): Promise>; /** @@ -989,7 +986,7 @@ declare namespace userFileManager { * @syscap SystemCapability.FileManagement.UserFileManager.Core * @param uri Uri of asset * @permission ohos.permission.READ_IMAGEVIDEO and ohos.permission.WRITE_IMAGEVIDEO or ohos.permission.READ_AUDIO and ohos.permission.WRITE_AUDIO - * @return A Promise instance, no value returned + * @returns A Promise instance, no value returned * @systemapi */ delete(uri: string): Promise; @@ -1009,11 +1006,11 @@ declare namespace userFileManager { * @param uri Uri of asset * @syscap SystemCapability.FileManagement.UserFileManager.Core * @permission ohos.permission.READ_IMAGEVIDEO and ohos.permission.WRITE_IMAGEVIDEO or ohos.permission.READ_AUDIO and ohos.permission.WRITE_AUDIO - * @return A Promise instance, no value returned + * @returns A Promise instance, no value returned * @systemapi */ recover(uri: string): Promise; } } -export default userFileManager; \ No newline at end of file +export default userFileManager; diff --git a/api/@ohos.multimedia.mediaLibrary.d.ts b/api/@ohos.multimedia.mediaLibrary.d.ts index 18699d7b45..935f502c28 100644 --- a/api/@ohos.multimedia.mediaLibrary.d.ts +++ b/api/@ohos.multimedia.mediaLibrary.d.ts @@ -21,16 +21,14 @@ import image from './@ohos.multimedia.image'; * @name mediaLibrary * @since 6 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @import import media from '@ohos.multimedia.mediaLibrary' */ declare namespace mediaLibrary { /** * Obtains a MediaLibrary instance. * @since 6 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @import import mediaLibrary from '@ohos.multimedia.mediaLibrary' * @FAModelOnly - * @return Returns a MediaLibrary instance if the operation is successful; returns null otherwise. + * @returns Returns a MediaLibrary instance if the operation is successful; returns null otherwise. */ function getMediaLibrary(): MediaLibrary; /** @@ -39,7 +37,7 @@ declare namespace mediaLibrary { * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @StageModelOnly * @param context hap context information - * @return Instance of MediaLibrary + * @returns Instance of MediaLibrary */ function getMediaLibrary(context: Context): MediaLibrary; @@ -79,7 +77,6 @@ declare namespace mediaLibrary { * Describes media resource options. * @since 6 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @import import mediaLibrary from '@ohos.multimedia.mediaLibrary' * @deprecated since 9 */ interface MediaAssetOption { @@ -110,7 +107,6 @@ declare namespace mediaLibrary { * Describes media selection options. * @since 6 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @import import mediaLibrary from '@ohos.multimedia.mediaLibrary' * @deprecated since 9 */ interface MediaSelectOption { @@ -134,7 +130,6 @@ declare namespace mediaLibrary { * Provides methods to encapsulate file attributes. * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @import import mediaLibrary from '@ohos.multimedia.mediaLibrary' */ interface FileAsset { /** @@ -270,7 +265,7 @@ declare namespace mediaLibrary { * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @permission ohos.permission.READ_MEDIA - * @param callback Callback return the result of isDerectory. + * @param callback Callback return the result of isDirectory. */ isDirectory(callback: AsyncCallback): void; /** @@ -359,7 +354,7 @@ declare namespace mediaLibrary { * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @permission ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA - * @param isFavorite ture is favorite file, false is not favorite file + * @param isFavorite true is favorite file, false is not favorite file * @param callback Callback used to return, No value is returned. */ favorite(isFavorite: boolean, callback: AsyncCallback): void; @@ -368,7 +363,7 @@ declare namespace mediaLibrary { * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @permission ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA - * @param isFavorite ture is favorite file, false is not favorite file + * @param isFavorite true is favorite file, false is not favorite file */ favorite(isFavorite: boolean): Promise; /** @@ -561,7 +556,7 @@ declare namespace mediaLibrary { */ selectionArgs: Array; /** - * Sorting criterion of the retrieval results, for example, order: "datetaken DESC,display_name DESC, file_id DESC". + * Sorting criterion of the retrieval results, for example, order: "dateTaken DESC,display_name DESC, file_id DESC". * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core */ @@ -590,23 +585,22 @@ declare namespace mediaLibrary { * Implements file retrieval. * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @import import mediaLibrary from '@ohos.multimedia.mediaLibrary' */ interface FetchFileResult { /** * Obtains the total number of files in the file retrieval result. * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @return Total number of files. + * @returns Total number of files. */ getCount(): number; /** * Checks whether the result set points to the last row. * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @return Whether the file is the last one. + * @returns Whether the file is the last one. * You need to check whether the file is the last one before calling getNextObject, - * which returns the next file only when True is returned for this method. + * which returns the next file only when False is returned for this method. */ isAfterLast(): boolean; /** @@ -626,14 +620,14 @@ declare namespace mediaLibrary { * Obtains the first FileAsset in the file retrieval result. This method uses a promise to return the file. * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @return A Promise instance used to return the file in the format of a FileAsset instance. + * @returns A Promise instance used to return the file in the format of a FileAsset instance. */ getFirstObject(): Promise; /** * Obtains the next FileAsset in the file retrieval result. * This method uses a callback to return the file. * Before calling this method, you must use isAfterLast() to check whether the result set points to the last row. - * This method returns the next file only when True is returned for isAfterLast(). + * This method returns the next file only when False is returned for isAfterLast(). * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @param callback Callback used to return the file in the format of a FileAsset instance. @@ -643,10 +637,10 @@ declare namespace mediaLibrary { * Obtains the next FileAsset in the file retrieval result. * This method uses a promise to return the file. * Before calling this method, you must use isAfterLast() to check whether the result set points to the last row. - * This method returns the next file only when True is returned for isAfterLast(). + * This method returns the next file only when False is returned for isAfterLast(). * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @return A Promise instance used to return the file in the format of a FileAsset instance. + * @returns A Promise instance used to return the file in the format of a FileAsset instance. */ getNextObject(): Promise; /** @@ -660,7 +654,7 @@ declare namespace mediaLibrary { * Obtains the last FileAsset in the file retrieval result. This method uses a promise to return the file. * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @return A Promise instance used to return the file in the format of a FileAsset instance. + * @returns A Promise instance used to return the file in the format of a FileAsset instance. */ getLastObject(): Promise; /** @@ -678,7 +672,7 @@ declare namespace mediaLibrary { * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @param index Index of the file to obtain. - * @return A Promise instance used to return the file in the format of a FileAsset instance. + * @returns A Promise instance used to return the file in the format of a FileAsset instance. */ getPositionObject(index: number): Promise; /** @@ -698,7 +692,7 @@ declare namespace mediaLibrary { * In this case, other methods cannot be called. * @since 7 * @syscap SystemCapability.Multimedia.MediaLibrary.Core - * @return A Promise instance used to return a FileAsset array. + * @returns A Promise instance used to return a FileAsset array. */ getAllObject(): Promise>; } @@ -791,7 +785,7 @@ declare namespace mediaLibrary { * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @permission ohos.permission.READ_MEDIA * @param option Media retrieval options. - * @return A Promise instance used to return the files in the format of a FetchFileResult instance. + * @returns A Promise instance used to return the files in the format of a FetchFileResult instance. */ getFileAssets(options?: MediaFetchOptions): Promise; } @@ -860,7 +854,7 @@ declare namespace mediaLibrary { * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @param type public directory predefined in DirectoryType. - * @return A promise instance used to return the public directory in the format of string + * @returns A promise instance used to return the public directory in the format of string */ getPublicDirectory(type: DirectoryType): Promise; /** @@ -880,11 +874,11 @@ declare namespace mediaLibrary { * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @permission ohos.permission.READ_MEDIA * @param options Media retrieval options. - * @return A promise instance used to return the files in the format of a FetchFileResult instance + * @returns A promise instance used to return the files in the format of a FetchFileResult instance */ getFileAssets(options: MediaFetchOptions): Promise; /** - * Turn on mornitor the data changes by media type + * Turn on monitor the data changes by media type * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @param type one of 'deviceChange','albumChange','imageChange','audioChange','videoChange','fileChange','remoteFileChange' @@ -892,7 +886,7 @@ declare namespace mediaLibrary { */ on(type: 'deviceChange'|'albumChange'|'imageChange'|'audioChange'|'videoChange'|'fileChange'|'remoteFileChange', callback: Callback): void; /** - * Turn off mornitor the data changes by media type + * Turn off monitor the data changes by media type * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @param type one of 'deviceChange','albumChange','imageChange','audioChange','videoChange','fileChange','remoteFileChange' @@ -918,7 +912,7 @@ declare namespace mediaLibrary { * @param mediaType mediaType for example:IMAGE, VIDEO, AUDIO, FILE * @param displayName file name * @param relativePath relative path - * @return A Promise instance used to return the FileAsset + * @returns A Promise instance used to return the FileAsset */ createAsset(mediaType: MediaType, displayName: string, relativePath: string): Promise; /** @@ -937,7 +931,7 @@ declare namespace mediaLibrary { * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @permission ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA * @param uri, FileAsset's URI - * @return A Promise instance, no value returned + * @returns A Promise instance, no value returned * @systemapi */ deleteAsset(uri: string): Promise; @@ -956,7 +950,7 @@ declare namespace mediaLibrary { * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @permission ohos.permission.READ_MEDIA * @param option Media retrieval options. - * @return A Promise instance used to return an album array. + * @returns A Promise instance used to return an album array. */ getAlbums(options: MediaFetchOptions): Promise>; /** @@ -974,7 +968,7 @@ declare namespace mediaLibrary { * @since 6 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @param option Media resource option. - * @return Promise used to return the URI that stores the media resources. + * @returns Promise used to return the URI that stores the media resources. * @deprecated since 9 */ storeMediaAsset(option: MediaAssetOption): Promise; @@ -1005,7 +999,7 @@ declare namespace mediaLibrary { * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @param images List of images to preview. * @param index Sequence number of the first image to preview. - * @return Promise used to return whether the operation is successful. + * @returns Promise used to return whether the operation is successful. * @deprecated since 9 */ startImagePreview(images: Array, index?: number): Promise; @@ -1025,7 +1019,7 @@ declare namespace mediaLibrary { * @since 6 * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @param option Media selection option. - * @return Promise used to return the list of URIs that store the selected media resources. + * @returns Promise used to return the list of URIs that store the selected media resources. * @deprecated since 9 */ startMediaSelect(option: MediaSelectOption): Promise>; @@ -1044,7 +1038,7 @@ declare namespace mediaLibrary { * @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore * @permission ohos.permission.READ_MEDIA * @systemapi - * @return Promise used to return the list of the active peer devices' information + * @returns Promise used to return the list of the active peer devices' information */ getActivePeers(): Promise>; /** @@ -1062,7 +1056,7 @@ declare namespace mediaLibrary { * @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore * @permission ohos.permission.READ_MEDIA * @systemapi - * @return Promise used to return the list of the all the peer devices' information + * @returns Promise used to return the list of the all the peer devices' information */ getAllPeers(): Promise>; /** @@ -1081,7 +1075,7 @@ declare namespace mediaLibrary { } /** - * thumbnail's size which have width and heigh + * thumbnail's size which have width and height * @syscap SystemCapability.Multimedia.MediaLibrary.Core * @since 8 */ @@ -1145,7 +1139,7 @@ declare namespace mediaLibrary { */ enum DeviceType { /** - * Unknow device type + * Unknown device type * @since 8 * @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore * @systemapi -- Gitee From aa532a066751ca8c9339137bd6682f183ce60994 Mon Sep 17 00:00:00 2001 From: fangJinliang1 Date: Thu, 17 Nov 2022 16:44:10 +0800 Subject: [PATCH 372/438] add interface Signed-off-by: fangJinliang1 Change-Id: Id7aa2ab22daab57cbd2988ab8672f7e30e9b86ae Signed-off-by: fangJinliang1 --- api/@ohos.notificationManager.d.ts | 30 ------------------- api/@ohos.notificationSubscribe.d.ts | 44 ++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 30 deletions(-) diff --git a/api/@ohos.notificationManager.d.ts b/api/@ohos.notificationManager.d.ts index e35bfb4fcd..6f285ae0bf 100644 --- a/api/@ohos.notificationManager.d.ts +++ b/api/@ohos.notificationManager.d.ts @@ -1157,17 +1157,6 @@ declare namespace notificationManager { uid?: number; } - /** - * Describes a NotificationKey, which can be used to identify a notification. - * @typedef NotificationKey - * @syscap SystemCapability.Notification.Notification - * @since 9 - */ - export interface NotificationKey { - id: number; - label?: string; - } - /** * The type of the Do Not Disturb. * @enum { number } @@ -1277,25 +1266,6 @@ declare namespace notificationManager { TYPE_TIMER = 2, } - /** - * Reason for remove a notification - * @enum { number } - * @syscap SystemCapability.Notification.Notification - * @systemapi - * @since 9 - */ - export enum RemoveReason { - /** - * Notification clicked notification on the status bar - */ - CLICK_REASON_REMOVE = 1, - - /** - * User dismissal notification on the status bar - */ - CANCEL_REASON_REMOVE = 2, - } - /** * Describes an action button displayed in a notification. * @syscap SystemCapability.Notification.Notification diff --git a/api/@ohos.notificationSubscribe.d.ts b/api/@ohos.notificationSubscribe.d.ts index a97f53a9b4..0d530853c1 100644 --- a/api/@ohos.notificationSubscribe.d.ts +++ b/api/@ohos.notificationSubscribe.d.ts @@ -22,11 +22,55 @@ import { EnabledNotificationCallbackData as _EnabledNotificationCallbackData } f /** * @name notificationSubscribe * @since 9 + * @systemapi * @syscap SystemCapability.Notification.Notification * @import import notificationSubscribe from '@ohos.notification.subscribe'; * @permission N/A */ declare namespace notificationSubscribe { + /** + * Describes a BundleOption. + * @typedef BundleOption + * @syscap SystemCapability.Notification.Notification + * @systemapi + * @since 9 + */ + export interface BundleOption { + bundle: string; + uid?: number; + } + + /** + * Describes a NotificationKey, which can be used to identify a notification. + * @typedef NotificationKey + * @syscap SystemCapability.Notification.Notification + * @systemapi + * @since 9 + */ + export interface NotificationKey { + id: number; + label?: string; + } + + /** + * Reason for remove a notification + * @enum { number } + * @syscap SystemCapability.Notification.Notification + * @systemapi + * @since 9 + */ + export enum RemoveReason { + /** + * Notification clicked notification on the status bar + */ + CLICK_REASON_REMOVE = 1, + + /** + * User dismissal notification on the status bar + */ + CANCEL_REASON_REMOVE = 2, + } + /** * Subscribe to notifications. * @permission ohos.permission.NOTIFICATION_CONTROLLER -- Gitee From 14b4e38148c4c95d401ce1c8003d6f91b2a44284 Mon Sep 17 00:00:00 2001 From: li-yaoyao777 Date: Mon, 21 Nov 2022 15:28:54 +0800 Subject: [PATCH 373/438] =?UTF-8?q?=E4=BF=AEapi=E6=89=AB=E6=8F=8F=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-yaoyao777 --- api/@system.sensor.d.ts | 17 ++++++++-- api/@system.vibrator.d.ts | 65 ++++++++++++++++++++------------------- 2 files changed, 47 insertions(+), 35 deletions(-) diff --git a/api/@system.sensor.d.ts b/api/@system.sensor.d.ts index fe87e39d74..4d7b4c23b4 100644 --- a/api/@system.sensor.d.ts +++ b/api/@system.sensor.d.ts @@ -18,6 +18,7 @@ * @permission ohos.permission.ACCELEROMETER * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#ACCELEROMETER */ export interface AccelerometerResponse { /** @@ -75,6 +76,7 @@ export interface subscribeAccelerometerOptions { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#getGeomagneticInfo */ export interface CompassResponse { /** @@ -108,6 +110,7 @@ export interface SubscribeCompassOptions { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#PROXIMITY */ export interface ProximityResponse { /** @@ -141,6 +144,7 @@ export interface SubscribeProximityOptions { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#AMBIENT_LIGHT */ export interface LightResponse { /** @@ -175,6 +179,7 @@ export interface SubscribeLightOptions { * @permission ohos.permission.ACTIVITY_MOTION * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#PEDOMETER */ export interface StepCounterResponse { /** @@ -190,7 +195,7 @@ export interface StepCounterResponse { * @permission ohos.permission.ACTIVITY_MOTION * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#event:eventSensorId.PEDOMETER + * @useinstead ohos.sensor/sensor#event:SensorId.PEDOMETER */ export interface SubscribeStepCounterOptions { /** @@ -210,6 +215,7 @@ export interface SubscribeStepCounterOptions { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#BAROMETER */ export interface BarometerResponse { /** @@ -223,7 +229,7 @@ export interface BarometerResponse { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#event:eventSensorId.BAROMETER + * @useinstead ohos.sensor/sensor#event:SensorId.BAROMETER */ export interface SubscribeBarometerOptions { /** @@ -244,6 +250,7 @@ export interface SubscribeBarometerOptions { * @permission ohos.permission.READ_HEALTH_DATA * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#HEART_RATE */ export interface HeartRateResponse { /** @@ -259,7 +266,7 @@ export interface HeartRateResponse { * @permission ohos.permission.READ_HEALTH_DATA * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#event:eventSensorId.HEART_RATE + * @useinstead ohos.sensor/sensor#event:SensorId.HEART_RATE */ export interface SubscribeHeartRateOptions { /** @@ -279,6 +286,7 @@ export interface SubscribeHeartRateOptions { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#WEAR_DETECTION */ export interface OnBodyStateResponse { /** @@ -337,6 +345,7 @@ export interface GetOnBodyStateOptions { * @syscap SystemCapability.Sensors.Sensor * @since 6 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#ORIENTATION */ export interface DeviceOrientationResponse { /** @@ -394,6 +403,7 @@ export interface SubscribeDeviceOrientationOptions { * @permission ohos.permission.GYROSCOPE * @since 6 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#GYROSCOPE */ export interface GyroscopeResponse { /** @@ -451,6 +461,7 @@ export interface SubscribeGyroscopeOptions { * @syscap SystemCapability.Sensors.Sensor * @since 6 * @deprecated since 8 + * @useinstead ohos.sensor/sensor */ export default class Sensor { /** diff --git a/api/@system.vibrator.d.ts b/api/@system.vibrator.d.ts index f35234bbfc..72b5a9a26b 100644 --- a/api/@system.vibrator.d.ts +++ b/api/@system.vibrator.d.ts @@ -18,33 +18,34 @@ * @permission ohos.permission.VIBRATE * @since 3 * @deprecated since 8 + * @useinstead ohos.vibrator/vibrator#EffectId */ export interface VibrateOptions { - /** - * Vibration mode. The value long indicates long vibration, and short indicates short vibration. - * The default value is long. - * @since 3 - */ - mode?: "long" | "short"; + /** + * Vibration mode. The value long indicates long vibration, and short indicates short vibration. + * The default value is long. + * @since 3 + */ + mode?: "long" | "short"; - /** - * Called when success to trigger vibration. - * @since 3 - */ - success: () => void; + /** + * Called when success to trigger vibration. + * @since 3 + */ + success: () => void; - /** - * Called when fail to trigger vibration. - * @since 3 - */ - fail?: (data: string, code: number) => void; + /** + * Called when fail to trigger vibration. + * @since 3 + */ + fail?: (data: string, code: number) => void; - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - } + /** + * Called when the execution is completed. + * @since 3 + */ + complete?: () => void; +} /** * @syscap SystemCapability.Sensors.MiscDevice @@ -54,13 +55,13 @@ * @useinstead ohos.vibrator/vibrator */ export default class Vibrator { - /** - * Triggers vibration. - * @param options Options. - * @permission ohos.permission.VIBRATE - * @since 3 - * @deprecated since 8 - * @useinstead ohos.vibrator/vibrator#startVibration - */ - static vibrate(options?: VibrateOptions): void; - } \ No newline at end of file + /** + * Triggers vibration. + * @param options Options. + * @permission ohos.permission.VIBRATE + * @since 3 + * @deprecated since 8 + * @useinstead ohos.vibrator/vibrator#startVibration + */ + static vibrate(options?: VibrateOptions): void; +} \ No newline at end of file -- Gitee From 85bd92f6aec294938e3e5d31951a451fb773f8c0 Mon Sep 17 00:00:00 2001 From: LVB8189 Date: Mon, 21 Nov 2022 16:12:11 +0800 Subject: [PATCH 374/438] modify import Signed-off-by: LVB8189 --- api/@ohos.wallpaper.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/api/@ohos.wallpaper.d.ts b/api/@ohos.wallpaper.d.ts index 6cf00f33d0..9dd484769a 100644 --- a/api/@ohos.wallpaper.d.ts +++ b/api/@ohos.wallpaper.d.ts @@ -18,7 +18,6 @@ import image from './@ohos.multimedia.image'; /** * System wallpaper * @syscap SystemCapability.MiscServices.Wallpaper - * @import import wallpaper from '@ohos.wallpaper'; * @since 7 */ declare namespace wallpaper { -- Gitee From 445a2a8bdf197f55116a8e0c5b57a8706dc96f15 Mon Sep 17 00:00:00 2001 From: li-yaoyao777 Date: Mon, 21 Nov 2022 16:51:07 +0800 Subject: [PATCH 375/438] =?UTF-8?q?=E4=BF=AEapi=E6=89=AB=E6=8F=8F=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-yaoyao777 --- api/@system.vibrator.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@system.vibrator.d.ts b/api/@system.vibrator.d.ts index 72b5a9a26b..b201f04f69 100644 --- a/api/@system.vibrator.d.ts +++ b/api/@system.vibrator.d.ts @@ -18,7 +18,7 @@ * @permission ohos.permission.VIBRATE * @since 3 * @deprecated since 8 - * @useinstead ohos.vibrator/vibrator#EffectId + * @useinstead ohos.vibrator/vibrator.EffectId */ export interface VibrateOptions { /** -- Gitee From 00ed7334738fa30944d74e102c2d5d60654bb4ce Mon Sep 17 00:00:00 2001 From: hw-wLiu Date: Mon, 21 Nov 2022 09:51:59 +0000 Subject: [PATCH 376/438] =?UTF-8?q?=E4=BF=AE=E6=94=B9api=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E4=B8=AD=E6=8B=BC=E5=86=99=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hw-wLiu --- api/@ohos.bytrace.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.bytrace.d.ts b/api/@ohos.bytrace.d.ts index e1b5a1ccad..b2ee906edc 100644 --- a/api/@ohos.bytrace.d.ts +++ b/api/@ohos.bytrace.d.ts @@ -65,8 +65,8 @@ declare namespace bytrace { * @deprecated * @since 7 * @syscap SystemCapability.HiviewDFX.HiTrace - * @param name Indicates the task name. It must be the same whith the {@code name} of startTrace. - * @param taskId The unique id used to distinguish the tasks and must be the same whith the . + * @param name Indicates the task name. It must be the same with the {@code name} of startTrace. + * @param taskId The unique id used to distinguish the tasks and must be the same with the . * {@code taskId} of startTrace. */ function finishTrace(name: string, taskId: number): void; -- Gitee From 2a04ca042ac07120d67254db2fdda6fbb78fbea6 Mon Sep 17 00:00:00 2001 From: hw-wLiu Date: Mon, 21 Nov 2022 09:52:48 +0000 Subject: [PATCH 377/438] =?UTF-8?q?=E4=BF=AE=E6=94=B9api=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E4=B8=AD=E6=8B=BC=E5=86=99=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hw-wLiu --- api/@ohos.hiTraceMeter.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.hiTraceMeter.d.ts b/api/@ohos.hiTraceMeter.d.ts index d9034b7c5b..7884496483 100644 --- a/api/@ohos.hiTraceMeter.d.ts +++ b/api/@ohos.hiTraceMeter.d.ts @@ -61,8 +61,8 @@ declare namespace hiTraceMeter { * * @since 8 * @syscap SystemCapability.HiviewDFX.HiTrace - * @param name Indicates the task name. It must be the same whith the {@code name} of startTrace. - * @param taskId The unique id used to distinguish the tasks and must be the same whith the . + * @param name Indicates the task name. It must be the same with the {@code name} of startTrace. + * @param taskId The unique id used to distinguish the tasks and must be the same with the . * {@code taskId} of startTrace. */ function finishTrace(name: string, taskId: number): void; -- Gitee From 66600ca35d12c857f9e6821e2cea004a2e1e0dd7 Mon Sep 17 00:00:00 2001 From: jackd320 Date: Mon, 21 Nov 2022 11:15:00 +0000 Subject: [PATCH 378/438] Signed-off-by: jackd320 Signed-off-by: jackd320 --- api/@ohos.update.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/api/@ohos.update.d.ts b/api/@ohos.update.d.ts index 6fa8e80005..be59bd960a 100644 --- a/api/@ohos.update.d.ts +++ b/api/@ohos.update.d.ts @@ -79,6 +79,7 @@ declare namespace update { * @permission ohos.permission.UPDATE_SYSTEM * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 11500104 - IPC error. + * @since 9 */ getNewVersionInfo(callback: AsyncCallback): void; getNewVersionInfo(): Promise; -- Gitee From faff617e8dde61083a37da1380193c2d64416be3 Mon Sep 17 00:00:00 2001 From: liu-binjun Date: Mon, 14 Nov 2022 20:34:50 +0800 Subject: [PATCH 379/438] bugfix:Discard system api from api 9 Signed-off-by: liu-binjun --- api/@system.geolocation.d.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/api/@system.geolocation.d.ts b/api/@system.geolocation.d.ts index d47a68ef7e..c6a47550ee 100644 --- a/api/@system.geolocation.d.ts +++ b/api/@system.geolocation.d.ts @@ -15,6 +15,8 @@ /** * @syscap SystemCapability.Location.Location.Lite + * @deprecated since 9 + * @useinstead ohos.geoLocationManager/geoLocationManager.Location */ export interface GeolocationResponse { /** @@ -51,6 +53,8 @@ export interface GeolocationResponse { /** * @syscap SystemCapability.Location.Location.Lite * @permission ohos.permission.LOCATION + * @deprecated since 9 + * @useinstead ohos.geoLocationManager/geoLocationManager.CurrentLocationRequest */ export interface GetLocationOption { /** @@ -92,6 +96,7 @@ export interface GetLocationOption { /** * @syscap SystemCapability.Location.Location.Lite + * @deprecated since 9 */ export interface GetLocationTypeResponse { /** @@ -102,6 +107,7 @@ export interface GetLocationTypeResponse { /** * @syscap SystemCapability.Location.Location.Lite + * @deprecated since 9 */ export interface GetLocationTypeOption { /** @@ -126,6 +132,8 @@ export interface GetLocationTypeOption { /** * @syscap SystemCapability.Location.Location.Lite * @permission ohos.permission.LOCATION + * @deprecated since 9 + * @useinstead ohos.geoLocationManager/geoLocationManager.LocationRequest */ export interface SubscribeLocationOption { /** @@ -150,18 +158,23 @@ export interface SubscribeLocationOption { /** * @syscap SystemCapability.Location.Location.Lite + * @deprecated since 9 + * @useinstead ohos.geoLocationManager/geoLocationManager */ export default class Geolocation { /** * Obtains the geographic location. * @permission ohos.permission.LOCATION * @param options Options. + * @deprecated since 9 + * @useinstead ohos.geoLocationManager/geoLocationManager.getCurrentLocation */ static getLocation(options?: GetLocationOption): void; /** * Obtains the location types supported by the system. * @param options Options. + * @deprecated since 9 */ static getLocationType(options?: GetLocationTypeOption): void; @@ -169,18 +182,23 @@ export default class Geolocation { * Listens to the geographical location. If this method is called multiple times, the last call takes effect. * @permission ohos.permission.LOCATION * @param options Options. + * @deprecated since 9 + * @useinstead ohos.geoLocationManager/geoLocationManager.on#event:locationChange */ static subscribe(options: SubscribeLocationOption): void; /** * Cancels listening to the geographical location. * @permission ohos.permission.LOCATION + * @deprecated since 9 + * @useinstead ohos.geoLocationManager/geoLocationManager.off#event:locationChange */ static unsubscribe(): void; /** * Obtains the supported coordinate system types. * @returns A string array of the supported coordinate system types, for example, ['wgs84']. + * @deprecated since 9 */ static getSupportedCoordTypes(): Array; } -- Gitee From 99f492045c15944164aface7e5d7a41816a4c9e3 Mon Sep 17 00:00:00 2001 From: zhufenghao Date: Mon, 21 Nov 2022 19:29:22 +0800 Subject: [PATCH 380/438] =?UTF-8?q?=E5=AF=B9=E9=BD=90=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=A0=81=E6=B3=A8=E9=87=8A=EF=BC=8C=E8=A1=A5=E5=85=85=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2=E6=8E=A5=E5=8F=A3=E6=B3=A8=E9=87=8A=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhufenghao --- api/@internal/component/ets/web.d.ts | 6 +++++- api/@ohos.web.webview.d.ts | 12 ++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/api/@internal/component/ets/web.d.ts b/api/@internal/component/ets/web.d.ts index 6dee9d2ab0..57325d3d9e 100644 --- a/api/@internal/component/ets/web.d.ts +++ b/api/@internal/component/ets/web.d.ts @@ -1563,6 +1563,7 @@ declare class WebAttribute extends CommonMethod { * * @since 8 * @deprecated since 9 + * @useinstead ohos.web.WebAttribute#textZoomRatio */ textZoomAtio(textZoomAtio: number): WebAttribute; @@ -1750,6 +1751,7 @@ declare class WebAttribute extends CommonMethod { * * @since 8 * @deprecated since 9 + * @useinstead ohos.web.WebAttribute#onSslErrorEventReceive */ onSslErrorReceive(callback: (event?: { handler: Function, error: object }) => void): WebAttribute; @@ -1776,6 +1778,7 @@ declare class WebAttribute extends CommonMethod { * * @since 8 * @deprecated since 9 + * @useinstead ohos.web.WebAttribute#onRenderExited */ onRenderExited(callback: (event?: { detail: object }) => boolean): WebAttribute; @@ -1785,6 +1788,7 @@ declare class WebAttribute extends CommonMethod { * * @since 8 * @deprecated since 9 + * @useinstead ohos.web.WebAttribute#onShowFileSelector */ onFileSelectorShow(callback: (event?: { callback: Function, fileSelector: object }) => void): WebAttribute; @@ -1924,4 +1928,4 @@ declare class WebAttribute extends CommonMethod { } declare const Web: WebInterface; -declare const WebInstance: WebAttribute; +declare const WebInstance: WebAttribute; \ No newline at end of file diff --git a/api/@ohos.web.webview.d.ts b/api/@ohos.web.webview.d.ts index b678e138c4..0bdb35eb44 100644 --- a/api/@ohos.web.webview.d.ts +++ b/api/@ohos.web.webview.d.ts @@ -149,7 +149,7 @@ declare namespace webview { * * @param { string } origin - The origin which to be deleted. * @throws { BusinessError } 401 - Invalid input parameter. - * @throws { BusinessError } 17100011 - Invalid permission origin. + * @throws { BusinessError } 17100011 - Invalid origin. * @since 9 */ static deleteOrigin(origin : string): void; @@ -168,7 +168,7 @@ declare namespace webview { * Get the web storage quota with the origin. * @param { string } origin - The origin which to be inquired. * @throws { BusinessError } 401 - Invalid input parameter. - * @throws { BusinessError } 17100011 - Invalid permission origin. + * @throws { BusinessError } 17100011 - Invalid origin. * @since 9 */ static getOriginQuota(origin : string) : Promise; @@ -178,7 +178,7 @@ declare namespace webview { * Get the web storage quota with the origin. * @param { string } origin - The origin which to be inquired. * @throws { BusinessError } 401 - Invalid input parameter. - * @throws { BusinessError } 17100011 - Invalid permission origin. + * @throws { BusinessError } 17100011 - Invalid origin. * @since 9 */ static getOriginUsage(origin : string) : Promise ; @@ -290,7 +290,7 @@ declare namespace webview { * Allow geolocation permissions for specifies source. * @param { string } origin - Url source. * @throws { BusinessError } 401 - Invalid input parameter. - * @throws { BusinessError } 17100011 - Invalid permission origin. + * @throws { BusinessError } 17100011 - Invalid origin. * * @since 9 */ @@ -300,7 +300,7 @@ declare namespace webview { * Delete geolocation permissions for specifies source. * @param { string } origin - Url source. * @throws { BusinessError } 401 - Invalid input parameter. - * @throws { BusinessError } 17100011 - Invalid permission origin. + * @throws { BusinessError } 17100011 - Invalid origin. * * @since 9 */ @@ -319,7 +319,7 @@ declare namespace webview { * @param { AsyncCallback } callback - Return to the specified source * geographic location permission status. * @throws { BusinessError } 401 - Invalid input parameter. - * @throws { BusinessError } 17100011 - Invalid permission origin. + * @throws { BusinessError } 17100011 - Invalid origin. * @return { Promise } Return whether there is a saved result. * * @since 9 -- Gitee From 30f86eea00f43ef35d2445bf082b223260414db7 Mon Sep 17 00:00:00 2001 From: mali Date: Tue, 22 Nov 2022 10:46:22 +0800 Subject: [PATCH 381/438] Camera interface file modification Signed-off-by: mali --- api/@ohos.multimedia.camera.d.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/api/@ohos.multimedia.camera.d.ts b/api/@ohos.multimedia.camera.d.ts index 596e921301..430e983472 100644 --- a/api/@ohos.multimedia.camera.d.ts +++ b/api/@ohos.multimedia.camera.d.ts @@ -19,7 +19,6 @@ import { Context } from './app/context'; /** * @name camera * @syscap SystemCapability.Multimedia.Camera.Core - * @import import camera from '@ohos.multimedia.camera'; * @since 9 */ declare namespace camera { @@ -1174,7 +1173,7 @@ declare namespace camera { /** * Query the exposure compensation range. - * @param callback Callback used to return the array of compenstation range. + * @param callback Callback used to return the array of compensation range. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1182,7 +1181,7 @@ declare namespace camera { /** * Query the exposure compensation range. - * @return Promise used to return the array of compenstation range. + * @return Promise used to return the array of compensation range. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ -- Gitee From 2db6af97e7e24370819ecd8483f500b5733d9ec7 Mon Sep 17 00:00:00 2001 From: mali Date: Tue, 22 Nov 2022 11:44:07 +0800 Subject: [PATCH 382/438] @return -> @returns Signed-off-by: mali --- api/@ohos.multimedia.camera.d.ts | 114 +++++++++++++++---------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/api/@ohos.multimedia.camera.d.ts b/api/@ohos.multimedia.camera.d.ts index 430e983472..dc5e379fd6 100644 --- a/api/@ohos.multimedia.camera.d.ts +++ b/api/@ohos.multimedia.camera.d.ts @@ -35,7 +35,7 @@ declare namespace camera { /** * Creates a CameraManager instance. * @param context Current application context. - * @return Promise used to return the CameraManager instance. + * @returns Promise used to return the CameraManager instance. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -175,7 +175,7 @@ declare namespace camera { /** * Gets supported camera descriptions. - * @return Promise used to return an array of supported cameras. + * @returns Promise used to return an array of supported cameras. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -193,7 +193,7 @@ declare namespace camera { /** * Gets supported output capability for specific camera. * @param camera Camera device. - * @return Promise used to return the camera output capability. + * @returns Promise used to return the camera output capability. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -201,7 +201,7 @@ declare namespace camera { /** * Determine whether camera is muted. - * @return Is camera muted. + * @returns Is camera muted. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -209,7 +209,7 @@ declare namespace camera { /** * Determine whether camera mute is supported. - * @return Is camera mute supported. + * @returns Is camera mute supported. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core * @systemapi @@ -238,7 +238,7 @@ declare namespace camera { /** * Creates a CameraInput instance by camera. * @param camera Camera device used to create the instance. - * @return Promise used to return the CameraInput instance. + * @returns Promise used to return the CameraInput instance. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core * @permission ohos.permission.CAMERA @@ -260,7 +260,7 @@ declare namespace camera { * Creates a CameraInput instance by camera position and type. * @param position Target camera position. * @param type Target camera type. - * @return Promise used to return the CameraInput instance. + * @returns Promise used to return the CameraInput instance. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core * @permission ohos.permission.CAMERA @@ -281,7 +281,7 @@ declare namespace camera { * 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. + * @returns Promise used to return the PreviewOutput instance. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -301,7 +301,7 @@ declare namespace camera { * 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. + * @returns Promise used to return the PhotoOutput instance. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -321,7 +321,7 @@ declare namespace camera { * 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. + * @returns Promise used to return the VideoOutput instance. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -339,7 +339,7 @@ declare namespace camera { /** * Creates a MetadataOutput instance. * @param metadataObjectTypes Array of MetadataObjectType. - * @return Promise used to return the MetadataOutput instance. + * @returns Promise used to return the MetadataOutput instance. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -355,7 +355,7 @@ declare namespace camera { /** * Gets a CaptureSession instance. - * @return Promise used to return the CaptureSession instance. + * @returns Promise used to return the CaptureSession instance. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -585,7 +585,7 @@ declare namespace camera { /** * Open camera. - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -601,7 +601,7 @@ declare namespace camera { /** * Close camera. - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -617,7 +617,7 @@ declare namespace camera { /** * Releases instance. - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -875,7 +875,7 @@ declare namespace camera { /** * Begin capture session config. - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -891,7 +891,7 @@ declare namespace camera { /** * Commit capture session config. - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -909,7 +909,7 @@ declare namespace camera { /** * Adds a camera input. * @param cameraInput Target camera input to add. - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -927,7 +927,7 @@ declare namespace camera { /** * Removes a camera input. * @param cameraInput Target camera input to remove. - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -945,7 +945,7 @@ declare namespace camera { /** * Adds a camera output. * @param cameraOutput Target camera output to add. - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -963,7 +963,7 @@ declare namespace camera { /** * Removes a camera output. * @param previewOutput Target camera output to remove. - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -979,7 +979,7 @@ declare namespace camera { /** * Starts capture session. - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -995,7 +995,7 @@ declare namespace camera { /** * Stops capture session. - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1011,7 +1011,7 @@ declare namespace camera { /** * Release capture session instance. - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1027,7 +1027,7 @@ declare namespace camera { /** * Check if device has flash light. - * @return Promise used to return the flash light support status. + * @returns Promise used to return the flash light support status. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1045,7 +1045,7 @@ declare namespace camera { /** * Checks whether a specified flash mode is supported. * @param flashMode Flash mode - * @return Promise used to return flash mode support status. + * @returns Promise used to return flash mode support status. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1061,7 +1061,7 @@ declare namespace camera { /** * Gets current flash mode. - * @return Promise used to return the flash mode. + * @returns Promise used to return the flash mode. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1079,7 +1079,7 @@ declare namespace camera { /** * Sets flash mode. * @param flashMode Target flash mode. - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1097,7 +1097,7 @@ declare namespace camera { /** * Checks whether a specified exposure mode is supported. * @param aeMode Exposure mode - * @return Promise used to return exposure mode support status. + * @returns Promise used to return exposure mode support status. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1113,7 +1113,7 @@ declare namespace camera { /** * Gets current exposure mode. - * @return Promise used to return the current exposure mode. + * @returns Promise used to return the current exposure mode. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1131,7 +1131,7 @@ declare namespace camera { /** * Sets Exposure mode. * @param aeMode Exposure mode - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1147,7 +1147,7 @@ declare namespace camera { /** * Gets current metering point. - * @return Promise used to return the current metering point. + * @returns Promise used to return the current metering point. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1165,7 +1165,7 @@ declare namespace camera { /** * Set the center point of the metering area. * @param point metering point - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1181,7 +1181,7 @@ declare namespace camera { /** * Query the exposure compensation range. - * @return Promise used to return the array of compensation range. + * @returns Promise used to return the array of compensation range. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1199,7 +1199,7 @@ declare namespace camera { /** * Set exposure compensation. * @param exposureBias Exposure compensation - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1215,7 +1215,7 @@ declare namespace camera { /** * Query the exposure value. - * @return Promise used to return the exposure value. + * @returns Promise used to return the exposure value. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1233,7 +1233,7 @@ declare namespace camera { /** * Checks whether a specified focus mode is supported. * @param afMode Focus mode. - * @return Promise used to return the focus mode support status. + * @returns Promise used to return the focus mode support status. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1249,7 +1249,7 @@ declare namespace camera { /** * Gets current focus mode. - * @return Promise used to return the focus mode. + * @returns Promise used to return the focus mode. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1267,7 +1267,7 @@ declare namespace camera { /** * Sets focus mode. * @param afMode Target focus mode. - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1285,7 +1285,7 @@ declare namespace camera { /** * Sets focus point. * @param afMode Target focus point. - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1301,7 +1301,7 @@ declare namespace camera { /** * Gets current focus point. - * @return Promise used to return the current focus point. + * @returns Promise used to return the current focus point. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1317,7 +1317,7 @@ declare namespace camera { /** * Gets current focal length. - * @return Promise used to return the current focal point. + * @returns Promise used to return the current focal point. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1333,7 +1333,7 @@ declare namespace camera { /** * Gets all supported zoom ratio range. - * @return Promise used to return the zoom ratio range. + * @returns Promise used to return the zoom ratio range. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1349,7 +1349,7 @@ declare namespace camera { /** * Gets zoom ratio. - * @return Promise used to return the zoom ratio value. + * @returns Promise used to return the zoom ratio value. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1367,7 +1367,7 @@ declare namespace camera { /** * Sets zoom ratio. * @param zoomRatio Target zoom ratio. - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1385,7 +1385,7 @@ declare namespace camera { /** * 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. + * @returns Promise used to return flash mode support status. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1401,7 +1401,7 @@ declare namespace camera { /** * Query the video stabilization mode currently in use. - * @return Promise used to return the current video stabilization mode. + * @returns Promise used to return the current video stabilization mode. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1419,7 +1419,7 @@ declare namespace camera { /** * Set video stabilization mode. * @param mode video stabilization mode to set. - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1492,7 +1492,7 @@ declare namespace camera { /** * Release output instance. - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1515,7 +1515,7 @@ declare namespace camera { /** * Start output instance. - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1531,7 +1531,7 @@ declare namespace camera { /** * Stop output instance. - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1730,7 +1730,7 @@ declare namespace camera { /** * Start capture output. * @param setting Photo capture settings. - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1746,7 +1746,7 @@ declare namespace camera { /** * Check whether to support mirror photo. - * @return Promise used to return the mirror support status. + * @returns Promise used to return the mirror support status. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1882,7 +1882,7 @@ declare namespace camera { /** * Start video output. - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -1898,7 +1898,7 @@ declare namespace camera { /** * Stop video output. - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -2081,7 +2081,7 @@ declare namespace camera { /** * Start output metadata - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ @@ -2097,7 +2097,7 @@ declare namespace camera { /** * Stop output metadata - * @return Promise used to return the result. + * @returns Promise used to return the result. * @since 9 * @syscap SystemCapability.Multimedia.Camera.Core */ -- Gitee From 9f04c08d893d946f987c25c4edc731e53fc3347f Mon Sep 17 00:00:00 2001 From: zzs110 Date: Tue, 22 Nov 2022 11:54:27 +0800 Subject: [PATCH 383/438] =?UTF-8?q?api9=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zzs110 --- api/@ohos.pasteboard.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api/@ohos.pasteboard.d.ts b/api/@ohos.pasteboard.d.ts index 722c99abcf..7de65d4acc 100644 --- a/api/@ohos.pasteboard.d.ts +++ b/api/@ohos.pasteboard.d.ts @@ -19,7 +19,6 @@ import image from './@ohos.multimedia.image'; /** * systemPasteboard * @syscap SystemCapability.MiscServices.Pasteboard - * @import import pasteboard from '@ohos.pasteboard'; */ declare namespace pasteboard { /** @@ -184,7 +183,7 @@ declare namespace pasteboard { LocalDevice, /** * CrossDevice indicates that paste in any app across devices is allowed. - * @since9 + * @since 9 */ CrossDevice } -- Gitee From d47fad25f0e7c616a07a9074a7b7c6de33b5755c Mon Sep 17 00:00:00 2001 From: wangdongqi Date: Tue, 22 Nov 2022 14:23:40 +0800 Subject: [PATCH 384/438] Signed-off-by: wangdongqi Changes to be committed: --- api/@ohos.screenLock.d.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/api/@ohos.screenLock.d.ts b/api/@ohos.screenLock.d.ts index 68d56d5320..5e9b6704c4 100644 --- a/api/@ohos.screenLock.d.ts +++ b/api/@ohos.screenLock.d.ts @@ -59,7 +59,7 @@ declare namespace screenLock { function isSecure(): boolean; /** - * Unlocks the screen. + * Unlock the screen. * return - * @since 7 * @deprecated since 9 @@ -69,7 +69,7 @@ declare namespace screenLock { function unlockScreen():Promise; /** - * Unlocks the screen. Returns true if the screen unlocked successfully. returns false otherwise. + * Unlock the screen. Returns true if the screen unlocked successfully. returns false otherwise. * @returns { Promise } the Promise returned by the function. * @throws {BusinessError} 401 - parameter error. * @since 9 @@ -95,8 +95,8 @@ declare namespace screenLock { } /** - * Register system event related to syscreen lock. Returns true if register system event is success. returns false otherwise. - * @params callback The callback function for indcating the system event related screen lock + * Register system event related to sysscreen lock. Returns true if register system event is success. returns false otherwise. + * @params callback The callback function for indicating the system event related screen lock * @returns { boolean } the boolean returned by the function. * @throws {BusinessError} 401 - parameter error. * @systemapi Hide this for inner system use. @@ -105,7 +105,7 @@ declare namespace screenLock { function onSystemEvent(callback: Callback): boolean; /** - * screenlockAPP send event to screenlockSA. + * The screen lock app sends the event to the screen lock service. * @params parameter The params of the event. * @throws {BusinessError} 401 - parameter error. * @systemapi Hide this for inner system use. -- Gitee From 9c24132bdc60cdd93f52e0a5c06c29e7f2f26671 Mon Sep 17 00:00:00 2001 From: li-yaoyao777 Date: Tue, 22 Nov 2022 14:26:43 +0800 Subject: [PATCH 385/438] =?UTF-8?q?=E6=95=B4=E6=94=B9api=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-yaoyao777 --- api/@ohos.sensor.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/@ohos.sensor.d.ts b/api/@ohos.sensor.d.ts index 24aef957af..4411e8cdda 100644 --- a/api/@ohos.sensor.d.ts +++ b/api/@ohos.sensor.d.ts @@ -1525,8 +1525,8 @@ declare namespace sensor { hardwareVersion:string; /**< Sensor hardware version */ sensorId:number; /**< Sensor type ID, {@code SensorType} */ maxRange:number; /**< Maximum measurement range of the sensor */ - minSamplePeriod; /**< Minimum sample period allowed, in ns */ - maxSamplePeriod; /**< maximum sample period allowed, in ns */ + minSamplePeriod:number; /**< Minimum sample period allowed, in ns */ + maxSamplePeriod:number; /**< maximum sample period allowed, in ns */ precision:number; /**< Sensor accuracy */ power:number; /**< Sensor power */ } @@ -1874,7 +1874,7 @@ declare namespace sensor { * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 - * @useinstead sensor#event:SensorId + * @useinstead sensor.SensorId */ enum SensorType { SENSOR_TYPE_ID_ACCELEROMETER = 1, /**< Acceleration sensor */ -- Gitee From 6b7a525c9f6e363156d467be10ca59da4ad2bd05 Mon Sep 17 00:00:00 2001 From: li-yaoyao777 Date: Tue, 22 Nov 2022 15:08:43 +0800 Subject: [PATCH 386/438] =?UTF-8?q?=E6=95=B4=E6=94=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BB=93=E6=9E=84=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-yaoyao777 --- api/@system.sensor.d.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/api/@system.sensor.d.ts b/api/@system.sensor.d.ts index 4d7b4c23b4..7fa83909e0 100644 --- a/api/@system.sensor.d.ts +++ b/api/@system.sensor.d.ts @@ -18,7 +18,7 @@ * @permission ohos.permission.ACCELEROMETER * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#ACCELEROMETER + * @useinstead ohos.sensor/sensor.AccelerometerResponse */ export interface AccelerometerResponse { /** @@ -76,7 +76,7 @@ export interface subscribeAccelerometerOptions { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#getGeomagneticInfo + * @useinstead ohos.sensor/sensor.MagneticFieldResponse */ export interface CompassResponse { /** @@ -90,7 +90,7 @@ export interface CompassResponse { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#event:SensorId.getGeomagneticInfo + * @useinstead ohos.sensor/sensor#event:SensorId.MAGNETIC_FIELD */ export interface SubscribeCompassOptions { /** @@ -110,7 +110,7 @@ export interface SubscribeCompassOptions { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#PROXIMITY + * @useinstead ohos.sensor/sensor.ProximityResponse */ export interface ProximityResponse { /** @@ -144,7 +144,7 @@ export interface SubscribeProximityOptions { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#AMBIENT_LIGHT + * @useinstead ohos.sensor/sensor.LightResponse */ export interface LightResponse { /** @@ -179,7 +179,7 @@ export interface SubscribeLightOptions { * @permission ohos.permission.ACTIVITY_MOTION * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#PEDOMETER + * @useinstead ohos.sensor/sensor.PedometerResponse */ export interface StepCounterResponse { /** @@ -215,7 +215,7 @@ export interface SubscribeStepCounterOptions { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#BAROMETER + * @useinstead ohos.sensor/sensor.BarometerResponse */ export interface BarometerResponse { /** @@ -250,7 +250,7 @@ export interface SubscribeBarometerOptions { * @permission ohos.permission.READ_HEALTH_DATA * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#HEART_RATE + * @useinstead ohos.sensor/sensor.HeartRateResponse */ export interface HeartRateResponse { /** @@ -286,7 +286,7 @@ export interface SubscribeHeartRateOptions { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#WEAR_DETECTION + * @useinstead ohos.sensor/sensor.WearDetectionResponse */ export interface OnBodyStateResponse { /** @@ -345,7 +345,7 @@ export interface GetOnBodyStateOptions { * @syscap SystemCapability.Sensors.Sensor * @since 6 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#ORIENTATION + * @useinstead ohos.sensor/sensor.OrientationResponse */ export interface DeviceOrientationResponse { /** @@ -403,7 +403,7 @@ export interface SubscribeDeviceOrientationOptions { * @permission ohos.permission.GYROSCOPE * @since 6 * @deprecated since 8 - * @useinstead ohos.sensor/sensor#GYROSCOPE + * @useinstead ohos.sensor/sensor#.GyroscopeResponse */ export interface GyroscopeResponse { /** -- Gitee From b5efd98b77228792afdfaa71de392bfc411dc276 Mon Sep 17 00:00:00 2001 From: li-yaoyao777 Date: Tue, 22 Nov 2022 15:41:54 +0800 Subject: [PATCH 387/438] =?UTF-8?q?=E6=95=B4=E6=94=B9ts=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=89=AB=E6=8F=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-yaoyao777 --- api/@system.sensor.d.ts | 1 + api/@system.vibrator.d.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/api/@system.sensor.d.ts b/api/@system.sensor.d.ts index 7fa83909e0..315ccc2188 100644 --- a/api/@system.sensor.d.ts +++ b/api/@system.sensor.d.ts @@ -627,6 +627,7 @@ export default class Sensor { * @syscap SystemCapability.Sensors.Sensor * @since 3 * @deprecated since 8 + * @useinstead ohos.sensor/sensor#event:SensorId.WEAR_DETECTION */ static unsubscribeOnBodyState(): void; diff --git a/api/@system.vibrator.d.ts b/api/@system.vibrator.d.ts index b201f04f69..864ed279fe 100644 --- a/api/@system.vibrator.d.ts +++ b/api/@system.vibrator.d.ts @@ -18,7 +18,7 @@ * @permission ohos.permission.VIBRATE * @since 3 * @deprecated since 8 - * @useinstead ohos.vibrator/vibrator.EffectId + * @useinstead ohos.vibrator/vibrator.VibrateTime */ export interface VibrateOptions { /** -- Gitee From 1ee40449a1d8304e17a75bb4714786f6bd4a6d47 Mon Sep 17 00:00:00 2001 From: jackd320 Date: Tue, 22 Nov 2022 07:43:44 +0000 Subject: [PATCH 388/438] Signed-off-by: jackd320 Signed-off-by: jackd320 --- api/@ohos.update.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api/@ohos.update.d.ts b/api/@ohos.update.d.ts index be59bd960a..7c0c767c00 100644 --- a/api/@ohos.update.d.ts +++ b/api/@ohos.update.d.ts @@ -231,6 +231,7 @@ declare namespace update { * Subscribe task update events * * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ @@ -240,6 +241,7 @@ declare namespace update { * Unsubscribe task update events * * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ @@ -279,6 +281,7 @@ declare namespace update { * * @permission ohos.permission.UPDATE_SYSTEM * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ @@ -291,6 +294,7 @@ declare namespace update { * * @permission ohos.permission.UPDATE_SYSTEM * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ @@ -310,6 +314,7 @@ declare namespace update { * Unsubscribe task update events * * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 401 - Parameter error. * @throws { BusinessError } 11500104 - IPC error. * @since 9 */ -- Gitee From 0ce91423bacbe7024c78200f8148f6a0c2d51012 Mon Sep 17 00:00:00 2001 From: aqxyjay Date: Tue, 22 Nov 2022 15:35:04 +0800 Subject: [PATCH 389/438] docs: fix typo Signed-off-by: aqxyjay --- api/@ohos.batteryInfo.d.ts | 2 +- api/@ohos.batteryStatistics.d.ts | 2 +- api/@system.brightness.d.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/@ohos.batteryInfo.d.ts b/api/@ohos.batteryInfo.d.ts index 108844a7a1..30342e91e0 100644 --- a/api/@ohos.batteryInfo.d.ts +++ b/api/@ohos.batteryInfo.d.ts @@ -209,7 +209,7 @@ declare namespace batteryInfo { */ export enum BatteryCapacityLevel { /** - * The battery is in unknow capacity level. + * The battery is in unknown capacity level. * @since 9 */ LEVEL_NONE, diff --git a/api/@ohos.batteryStatistics.d.ts b/api/@ohos.batteryStatistics.d.ts index a3b0b0531f..84ca2603a2 100755 --- a/api/@ohos.batteryStatistics.d.ts +++ b/api/@ohos.batteryStatistics.d.ts @@ -138,7 +138,7 @@ declare namespace batteryStats { /** The type related with the power consumption info. */ type: ConsumptionType; - /** The power consumption value(mah). */ + /** The power consumption value(Mah). */ power: number; } } diff --git a/api/@system.brightness.d.ts b/api/@system.brightness.d.ts index 806775ade8..055ed06fc5 100755 --- a/api/@system.brightness.d.ts +++ b/api/@system.brightness.d.ts @@ -249,7 +249,7 @@ export default class Brightness { static setMode(options?: SetBrightnessModeOptions): void; /** - * Sets whether to always keey the screen on. + * Sets whether to always keep the screen on. * @param options Options. * @since 3 * @deprecated since 7 -- Gitee From deb586b0c2f362c693125caac8ff549a4f2ff483 Mon Sep 17 00:00:00 2001 From: wangdongqi Date: Tue, 22 Nov 2022 15:52:27 +0800 Subject: [PATCH 390/438] Signed-off-by: wangdongqi Changes to be committed: --- api/@ohos.screenLock.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/@ohos.screenLock.d.ts b/api/@ohos.screenLock.d.ts index 5e9b6704c4..b6088367ad 100644 --- a/api/@ohos.screenLock.d.ts +++ b/api/@ohos.screenLock.d.ts @@ -96,7 +96,7 @@ declare namespace screenLock { /** * Register system event related to sysscreen lock. Returns true if register system event is success. returns false otherwise. - * @params callback The callback function for indicating the system event related screen lock + * @param { Callback } callback - the callback function for indicating the system event related screen lock * @returns { boolean } the boolean returned by the function. * @throws {BusinessError} 401 - parameter error. * @systemapi Hide this for inner system use. @@ -106,7 +106,8 @@ declare namespace screenLock { /** * The screen lock app sends the event to the screen lock service. - * @params parameter The params of the event. + * @param { String } event - event type. + * @param { number } parameter - operation result of the event. * @throws {BusinessError} 401 - parameter error. * @systemapi Hide this for inner system use. * @since 9 -- Gitee From b3f4211ac4bb8ba49d66985195ee8bfa306bb253 Mon Sep 17 00:00:00 2001 From: li-yaoyao777 Date: Tue, 22 Nov 2022 17:30:40 +0800 Subject: [PATCH 391/438] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E8=AF=AF=E5=88=A0?= =?UTF-8?q?=E7=A9=BA=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: li-yaoyao777 --- api/@system.sensor.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/api/@system.sensor.d.ts b/api/@system.sensor.d.ts index 315ccc2188..8ffdfe5624 100644 --- a/api/@system.sensor.d.ts +++ b/api/@system.sensor.d.ts @@ -328,6 +328,7 @@ export interface GetOnBodyStateOptions { * @since 3 */ success: (data: OnBodyStateResponse) => void; + /** * Called when the sensor wearing state fails to be obtained * @since 3 -- Gitee From 49b63fe3739b9b48f0c1dc0745f105889ac2416b Mon Sep 17 00:00:00 2001 From: summer8999 Date: Wed, 23 Nov 2022 18:04:44 +0800 Subject: [PATCH 392/438] modify api comments Signed-off-by: summer8999 --- api/@ohos.distributedHardware.deviceManager.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.distributedHardware.deviceManager.d.ts b/api/@ohos.distributedHardware.deviceManager.d.ts index f388aecaef..02aacbe0c6 100644 --- a/api/@ohos.distributedHardware.deviceManager.d.ts +++ b/api/@ohos.distributedHardware.deviceManager.d.ts @@ -53,7 +53,7 @@ declare namespace deviceManager { /** * @since 9 - * The distance of dicovered device, in centimeters(cm). + * The distance of discovered device, in centimeter(cm). */ range: number; } @@ -192,7 +192,7 @@ declare namespace deviceManager { freq: ExchangeFreq; /** - * Whether the device should be ranged by discoverers. + * Whether the device should be ranged by discoverer. */ ranging : boolean; } -- Gitee From 3103fc45be12fec5e5083ac4ada877fe00728201 Mon Sep 17 00:00:00 2001 From: leafly2021 Date: Thu, 24 Nov 2022 10:08:04 +0800 Subject: [PATCH 393/438] modify window misspell Signed-off-by: leafly2021 Change-Id: Ieb6f2982992c6d7b2bbcd6c687399306af7b974c --- api/@ohos.screen.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.screen.d.ts b/api/@ohos.screen.d.ts index a9da9f6452..649236ac4b 100644 --- a/api/@ohos.screen.d.ts +++ b/api/@ohos.screen.d.ts @@ -240,7 +240,7 @@ declare namespace screen { } /** - * The infomation of the screen + * The information of the screen * @syscap SystemCapability.WindowManager.WindowManager.Core * @since 9 */ -- Gitee From ea81ead610025e80670636521229f6f8b6721736 Mon Sep 17 00:00:00 2001 From: xuyong Date: Thu, 24 Nov 2022 10:46:59 +0800 Subject: [PATCH 394/438] =?UTF-8?q?DFT=20d.ts=E6=96=87=E6=A1=A3=E6=B3=A8?= =?UTF-8?q?=E8=A7=A3=E6=A0=87=E7=AD=BE=E8=A7=84=E8=8C=83=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xuyong --- api/@ohos.hiAppEvent.d.ts | 6 +++--- api/@ohos.hiSysEvent.d.ts | 17 ++++++++--------- api/@ohos.hiTraceChain.d.ts | 10 +++++----- api/@ohos.hiviewdfx.hiAppEvent.d.ts | 6 +++--- 4 files changed, 19 insertions(+), 20 deletions(-) diff --git a/api/@ohos.hiAppEvent.d.ts b/api/@ohos.hiAppEvent.d.ts index b62cf6f34a..96446e5bc5 100644 --- a/api/@ohos.hiAppEvent.d.ts +++ b/api/@ohos.hiAppEvent.d.ts @@ -140,7 +140,7 @@ declare namespace hiAppEvent { * @param {EventType} eventType Application event type. * @param {object} keyValues Application event key-value pair params. * @param {AsyncCallback} [callback] Callback function. - * @return {void | Promise} No callback return Promise otherwise return void. + * @returns {void | Promise} No callback return Promise otherwise return void. */ function write(eventName: string, eventType: EventType, keyValues: object): Promise; function write(eventName: string, eventType: EventType, keyValues: object, callback: AsyncCallback): void; @@ -152,7 +152,7 @@ declare namespace hiAppEvent { * @syscap SystemCapability.HiviewDFX.HiAppEvent * @static * @param {ConfigOption} config Application event logging configuration item object. - * @return {boolean} Configuration result. + * @returns {boolean} Configuration result. */ function configure(config: ConfigOption): boolean; @@ -181,4 +181,4 @@ declare namespace hiAppEvent { } } -export default hiAppEvent; \ No newline at end of file +export default hiAppEvent; diff --git a/api/@ohos.hiSysEvent.d.ts b/api/@ohos.hiSysEvent.d.ts index 625d69b69f..cbda18a429 100644 --- a/api/@ohos.hiSysEvent.d.ts +++ b/api/@ohos.hiSysEvent.d.ts @@ -22,7 +22,6 @@ import { AsyncCallback } from './basic'; * * @syscap SystemCapability.HiviewDFX.HiSysEvent * @systemapi hide for inner use - * @import import hiSysEvent from '@ohos.hiSysEvent' * @since 9 */ declare namespace hiSysEvent { @@ -119,7 +118,7 @@ declare namespace hiSysEvent { * @throws {BusinessError} 11200052 - Size of the event parameter of the string type is over limit. * @throws {BusinessError} 11200053 - Count of event parameters is over limit. * @throws {BusinessError} 11200054 - Count of event parameter of the array type is over limit. - * @return {void | Promise} no callback return Promise otherwise return void. + * @returns {void | Promise} no callback return Promise otherwise return void. * @since 9 */ function write(info: SysEventInfo): Promise; @@ -211,7 +210,7 @@ declare namespace hiSysEvent { * @syscap SystemCapability.HiviewDFX.HiSysEvent * @systemapi hide for inner use * @param {SysEventInfo} info system event information of receive. - * @return {void} return void. + * @returns {void} return void. * @since 9 */ onEvent: (info: SysEventInfo) => void; @@ -221,7 +220,7 @@ declare namespace hiSysEvent { * * @syscap SystemCapability.HiviewDFX.HiSysEvent * @systemapi hide for inner use - * @return {void} return void. + * @returns {void} return void. * @since 9 */ onServiceDied: () => void; @@ -286,7 +285,7 @@ declare namespace hiSysEvent { * @syscap SystemCapability.HiviewDFX.HiSysEvent * @systemapi hide for inner use * @param {SysEventInfo[]} infos system event information of query result. - * @return {void} return void. + * @returns {void} return void. * @since 9 */ onQuery: (infos: SysEventInfo[]) => void; @@ -298,7 +297,7 @@ declare namespace hiSysEvent { * @systemapi hide for inner use * @param {number} reason 0 success, 1 fail. * @param {number} total the total number of query result. - * @return {void} return void. + * @returns {void} return void. * @since 9 */ onComplete: (reason: number, total: number) => void; @@ -315,7 +314,7 @@ declare namespace hiSysEvent { * @throws {BusinessError} 401 - Invalid argument. * @throws {BusinessError} 11200101 - Count of watchers is over limit. * @throws {BusinessError} 11200102 - Count of watch rules is over limit. - * @return {void} return void. + * @returns {void} return void. * @since 9 */ function addWatcher(watcher: Watcher): void; @@ -330,7 +329,7 @@ declare namespace hiSysEvent { * @throws {BusinessError} 201 - Permission denied. An attempt was made to read system event forbidden by permission: ohos.permission.READ_DFX_SYSEVENT. * @throws {BusinessError} 401 - Invalid argument. * @throws {BusinessError} 11200201 - The watcher does not exist. - * @return {void} return void. + * @returns {void} return void. * @since 9 */ function removeWatcher(watcher: Watcher): void; @@ -350,7 +349,7 @@ declare namespace hiSysEvent { * @throws {BusinessError} 11200302 - Invalid query rule. * @throws {BusinessError} 11200303 - Count of concurrent queriers is over limit. * @throws {BusinessError} 11200304 - Query frequency is over limit. - * @return {void} return void. + * @returns {void} return void. * @since 9 */ function query(queryArg: QueryArg, rules: QueryRule[], querier: Querier): void; diff --git a/api/@ohos.hiTraceChain.d.ts b/api/@ohos.hiTraceChain.d.ts index 30d805b372..4c0150cb7d 100644 --- a/api/@ohos.hiTraceChain.d.ts +++ b/api/@ohos.hiTraceChain.d.ts @@ -152,7 +152,7 @@ declare namespace hiTraceChain { * @syscap SystemCapability.HiviewDFX.HiTrace * @param {string} name Process name. * @param {number} flags Trace function flag. - * @return {HiTraceId} Valid if first call, otherwise invalid. + * @returns {HiTraceId} Valid if first call, otherwise invalid. */ function begin(name: string, flags?: number): HiTraceId; @@ -172,7 +172,7 @@ declare namespace hiTraceChain { * * @since 8 * @syscap SystemCapability.HiviewDFX.HiTrace - * @return {HiTraceId} Valid if current thread have a trace id, otherwise invalid. + * @returns {HiTraceId} Valid if current thread have a trace id, otherwise invalid. */ function getId(): HiTraceId; @@ -198,7 +198,7 @@ declare namespace hiTraceChain { * * @since 8 * @syscap SystemCapability.HiviewDFX.HiTrace - * @return {HiTraceId} A valid span trace id. Otherwise trace id of current thread if do not allow create span. + * @returns {HiTraceId} A valid span trace id. Otherwise trace id of current thread if do not allow create span. */ function createSpan(): HiTraceId; @@ -220,7 +220,7 @@ declare namespace hiTraceChain { * @since 8 * @syscap SystemCapability.HiviewDFX.HiTrace * @param {HiTraceId} id Trace id that need to judge. - * @return {boolean} True for a valid trace id, otherwise false. + * @returns {boolean} True for a valid trace id, otherwise false. */ function isValid(id: HiTraceId): boolean; @@ -231,7 +231,7 @@ declare namespace hiTraceChain { * @syscap SystemCapability.HiviewDFX.HiTrace * @param {HiTraceId} id Trace id that need to judge. * @param {HiTraceFlag} flag Trace flag that need to judge. - * @return {boolean} true if the trace id has enabled the flag. + * @returns {boolean} true if the trace id has enabled the flag. */ function isFlagEnabled(id: HiTraceId, flag: HiTraceFlag): boolean; diff --git a/api/@ohos.hiviewdfx.hiAppEvent.d.ts b/api/@ohos.hiviewdfx.hiAppEvent.d.ts index 9d9df9602c..a856daee9b 100644 --- a/api/@ohos.hiviewdfx.hiAppEvent.d.ts +++ b/api/@ohos.hiviewdfx.hiAppEvent.d.ts @@ -272,7 +272,7 @@ declare namespace hiAppEvent { * * @since 9 * @syscap SystemCapability.HiviewDFX.HiAppEvent - * @return {AppEventPackage} The read event package. + * @returns {AppEventPackage} The read event package. */ takeNext(): AppEventPackage; } @@ -353,7 +353,7 @@ declare namespace hiAppEvent { * @syscap SystemCapability.HiviewDFX.HiAppEvent * @static * @param {Watcher} watcher Watcher object for monitoring events. - * @return {AppEventPackageHolder} Holder object, which is used to read the monitoring data of the watcher. + * @returns {AppEventPackageHolder} Holder object, which is used to read the monitoring data of the watcher. * @throws {BusinessError} 401 - Parameter error. * @throws {BusinessError} 11102001 - Invalid watcher name. * @throws {BusinessError} 11102002 - Invalid filtering event domain. @@ -385,4 +385,4 @@ declare namespace hiAppEvent { function clearData(): void; } -export default hiAppEvent; \ No newline at end of file +export default hiAppEvent; -- Gitee From b21051b8a50d1e367b699ac4b9141a6800b28b4d Mon Sep 17 00:00:00 2001 From: hw-wLiu Date: Thu, 24 Nov 2022 02:58:58 +0000 Subject: [PATCH 395/438] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: hw-wLiu --- api/@ohos.hichecker.d.ts | 6 +++--- api/@ohos.hidebug.d.ts | 28 ++++++++++++++-------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/api/@ohos.hichecker.d.ts b/api/@ohos.hichecker.d.ts index 55293cb08c..d35c364c5e 100644 --- a/api/@ohos.hichecker.d.ts +++ b/api/@ohos.hichecker.d.ts @@ -73,7 +73,7 @@ declare namespace hichecker { /** * get added rule - * @return all added thread rule and process rule. + * @returns all added thread rule and process rule. * @since 8 * @syscap SystemCapability.HiviewDFX.HiChecker */ @@ -82,7 +82,7 @@ declare namespace hichecker { /** * whether the query rule is added * @param rule - * @return the result of whether the query rule is added. + * @returns the result of whether the query rule is added. * @since 8 * @deprecated since 9 * @useinstead ohos.hichecker/hichecker#containsCheckRule @@ -111,7 +111,7 @@ declare namespace hichecker { /** * Whether the query rule is added * @param rule - * @return the result of whether the query rule is added. + * @returns the result of whether the query rule is added. * @since 9 * @syscap SystemCapability.HiviewDFX.HiChecker * @throws { BusinessError } 401 - the parameter check failed diff --git a/api/@ohos.hidebug.d.ts b/api/@ohos.hidebug.d.ts index cd2f7bba54..6eea60cce9 100644 --- a/api/@ohos.hidebug.d.ts +++ b/api/@ohos.hidebug.d.ts @@ -25,7 +25,7 @@ declare namespace hidebug { /** * Get total native heap memory size * @param - - * @return Returns total native heap memory size. + * @returns Returns total native heap memory size. * @since 8 * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug */ @@ -34,7 +34,7 @@ declare namespace hidebug { /** * Get Native heap memory allocation size. * @param - - * @return Returns native heap memory allocation size. + * @returns Returns native heap memory allocation size. * @since 8 * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug */ @@ -43,7 +43,7 @@ declare namespace hidebug { /** * Get Native heap memory free size * @param - - * @return Returns native heap memory free size. + * @returns Returns native heap memory free size. * @since 8 * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug */ @@ -52,7 +52,7 @@ declare namespace hidebug { /** * Get application process proportional set size memory information * @param - - * @return Returns application process proportional set size memory information. + * @returns Returns application process proportional set size memory information. * @since 8 * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug */ @@ -61,7 +61,7 @@ declare namespace hidebug { /** * Obtains the size of the shared dirty memory of a process. * @param - - * @return Returns the size of the shared dirty memory. + * @returns Returns the size of the shared dirty memory. * @since 8 * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug */ @@ -70,7 +70,7 @@ declare namespace hidebug { /** * Obtains the size of the private dirty memory of a process. * @param - - * @return Returns the size of the private dirty memory. + * @returns Returns the size of the private dirty memory. * @since 9 * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug */ @@ -79,7 +79,7 @@ declare namespace hidebug { /** * Obtains the cpu usage percent of a process. * @param - - * @return Returns the cpu usage of a process. + * @returns Returns the cpu usage of a process. * @since 9 * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug */ @@ -92,7 +92,7 @@ declare namespace hidebug { * Such as "/data/accounts/account_0/appdata/[package name]/files/cpuprofiler-xxx.json" * * @param filename Indicates the user-defined file name, excluding the file suffix. - * @return - + * @returns - * @since 8 * @deprecated since 9 * @useinstead ohos.hidebug/hidebug.startJsCpuProfiling @@ -105,7 +105,7 @@ declare namespace hidebug { * It takes effect only when the CPU profiler is turned on * * @param - - * @return - + * @returns - * @since 8 * @deprecated since 9 * @useinstead ohos.hidebug/hidebug.stopJsCpuProfiling @@ -120,7 +120,7 @@ declare namespace hidebug { * Such as "/data/accounts/account_0/appdata/[package name]/files/xxx.heapsnapshot" * * @param filename Indicates the user-defined file name, excluding the file suffix. - * @return - + * @returns - * @since 8 * @deprecated since 9 * @useinstead ohos.hidebug/hidebug.dumpJsHeapData @@ -135,7 +135,7 @@ declare namespace hidebug { * * @param filename Indicates the user-defined file name, excluding the file suffix. * @throws {BusinessError} 401 - the parameter check failed - * @return - + * @returns - * @since 9 * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug */ @@ -146,7 +146,7 @@ declare namespace hidebug { * It takes effect only when the CPU profiler is turned on * * @param - - * @return - + * @returns - * @since 9 * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug */ @@ -159,7 +159,7 @@ declare namespace hidebug { * * @param filename Indicates the user-defined file name, excluding the file suffix. * @throws {BusinessError} 401 - the parameter check failed - * @return - + * @returns - * @since 9 * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug */ @@ -174,7 +174,7 @@ declare namespace hidebug { * @param args The args list of the system ability dump interface. * @throws {BusinessError} 401 - the parameter check failed * @throws {BusinessError} 11400101 - the service id is invalid - * @return - + * @returns - * @permission ohos.permission.DUMP * @since 9 * @syscap SystemCapability.HiviewDFX.HiProfiler.HiDebug -- Gitee From 3cfcd03281b34ef46ff0844ad75be3a72a3f1e80 Mon Sep 17 00:00:00 2001 From: donglin Date: Thu, 24 Nov 2022 10:52:19 +0800 Subject: [PATCH 396/438] fix Signed-off-by: donglin Change-Id: Id5871bfc53382c55596eea16516ac90eaf724434 --- api/@ohos.app.ability.appRecovery.d.ts | 1 - api/app/context.d.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/api/@ohos.app.ability.appRecovery.d.ts b/api/@ohos.app.ability.appRecovery.d.ts index 28446ddd73..1416c6a89f 100644 --- a/api/@ohos.app.ability.appRecovery.d.ts +++ b/api/@ohos.app.ability.appRecovery.d.ts @@ -15,7 +15,6 @@ /** * This module provides the capability to app receovery. - * @import appRecovery from '@ohos.app.ability.appRecovery' * @syscap SystemCapability.Ability.AbilityRuntime.Core * @since 9 */ diff --git a/api/app/context.d.ts b/api/app/context.d.ts index 6cbdd0a621..41644a838e 100644 --- a/api/app/context.d.ts +++ b/api/app/context.d.ts @@ -31,7 +31,6 @@ import bundle from '../@ohos.bundle'; * * @since 6 * @syscap SystemCapability.Ability.AbilityRuntime.Core - * @import import abilityManager from 'app/context' * @permission N/A * @FAModelOnly */ -- Gitee From 6dca99f9121da0a153778faacbcb6c823559006d Mon Sep 17 00:00:00 2001 From: winnie-hu Date: Thu, 24 Nov 2022 11:16:08 +0800 Subject: [PATCH 397/438] fix API notes check problems Signed-off-by: winnie-hu --- api/@ohos.security.cryptoFramework.d.ts | 476 +++++++++++------------- 1 file changed, 207 insertions(+), 269 deletions(-) diff --git a/api/@ohos.security.cryptoFramework.d.ts b/api/@ohos.security.cryptoFramework.d.ts index 69aab9025d..9660b0b325 100755 --- a/api/@ohos.security.cryptoFramework.d.ts +++ b/api/@ohos.security.cryptoFramework.d.ts @@ -13,15 +13,13 @@ * limitations under the License. */ - import {AsyncCallback, Callback} from './basic'; /** * Provides a set of encryption and decryption algorithm library framework, shields the underlying differences, - * encapsulates the relevant algorithm library, and provides a unified functional interface upward. + * encapsulate the relevant algorithm library, and provides a unified functional interface upward. * * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 */ declare namespace cryptoFramework { @@ -86,16 +84,30 @@ declare namespace cryptoFramework { ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE = 17630007, } + /** + * Provides the data blob type. + * @typedef DataBlob + * @syscap SystemCapability.Security.CryptoFramework + * @since 9 + */ interface DataBlob { data : Uint8Array; } + /** + * Provides the data array type. + * @typedef DataArray + * @syscap SystemCapability.Security.CryptoFramework + * @since 9 + */ interface DataArray { data : Array; } /** - * Enum for supported cert encoding format + * Enum for supported cert encoding format. + * @enum {number} + * @syscap SystemCapability.Security.CryptoFramework * @since 9 */ enum EncodingFormat { @@ -112,41 +124,68 @@ declare namespace cryptoFramework { FORMAT_PEM = 1, } + /** + * Provides the cert encoding blob type. + * @typedef EncodingBlob + * @syscap SystemCapability.Security.CryptoFramework + * @since 9 + */ interface EncodingBlob { data : Uint8Array; encodingFormat : EncodingFormat; } + /** + * Provides the cert chain data type. + * @typedef CertChainData + * @syscap SystemCapability.Security.CryptoFramework + * @since 9 + */ interface CertChainData { data: Uint8Array; count : number; encodingFormat: EncodingFormat; } + /** + * Provides the ParamsSpec type, including the algorithm name. + * @typedef ParamsSpec + * @syscap SystemCapability.Security.CryptoFramework + * @since 9 + */ interface ParamsSpec { /** * Indicates the algorithm name. - * * @syscap SystemCapability.Security.CryptoFramework * @since 9 */ algoName : string; } + /** + * Provides the IvParamsSpec type, including the parameter iv. + * @typedef IvParamsSpec + * @syscap SystemCapability.Security.CryptoFramework + * @since 9 + */ interface IvParamsSpec extends ParamsSpec { /** * Indicates the algorithm parameters such as iv. - * * @syscap SystemCapability.Security.CryptoFramework * @since 9 */ iv : DataBlob; } + /** + * Provides the GcmParamsSpec type, including the parameter iv, aad and authTag. + * @typedef GcmParamsSpec + * @syscap SystemCapability.Security.CryptoFramework + * @since 9 + */ interface GcmParamsSpec extends ParamsSpec { /** * Indicates the GCM algorithm parameters such as iv. - * * @syscap SystemCapability.Security.CryptoFramework * @since 9 */ @@ -154,7 +193,6 @@ declare namespace cryptoFramework { /** * Indicates the GCM additional message for integrity check. - * * @syscap SystemCapability.Security.CryptoFramework * @since 9 */ @@ -162,13 +200,18 @@ declare namespace cryptoFramework { /** * Indicates the GCM Authenticated Data. - * * @syscap SystemCapability.Security.CryptoFramework * @since 9 */ authTag : DataBlob; } + /** + * Provides the CcmParamsSpec type, including the parameter iv, aad and authTag. + * @typedef CcmParamsSpec + * @syscap SystemCapability.Security.CryptoFramework + * @since 9 + */ interface CcmParamsSpec extends ParamsSpec { /** * Indicates the GCM algorithm parameters such as iv. @@ -180,7 +223,6 @@ declare namespace cryptoFramework { /** * Indicates the CCM additional message for integrity check. - * * @syscap SystemCapability.Security.CryptoFramework * @since 9 */ @@ -188,7 +230,6 @@ declare namespace cryptoFramework { /** * Indicates the CCM Authenticated Data. - * * @syscap SystemCapability.Security.CryptoFramework * @since 9 */ @@ -215,17 +256,14 @@ declare namespace cryptoFramework { /** * The common parents class of key. - * * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 */ interface Key { /** - * Encode key Object to bin. - * + * Encode the key object to binary data. + * @returns { DataBlob } the binary data of the key object. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 */ getEncoded() : DataBlob; @@ -234,16 +272,13 @@ declare namespace cryptoFramework { * Key format. * * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 */ readonly format : string; /** * Key algorithm name. - * * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 */ readonly algName : string; @@ -254,56 +289,45 @@ declare namespace cryptoFramework { } /** - * The private key class of asy-key. + * The private key class of asymmetrical key. * * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 */ interface PriKey extends Key { /** * The function used to clear private key mem. - * * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 */ clearMem() : void; } /** - * The public key class of asy-key. - * + * The public key class of asymmetrical key. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 */ interface PubKey extends Key {} /** - * The keyPair class of asy-key. Include privateKey and publickey. - * + * The keyPair class of asymmetrical key. Include privateKey and publickey. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 */ interface KeyPair { /** * Public key. - * * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 */ readonly priKey : PriKey; /** * Private key. - * * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 */ readonly pubKey : PubKey; @@ -312,21 +336,20 @@ declare namespace cryptoFramework { interface Random { /** - * Generate radom DataBlob by given length - * + * Generate radom DataBlob by given length. + * @param len Indicates the length of random DataBlob. + * @returns Returns the generated random blob. * @syscap SystemCapability.Security.CryptoFramework * @since 9 - * @param len Indicates the length of random DataBlob */ generateRandom(len : number, callback: AsyncCallback) : void; generateRandom(len : number) : Promise; /** - * set seed by given DataBlob - * + * Set seed by given DataBlob. + * @param seed Indicates the seed DataBlob. * @syscap SystemCapability.Security.CryptoFramework * @since 9 - * @param seed Indicates the seed DataBlob */ setSeed(seed : DataBlob, callback : AsyncCallback) : void; setSeed(seed : DataBlob) : Promise; @@ -334,111 +357,135 @@ declare namespace cryptoFramework { /** * Provides the rand create func. - * + * @returns Returns the created rand instance. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns the rand create instance. */ function createRandom() : Random; /** - * The generator used to generate asy_key. - * + * The generator used to generate asymmetrical key. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 */ interface AsyKeyGenerator { /** - * Generate keyPair by init params. - * + * Used to generate asymetric key pair. + * @param { AsyncCallback } callback - the callback used to return keypair. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return The generated keyPair. */ generateKeyPair(callback : AsyncCallback) : void; generateKeyPair() : Promise; /** * Convert keyPair object from privateKey and publicKey binary data. - * - * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' - * @since 9 * @param pubKey The binary data of public key. * @param priKey The binary data of private key. - * @return The Converted key pair. + * @returns The Converted key pair. + * @syscap SystemCapability.Security.CryptoFramework + * @since 9 */ convertKey(pubKey : DataBlob, priKey : DataBlob, callback : AsyncCallback) : void; convertKey(pubKey : DataBlob, priKey : DataBlob) : Promise; /** - * The algorothm name of generator. - * + * The algorithm name of generator. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 */ readonly algName : string; } + /** + * Provides the SymKeyGenerator type, which is used for generating symmetric key. + * @typedef SymKeyGenerator + * @syscap SystemCapability.Security.CryptoFramework + * @since 9 + */ interface SymKeyGenerator { + /** + * Generate a symmetric key object randomly. + * @param { AsyncCallback } callback - the callback of generateSymKey. + * @syscap SystemCapability.Security.CryptoFramework + * @since 9 + */ generateSymKey(callback : AsyncCallback) : void; + + /** + * Generate a symmetric key object randomly. + * @returns { Promise } the promise returned by the function. + * @syscap SystemCapability.Security.CryptoFramework + * @since 9 + */ generateSymKey() : Promise; + + /** + * Generate a symmetric key object according to the provided binary key data. + * @param { AsyncCallback } callback - the callback of generateSymKey. + * @syscap SystemCapability.Security.CryptoFramework + * @since 9 + */ convertKey(key : DataBlob, callback : AsyncCallback) : void; + + /** + * Generate a symmetric key object according to the provided binary key data. + * @returns { Promise } the promise returned by the function. + * @syscap SystemCapability.Security.CryptoFramework + * @since 9 + */ convertKey(key : DataBlob) : Promise; + + /** + * Indicates the algorithm name of the SymKeyGenerator object. + * @type { string } + * @readonly + * @syscap SystemCapability.Security.CryptoFramework + * @since 9 + */ readonly algName : string; } /** - * Provides the asy key generator instance func. - * + * Provides the asymmetrical key generator instance func. + * @param algName This algName contains params of generateKeyPair, like bits, primes or ECC_curve; + * @returns The generator object. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @param algName This algName contains params of generateKeyPair, like bits, primes or ECC_curve; - * @return The generator object. */ function createAsyKeyGenerator(algName : string) : AsyKeyGenerator; /** * Provides the sym key generator instance func. - * + * @param algName Indicates the algorithm name. + * @returns Returns the sym key generator instance. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @param algName Indicates the algorithm name. - * @return Returns the sym key generator instance. */ function createSymKeyGenerator(algName : string) : SymKeyGenerator; interface Mac { /** * Init hmac with given SymKey - * + * @param key Indicates the SymKey * @syscap SystemCapability.Security.CryptoFramework * @since 9 - * @param key Indicates the SymKey */ init(key : SymKey, callback : AsyncCallback) : void; init(key : SymKey) : Promise; /** * Update hmac with DataBlob - * + * @param input Indicates the DataBlob * @syscap SystemCapability.Security.CryptoFramework * @since 9 - * @param input Indicates the DataBlob */ update(input : DataBlob, callback : AsyncCallback) : void; update(input : DataBlob) : Promise; /** * Output the result of hmac calculation - * * @syscap SystemCapability.Security.CryptoFramework * @since 9 */ @@ -447,7 +494,6 @@ declare namespace cryptoFramework { /** * Output the length of hmac result - * * @syscap SystemCapability.Security.CryptoFramework * @since 9 */ @@ -455,7 +501,6 @@ declare namespace cryptoFramework { /** * Indicates the algorithm name - * * @syscap SystemCapability.Security.CryptoFramework * @since 9 */ @@ -464,29 +509,25 @@ declare namespace cryptoFramework { /** * Provides the mac create func. - * + * @param algName Indicates the mac algorithm name. + * @returns Returns the mac create instance. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @param algName Indicates the mac algorithm name. - * @return Returns the mac create instance. */ function createMac(algName : string) : Mac; interface Md { /** * Update md with DataBlob - * + * @param input Indicates the DataBlob * @syscap SystemCapability.Security.CryptoFramework * @since 9 - * @param input Indicates the DataBlob */ update(input : DataBlob, callback : AsyncCallback) : void; update(input : DataBlob) : Promise; /** * Output the result of md calculation - * * @syscap SystemCapability.Security.CryptoFramework * @since 9 */ @@ -495,7 +536,6 @@ declare namespace cryptoFramework { /** * Output the length of md result - * * @syscap SystemCapability.Security.CryptoFramework * @since 9 */ @@ -503,7 +543,6 @@ declare namespace cryptoFramework { /** * Indicates the algorithm name - * * @syscap SystemCapability.Security.CryptoFramework * @since 9 */ @@ -512,41 +551,36 @@ declare namespace cryptoFramework { /** * Provides the md create func. - * + * @param algorithm Indicates the md algorithm. + * @returns Returns the md create instances. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @param algorithm Indicates the md algorithm. - * @return Returns the md create instances. */ function createMd(algName : string) : Md; interface Cipher { /** * Init cipher with given cipher mode, key and params. - * - * @syscap SystemCapability.Security.CryptoFramework - * @since 9 * @param opMode Indicates the cipher mode. - * @param key Indicates the SymKey or AsyKey. + * @param key Indicates the SymKey or asymmetrical key. * @param params Indicates the algorithm parameters such as IV. + * @syscap SystemCapability.Security.CryptoFramework + * @since 9 */ init(opMode : CryptoMode, key : Key, params : ParamsSpec, callback : AsyncCallback) : void; init(opMode : CryptoMode, key : Key, params : ParamsSpec) : Promise; /** * Update cipher with DataBlob. - * + * @param input Indicates the DataBlob * @syscap SystemCapability.Security.CryptoFramework * @since 9 - * @param input Indicates the DataBlob */ update(data : DataBlob, callback : AsyncCallback) : void; update(data : DataBlob) : Promise; /** * Output the result of cipher calculation. - * * @syscap SystemCapability.Security.CryptoFramework * @since 9 */ @@ -555,7 +589,6 @@ declare namespace cryptoFramework { /** * Indicates the algorithm name. - * * @syscap SystemCapability.Security.CryptoFramework * @since 9 */ @@ -564,139 +597,130 @@ declare namespace cryptoFramework { /** * Provides the cipher create func. - * + * @param transformation Indicates the transform type, and contains init params of cipher. + * @returns Returns the cipher create instance. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @param transformation Indicates the transform type, and contains init params of cipher. - * @return Returns the cipher create instance. */ function createCipher(transformation : string) : Cipher; /** * The sign class - * * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 */ interface Sign { /** * This init function used to Initialize environment, must be invoked before update and sign. - * + * @param priKey The prikey object. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @param priKey The prikey object. */ init(priKey : PriKey, callback : AsyncCallback) : void; init(priKey : PriKey) : Promise; /** * This function used to update data. - * + * @param data The data need to update. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @param data The data need to update. */ update(data : DataBlob, callback : AsyncCallback) : void; update(data : DataBlob) : Promise; /** * This function used to sign all data. - * + * @param data The data need to update. + * @returns The sign data. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @param data The data need to update. - * @return The sign data. */ sign(data : DataBlob, callback : AsyncCallback) : void; sign(data : DataBlob) : Promise; + + /** + * The sign algName. + * @type { string } + * @syscap SystemCapability.Security.CryptoFramework. + * @readonly + * @since 9 + */ readonly algName : string; } /** * The verify class - * * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 */ interface Verify { /** * This init function used to Initialize environment, must be invoked before update and verify. - * + * @param priKey The prikey object. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @param priKey The prikey object. */ init(pubKey : PubKey, callback : AsyncCallback) : void; init(pubKey : PubKey) : Promise; /** * This function used to update data. - * + * @param data The data need to update. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @param data The data need to update. */ update(data : DataBlob, callback : AsyncCallback) : void; update(data : DataBlob) : Promise; /** * This function used to sign all data. - * - * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' - * @since 9 * @param data The data need to update. * @param signatureData The sign data. - * @return true means verify success. + * @returns true means verify success. + * @syscap SystemCapability.Security.CryptoFramework + * @since 9 */ verify(data : DataBlob, signatureData : DataBlob, callback : AsyncCallback) : void; verify(data : DataBlob, signatureData : DataBlob) : Promise; + + /** + * Indicates the verify algorithm name. + * @type { string } + * @readonly + * @syscap SystemCapability.Security.CryptoFramework + * @since 9 + */ readonly algName : string; } /** * Provides the sign func. - * + * @param algName Indicates the sign algorithm name, include init detail params. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @param algName Indicates the sign algorithm name, include init detail params. */ function createSign(algName : string) : Sign; /** * Provides the verify func. - * + * @param algName Indicates the verify algorithm name, include init detail params. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @param algName Indicates the verify algorithm name, include init detail params. */ function createVerify(algName : string) : Verify; interface KeyAgreement { /** * Generate secret by init params. - * + * @returns The generated secret. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return The generated secret. */ generateSecret(priKey : PriKey, pubKey : PubKey, callback : AsyncCallback) : void; generateSecret(priKey : PriKey, pubKey : PubKey) : Promise; /** * Indicates the algorithm name - * * @syscap SystemCapability.Security.CryptoFramework * @since 9 */ @@ -707,7 +731,6 @@ declare namespace cryptoFramework { * Provides the key agree func. * * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 * @param algName Indicates the key agreement algorithm name. */ @@ -716,207 +739,167 @@ declare namespace cryptoFramework { interface X509Cert { /** * Verify the X509 cert. - * + * @param key Indicates the cert chain validator data. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @param key Indicates the cert chain validator data. */ verify(key : PubKey, callback : AsyncCallback) : void; verify(key : PubKey) : Promise; /** * Get X509 cert encoded data. - * + * @returns Returns X509 cert encoded data. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns X509 cert encoded data. */ getEncoded(callback : AsyncCallback) : void; getEncoded() : Promise; /** * Get X509 cert public key. - * + * @returns Returns X509 cert pubKey. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns X509 cert pubKey. */ getPublicKey(callback : AsyncCallback) : void; getPublicKey() : Promise; /** * Check the X509 cert validity with date. - * + * @param date Indicates the cert date. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @param date Indicates the cert date. */ checkValidityWithDate(date: string, callback : AsyncCallback) : void; checkValidityWithDate(date: string) : Promise; /** * Get X509 cert version. - * + * @returns Returns X509 cert version. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns X509 cert version. */ getVersion() : number; /** * Get X509 cert serial number. - * + * @returns Returns X509 cert serial number. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns X509 cert serial number. */ getSerialNumber() : number; /** * Get X509 cert issuer name. - * + * @returns Returns X509 cert issuer name. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns X509 cert issuer name. */ getIssuerName() : DataBlob; /** * Get X509 cert subject name. - * + * @returns Returns X509 cert subject name. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns X509 cert subject name. */ getSubjectName() : DataBlob; /** * Get X509 cert not before time. - * + * @returns Returns X509 cert not before time. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns X509 cert not before time. */ getNotBeforeTime() : string; /** * Get X509 cert not after time. - * + * @returns Returns X509 cert not after time. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns X509 cert not after time. */ getNotAfterTime() : string; /** * Get X509 cert signature. - * + * @returns Returns X509 cert signature. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns X509 cert signature. */ getSignature() : DataBlob; /** * Get X509 cert signature's algorithm name. - * + * @returns Returns X509 cert signature's algorithm name. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns X509 cert signature's algorithm name. */ getSignatureAlgName() : string; /** * Get X509 cert signature's algorithm oid. - * + * @returns Returns X509 cert signature's algorithm oid. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns X509 cert signature's algorithm oid. */ getSignatureAlgOid() : string; /** * Get X509 cert signature's algorithm name. - * + * @returns Returns X509 cert signature's algorithm name. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns X509 cert signature's algorithm name. */ getSignatureAlgParams() : DataBlob; /** * Get X509 cert key usage. - * + * @returns Returns X509 cert key usage. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns X509 cert key usage. */ getKeyUsage() : DataBlob; /** * Get X509 cert extended key usage. - * + * @returns Returns X509 cert extended key usage. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns X509 cert extended key usage. */ getExtKeyUsage() : DataArray; /** * Get X509 cert basic constraints path len. - * + * @returns Returns X509 cert basic constraints path len. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns X509 cert basic constraints path len. */ getBasicConstraints() : number; /** * Get X509 cert subject alternative name. - * + * @returns Returns X509 cert subject alternative name. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns X509 cert subject alternative name. */ getSubjectAltNames() : DataArray; /** * Get X509 cert issuer alternative name. - * + * @returns Returns X509 cert issuer alternative name. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns X509 cert issuer alternative name. */ getIssuerAltNames() : DataArray; } /** * Provides the x509 cert func. - * + * @param inStream Indicates the input cert data. + * @returns Returns X509 cert instance. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @param inStream Indicates the input cert data. - * @return Returns X509 cert instance. */ function createX509Cert(inStream : EncodingBlob, callback : AsyncCallback) : void; function createX509Cert(inStream : EncodingBlob) : Promise; @@ -929,43 +912,35 @@ declare namespace cryptoFramework { interface X509CrlEntry { /** * Returns the ASN of this CRL entry 1 der coding form, i.e. internal sequence. - * + * @returns Returns EncodingBlob of crl entry. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns EncodingBlob of crl entry. */ getEncoded(callback : AsyncCallback) : void; getEncoded() : Promise; /** * Get the serial number from this x509crl entry. - * + * @returns Returns serial number of crl entry. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns serial number of crl entry. */ getSerialNumber() : number; /** * Get the issuer of the x509 certificate described by this entry. - * + * @returns Returns DataBlob of issuer. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns DataBlob of issuer. */ getCertIssuer(callback : AsyncCallback) : void; getCertIssuer() : Promise; /** * Get the revocation date from x509crl entry. - * + * @returns Returns string of revocation date. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns string of revocation date. */ getRevocationDate(callback : AsyncCallback) : void; getRevocationDate() : Promise; @@ -979,162 +954,132 @@ declare namespace cryptoFramework { interface X509Crl { /** * Check if the given certificate is on this CRL. - * + * @param X509Cert Input cert data. + * @returns Returns result of Check cert is revoked or not. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @param X509Cert Input cert data. - * @return Returns result of Check cert is revoked or not. */ isRevoked(cert : X509Cert, callback : AsyncCallback) : void; isRevoked(cert : X509Cert) : Promise; /** * Returns the type of this CRL. - * + * @returns Returns string of crl type. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns string of crl type. */ getType() : string; /** * Get the der coding format. - * + * @returns Returns EncodingBlob of crl. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns EncodingBlob of crl. */ getEncoded(callback : AsyncCallback) : void; getEncoded() : Promise; /** * Use the public key to verify the signature of CRL. - * + * @param PubKey Input public Key. + * @returns Returns verify result. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @param PubKey Input public Key. - * @return Returns verify result. */ verify(key : PubKey, callback : AsyncCallback) : void; verify(key : PubKey) : Promise; /** * Get version number from CRL. - * + * @returns Returns version of crl. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns version of crl. */ getVersion() : number; /** * Get the issuer name from CRL. Issuer means the entity that signs and publishes the CRL. - * + * @returns Returns issuer name of crl. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns issuer name of crl. */ getIssuerName() : DataBlob; /** * Get lastUpdate value from CRL. - * + * @returns Returns last update of crl. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns last update of crl. */ getLastUpdate() : string; /** * Get nextUpdate value from CRL. - * + * @returns Returns next update of crl. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns next update of crl. */ getNextUpdate() : string; /** * This method can be used to find CRL entries in indirect CRLs. - * + * @param serialNumber serial number of crl. + * @returns Returns next update of crl. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @param serialNumber serial number of crl. - * @return Returns next update of crl. */ getRevokedCert(serialNumber : number, callback : AsyncCallback) : void; getRevokedCert(serialNumber : number) : Promise; /** * This method can be used to find CRL entries in indirect cert. - * + * @param X509Cert Cert of x509. + * @returns Returns X509CrlEntry instance. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @param X509Cert Cert of x509. - * @return Returns X509CrlEntry instance. */ getRevokedCertWithCert(cert : X509Cert, callback : AsyncCallback) : void; getRevokedCertWithCert(cert : X509Cert) : Promise; /** * Get all entries in this CRL. - * + * @returns Returns Array of X509CrlEntry instance. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns Array of X509CrlEntry instance. */ getRevokedCerts(callback : AsyncCallback>) : void; getRevokedCerts() : Promise>; /** * Get the CRL information encoded by Der from this CRL. - * + * @returns Returns DataBlob of tbs info. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns DataBlob of tbs info. */ getTbsInfo(callback : AsyncCallback) : void; getTbsInfo() : Promise; /** * Get signature value from CRL. - * + * @returns Returns DataBlob of signature. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns DataBlob of signature. */ getSignature() : DataBlob; /** * Get the signature algorithm name of the CRL signature algorithm. - * + * @returns Returns string of signature algorithm name. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns string of signature algorithm name. */ getSignatureAlgName() : string; /** * Get the signature algorithm oid string from CRL. - * + * @returns Returns string of signature algorithm oid. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns string of signature algorithm oid. */ getSignatureAlgOid() : string; @@ -1142,21 +1087,18 @@ declare namespace cryptoFramework { * Get the der encoded signature algorithm parameters from the CRL signature algorithm. * * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @return Returns DataBlob of signature algorithm params. + * @returns Returns DataBlob of signature algorithm params. */ getSignatureAlgParams() : DataBlob; } /** * Provides the x509 CRL func. - * + * @param inStream Indicates the input CRL data. + * @returns Returns the x509 CRL instance. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @param inStream Indicates the input CRL data. - * @return Returns the x509 CRL instance. */ function createX509Crl(inStream : EncodingBlob, callback : AsyncCallback) : void; function createX509Crl(inStream : EncodingBlob) : Promise; @@ -1169,11 +1111,9 @@ declare namespace cryptoFramework { interface CertChainValidator { /** * Validate the cert chain. - * + * @param certChain Indicates the cert chain validator data. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @param certChain Indicates the cert chain validator data. */ validate(certChain : CertChainData, callback : AsyncCallback) : void; validate(certChain : CertChainData) : Promise; @@ -1182,12 +1122,10 @@ declare namespace cryptoFramework { /** * Provides the cert chain validator func. - * + * @param algorithm Indicates the cert chain validator type. + * @returns { CertChainValidator } the cert chain validator instance. * @syscap SystemCapability.Security.CryptoFramework - * @import import cryptoFramework from '@ohos.security.cryptoFramework' * @since 9 - * @param algorithm Indicates the cert chain validator type. - * @return Returns the cert chain validator instance. */ function createCertChainValidator(algorithm :string) : CertChainValidator; } -- Gitee From 6c3cb96044dd307d5fdf537ba20e95f59b8c322b Mon Sep 17 00:00:00 2001 From: youliang_1314 Date: Thu, 24 Nov 2022 11:22:38 +0800 Subject: [PATCH 398/438] update useriam Signed-off-by: youliang_1314 Change-Id: I2e909dd0553acd5f85d233d19eb39e8329d231a6 --- api/@ohos.userIAM.faceAuth.d.ts | 20 ++- api/@ohos.userIAM.userAuth.d.ts | 215 ++++++++++++++++---------------- 2 files changed, 117 insertions(+), 118 deletions(-) diff --git a/api/@ohos.userIAM.faceAuth.d.ts b/api/@ohos.userIAM.faceAuth.d.ts index e1ac81440a..798772c779 100644 --- a/api/@ohos.userIAM.faceAuth.d.ts +++ b/api/@ohos.userIAM.faceAuth.d.ts @@ -15,37 +15,35 @@ /** * This module provides the capability to manage face auth. - * + * @namespace faceAuth * @since 9 */ declare namespace faceAuth { /** * Provides the abilities for face authentication. - * @name FaceAuth - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.FaceAuth - * @systemapi Hide this for inner system use. + * @since 9 */ class FaceAuthManager { /** * Constructor to get the FaceAuthManager class instance. - * - * @since 9 - * @return Returns the FaceAuthManager class instance. + * @returns Returns the FaceAuthManager class instance. + * @syscap SystemCapability.UserIAM.UserAuth.FaceAuth * @systemapi Hide this for inner system use. + * @since 9 */ constructor(); /** * Set XComponent surface id for camera preview during enroll. - * - * @since 9 - * @param surfaceId Indicates surface id for face enroll preview. * @permission ohos.permission.MANAGE_USER_IDM - * @systemapi Hide this for inner system use. + * @param surfaceId Indicates surface id for face enroll preview. * @throws { BusinessError } 201 - Permission verification failed. * @throws { BusinessError } 202 - The caller is not a system application. * @throws { BusinessError } 12700001 - The operation is failed. + * @syscap SystemCapability.UserIAM.UserAuth.FaceAuth + * @systemapi Hide this for inner system use. + * @since 9 */ setSurfaceId(surfaceId: string): void; } diff --git a/api/@ohos.userIAM.userAuth.d.ts b/api/@ohos.userIAM.userAuth.d.ts index 27623d6e45..776176bc31 100644 --- a/api/@ohos.userIAM.userAuth.d.ts +++ b/api/@ohos.userIAM.userAuth.d.ts @@ -17,8 +17,9 @@ import { AsyncCallback } from './basic'; /** * User authentication - * @since 6 + * @namespace userAuth * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 */ declare namespace userAuth { export enum AuthenticationResult { @@ -104,11 +105,11 @@ declare namespace userAuth { interface Authenticator { /** * Execute authentication. - * @syscap SystemCapability.UserIAM.UserAuth.Core * @permission ohos.permission.ACCESS_BIOMETRIC * @param type Indicates the authentication type. * @param level Indicates the security level. - * @return Returns authentication result, which is specified by AuthenticationResult. + * @returns Returns authentication result, which is specified by AuthenticationResult. + * @syscap SystemCapability.UserIAM.UserAuth.Core * @deprecated since 8 */ execute(type: AuthType, level: SecureLevel, callback: AsyncCallback): void; @@ -117,23 +118,23 @@ declare namespace userAuth { /** * Get Authenticator instance. + * @returns Returns an Authenticator. * @syscap SystemCapability.UserIAM.UserAuth.Core - * @return Returns an Authenticator. * @deprecated since 8 */ function getAuthenticator(): Authenticator; /** * User authentication. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ class UserAuth { /** * Constructor to get the UserAuth class instance. - * @since 8 + * @returns Returns the UserAuth class instance. * @syscap SystemCapability.UserIAM.UserAuth.Core - * @return Returns the UserAuth class instance. + * @since 8 * @deprecated since 9 * @useinstead ohos.userIAM.userAuth.getAuthInstance */ @@ -141,10 +142,10 @@ declare namespace userAuth { /** * Get version information. - * @since 8 - * @syscap SystemCapability.UserIAM.UserAuth.Core * @permission ohos.permission.ACCESS_BIOMETRIC - * @return Returns version information. + * @returns Returns version information. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 * @deprecated since 9 * @useinstead ohos.userIAM.userAuth.getVersion */ @@ -152,12 +153,12 @@ declare namespace userAuth { /** * Check whether the authentication capability is available. - * @since 8 - * @syscap SystemCapability.UserIAM.UserAuth.Core * @permission ohos.permission.ACCESS_BIOMETRIC * @param authType Credential type for authentication. * @param authTrustLevel Trust level of authentication result. - * @return Returns a check result, which is specified by getAvailableStatus. + * @returns Returns a check result, which is specified by getAvailableStatus. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 * @deprecated since 9 * @useinstead ohos.userIAM.userAuth.getAvailableStatus */ @@ -165,14 +166,14 @@ declare namespace userAuth { /** * Executes authentication. - * @since 8 - * @syscap SystemCapability.UserIAM.UserAuth.Core * @permission ohos.permission.ACCESS_BIOMETRIC - * @param challenge pass in challenge value. - * @param authType type of authentication. + * @param challenge Pass in challenge value. + * @param authType Type of authentication. * @param authTrustLevel Trust level of authentication result. * @param callback Return result and acquireInfo through callback. - * @return Returns ContextId for cancel. + * @returns Returns ContextId for cancel. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 * @deprecated since 9 * @useinstead ohos.userIAM.userAuth.AuthInstance.start */ @@ -180,11 +181,11 @@ declare namespace userAuth { /** * Cancel authentication with ContextID. - * @since 8 - * @syscap SystemCapability.UserIAM.UserAuth.Core * @permission ohos.permission.ACCESS_BIOMETRIC * @param contextID Cancel authentication and pass in ContextID. - * @return Returns a number value indicating whether Cancel authentication was successful. + * @returns Returns a number value indicating whether Cancel authentication was successful. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 * @deprecated since 9 * @useinstead ohos.userIAM.userAuth.AuthInstance.cancel */ @@ -194,13 +195,13 @@ declare namespace userAuth { interface IUserAuthCallback { /** * The authentication result code is returned through the callback. - * @since 8 - * @syscap SystemCapability.UserIAM.UserAuth.Core - * @param result authentication result code. - * @param extraInfo pass the specific information for different situation. * If the authentication is passed, the authentication token is returned in extraInfo, * If the authentication fails, the remaining authentication times are returned in extraInfo, * If the authentication executor is locked, the freezing time is returned in extraInfo. + * @param result Authentication result code. + * @param extraInfo Pass the specific information for different situation. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 * @deprecated since 9 * @useinstead ohos.userIAM.userAuth.AuthEvent.callback */ @@ -208,11 +209,11 @@ declare namespace userAuth { /** * During an authentication, the TipsCode is returned through the callback. - * @since 8 + * @param module The executor type for authentication. + * @param acquire The tip code for different authentication executor. + * @param extraInfo Reserved parameter. * @syscap SystemCapability.UserIAM.UserAuth.Core - * @param module the executor type for authentication. - * @param acquire the tip code for different authentication executor. - * @param extraInfo reserved parameter. + * @since 8 * @deprecated since 9 * @useinstead ohos.userIAM.userAuth.AuthEvent.callback */ @@ -221,11 +222,11 @@ declare namespace userAuth { /** * Authentication result: authentication token, remaining authentication times, freezing time. - * @since 8 + * @param token Pass the authentication result if the authentication is passed. + * @param remainTimes Return the remaining authentication times if the authentication fails. + * @param freezingTime Return the freezing time if the authentication executor is locked. * @syscap SystemCapability.UserIAM.UserAuth.Core - * @param token pass the authentication result if the authentication is passed. - * @param remainTimes return the remaining authentication times if the authentication fails. - * @param freezingTime return the freezing time if the authentication executor is locked. + * @since 8 * @deprecated since 9 * @useinstead ohos.userIAM.userAuth.AuthResultInfo */ @@ -237,275 +238,275 @@ declare namespace userAuth { /** * Result code. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 * @deprecated since 9 * @useinstead ohos.userIAM.userAuth.ResultCodeV9 */ enum ResultCode { /** * Indicates that the result is success or ability is supported. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ SUCCESS = 0, /** * Indicates the the result is failure or ability is not supported. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FAIL = 1, /** * Indicates other errors. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ GENERAL_ERROR = 2, /** * Indicates that this operation has been canceled. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ CANCELED = 3, /** * Indicates that this operation has timed out. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ TIMEOUT = 4, /** * Indicates that this authentication type is not supported. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ TYPE_NOT_SUPPORT = 5, /** * Indicates that the authentication trust level is not supported. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ TRUST_LEVEL_NOT_SUPPORT = 6, /** * Indicates that the authentication task is busy. Wait for a few seconds and try again. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ BUSY = 7, /** * Indicates incorrect parameters. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ INVALID_PARAMETERS = 8, /** * Indicates that the authenticator is locked. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ LOCKED = 9, /** * Indicates that the user has not enrolled the authenticator. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ NOT_ENROLLED = 10 } /** * Indicates the enumeration of prompt codes in the process of face authentication. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ enum FaceTips { /** * Indicates that the obtained facial image is too bright due to high illumination. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FACE_AUTH_TIP_TOO_BRIGHT = 1, /** * Indicates that the obtained facial image is too dark due to low illumination. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FACE_AUTH_TIP_TOO_DARK = 2, /** * Indicates that the face is too close to the device. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FACE_AUTH_TIP_TOO_CLOSE = 3, /** * Indicates that the face is too far away from the device. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FACE_AUTH_TIP_TOO_FAR = 4, /** * Indicates that the device is too high, and that only the upper part of the face is captured. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FACE_AUTH_TIP_TOO_HIGH = 5, /** * Indicates that the device is too low, and that only the lower part of the face is captured. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FACE_AUTH_TIP_TOO_LOW = 6, /** * Indicates that the device is deviated to the right, and that only the right part of the face is captured. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FACE_AUTH_TIP_TOO_RIGHT = 7, /** * Indicates that the device is deviated to the left, and that only the left part of the face is captured. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FACE_AUTH_TIP_TOO_LEFT = 8, /** * Indicates that the face moves too fast during facial information collection. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FACE_AUTH_TIP_TOO_MUCH_MOTION = 9, /** * Indicates that the face is not facing the device. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FACE_AUTH_TIP_POOR_GAZE = 10, /** * Indicates that no face is detected. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FACE_AUTH_TIP_NOT_DETECTED = 11, } /** * Indicates the enumeration of prompt codes in the process of fingerprint authentication. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ enum FingerprintTips { /** * Indicates that the image acquired is good. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FINGERPRINT_AUTH_TIP_GOOD = 0, /** * Indicates that the fingerprint image is too noisy due to suspected or detected dirt on sensor. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FINGERPRINT_AUTH_TIP_DIRTY = 1, /** * Indicates that the fingerprint image is too noisy to process due to a detected condition. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FINGERPRINT_AUTH_TIP_INSUFFICIENT = 2, /** * Indicates that only a partial fingerprint image is detected. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FINGERPRINT_AUTH_TIP_PARTIAL = 3, /** * Indicates that the fingerprint image is incomplete due to quick motion. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FINGERPRINT_AUTH_TIP_TOO_FAST = 4, /** * Indicates that the fingerprint image is unreadable due to lack of motion. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FINGERPRINT_AUTH_TIP_TOO_SLOW = 5 } /** * Credential type for authentication. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ enum UserAuthType { /** * Authentication type face. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FACE = 2, /** * Authentication type fingerprint. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ FINGERPRINT = 4 } /** * Trust level of authentication results. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ enum AuthTrustLevel { /** * Authentication result trusted level 1. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ ATL1 = 10000, /** * Authentication result trusted level 2. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ ATL2 = 20000, /** * Authentication result trusted level 3. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ ATL3 = 30000, /** * Authentication result trusted level 4. - * @since 8 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 */ ATL4 = 40000 } @@ -518,29 +519,29 @@ declare namespace userAuth { /** * Return information of Authentication events. - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ type EventInfo = AuthResultInfo | TipInfo; interface AuthEvent { /** * The authentication event callback. - * @since 9 - * @syscap SystemCapability.UserIAM.UserAuth.Core * @param result Event info. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ callback(result: EventInfo): void; } /** * Authentication result: authentication token, remaining authentication attempts, lockout duration. - * @since 9 - * @syscap SystemCapability.UserIAM.UserAuth.Core * @param result Authentication result. * @param token Pass the authentication token if the authentication is passed. * @param remainAttempts Return the remaining authentication attempts if the authentication fails. * @param lockoutDuration Return the lockout duration if the authentication executor is locked. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ interface AuthResultInfo { result : number; @@ -551,10 +552,10 @@ declare namespace userAuth { /** * Authentication tip info. - * @since 9 - * @syscap SystemCapability.UserIAM.UserAuth.Core * @param module Authentication module. * @param tip Tip information, used to prompt the business to perform some operations. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ interface TipInfo { module : number; @@ -563,35 +564,33 @@ declare namespace userAuth { /** * Authentication instance, used to initiate a complete authentication - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ interface AuthInstance { /** * Turn on authentication event listening. - * @since since 9 - * @syscap SystemCapability.UserIAM.UserAuth.Core * @param name Event name. * @param callback Event information return. * @throws { BusinessError } 401 - Incorrect parameters. * @throws { BusinessError } 12500002 - General operation error. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since since 9 */ on: (name: AuthEventKey, callback: AuthEvent) => void; /** * Turn off authentication event listening. - * @since since 9 - * @syscap SystemCapability.UserIAM.UserAuth.Core * @param name Event name. * @throws { BusinessError } 401 - Incorrect parameters. * @throws { BusinessError } 12500002 - General operation error. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since since 9 */ off: (name: AuthEventKey) => void; /** * Start this authentication, an instance can only perform authentication once. - * @since since 9 - * @syscap SystemCapability.UserIAM.UserAuth.Core * @permission ohos.permission.ACCESS_BIOMETRIC * @throws { BusinessError } 201 - Permission verification failed. * @throws { BusinessError } 401 - Incorrect parameters. @@ -599,36 +598,36 @@ declare namespace userAuth { * @throws { BusinessError } 12500005 - The authentication type is not supported. * @throws { BusinessError } 12500006 - The authentication trust level is not supported. * @throws { BusinessError } 12500010 - The type of credential has not been enrolled. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since since 9 */ start: () => void; /** * Cancel this authentication. - * @since since 9 - * @syscap SystemCapability.UserIAM.UserAuth.Core * @permission ohos.permission.ACCESS_BIOMETRIC * @throws { BusinessError } 201 - Permission verification failed. * @throws { BusinessError } 401 - Incorrect parameters. * @throws { BusinessError } 12500002 - General operation error. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since since 9 */ cancel: () => void; } /** * Get version information. - * @since 9 - * @syscap SystemCapability.UserIAM.UserAuth.Core * @permission ohos.permission.ACCESS_BIOMETRIC - * @return Returns version information. + * @returns Returns version information. * @throws { BusinessError } 201 - Permission verification failed. * @throws { BusinessError } 12500002 - General operation error. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ function getVersion(): number; /** * Check whether the authentication capability is available. - * @since 9 - * @syscap SystemCapability.UserIAM.UserAuth.Core * @permission ohos.permission.ACCESS_BIOMETRIC * @param authType Credential type for authentication. * @param authTrustLevel Trust level of authentication result. @@ -638,94 +637,96 @@ declare namespace userAuth { * @throws { BusinessError } 12500005 - The authentication type is not supported. * @throws { BusinessError } 12500006 - The authentication trust level is not supported. * @throws { BusinessError } 12500010 - The type of credential has not been enrolled. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ function getAvailableStatus(authType : UserAuthType, authTrustLevel : AuthTrustLevel): void; /** * Get Authentication instance. - * @since 9 - * @syscap SystemCapability.UserIAM.UserAuth.Core - * @return Returns an authentication instance. + * @returns Returns an authentication instance. * @throws { BusinessError } 401 - Incorrect parameters. * @throws { BusinessError } 12500002 - General operation error. * @throws { BusinessError } 12500005 - The authentication type is not supported. * @throws { BusinessError } 12500006 - The authentication trust level is not supported. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ function getAuthInstance(challenge : Uint8Array, authType : UserAuthType, authTrustLevel : AuthTrustLevel): AuthInstance; /** * Result code. - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ enum ResultCodeV9 { /** * Indicates that the result is success or ability is supported. - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ SUCCESS = 12500000, /** * Indicates the result is failure or ability is not supported. - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ FAIL = 12500001, /** * Indicates other errors. - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ GENERAL_ERROR = 12500002, /** * Indicates that this operation is canceled. - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ CANCELED = 12500003, /** * Indicates that this operation is time-out. - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ TIMEOUT = 12500004, /** * Indicates that this authentication type is not supported. - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ TYPE_NOT_SUPPORT = 12500005, /** * Indicates that the authentication trust level is not supported. - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ TRUST_LEVEL_NOT_SUPPORT = 12500006, /** * Indicates that the authentication task is busy. Wait for a few seconds and try again. - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ BUSY = 12500007, /** * Indicates that the authenticator is locked. - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ LOCKED = 12500009, /** * Indicates that the user has not enrolled the authenticator. - * @since 9 * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 */ NOT_ENROLLED = 12500010 } -- Gitee From 966490baa9403cc7bd967c9a8bd76c827c026d75 Mon Sep 17 00:00:00 2001 From: jackd320 Date: Thu, 24 Nov 2022 03:42:16 +0000 Subject: [PATCH 399/438] Signed-off-by: jackd320 Signed-off-by: jackd320 --- api/@ohos.update.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/@ohos.update.d.ts b/api/@ohos.update.d.ts index 7c0c767c00..78760f8efa 100644 --- a/api/@ohos.update.d.ts +++ b/api/@ohos.update.d.ts @@ -27,7 +27,7 @@ declare namespace update { * Get online update handler for the calling device. * * @param upgradeInfo indicates client app and business type - * @return online update handler to perform online update + * @returns online update handler to perform online update * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 11500104 - IPC error. * @since 9 @@ -37,7 +37,7 @@ declare namespace update { /** * Get restore handler. * - * @return restore handler to perform factory reset + * @returns restore handler to perform factory reset * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 11500104 - IPC error. * @since 9 @@ -47,7 +47,7 @@ declare namespace update { /** * Get local update handler. * - * @return local update handler to perform local update + * @returns local update handler to perform local update * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 11500104 - IPC error. * @since 9 -- Gitee From 08d0b0cfa77d507e8fa7ecbf81de6e9ea7589aa0 Mon Sep 17 00:00:00 2001 From: luoying_ace_admin Date: Fri, 18 Nov 2022 14:38:45 +0800 Subject: [PATCH 400/438] revise name Signed-off-by: luoying_ace_admin --- .../component/ets/alphabet_indexer.d.ts | 1 + api/@internal/component/ets/animator.d.ts | 2 +- api/@internal/component/ets/badge.d.ts | 4 ++-- api/@internal/component/ets/calendar.d.ts | 2 +- .../component/ets/checkboxgroup.d.ts | 2 +- api/@internal/component/ets/common.d.ts | 19 ++++++++++--------- .../component/ets/common_ts_ets_api.d.ts | 12 +----------- .../ets/custom_dialog_controller.d.ts | 2 +- api/@internal/component/ets/enums.d.ts | 6 +++--- api/@internal/component/ets/grid.d.ts | 2 +- api/@internal/component/ets/hyperlink.d.ts | 2 +- api/@internal/component/ets/inspector.d.ts | 6 ++++-- .../component/ets/lazy_for_each.d.ts | 4 ++++ api/@internal/component/ets/list_item.d.ts | 2 +- .../component/ets/list_item_group.d.ts | 2 +- api/@internal/component/ets/navigation.d.ts | 2 +- .../component/ets/plugin_component.d.ts | 2 +- api/@internal/component/ets/progress.d.ts | 5 +++-- api/@internal/component/ets/qrcode.d.ts | 2 +- api/@internal/component/ets/rating.d.ts | 2 +- api/@internal/component/ets/refresh.d.ts | 2 +- api/@internal/component/ets/scroll.d.ts | 4 ++-- api/@internal/component/ets/scroll_bar.d.ts | 2 +- api/@internal/component/ets/select.d.ts | 2 +- api/@internal/component/ets/sidebar.d.ts | 2 +- api/@internal/component/ets/stepper_item.d.ts | 2 +- api/@internal/component/ets/swiper.d.ts | 2 +- api/@internal/component/ets/text_input.d.ts | 1 + api/@internal/component/ets/toggle.d.ts | 2 +- api/@internal/ets/global.d.ts | 4 ++-- api/@ohos.curves.d.ts | 4 ++++ api/@system.mediaquery.d.ts | 2 +- api/@system.router.d.ts | 18 ++++++++++++------ api/common/full/dom.d.ts | 2 +- api/common/full/viewmodel.d.ts | 10 +++++----- 35 files changed, 75 insertions(+), 65 deletions(-) diff --git a/api/@internal/component/ets/alphabet_indexer.d.ts b/api/@internal/component/ets/alphabet_indexer.d.ts index 42a4b1694a..55264f74fe 100644 --- a/api/@internal/component/ets/alphabet_indexer.d.ts +++ b/api/@internal/component/ets/alphabet_indexer.d.ts @@ -53,6 +53,7 @@ declare class AlphabetIndexerAttribute extends CommonMethod void): AlphabetIndexerAttribute; diff --git a/api/@internal/component/ets/animator.d.ts b/api/@internal/component/ets/animator.d.ts index ff253c2eba..e83ece83d4 100644 --- a/api/@internal/component/ets/animator.d.ts +++ b/api/@internal/component/ets/animator.d.ts @@ -70,7 +70,7 @@ declare class ScrollMotion { } /** - * Defines Animtor. + * Defines Animator. * @since 7 * @systemapi */ diff --git a/api/@internal/component/ets/badge.d.ts b/api/@internal/component/ets/badge.d.ts index 6c6ef7b593..6e292e1e05 100644 --- a/api/@internal/component/ets/badge.d.ts +++ b/api/@internal/component/ets/badge.d.ts @@ -116,7 +116,7 @@ declare interface BadgeParamWithString extends BadgeParam { } /** - * Defines Badge Componrnt. + * Defines Badge Component. * @since 7 */ interface BadgeInterface { @@ -140,7 +140,7 @@ interface BadgeInterface { } /** - * Defines Badge Componrnt attribute. + * Defines Badge Component attribute. * @since 7 */ declare class BadgeAttribute extends CommonMethod {} diff --git a/api/@internal/component/ets/calendar.d.ts b/api/@internal/component/ets/calendar.d.ts index 63569d8107..5b528afd21 100644 --- a/api/@internal/component/ets/calendar.d.ts +++ b/api/@internal/component/ets/calendar.d.ts @@ -283,7 +283,7 @@ interface CurrentDayStyle { scheduleMarkerRadius?: number; /** - * Bound dary row offset. + * Boundary row offset. * @since 7 * @systemapi */ diff --git a/api/@internal/component/ets/checkboxgroup.d.ts b/api/@internal/component/ets/checkboxgroup.d.ts index 16695f09d2..32a3810ef5 100644 --- a/api/@internal/component/ets/checkboxgroup.d.ts +++ b/api/@internal/component/ets/checkboxgroup.d.ts @@ -19,7 +19,7 @@ */ declare enum SelectStatus { /** - * All checkboxs is selected. + * All checkboxes are selected. * @since 8 */ All, diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index 199a372cb9..f69d4928ad 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -692,12 +692,12 @@ declare enum SourceTool { /** * The finger type. */ - FINGER, + Finger, /** * The pen type. */ - PEN, + Pen, } /** @@ -1090,7 +1090,7 @@ declare interface KeyEvent { } /** - * Component State Styels. + * Component State Styles. * @since 8 */ declare interface StateStyles { @@ -1304,7 +1304,8 @@ declare class CommonMethod { /** * Sets the touchable of the current component * @since 7 - * @deprecated since 9, instead of hitTestBehavior. + * @deprecated since 9 + * @useinstead hitTestBehavior */ touchable(value: boolean): T; @@ -1599,7 +1600,7 @@ declare class CommonMethod { sepia(value: number): T; /** - * Inverts the input image. Value defines the scale of the conversion. 100% of the value is a complete reversal. + * Invert the input image. Value defines the scale of the conversion. 100% of the value is a complete reversal. * A value of 0% does not change the image. (Percentage) * @since 7 */ @@ -1875,7 +1876,7 @@ declare class CommonMethod { * path:Motion path for displacement animation, using the svg path string. * from:Start point of the motion path. The default value is 0.0. * to:End point of the motion path. The default value is 1.0. - * rotatble:Whether to follow the path for rotation. + * rotatable:Whether to follow the path for rotation. * @since 7 */ motionPath(value: MotionPathOptions): T; @@ -1949,7 +1950,7 @@ declare class CommonMethod { stateStyles(value: StateStyles): T; /** - * id for distrubte identification. + * id for distribute identification. * @since 8 */ restoreId(value: number): T; @@ -2001,7 +2002,7 @@ declare class CommonShapeMethod extends CommonMethod { /** * constructor. * @since 7 - * @syetemapi + * @systemapi */ constructor(); @@ -2214,7 +2215,7 @@ declare class CustomComponent extends CommonAttribute { declare class View { /** * Just use for generate tsbundle - * @ignore ide should ignore this arrtibute + * @ignore ide should ignore this attribute * @systemapi * @since 7 */ diff --git a/api/@internal/component/ets/common_ts_ets_api.d.ts b/api/@internal/component/ets/common_ts_ets_api.d.ts index a1c780576a..2e33d8736d 100644 --- a/api/@internal/component/ets/common_ts_ets_api.d.ts +++ b/api/@internal/component/ets/common_ts_ets_api.d.ts @@ -368,14 +368,12 @@ interface ISinglePropertyChangeSubscriber extends IPropertySubscriber { * Defines the Subscribale base class. * @since 7 * @systemapi - * @hide */ declare abstract class SubscribaleAbstract { /** * Returns the ownership attribute set by the. * @since 7 * @systemapi - * @hide */ private owningProperties_: Set; @@ -383,7 +381,6 @@ declare abstract class SubscribaleAbstract { * Constructor. * @since 7 * @systemapi - * @hide */ constructor(); @@ -391,7 +388,6 @@ declare abstract class SubscribaleAbstract { * Called when the notification property has changed. * @since 7 * @systemapi - * @hide */ protected notifyPropertyHasChanged(propName: string, newValue: any): void; @@ -399,7 +395,6 @@ declare abstract class SubscribaleAbstract { * Called when adding an already owned property. * @since 7 * @systemapi - * @hide */ public addOwningProperty(subscriber: IPropertySubscriber): void; @@ -407,7 +402,6 @@ declare abstract class SubscribaleAbstract { * Called when an already owned property is deleted. * @since 7 * @systemapi - * @hide */ public removeOwningProperty(property: IPropertySubscriber): void; @@ -415,7 +409,6 @@ declare abstract class SubscribaleAbstract { * Called when an already owned property is deleted by ID * @since 7 * @systemapi - * @hide */ public removeOwningPropertyById(subscriberId: number): void; } @@ -429,7 +422,6 @@ declare class Environment { * Constructor. * @since 7 * @systemapi - * @hide */ constructor(); @@ -466,7 +458,6 @@ declare class PersistentStorage { * Constructor parameters. * @since 7 * @systemapi - * @hide */ constructor(appStorage: AppStorage, storage: Storage); @@ -504,7 +495,6 @@ declare class PersistentStorage { * Used for ide. * @since 7 * @systemapi - * @hide */ declare const appStorage: AppStorage; @@ -527,7 +517,7 @@ declare const appStorage: AppStorage; static GetShared(): LocalStorage; /** - * Return true if prooperty with given name exists + * Return true if property with given name exists * @since 9 */ has(propName: string): boolean; diff --git a/api/@internal/component/ets/custom_dialog_controller.d.ts b/api/@internal/component/ets/custom_dialog_controller.d.ts index c0686ea814..ee5cca1718 100644 --- a/api/@internal/component/ets/custom_dialog_controller.d.ts +++ b/api/@internal/component/ets/custom_dialog_controller.d.ts @@ -50,7 +50,7 @@ declare interface CustomDialogControllerOptions { offset?: Offset; /** - * Defines if use costom style. + * Defines if use custom style. * @since 7 */ customStyle?: boolean; diff --git a/api/@internal/component/ets/enums.d.ts b/api/@internal/component/ets/enums.d.ts index 0316ba0eb6..b97c007442 100644 --- a/api/@internal/component/ets/enums.d.ts +++ b/api/@internal/component/ets/enums.d.ts @@ -361,7 +361,7 @@ declare enum Curve { LinearOutSlowIn, /** - * Fast OutL inear In. + * Fast Out Linear In. * @since 7 */ FastOutLinearIn, @@ -1514,13 +1514,13 @@ declare enum HitTestMode { */ declare enum TitleHeight { /** - * Title height when only main title is avaliable. + * Title height when only main title is available. * @since 9 */ MainOnly, /** - * Title height when main title and subtitle are both avaliable. + * Title height when main title and subtitle are both available. * @since 9 */ MainWithSub, diff --git a/api/@internal/component/ets/grid.d.ts b/api/@internal/component/ets/grid.d.ts index e58a4765bc..f65b792b93 100644 --- a/api/@internal/component/ets/grid.d.ts +++ b/api/@internal/component/ets/grid.d.ts @@ -53,7 +53,7 @@ declare enum GridDirection { } /** - * Defines the grid attibute functions. + * Defines the grid attribute functions. * @since 7 */ declare class GridAttribute extends CommonMethod { diff --git a/api/@internal/component/ets/hyperlink.d.ts b/api/@internal/component/ets/hyperlink.d.ts index 40751b2d28..07b7f981f3 100644 --- a/api/@internal/component/ets/hyperlink.d.ts +++ b/api/@internal/component/ets/hyperlink.d.ts @@ -28,7 +28,7 @@ interface HyperlinkInterface { } /** - * Defines the hyperlink attibute functions + * Defines the hyperlink attribute functions * @since 7 */ declare class HyperlinkAttribute extends CommonMethod { diff --git a/api/@internal/component/ets/inspector.d.ts b/api/@internal/component/ets/inspector.d.ts index c62f3802cf..eae589afa5 100644 --- a/api/@internal/component/ets/inspector.d.ts +++ b/api/@internal/component/ets/inspector.d.ts @@ -17,7 +17,8 @@ * Get inspector node infos. * @since 7 * @systemapi - * @deprecated + * @deprecated since 9 + * @useinstead getInspectorTree */ declare function getInspectorNodes(): object; @@ -25,7 +26,8 @@ declare function getInspectorNodes(): object; * Get inspector node info by node id. * @since 7 * @systemapi - * @deprecated + * @deprecated since 9 + * @useinstead getInspectorByKey */ declare function getInspectorNodeById(id: number): object; diff --git a/api/@internal/component/ets/lazy_for_each.d.ts b/api/@internal/component/ets/lazy_for_each.d.ts index a027eab8af..7e6c2da51f 100644 --- a/api/@internal/component/ets/lazy_for_each.d.ts +++ b/api/@internal/component/ets/lazy_for_each.d.ts @@ -28,6 +28,7 @@ declare interface DataChangeListener { * Data added. * @since 7 * @deprecated since 8 + * @useinstead onDataAdd */ onDataAdded(index: number): void; @@ -41,6 +42,7 @@ declare interface DataChangeListener { * Data moved. * @since 7 * @deprecated since 8 + * @useinstead onDataMove */ onDataMoved(from: number, to: number): void; @@ -54,6 +56,7 @@ declare interface DataChangeListener { * Data deleted. * @since 7 * @deprecated since 8 + * @useinstead onDataDelete */ onDataDeleted(index: number): void; @@ -67,6 +70,7 @@ declare interface DataChangeListener { * Call when has data change. * @since 7 * @deprecated since 8 + * @useinstead onDataChange */ onDataChanged(index: number): void; diff --git a/api/@internal/component/ets/list_item.d.ts b/api/@internal/component/ets/list_item.d.ts index c6f104be32..19eafad7eb 100644 --- a/api/@internal/component/ets/list_item.d.ts +++ b/api/@internal/component/ets/list_item.d.ts @@ -52,7 +52,7 @@ declare enum EditMode { None, /** - * Deleteable. + * Deletable. * @since 7 */ Deletable, diff --git a/api/@internal/component/ets/list_item_group.d.ts b/api/@internal/component/ets/list_item_group.d.ts index 6914c606ce..28a580f94d 100644 --- a/api/@internal/component/ets/list_item_group.d.ts +++ b/api/@internal/component/ets/list_item_group.d.ts @@ -50,7 +50,7 @@ interface ListItemGroupInterface { } /** - * Defines the item group attibute functions. + * Defines the item group attribute functions. * @since 9 */ declare class ListItemGroupAttribute extends CommonMethod { diff --git a/api/@internal/component/ets/navigation.d.ts b/api/@internal/component/ets/navigation.d.ts index 3cec4a169d..0d8ba46d4c 100644 --- a/api/@internal/component/ets/navigation.d.ts +++ b/api/@internal/component/ets/navigation.d.ts @@ -50,7 +50,7 @@ declare interface NavigationCustomTitle { } /** - * Nativation mode + * Navigation mode * @since 9 */ declare enum NavigationMode { diff --git a/api/@internal/component/ets/plugin_component.d.ts b/api/@internal/component/ets/plugin_component.d.ts index 08ddae847e..c306f416b4 100644 --- a/api/@internal/component/ets/plugin_component.d.ts +++ b/api/@internal/component/ets/plugin_component.d.ts @@ -48,7 +48,7 @@ interface PluginComponentInterface { } /** - * Defines the plugin component attibute functions. + * Defines the plugin component attribute functions. * @since 9 * @systemapi */ diff --git a/api/@internal/component/ets/progress.d.ts b/api/@internal/component/ets/progress.d.ts index 76faf8e8a6..1e35aa28c8 100644 --- a/api/@internal/component/ets/progress.d.ts +++ b/api/@internal/component/ets/progress.d.ts @@ -34,6 +34,7 @@ * Sets the style of Progress. * @since 7 * @deprecated since 8 + * @useinstead type */ style?: ProgressStyle @@ -92,7 +93,7 @@ declare interface ProgressStyleOptions { strokeWidth?: Length; /** - * Defines the scaleCoun property. + * Defines the scaleCount property. * @since 8 */ scaleCount?: number; @@ -153,7 +154,7 @@ interface ProgressInterface { } /** - * Defines the progress attibute functions. + * Defines the progress attribute functions. * @since 7 */ declare class ProgressAttribute extends CommonMethod { diff --git a/api/@internal/component/ets/qrcode.d.ts b/api/@internal/component/ets/qrcode.d.ts index ecae91dc55..9f28e680fc 100644 --- a/api/@internal/component/ets/qrcode.d.ts +++ b/api/@internal/component/ets/qrcode.d.ts @@ -26,7 +26,7 @@ interface QRCodeInterface { } /** - * Defines the qrcode attibute functions. + * Defines the qrcode attribute functions. * @since 7 */ declare class QRCodeAttribute extends CommonMethod { diff --git a/api/@internal/component/ets/rating.d.ts b/api/@internal/component/ets/rating.d.ts index 7dc8bac496..555806118b 100644 --- a/api/@internal/component/ets/rating.d.ts +++ b/api/@internal/component/ets/rating.d.ts @@ -26,7 +26,7 @@ interface RatingInterface { } /** - * Defines the rating attibute functions. + * Defines the rating attribute functions. * @since 7 */ declare class RatingAttribute extends CommonMethod { diff --git a/api/@internal/component/ets/refresh.d.ts b/api/@internal/component/ets/refresh.d.ts index 2475dc5518..43bcf23f7a 100644 --- a/api/@internal/component/ets/refresh.d.ts +++ b/api/@internal/component/ets/refresh.d.ts @@ -62,7 +62,7 @@ interface RefreshInterface { } /** - * Defines the refresh attibute functions. + * Defines the refresh attribute functions. * @since 8 */ declare class RefreshAttribute extends CommonMethod { diff --git a/api/@internal/component/ets/scroll.d.ts b/api/@internal/component/ets/scroll.d.ts index 6795800e39..23dfb16e7d 100644 --- a/api/@internal/component/ets/scroll.d.ts +++ b/api/@internal/component/ets/scroll.d.ts @@ -115,7 +115,7 @@ interface ScrollInterface { } /** - * Defines the scroll attibute functions. + * Defines the scroll attribute functions. * @since 7 */ declare class ScrollAttribute extends CommonMethod { @@ -168,7 +168,7 @@ declare class ScrollAttribute extends CommonMethod { edgeEffect(edgeEffect: EdgeEffect): ScrollAttribute; /** - * Event called when sroll will scroll. + * Event called when Scroll will scroll. * @since 9 */ onScrollBegin(event: (dx: number, dy: number) => { dxRemain: number, dyRemain: number }): ScrollAttribute; diff --git a/api/@internal/component/ets/scroll_bar.d.ts b/api/@internal/component/ets/scroll_bar.d.ts index d8089e23b4..5e33db841d 100644 --- a/api/@internal/component/ets/scroll_bar.d.ts +++ b/api/@internal/component/ets/scroll_bar.d.ts @@ -68,7 +68,7 @@ interface ScrollBarInterface { } /** - * Defines the scrollbar attibute functions. + * Defines the scrollbar attribute functions. * @since 8 */ declare class ScrollBarAttribute extends CommonMethod {} diff --git a/api/@internal/component/ets/select.d.ts b/api/@internal/component/ets/select.d.ts index 0c03c35b06..09ad5034ba 100644 --- a/api/@internal/component/ets/select.d.ts +++ b/api/@internal/component/ets/select.d.ts @@ -14,7 +14,7 @@ */ /** - * The declare of slectOption. + * The declare of selectOption. * @since 8 */ declare interface SelectOption { diff --git a/api/@internal/component/ets/sidebar.d.ts b/api/@internal/component/ets/sidebar.d.ts index 55e73273e3..e7bd376653 100644 --- a/api/@internal/component/ets/sidebar.d.ts +++ b/api/@internal/component/ets/sidebar.d.ts @@ -69,7 +69,7 @@ declare interface ButtonStyle { width?: number; /** - * Set the heigth of control button + * Set the height of control button * @since 8 */ height?: number; diff --git a/api/@internal/component/ets/stepper_item.d.ts b/api/@internal/component/ets/stepper_item.d.ts index c7e0976f37..3a407266a4 100644 --- a/api/@internal/component/ets/stepper_item.d.ts +++ b/api/@internal/component/ets/stepper_item.d.ts @@ -56,7 +56,7 @@ interface StepperItemInterface { } /** - * Defines the stepper item attrbute functions. + * Defines the stepper item attribute functions. * @since 8 */ declare class StepperItemAttribute extends CommonMethod { diff --git a/api/@internal/component/ets/swiper.d.ts b/api/@internal/component/ets/swiper.d.ts index 1a3f7ad21e..f584d9047a 100644 --- a/api/@internal/component/ets/swiper.d.ts +++ b/api/@internal/component/ets/swiper.d.ts @@ -128,7 +128,7 @@ declare interface IndicatorStyle { } /** - * Defines the swiper attibute functions. + * Defines the swiper attribute functions. * @since 7 */ declare class SwiperAttribute extends CommonMethod { diff --git a/api/@internal/component/ets/text_input.d.ts b/api/@internal/component/ets/text_input.d.ts index 8b8db8f2c9..125bf7dca0 100644 --- a/api/@internal/component/ets/text_input.d.ts +++ b/api/@internal/component/ets/text_input.d.ts @@ -195,6 +195,7 @@ declare class TextInputAttribute extends CommonMethod { * Called when judging whether the text editing change finished. * @since 7 * @deprecated since 8 + * @useinstead onEditChange */ onEditChanged(callback: (isEditing: boolean) => void): TextInputAttribute; diff --git a/api/@internal/component/ets/toggle.d.ts b/api/@internal/component/ets/toggle.d.ts index b51b5b490e..287e86e8c8 100644 --- a/api/@internal/component/ets/toggle.d.ts +++ b/api/@internal/component/ets/toggle.d.ts @@ -50,7 +50,7 @@ interface ToggleInterface { } /** - * Defines the toggle attibute functions + * Defines the toggle attribute functions * @since 8 */ declare class ToggleAttribute extends CommonMethod { diff --git a/api/@internal/ets/global.d.ts b/api/@internal/ets/global.d.ts index 8040d61a98..ac16fd7e2d 100644 --- a/api/@internal/ets/global.d.ts +++ b/api/@internal/ets/global.d.ts @@ -82,7 +82,7 @@ export declare function setInterval(handler: Function | string, delay: number, . export declare function setTimeout(handler: Function | string, delay?: number, ...arguments: any[]): number; /** - * Cancels the interval set by " setInterval()". + * Cancel the interval set by " setInterval()". * @syscap SystemCapability.ArkUI.ArkUI.Full * @param intervalID Indicates the timer ID returned by "setInterval()". * @since 7 @@ -90,7 +90,7 @@ export declare function setTimeout(handler: Function | string, delay?: number, . export declare function clearInterval(intervalID?: number): void; /** - * Cancels the timer set by "setTimeout()". + * Cancel the timer set by "setTimeout()". * @syscap SystemCapability.ArkUI.ArkUI.Full * @param timeoutID Indicates the timer ID returned by "setTimeout()". * @since 7 diff --git a/api/@ohos.curves.d.ts b/api/@ohos.curves.d.ts index 4eb74e0d97..bc7b2df505 100644 --- a/api/@ohos.curves.d.ts +++ b/api/@ohos.curves.d.ts @@ -76,6 +76,7 @@ declare namespace curves { * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 * @deprecated since 9 + * @useinstead initCurve */ function init(curve?: Curve): string; @@ -97,6 +98,7 @@ declare namespace curves { * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 * @deprecated since 9 + * @useinstead stepsCurve */ function steps(count: number, end: boolean): string; @@ -120,6 +122,7 @@ declare namespace curves { * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 * @deprecated since 9 + * @useinstead cubicBezierCurve */ function cubicBezier(x1: number, y1: number, x2: number, y2: number): string; @@ -145,6 +148,7 @@ declare namespace curves { * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 7 * @deprecated since 9 + * @useinstead springCurve */ function spring(velocity: number, mass: number, stiffness: number, damping: number): string; diff --git a/api/@system.mediaquery.d.ts b/api/@system.mediaquery.d.ts index 445cd2d1ee..e0b58acc47 100644 --- a/api/@system.mediaquery.d.ts +++ b/api/@system.mediaquery.d.ts @@ -73,7 +73,7 @@ export interface MediaQueryList { } /** - * Defines the mediaqurey interface. + * Defines the mediaquery interface. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 3 */ diff --git a/api/@system.router.d.ts b/api/@system.router.d.ts index 0867df975c..83cc054702 100644 --- a/api/@system.router.d.ts +++ b/api/@system.router.d.ts @@ -16,7 +16,8 @@ /** * Defines the option of router. * @syscap SystemCapability.ArkUI.ArkUI.Lite - * @deprecated since 8, please use @ohos.router instead. + * @deprecated since 8 + * @useinstead @ohos.router * @since 3 */ export interface RouterOptions { @@ -45,7 +46,8 @@ export interface RouterOptions { /** * Defines the option of router back. * @syscap SystemCapability.ArkUI.ArkUI.Full - * @deprecated since 8, please use @ohos.router instead. + * @deprecated since 8 + * @useinstead @ohos.router * @since 7 */ export interface BackRouterOptions { @@ -68,7 +70,8 @@ export interface BackRouterOptions { /** * Defines the state of router. * @syscap SystemCapability.ArkUI.ArkUI.Full - * @deprecated since 8, please use @ohos.router instead. + * @deprecated since 8 + * @useinstead @ohos.router * @since 3 */ export interface RouterState { @@ -98,7 +101,8 @@ export interface RouterState { /** * Defines the option of EnableAlertBeforeBackPage. * @syscap SystemCapability.ArkUI.ArkUI.Full - * @deprecated since 8, please use @ohos.router instead. + * @deprecated since 8 + * @useinstead @ohos.router * @since 6 */ export interface EnableAlertBeforeBackPageOptions { @@ -134,7 +138,8 @@ export interface EnableAlertBeforeBackPageOptions { /** * Defines the option of DisableAlertBeforeBackPage. * @syscap SystemCapability.ArkUI.ArkUI.Full - * @deprecated since 8, please use @ohos.router instead. + * @deprecated since 8 + * @useinstead @ohos.router * @since 6 */ export interface DisableAlertBeforeBackPageOptions { @@ -167,7 +172,8 @@ type ParamsInterface = { /** * Defines the Router interface. * @syscap SystemCapability.ArkUI.ArkUI.Lite - * @deprecated since 8, please use @ohos.router instead. + * @deprecated since 8 + * @useinstead @ohos.router * @since 3 */ export default class Router { diff --git a/api/common/full/dom.d.ts b/api/common/full/dom.d.ts index 6d9ea5aeea..96a2cb5dbd 100644 --- a/api/common/full/dom.d.ts +++ b/api/common/full/dom.d.ts @@ -21,7 +21,7 @@ import { Element } from './viewmodel'; */ export declare class dom { /** - * create a dynamic dom by tag, rturn element + * create a dynamic dom by tag, return element * @param tag dom tag * @since 8 */ diff --git a/api/common/full/viewmodel.d.ts b/api/common/full/viewmodel.d.ts index 06b578c7fd..991dd2553d 100644 --- a/api/common/full/viewmodel.d.ts +++ b/api/common/full/viewmodel.d.ts @@ -20,7 +20,7 @@ import image from "../../@ohos.multimedia.image"; import { CanvasPattern } from './canvaspattern'; /** - * Defines the foucs param. + * Defines the focus param. * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 3 */ @@ -555,7 +555,7 @@ export interface observer { observe(callback: string): void; /** - * Turn off the listenerr. + * Turn off the listener. * @since 6 */ unobserve(): void; @@ -2546,7 +2546,7 @@ export interface ViewModel { $t(path: string, params?: object | Array): string; /** - * Converses between singular and plural forms based on the system language, for example, this.$tc('strings.plurals'). + * Converse between singular and plural forms based on the system language, for example, this.$tc('strings.plurals'). * NOTE * The resource content is distinguished by the following JSON keys: zero, one, two, few, many, and other. * @param path Resource file path. @@ -2698,7 +2698,7 @@ export declare class Locate { language: string; /** - * country or regin, such ass 'CN'. + * country or region, such ass 'CN'. * @since 4 */ countryOrRegion: string; @@ -2796,7 +2796,7 @@ export interface Options> { /** * Listens for page active. - * Called when the page is activing. + * Called when the page is active. * @since 5 */ onActive?(): void; -- Gitee From 8ea79ef1530a5c162028312d4f297307a8c9436f Mon Sep 17 00:00:00 2001 From: zhouke Date: Thu, 24 Nov 2022 11:58:12 +0800 Subject: [PATCH 401/438] @ohos.uitest.d.ts modify. Signed-off-by: . Signed-off-by: zhouke --- api/@ohos.uitest.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/api/@ohos.uitest.d.ts b/api/@ohos.uitest.d.ts index eeb34b69b9..dc9db54b6c 100644 --- a/api/@ohos.uitest.d.ts +++ b/api/@ohos.uitest.d.ts @@ -576,10 +576,10 @@ declare interface Rect { * @since 9 */ declare interface WindowFilter { - readonly bundleName?: string; - readonly title?: string; - readonly focused?: boolean; - readonly actived?: boolean; + bundleName?: string; + title?: string; + focused?: boolean; + actived?: boolean; } /** -- Gitee From 076895d0107b00f576f52a69b9e422e6ab5fa80f Mon Sep 17 00:00:00 2001 From: wangtiantian Date: Thu, 24 Nov 2022 11:54:26 +0800 Subject: [PATCH 402/438] IssueNo:#I62TZ3 Description:fix spell bug Sig:SIG_ApplicaitonFramework Feature or Bugfix:Bugfix Binary Source:No Signed-off-by: wangtiantian --- api/@ohos.bundle.d.ts | 26 ++++++++++++------------ api/@ohos.bundle.innerBundleManager.d.ts | 10 ++++----- api/@ohos.bundle.installer.d.ts | 4 ++-- api/@ohos.distributedBundle.d.ts | 4 ++-- api/@ohos.zlib.d.ts | 4 ++-- api/bundle/bundleInstaller.d.ts | 12 +++++------ 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/api/@ohos.bundle.d.ts b/api/@ohos.bundle.d.ts index 7f0fba3c7d..d9285e25e2 100644 --- a/api/@ohos.bundle.d.ts +++ b/api/@ohos.bundle.d.ts @@ -275,7 +275,7 @@ declare namespace bundle { * @param bundleName Indicates the application bundle name to be queried. * @param bundleFlags Indicates the application bundle flags to be queried. * @param options Indicates the bundle options object. - * @return Returns the BundleInfo object. + * @returns Returns the BundleInfo object. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @deprecated since 9 * @useinstead ohos.bundle.bundleManager#getBundleInfo @@ -289,7 +289,7 @@ declare namespace bundle { * * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework - * @return Returns the IBundleInstaller interface. + * @returns Returns the IBundleInstaller interface. * @permission ohos.permission.INSTALL_BUNDLE * @systemapi Hide this for inner system use * @deprecated since 9 @@ -305,7 +305,7 @@ declare namespace bundle { * @syscap SystemCapability.BundleManager.BundleFramework * @param bundleName Indicates the application bundle name to be queried. * @param abilityName Indicates the ability name. - * @return Returns the AbilityInfo object for the current ability. + * @returns Returns the AbilityInfo object for the current ability. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @deprecated since 9 * @useinstead ohos.bundle.bundleManager#queryAbilityInfo @@ -322,7 +322,7 @@ declare namespace bundle { * @param bundleFlags Indicates the flag used to specify information contained in the ApplicationInfo object * that will be returned. * @param userId Indicates the user ID or do not pass user ID. - * @return Returns the ApplicationInfo object. + * @returns Returns the ApplicationInfo object. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @deprecated since 9 * @useinstead ohos.bundle.bundleManager#getApplicationInfo @@ -341,7 +341,7 @@ declare namespace bundle { * @param bundleFlags Indicates the flag used to specify information contained in the AbilityInfo objects that * will be returned. * @param userId Indicates the user ID. - * @return Returns a list of AbilityInfo objects. + * @returns Returns a list of AbilityInfo objects. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @deprecated since 9 * @useinstead ohos.bundle.bundleManager#queryAbilityInfo @@ -358,7 +358,7 @@ declare namespace bundle { * @param bundleFlag Indicates the flag used to specify information contained in the BundleInfo that will be * returned. * @param userId Indicates the user id. - * @return Returns a list of BundleInfo objects. + * @returns Returns a list of BundleInfo objects. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @deprecated since 9 * @useinstead ohos.bundle.bundleManager#getAllBundleInfo @@ -375,7 +375,7 @@ declare namespace bundle { * @param bundleFlags Indicates the flag used to specify information contained in the ApplicationInfo objects * that will be returned. * @param userId Indicates the user ID or do not pass user ID. - * @return Returns a list of ApplicationInfo objects. + * @returns Returns a list of ApplicationInfo objects. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @deprecated since 9 * @useinstead ohos.bundle.bundleManager#getAllApplicationInfo @@ -390,7 +390,7 @@ declare namespace bundle { * @since 8 * @syscap SystemCapability.BundleManager.BundleFramework * @param uid Indicates the UID of an application. - * @return Returns the bundle name. + * @returns Returns the bundle name. * @deprecated since 9 * @useinstead ohos.bundle.bundleManager#getNameForUid */ @@ -406,7 +406,7 @@ declare namespace bundle { * directory of the current application. * @param bundleFlags Indicates the flag used to specify information contained in the BundleInfo object to be * returned. - * @return Returns the BundleInfo object. + * @returns Returns the BundleInfo object. * @deprecated since 9 * @useinstead ohos.bundle.bundleManager#getBundleArchiveInfo */ @@ -422,7 +422,7 @@ declare namespace bundle { * @since 7 * @syscap SystemCapability.BundleManager.BundleFramework * @param bundleName Indicates the bundle name of the application. - * @return Returns the Want for starting the application's main ability if any; returns null if + * @returns Returns the Want for starting the application's main ability if any; returns null if * the given bundle does not exist or does not contain any main ability. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @deprecated since 9 @@ -484,7 +484,7 @@ declare namespace bundle { * @since 8 * @syscap SystemCapability.BundleManager.BundleFramework * @param permissionName Indicates permission name. - * @return Returns permissionDef object. + * @returns Returns permissionDef object. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @systemapi * @deprecated since 9 @@ -501,7 +501,7 @@ declare namespace bundle { * @param bundleName Indicates the bundle name of the application to which the ability belongs. * @param abilityName Indicates the ability name. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO - * @return Returns the label representing the label of the specified ability. + * @returns Returns the label representing the label of the specified ability. * @deprecated since 9 * @useinstead ohos.bundle.bundleManager#getAbilityLabel */ @@ -515,7 +515,7 @@ declare namespace bundle { * @syscap SystemCapability.BundleManager.BundleFramework * @param bundleName Indicates the bundle name of the application to which the ability belongs. * @param abilityName Indicates the ability name. - * @return Returns the PixelMap object representing the icon of the specified ability. + * @returns Returns the PixelMap object representing the icon of the specified ability. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO * @deprecated since 9 * @useinstead ohos.bundle.bundleManager#getAbilityIcon diff --git a/api/@ohos.bundle.innerBundleManager.d.ts b/api/@ohos.bundle.innerBundleManager.d.ts index 526e4bee19..e979c17a9e 100644 --- a/api/@ohos.bundle.innerBundleManager.d.ts +++ b/api/@ohos.bundle.innerBundleManager.d.ts @@ -36,7 +36,7 @@ declare namespace innerBundleManager { * @syscap SystemCapability.BundleManager.BundleFramework * @param bundleName Indicates the application bundle name to be queried. * @param userId Indicates the id for the user. - * @return Returns the LauncherAbilityInfo object. + * @returns Returns the LauncherAbilityInfo object. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @systemapi Hide this for inner system use * @deprecated since 9 @@ -52,7 +52,7 @@ declare namespace innerBundleManager { * @syscap SystemCapability.BundleManager.BundleFramework * @param type Indicates the command should be implement. * @param LauncherStatusCallback Indicates the callback to be register. - * @return { string | Promise } Returns the result of register. + * @returns { string | Promise } Returns the result of register. * @permission ohos.permission.LISTEN_BUNDLE_CHANGE * @systemapi Hide this for inner system use * @deprecated since 9 @@ -67,7 +67,7 @@ declare namespace innerBundleManager { * @since 8 * @syscap SystemCapability.BundleManager.BundleFramework * @param type Indicates the command should be implement. - * @return { string | Promise } Returns the result of unregister. + * @returns { string | Promise } Returns the result of unregister. * @permission ohos.permission.LISTEN_BUNDLE_CHANGE * @systemapi Hide this for inner system use * @deprecated since 9 @@ -82,7 +82,7 @@ declare namespace innerBundleManager { * @since 8 * @syscap SystemCapability.BundleManager.BundleFramework * @param userId Indicates the id for the user. - * @return Returns the LauncherAbilityInfo object. + * @returns Returns the LauncherAbilityInfo object. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @systemapi Hide this for inner system use * @deprecated since 9 @@ -97,7 +97,7 @@ declare namespace innerBundleManager { * @since 8 * @syscap SystemCapability.BundleManager.BundleFramework * @param bundleName Indicates the application bundle name to be queried. - * @return Returns the LauncherShortcutInfo object. + * @returns Returns the LauncherShortcutInfo object. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @systemapi Hide this for inner system use * @deprecated since 9 diff --git a/api/@ohos.bundle.installer.d.ts b/api/@ohos.bundle.installer.d.ts index 40ffa7185a..50cc5f8742 100644 --- a/api/@ohos.bundle.installer.d.ts +++ b/api/@ohos.bundle.installer.d.ts @@ -95,8 +95,8 @@ declare namespace installer { /** * recover an application. * @permission ohos.permission.INSTALL_BUNDLE - * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled. - * @param { InstallParam } installParam - Indicates other parameters required for the uninstall. + * @param { string } bundleName - Indicates the bundle name of the application to be recovered. + * @param { InstallParam } installParam - Indicates other parameters required for the recover. * @param { AsyncCallback } callback - The callback of recovering application result. * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. * @throws { BusinessError } 401 - Input parameters check failed. diff --git a/api/@ohos.distributedBundle.d.ts b/api/@ohos.distributedBundle.d.ts index 0edb99e97f..5e19007e92 100644 --- a/api/@ohos.distributedBundle.d.ts +++ b/api/@ohos.distributedBundle.d.ts @@ -33,7 +33,7 @@ import { RemoteAbilityInfo } from './bundle/remoteAbilityInfo'; * @since 8 * @syscap SystemCapability.BundleManager.DistributedBundleFramework * @param elementName Indicates the elementName. - * @return Returns the ability info of the remote device. + * @returns Returns the ability info of the remote device. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @systemapi * @deprecated since 9 @@ -48,7 +48,7 @@ import { RemoteAbilityInfo } from './bundle/remoteAbilityInfo'; * @since 8 * @syscap SystemCapability.BundleManager.DistributedBundleFramework * @param elementNames Indicates the elementNames, Maximum array length ten. - * @return Returns the ability infos of the remote device. + * @returns Returns the ability infos of the remote device. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED * @systemapi * @deprecated since 9 diff --git a/api/@ohos.zlib.d.ts b/api/@ohos.zlib.d.ts index 9230b0f9c4..68ac169d3c 100644 --- a/api/@ohos.zlib.d.ts +++ b/api/@ohos.zlib.d.ts @@ -81,7 +81,7 @@ declare namespace zlib { * @syscap SystemCapability.BundleManager.Zlib * @param inFile Indicates the path of the file to be compressed. * @param outFile Indicates the path of the output compressed file. - * @return Returns error code. + * @returns Returns error code. * @deprecated since 9 * @useinstead ohos.zlib#compressFile */ @@ -94,7 +94,7 @@ declare namespace zlib { * @syscap SystemCapability.BundleManager.Zlib * @param inFile Indicates the path of the file to be decompressed. * @param outFile Indicates the path of the decompressed file. - * @return Returns error code. + * @returns Returns error code. * @deprecated since 9 * @useinstead ohos.zlib#decompressFile */ diff --git a/api/bundle/bundleInstaller.d.ts b/api/bundle/bundleInstaller.d.ts index 95997273a7..f5c0832d0f 100644 --- a/api/bundle/bundleInstaller.d.ts +++ b/api/bundle/bundleInstaller.d.ts @@ -96,8 +96,8 @@ export interface BundleInstaller { * * @param bundleFilePaths Indicates the path where the bundle of the application is stored. The path should be the * relative path to the data directory of the current application. - * @param installParam Indicates other parameters required for the installation. - * @return InstallStatus + * @param param Indicates other parameters required for the installation. + * @returns InstallStatus * @permission ohos.permission.INSTALL_BUNDLE * @deprecated since 9 * @useinstead ohos.bundle.installer.BundleInstaller#install @@ -111,8 +111,8 @@ export interface BundleInstaller { * @syscap SystemCapability.BundleManager.BundleFramework * * @param bundleName Indicates the bundle name of the application to be uninstalled. - * @param installParam Indicates other parameters required for the uninstallation. - * @return InstallStatus + * @param param Indicates other parameters required for the uninstall. + * @returns InstallStatus * @permission ohos.permission.INSTALL_BUNDLE * @deprecated since 9 * @useinstead ohos.bundle.installer.BundleInstaller#uninstall @@ -126,8 +126,8 @@ export interface BundleInstaller { * @syscap SystemCapability.BundleManager.BundleFramework * * @param bundleName Indicates the bundle name of the application to be recovered. - * @param installParam Indicates other parameters required for the recover. - * @return InstallStatus + * @param param Indicates other parameters required for the recover. + * @returns InstallStatus * @permission ohos.permission.INSTALL_BUNDLE * @systemapi Hide this for inner system use * @deprecated since 9 -- Gitee From 6b2fe6e2f72af99d16d8c576a889caa280a2d70b Mon Sep 17 00:00:00 2001 From: shiyueeee Date: Thu, 24 Nov 2022 09:59:06 +0800 Subject: [PATCH 403/438] colorSpaceManager.d.ts correct spelling Signed-off-by: shiyueeee Change-Id: Iebe855daffc5c4c26fb88d4863bca8fdda4e74f8 --- api/@ohos.graphics.colorSpaceManager.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.graphics.colorSpaceManager.d.ts b/api/@ohos.graphics.colorSpaceManager.d.ts index e73dccbdfb..ff95a5b29b 100644 --- a/api/@ohos.graphics.colorSpaceManager.d.ts +++ b/api/@ohos.graphics.colorSpaceManager.d.ts @@ -135,7 +135,7 @@ import { AsyncCallback } from './basic'; } /** - * color space manager, created by color space infomation + * Defines a color space object and manages its key information * @since 9 * @syscap SystemCapability.Graphic.Graphic2D.ColorManager.Core */ @@ -163,7 +163,7 @@ import { AsyncCallback } from './basic'; } /** - * Create a color space manager by proviced color space type. + * Create a color space manager by provided color space type. * @param colorSpaceName Indicates the type of color space * @since 9 * @throws {BusinessError} 401 - If param is invalid -- Gitee From 48d50bf95dc4bdbff792b244778ace70508fb228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwangyipeng=E2=80=9D?= Date: Thu, 24 Nov 2022 11:42:03 +0800 Subject: [PATCH 404/438] fix:Fixed JS API Docs spelling errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: “wangyipeng” --- api/@ohos.usb.d.ts | 98 +++++++++++++++++++++++++++++++++----------- api/@ohos.usbV9.d.ts | 89 +++++++++++++++++++++++++++++----------- 2 files changed, 138 insertions(+), 49 deletions(-) diff --git a/api/@ohos.usb.d.ts b/api/@ohos.usb.d.ts index fce6f34e61..d0c2a77f21 100644 --- a/api/@ohos.usb.d.ts +++ b/api/@ohos.usb.d.ts @@ -21,7 +21,7 @@ declare namespace usb { /** * Obtains the USB device list. * - * @return Returns the {@link USBDevice} list. + * @returns Returns the {@link USBDevice} list. * @syscap SystemCapability.USB.USBManager * @since 8 */ @@ -31,7 +31,7 @@ declare namespace usb { * Connects to the USB device based on the device information returned by {@link getDevices()}. * * @param device USB device on the device list returned by {@link getDevices()}. - * @return Returns the {@link USBDevicePipe} object for data transfer. + * @returns Returns the {@link USBDevicePipe} object for data transfer. * @syscap SystemCapability.USB.USBManager * @since 8 */ @@ -41,7 +41,7 @@ declare namespace usb { * Checks whether the application has the permission to access the device. * * @param deviceName Device name defined by {@link USBDevice.name}. - * @return Returns **true** if the user has the permission to access the device; return **false** otherwise. + * @returns Returns **true** if the user has the permission to access the device; return **false** otherwise. * @syscap SystemCapability.USB.USBManager * @since 8 */ @@ -51,7 +51,7 @@ declare namespace usb { * Requests the temporary permission for a given application to access the USB device. * * @param deviceName Device name defined by {@link USBDevice.name}. - * @return Returns **true** if the temporary device access permissions are granted; return **false** otherwise. + * @returns Returns **true** if the temporary device access permissions are granted; return **false** otherwise. * @syscap SystemCapability.USB.USBManager * @since 8 */ @@ -61,7 +61,7 @@ declare namespace usb { * Converts the string descriptor of a given USB function list to a numeric mask combination. * * @param funcs Descriptor of the supported function list. - * @return Returns the numeric mask combination of the function list. + * @returns Returns the numeric mask combination of the function list. * @systemapi * @syscap SystemCapability.USB.USBManager * @since 9 @@ -72,7 +72,7 @@ declare namespace usb { * Converts the numeric mask combination of a given USB function list to a string descriptor. * * @param funcs Numeric mask combination of the function list. - * @return Returns the string descriptor of the supported function list. + * @returns Returns the string descriptor of the supported function list. * @systemapi * @syscap SystemCapability.USB.USBManager * @since 9 @@ -83,16 +83,17 @@ declare namespace usb { * Sets the current USB function list in Device mode. * * @param funcs Numeric mask combination of the supported function list. - * @return Returns **true** if the setting is successful; returns **false** otherwise. + * @returns Returns **true** if the setting is successful; returns **false** otherwise. * @systemapi * @syscap SystemCapability.USB.USBManager * @since 9 */ function setCurrentFunctions(funcs: FunctionType): Promise; + /** * Obtains the numeric mask combination for the current USB function list in Device mode. * - * @return Returns the numeric mask combination for the current USB function list in {@link FunctionType}. + * @returns Returns the numeric mask combination for the current USB function list in {@link FunctionType}. * @systemapi * @syscap SystemCapability.USB.USBManager * @since 9 @@ -103,7 +104,7 @@ declare namespace usb { /** * Obtains the {@link USBPort} list. * - * @return Returns the {@link USBPort} list. + * @returns Returns the {@link USBPort} list. * @systemapi * @syscap SystemCapability.USB.USBManager * @since 9 @@ -113,7 +114,7 @@ declare namespace usb { /** * Gets the mask combination for the supported mode list of the specified {@link USBPort}. * - * @return Returns the mask combination for the supported mode list in {@link PortModeType}. + * @returns Returns the mask combination for the supported mode list in {@link PortModeType}. * @systemapi * @syscap SystemCapability.USB.USBManager * @since 9 @@ -126,7 +127,7 @@ declare namespace usb { * @param portId Unique ID of the port. * @param powerRole Charging role defined by {@link PowerRoleType}. * @param dataRole Data role defined by {@link DataRoleType}. - * @return Returns the supported role type. + * @returns Returns the supported role type. * @systemapi * @syscap SystemCapability.USB.USBManager * @since 9 @@ -138,68 +139,74 @@ declare namespace usb { * Claims a USB interface. * * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address. - * @param iface USB interface defined by {@link USBInterface}, which is used to determine the interface to claim. + * @param iface USB interface defined by {@link USBInterface}, which is used to determine the interface to claim. * @param force Optional parameter that determines whether to forcibly claim the USB interface. - * @return Returns **0** if the USB interface is successfully claimed; returns an error code otherwise. + * @returns Returns **0** if the USB interface is successfully claimed; returns an error code otherwise. * @syscap SystemCapability.USB.USBManager * @since 8 */ function claimInterface(pipe: USBDevicePipe, iface: USBInterface, force?: boolean): number; + /** * Releases a USB interface. * * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address. - * @param iface USB interface defined by {@link USBInterface}, which is used to determine the interface to release. - * @return Returns **0** if the USB interface is successfully released; returns an error code otherwise. + * @param iface USB interface defined by {@link USBInterface}, which is used to determine the interface to release. + * @returns Returns **0** if the USB interface is successfully released; returns an error code otherwise. * @syscap SystemCapability.USB.USBManager * @since 8 */ function releaseInterface(pipe: USBDevicePipe, iface: USBInterface): number; + /** * Sets the device configuration. * * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address. * @param config Device configuration defined by {@link USBConfig}. - * @return Returns **0** if the device configuration is successfully set; returns an error code otherwise. + * @returns Returns **0** if the device configuration is successfully set; returns an error code otherwise. * @syscap SystemCapability.USB.USBManager * @since 8 */ function setConfiguration(pipe: USBDevicePipe, config: USBConfig): number; + /** * Sets a USB interface. * * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address. - * @param iface USB interface defined by {@link USBInterface}, which is used to determine the interface to set. - * @return Returns **0** if the USB interface is successfully set; return an error code otherwise. + * @param iface USB interface defined by {@link USBInterface}, which is used to determine the interface to set. + * @returns Returns **0** if the USB interface is successfully set; return an error code otherwise. * @syscap SystemCapability.USB.USBManager * @since 8 */ function setInterface(pipe: USBDevicePipe, iface: USBInterface): number; + /** * Obtains the raw USB descriptor. * * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address. - * @return Returns the raw descriptor data. + * @returns Returns the raw descriptor data. * @syscap SystemCapability.USB.USBManager * @since 8 */ function getRawDescriptor(pipe: USBDevicePipe): Uint8Array; + /** * Obtains the file descriptor. * * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the USB device. - * @return Returns the file descriptor of the USB device. + * @returns Returns the file descriptor of the USB device. * @syscap SystemCapability.USB.USBManager * @since 8 */ function getFileDescriptor(pipe: USBDevicePipe): number; + /** * Performs control transfer. * * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the USB device. * @param contrlparam Control transfer parameters. * @param timeout Timeout duration. This parameter is optional. The default value is **0**, indicating no timeout. - * @return Returns the size of the transmitted or received data block if the control transfer is successful; return **-1** if an exception occurs. + * @returns Returns the size of the transmitted or received data block if the control transfer is successful; return **-1** if an exception occurs. * @syscap SystemCapability.USB.USBManager * @since 8 */ @@ -212,7 +219,7 @@ declare namespace usb { * @param endpoint USB endpoint defined by {@link USBEndpoint}, which is used to determine the USB port for data transfer. * @param buffer Buffer for writing or reading data. * @param timeout Timeout duration. This parameter is optional. The default value is **0**, indicating no timeout. - * @return Returns the size of the transmitted or received data block if the control transfer is successful; return **-1** if an exception occurs. + * @returns Returns the size of the transmitted or received data block if the control transfer is successful; return **-1** if an exception occurs. * @syscap SystemCapability.USB.USBManager * @since 8 */ @@ -223,7 +230,7 @@ declare namespace usb { * Closes a USB device pipe. * * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the USB device. - * @return Returns **0** if the USB device pipe is closed successfully; return an error code otherwise. + * @returns Returns **0** if the USB device pipe is closed successfully; return an error code otherwise. * @syscap SystemCapability.USB.USBManager * @since 8 */ @@ -330,7 +337,7 @@ declare namespace usb { subClass: number; /** - * Alternating between descriptors of the same USB interface + * Alternation between descriptors of the same USB interface * * @since 8 */ @@ -423,72 +430,84 @@ declare namespace usb { * @since 8 */ busNum: number; + /** * Device address * * @since 8 */ devAddress: number; + /** * Device SN * * @since 8 */ serial: string; + /** * Device name * * @since 8 */ name: string; + /** * Device manufacturer * * @since 8 */ manufacturerName: string; + /** * Product information * * @since 8 */ productName: string; + /** * Product version * * @since 8 */ version: string; + /** * Vendor ID * * @since 8 */ vendorId: number; + /** * Product ID * * @since 8 */ productId: number; + /** * Device class * * @since 8 */ clazz: number; + /** * Device subclass * * @since 8 */ subClass: number; + /** * Device protocol code * * @since 8 */ protocol: number; + /** * Device configuration descriptor information defined by {@link USBConfig} * @@ -510,6 +529,7 @@ declare namespace usb { * @since 8 */ busNum: number; + /** * Device address * @@ -532,12 +552,14 @@ declare namespace usb { * @since 9 */ NONE = 0, + /** * External power supply * * @since 9 */ SOURCE = 1, + /** * Internal power supply * @@ -560,12 +582,14 @@ declare namespace usb { * @since 9 */ NONE = 0, + /** * Host mode * * @since 9 */ HOST = 1, + /** * Device mode * @@ -588,24 +612,28 @@ declare namespace usb { * @since 9 */ NONE = 0, + /** * Upstream facing port, which functions as the sink of power supply * * @since 9 */ UFP = 1, + /** * Downstream facing port, which functions as the source of power supply * * @since 9 */ DFP = 2, + /** - * Dynamic reconfiguration port (DRP), which can function as the DFP (host) or UFP (device). It is not supported currently. + * Dynamic configuration port (DRP), which can function as the DFP (host) or UFP (device). It is not supported currently. * * @since 9 */ DRP = 3, + /** * Not supported currently * @@ -687,30 +715,35 @@ declare namespace usb { * @since 8 */ request: number; + /** * Request target type * * @since 8 */ target: USBRequestTargetType; + /** * Control request type * * @since 8 */ reqType: USBControlRequestType; + /** * Request parameter value * * @since 8 */ value: number; + /** * Index of the parameter value * * @since 8 */ index: number; + /** * Data written to or read from the buffer * @since 8 @@ -731,18 +764,21 @@ declare namespace usb { * @since 8 */ USB_REQUEST_TARGET_DEVICE = 0, + /** * USB interface * * @since 8 */ USB_REQUEST_TARGET_INTERFACE = 1, + /** * Endpoint * * @since 8 */ USB_REQUEST_TARGET_ENDPOINT = 2, + /** * Others * @@ -764,12 +800,14 @@ declare namespace usb { * @since 8 */ USB_REQUEST_TYPE_STANDARD = 0, + /** * Class * * @since 8 */ USB_REQUEST_TYPE_CLASS = 1, + /** * Vendor * @@ -791,6 +829,7 @@ declare namespace usb { * @since 8 */ USB_REQUEST_DIR_TO_DEVICE = 0, + /** * Request for reading data from the device to the host * @@ -813,54 +852,63 @@ declare namespace usb { * @since 9 */ NONE = 0, + /** * Serial port device * * @since 9 */ ACM = 1, + /** * Ethernet port device * * @since 9 */ ECM = 2, + /** * HDC device * * @since 9 */ HDC = 4, + /** * MTP device * * @since 9 */ MTP = 8, + /** * PTP device * * @since 9 */ PTP = 16, + /** * RNDIS device * * @since 9 */ RNDIS = 32, + /** * MIDI device * * @since 9 */ MIDI = 64, + /** * Audio source device * * @since 9 */ AUDIO_SOURCE = 128, + /** * NCM device * diff --git a/api/@ohos.usbV9.d.ts b/api/@ohos.usbV9.d.ts index 5ff0ebbe45..7d365909f3 100644 --- a/api/@ohos.usbV9.d.ts +++ b/api/@ohos.usbV9.d.ts @@ -23,7 +23,7 @@ declare namespace usbV9 { /** * Obtains the USB device list. * - * @return Returns the {@link USBDevice} list. + * @returns Returns the {@link USBDevice} list. * @syscap SystemCapability.USB.USBManager * @since 9 */ @@ -33,7 +33,7 @@ declare namespace usbV9 { * Connects to the USB device based on the device information returned by {@link getDevices()}. * * @param device USB device on the device list returned by {@link getDevices()}. - * @return Returns the {@link USBDevicePipe} object for data transfer. + * @returns Returns the {@link USBDevicePipe} object for data transfer. * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @throws {BusinessError} 14400001 - USB Device access denied. * @syscap SystemCapability.USB.USBManager @@ -45,7 +45,7 @@ declare namespace usbV9 { * Checks whether the application has the permission to access the device. * * @param deviceName Device name defined by {@link USBDevice.name}. - * @return Returns **true** if the user has the permission to access the device; return **false** otherwise. + * @returns Returns **true** if the user has the permission to access the device; return **false** otherwise. * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @syscap SystemCapability.USB.USBManager * @since 9 @@ -56,7 +56,7 @@ declare namespace usbV9 { * Requests the permission for a given application to access the USB device. * * @param deviceName Device name defined by {@link USBDevice.name}. - * @return Returns **true** if the device access permissions are granted; return **false** otherwise. + * @returns Returns **true** if the device access permissions are granted; return **false** otherwise. * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @syscap SystemCapability.USB.USBManager * @since 9 @@ -67,7 +67,7 @@ declare namespace usbV9 { * Remove the permission for a given application to access the USB device. * * @param deviceName Device name defined by {@link USBDevice.name}. - * @return Returns **true** if the device access permissions are removed; return **false** otherwise. + * @returns Returns **true** if the device access permissions are removed; return **false** otherwise. * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @syscap SystemCapability.USB.USBManager * @since 9 @@ -79,7 +79,7 @@ declare namespace usbV9 { * * @param bundleName refers to application that require access permissions. * @param deviceName Device name defined by {@link USBDevice.name}. - * @return Returns the boolean value to indicate whether the permission is granted. + * @returns Returns the boolean value to indicate whether the permission is granted. * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @systemapi * @syscap SystemCapability.USB.USBManager @@ -91,7 +91,7 @@ declare namespace usbV9 { * Converts the string descriptor of a given USB function list to a numeric mask combination. * * @param funcs Descriptor of the supported function list. - * @return Returns the numeric mask combination of the function list. + * @returns Returns the numeric mask combination of the function list. * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @systemapi * @syscap SystemCapability.USB.USBManager @@ -103,7 +103,7 @@ declare namespace usbV9 { * Converts the numeric mask combination of a given USB function list to a string descriptor. * * @param funcs Numeric mask combination of the function list. - * @return Returns the string descriptor of the supported function list. + * @returns Returns the string descriptor of the supported function list. * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @systemapi * @syscap SystemCapability.USB.USBManager @@ -115,7 +115,7 @@ declare namespace usbV9 { * Sets the current USB function list in Device mode. * * @param funcs Numeric mask combination of the supported function list. - * @return Returns **true** if the setting is successful; returns **false** otherwise. + * @returns Returns **true** if the setting is successful; returns **false** otherwise. * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @systemapi * @syscap SystemCapability.USB.USBManager @@ -126,7 +126,7 @@ declare namespace usbV9 { /** * Obtains the numeric mask combination for the current USB function list in Device mode. * - * @return Returns the numeric mask combination for the current USB function list in {@link FunctionType}. + * @returns Returns the numeric mask combination for the current USB function list in {@link FunctionType}. * @systemapi * @syscap SystemCapability.USB.USBManager * @since 9 @@ -137,7 +137,7 @@ declare namespace usbV9 { /** * Obtains the {@link USBPort} list. * - * @return Returns the {@link USBPort} list. + * @returns Returns the {@link USBPort} list. * @systemapi * @syscap SystemCapability.USB.USBManager * @since 9 @@ -147,7 +147,7 @@ declare namespace usbV9 { /** * Gets the mask combination for the supported mode list of the specified {@link USBPort}. * - * @return Returns the mask combination for the supported mode list in {@link PortModeType}. + * @returns Returns the mask combination for the supported mode list in {@link PortModeType}. * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @systemapi * @syscap SystemCapability.USB.USBManager @@ -161,7 +161,7 @@ declare namespace usbV9 { * @param portId Unique ID of the port. * @param powerRole Charging role defined by {@link PowerRoleType}. * @param dataRole Data role defined by {@link DataRoleType}. - * @return Returns the supported role type. + * @returns Returns the supported role type. * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @systemapi * @syscap SystemCapability.USB.USBManager @@ -176,7 +176,7 @@ declare namespace usbV9 { * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address. * @param iface USB interface defined by {@link USBInterface}, which is used to determine the interface to claim. * @param force Optional parameter that determines whether to forcibly claim the USB interface. - * @return Returns **0** if the USB interface is successfully claimed; returns an error code otherwise. + * @returns Returns **0** if the USB interface is successfully claimed; returns an error code otherwise. * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @syscap SystemCapability.USB.USBManager * @since 9 @@ -188,7 +188,7 @@ declare namespace usbV9 { * * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address. * @param iface USB interface defined by {@link USBInterface}, which is used to determine the interface to release. - * @return Returns **0** if the USB interface is successfully released; returns an error code otherwise. + * @returns Returns **0** if the USB interface is successfully released; returns an error code otherwise. * @syscap SystemCapability.USB.USBManager * @since 9 */ @@ -199,7 +199,7 @@ declare namespace usbV9 { * * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address. * @param config Device configuration defined by {@link USBConfig}. - * @return Returns **0** if the device configuration is successfully set; returns an error code otherwise. + * @returns Returns **0** if the device configuration is successfully set; returns an error code otherwise. * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @syscap SystemCapability.USB.USBManager * @since 9 @@ -211,7 +211,7 @@ declare namespace usbV9 { * * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address. * @param iface USB interface defined by {@link USBInterface}, which is used to determine the interface to set. - * @return Returns **0** if the USB interface is successfully set; return an error code otherwise. + * @returns Returns **0** if the USB interface is successfully set; return an error code otherwise. * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @syscap SystemCapability.USB.USBManager * @since 9 @@ -222,7 +222,7 @@ declare namespace usbV9 { * Obtains the raw USB descriptor. * * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the bus number and device address. - * @return Returns the raw descriptor data. + * @returns Returns the raw descriptor data. * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @syscap SystemCapability.USB.USBManager * @since 9 @@ -233,7 +233,7 @@ declare namespace usbV9 { * Obtains the file descriptor. * * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the USB device. - * @return Returns the file descriptor of the USB device. + * @returns Returns the file descriptor of the USB device. * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @syscap SystemCapability.USB.USBManager * @since 9 @@ -246,7 +246,7 @@ declare namespace usbV9 { * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the USB device. * @param contrlparam Control transfer parameters. * @param timeout Timeout duration. This parameter is optional. The default value is **0**, indicating no timeout. - * @return Returns the size of the transmitted or received data block if the control transfer is successful; return **-1** if an exception occurs. + * @returns Returns the size of the transmitted or received data block if the control transfer is successful; return **-1** if an exception occurs. * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @syscap SystemCapability.USB.USBManager * @since 9 @@ -260,7 +260,7 @@ declare namespace usbV9 { * @param endpoint USB endpoint defined by {@link USBEndpoint}, which is used to determine the USB port for data transfer. * @param buffer Buffer for writing or reading data. * @param timeout Timeout duration. This parameter is optional. The default value is **0**, indicating no timeout. - * @return Returns the size of the transmitted or received data block if the control transfer is successful; return **-1** if an exception occurs. + * @returns Returns the size of the transmitted or received data block if the control transfer is successful; return **-1** if an exception occurs. * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @syscap SystemCapability.USB.USBManager * @since 9 @@ -272,7 +272,7 @@ declare namespace usbV9 { * Closes a USB device pipe. * * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the USB device. - * @return Returns **0** if the USB device pipe is closed successfully; return an error code otherwise. + * @returns Returns **0** if the USB device pipe is closed successfully; return an error code otherwise. * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @syscap SystemCapability.USB.USBManager * @since 9 @@ -382,7 +382,7 @@ declare namespace usbV9 { subClass: number; /** - * Alternating between descriptors of the same USB interface + * Alternation between descriptors of the same USB interface * * @since 9 */ @@ -477,72 +477,84 @@ declare namespace usbV9 { * @since 9 */ busNum: number; + /** * Device address * * @since 9 */ devAddress: number; + /** * Device SN * * @since 9 */ serial: string; + /** * Device name * * @since 9 */ name: string; + /** * Device manufacturer * * @since 9 */ manufacturerName: string; + /** * Product information * * @since 9 */ productName: string; + /** * Product version * * @since 9 */ version: string; + /** * Vendor ID * * @since 9 */ vendorId: number; + /** * Product ID * * @since 9 */ productId: number; + /** * Device class * * @since 9 */ clazz: number; + /** * Device subclass * * @since 9 */ subClass: number; + /** * Device protocol code * * @since 9 */ protocol: number; + /** * Device configuration descriptor information defined by {@link USBConfig} * @@ -565,6 +577,7 @@ declare namespace usbV9 { * @since 9 */ busNum: number; + /** * Device address * @@ -588,12 +601,14 @@ declare namespace usbV9 { * @since 9 */ NONE = 0, + /** * External power supply * * @since 9 */ SOURCE = 1, + /** * Internal power supply * @@ -617,12 +632,14 @@ declare namespace usbV9 { * @since 9 */ NONE = 0, + /** * Host mode * * @since 9 */ HOST = 1, + /** * Device mode * @@ -646,24 +663,28 @@ declare namespace usbV9 { * @since 9 */ NONE = 0, + /** * Upstream facing port, which functions as the sink of power supply * * @since 9 */ UFP = 1, + /** * Downstream facing port, which functions as the source of power supply * * @since 9 */ DFP = 2, + /** - * Dynamic reconfiguration port (DRP), which can function as the DFP (host) or UFP (device). It is not supported currently. + * Dynamic configuration port (DRP), which can function as the DFP (host) or UFP (device). It is not supported currently. * * @since 9 */ DRP = 3, + /** * Not supported currently * @@ -748,30 +769,35 @@ declare namespace usbV9 { * @since 9 */ request: number; + /** * Request target type * * @since 9 */ target: USBRequestTargetType; + /** * Control request type * * @since 9 */ reqType: USBControlRequestType; + /** * Request parameter value * * @since 9 */ value: number; + /** * Index of the parameter value * * @since 9 */ index: number; + /** * Data written to or read from the buffer * @since 9 @@ -793,18 +819,21 @@ declare namespace usbV9 { * @since 9 */ USB_REQUEST_TARGET_DEVICE = 0, + /** * USB interface * * @since 9 */ USB_REQUEST_TARGET_INTERFACE = 1, + /** * Endpoint * * @since 9 */ USB_REQUEST_TARGET_ENDPOINT = 2, + /** * Others * @@ -827,12 +856,14 @@ declare namespace usbV9 { * @since 9 */ USB_REQUEST_TYPE_STANDARD = 0, + /** * Class * * @since 9 */ USB_REQUEST_TYPE_CLASS = 1, + /** * Vendor * @@ -855,6 +886,7 @@ declare namespace usbV9 { * @since 9 */ USB_REQUEST_DIR_TO_DEVICE = 0, + /** * Request for reading data from the device to the host * @@ -878,54 +910,63 @@ declare namespace usbV9 { * @since 9 */ NONE = 0, + /** * Serial port device * * @since 9 */ ACM = 1, + /** * Ethernet port device * * @since 9 */ ECM = 2, + /** * HDC device * * @since 9 */ HDC = 4, + /** * MTP device * * @since 9 */ MTP = 8, + /** * PTP device * * @since 9 */ PTP = 16, + /** * RNDIS device * * @since 9 */ RNDIS = 32, + /** * MIDI device * * @since 9 */ MIDI = 64, + /** * Audio source device * * @since 9 */ AUDIO_SOURCE = 128, + /** * NCM device * -- Gitee From 8bafe130f453c8fe46872c346d7e2b0c473ef942 Mon Sep 17 00:00:00 2001 From: zaki Date: Thu, 24 Nov 2022 17:04:13 +0800 Subject: [PATCH 405/438] fix api docs problems of accessibility and init Signed-off-by: zaki Change-Id: I05b09938415f51d9429fc7e0f1858ea8120099e2 --- api/@ohos.accessibility.d.ts | 22 +++++++++++----------- api/@ohos.systemParameterV9.d.ts | 6 +++--- api/@ohos.systemparameter.d.ts | 6 +++--- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/api/@ohos.accessibility.d.ts b/api/@ohos.accessibility.d.ts index 5ca5f8250e..597532bead 100644 --- a/api/@ohos.accessibility.d.ts +++ b/api/@ohos.accessibility.d.ts @@ -88,7 +88,7 @@ declare namespace accessibility { * @since 7 * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @return Returns {@code true} if the accessibility is enabled; returns {@code false} otherwise. + * @returns Returns {@code true} if the accessibility is enabled; returns {@code false} otherwise. */ function isOpenAccessibility(callback: AsyncCallback): void; function isOpenAccessibility(): Promise; @@ -98,7 +98,7 @@ declare namespace accessibility { * @since 7 * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Vision - * @return Returns {@code true} if the touch browser is enabled; returns {@code false} otherwise. + * @returns Returns {@code true} if the touch browser is enabled; returns {@code false} otherwise. */ function isOpenTouchGuide(callback: AsyncCallback): void; function isOpenTouchGuide(): Promise; @@ -109,7 +109,7 @@ declare namespace accessibility { * @param abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken * @param stateType The state of the accessibility ability. {@code AbilityState} eg.installed * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @return Returns the list of abilityInfos. + * @returns Returns the list of abilityInfos. * @deprecated since 9 * @useinstead ohos.accessibility#getAccessibilityExtensionList */ @@ -125,7 +125,7 @@ declare namespace accessibility { * @param abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken * @param stateType The state of the accessibility ability. {@code AbilityState} eg.installed * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @return Returns the list of abilityInfos. + * @returns Returns the list of abilityInfos. * @throws { BusinessError } 401 - Input parameter error. */ function getAccessibilityExtensionList(abilityType: AbilityType, stateType: AbilityState): Promise>; @@ -137,7 +137,7 @@ declare namespace accessibility { * @param event The object of the accessibility {@code EventInfo} . * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @return Returns {@code true} if success ; returns {@code false} otherwise. + * @returns Returns {@code true} if success ; returns {@code false} otherwise. * @deprecated since 9 * @useinstead ohos.accessibility#sendAccessibilityEvent */ @@ -150,7 +150,7 @@ declare namespace accessibility { * @param event The object of the accessibility {@code EventInfo} . * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @return Returns {@code true} if success ; returns {@code false} otherwise. + * @returns Returns {@code true} if success ; returns {@code false} otherwise. * @throws { BusinessError } 401 - Input parameter error. */ function sendAccessibilityEvent(event: EventInfo, callback: AsyncCallback): void; @@ -162,7 +162,7 @@ declare namespace accessibility { * @param type state event type. * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @return Returns {@code true} if the register is success ; returns {@code false} otherwise. + * @returns Returns {@code true} if the register is success ; returns {@code false} otherwise. * @throws { BusinessError } 401 - Input parameter error. */ function on(type: 'accessibilityStateChange', callback: Callback): void; @@ -173,7 +173,7 @@ declare namespace accessibility { * @param type state event type. * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Vision - * @return Returns {@code true} if the register is success ; returns {@code false} otherwise. + * @returns Returns {@code true} if the register is success ; returns {@code false} otherwise. * @throws { BusinessError } 401 - Input parameter error. */ function on(type: 'touchGuideStateChange', callback: Callback): void; @@ -184,7 +184,7 @@ declare namespace accessibility { * @param type state event type * @param callback Asynchronous callback interface. * @syscap SystemCapability.BarrierFree.Accessibility.Core - * @return Returns {@code true} if the Unregister is success ; returns {@code false} otherwise. + * @returns Returns {@code true} if the Unregister is success ; returns {@code false} otherwise. * @throws { BusinessError } 401 - Input parameter error. */ function off(type: 'accessibilityStateChange', callback?: Callback): void; @@ -194,7 +194,7 @@ declare namespace accessibility { * @since 7 * @param type state event type * @param callback Asynchronous callback interface. - * @return Returns {@code true} if the Unregister is success ; returns {@code false} otherwise. + * @returns Returns {@code true} if the Unregister is success ; returns {@code false} otherwise. * @throws { BusinessError } 401 - Input parameter error. */ function off(type: 'touchGuideStateChange', callback?: Callback): void; @@ -203,7 +203,7 @@ declare namespace accessibility { * Get the captions manager. * @syscap SystemCapability.BarrierFree.Accessibility.Hearing * @since 8 - * @return Returns the captions manager. + * @returns Returns the captions manager. */ function getCaptionsManager(): CaptionsManager; diff --git a/api/@ohos.systemParameterV9.d.ts b/api/@ohos.systemParameterV9.d.ts index aee1b8584e..9d37d7f828 100755 --- a/api/@ohos.systemParameterV9.d.ts +++ b/api/@ohos.systemParameterV9.d.ts @@ -28,7 +28,7 @@ declare namespace systemParameterV9 { * * @param key Key of the system attribute. * @param def Default value. - * @return the value of the parameter. + * @returns the value of the parameter. * @throws {BusinessError} 401 - if type of key is not string or key is not specified. * @throws {BusinessError} 14700101 - if key is not found * @throws {BusinessError} 14700103 - if permission denied @@ -76,7 +76,7 @@ declare namespace systemParameterV9 { * @throws {BusinessError} 14700101 - if key is not found * @throws {BusinessError} 14700103 - if permission denied * @throws {BusinessError} 14700104 - if system internal error - * @return Promise, which is used to obtain the result asynchronously. + * @returns Promise, which is used to obtain the result asynchronously. * @syscap SystemCapability.Startup.SystemInfo * @since 9 */ @@ -116,7 +116,7 @@ declare namespace systemParameterV9 { * * @param key Key of the system attribute. * @param value Default value. - * @return Promise, which is used to obtain the result asynchronously. + * @returns Promise, which is used to obtain the result asynchronously. * @throws {BusinessError} 401 - if type of key is not string or key is not specified. * @throws {BusinessError} 14700102 - if value is invalid * @throws {BusinessError} 14700103 - if permission denied diff --git a/api/@ohos.systemparameter.d.ts b/api/@ohos.systemparameter.d.ts index 18f92152a4..93aa70a203 100644 --- a/api/@ohos.systemparameter.d.ts +++ b/api/@ohos.systemparameter.d.ts @@ -28,7 +28,7 @@ declare namespace systemParameter { * * @param key Key of the system attribute. * @param def Default value. - * @return if the parameter is empty or doesn't exist, empty string will be returned. + * @returns if the parameter is empty or doesn't exist, empty string will be returned. * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ @@ -60,7 +60,7 @@ declare namespace systemParameter { * * @param key Key of the system attribute. * @param def Default value. - * @return Promise, which is used to obtain the result asynchronously. + * @returns Promise, which is used to obtain the result asynchronously. * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ @@ -92,7 +92,7 @@ declare namespace systemParameter { * * @param key Key of the system attribute. * @param value Default value. - * @return Promise, which is used to obtain the result asynchronously. + * @returns Promise, which is used to obtain the result asynchronously. * @syscap SystemCapability.Startup.SystemInfo * @since 6 */ -- Gitee From 9f9ceb29b5daa405749b0cd82d506568d750a851 Mon Sep 17 00:00:00 2001 From: youliang_1314 Date: Thu, 24 Nov 2022 14:24:50 +0800 Subject: [PATCH 406/438] update iam Signed-off-by: youliang_1314 Change-Id: I500039fe768d58845653702de16ecd6e6a3dd32b --- api/@ohos.userIAM.faceAuth.d.ts | 2 + api/@ohos.userIAM.userAuth.d.ts | 152 ++++++++++++++++++++++++++++---- 2 files changed, 139 insertions(+), 15 deletions(-) diff --git a/api/@ohos.userIAM.faceAuth.d.ts b/api/@ohos.userIAM.faceAuth.d.ts index 798772c779..b3026ba676 100644 --- a/api/@ohos.userIAM.faceAuth.d.ts +++ b/api/@ohos.userIAM.faceAuth.d.ts @@ -16,12 +16,14 @@ /** * This module provides the capability to manage face auth. * @namespace faceAuth + * @syscap SystemCapability.UserIAM.UserAuth.FaceAuth * @since 9 */ declare namespace faceAuth { /** * Provides the abilities for face authentication. * @syscap SystemCapability.UserIAM.UserAuth.FaceAuth + * @systemapi Hide this for inner system use. * @since 9 */ class FaceAuthManager { diff --git a/api/@ohos.userIAM.userAuth.d.ts b/api/@ohos.userIAM.userAuth.d.ts index 776176bc31..f1ca18438f 100644 --- a/api/@ohos.userIAM.userAuth.d.ts +++ b/api/@ohos.userIAM.userAuth.d.ts @@ -22,69 +22,99 @@ import { AsyncCallback } from './basic'; * @since 6 */ declare namespace userAuth { + /** + * Enum for authentication result. + * @enum {number} + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 + * @deprecated since 8 + * @useinstead ohos.userIAM.userAuth.ResultCode + */ export enum AuthenticationResult { /** * Indicates that the device does not support authentication. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 * @deprecated since 8 */ NO_SUPPORT = -1, /** * Indicates that authentication is success. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 * @deprecated since 8 */ SUCCESS = 0, /** * Indicates the authenticator fails to identify user. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 * @deprecated since 8 */ COMPARE_FAILURE = 1, /** * Indicates that authentication has been canceled. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 * @deprecated since 8 */ CANCELED = 2, /** * Indicates that authentication has timed out. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 * @deprecated since 8 */ TIMEOUT = 3, /** * Indicates a failure to open the camera. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 * @deprecated since 8 */ CAMERA_FAIL = 4, /** * Indicates that the authentication task is busy. Wait for a few seconds and try again. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 * @deprecated since 8 */ BUSY = 5, /** * Indicates incorrect parameters. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 * @deprecated since 8 */ INVALID_PARAMETERS = 6, /** * Indicates that the authenticator is locked. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 * @deprecated since 8 */ LOCKED = 7, /** * Indicates that the user has not enrolled the authenticator. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 * @deprecated since 8 */ NOT_ENROLLED = 8, /** * Indicates other errors. + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 * @deprecated since 8 */ GENERAL_ERROR = 100, @@ -92,16 +122,25 @@ declare namespace userAuth { /** * Auth types + * @since 6 * @deprecated since 8 */ type AuthType = "ALL" | "FACE_ONLY"; /** * Secure levels + * @since 6 * @deprecated since 8 */ type SecureLevel = "S1" | "S2" | "S3" | "S4"; + /** + * Used to initiate authentication. + * @interface Authenticator + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 + * @deprecated since 8 + */ interface Authenticator { /** * Execute authentication. @@ -110,6 +149,7 @@ declare namespace userAuth { * @param level Indicates the security level. * @returns Returns authentication result, which is specified by AuthenticationResult. * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 6 * @deprecated since 8 */ execute(type: AuthType, level: SecureLevel, callback: AsyncCallback): void; @@ -128,6 +168,8 @@ declare namespace userAuth { * User authentication. * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 + * @deprecated since 9 + * @useinstead ohos.userIAM.userAuth.AuthInstance */ class UserAuth { /** @@ -192,6 +234,14 @@ declare namespace userAuth { cancelAuth(contextID : Uint8Array) : number; } + /** + * Asynchronous callback of authentication operation. + * @interface IUserAuthCallback + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 8 + * @deprecated since 9 + * @useinstead ohos.userIAM.userAuth.AuthEvent + */ interface IUserAuthCallback { /** * The authentication result code is returned through the callback. @@ -222,22 +272,38 @@ declare namespace userAuth { /** * Authentication result: authentication token, remaining authentication times, freezing time. - * @param token Pass the authentication result if the authentication is passed. - * @param remainTimes Return the remaining authentication times if the authentication fails. - * @param freezingTime Return the freezing time if the authentication executor is locked. + * @typedef AuthResult * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 * @deprecated since 9 * @useinstead ohos.userIAM.userAuth.AuthResultInfo */ interface AuthResult { + /** + * The authentication result if the authentication is passed. + * @type {Uint8Array} + * @since 8 + */ token ?: Uint8Array; + + /** + * The remaining authentication times if the authentication fails. + * @type {number} + * @since 8 + */ remainTimes ?: number; + + /** + * The freezing time if the authentication executor is locked. + * @type {number} + * @since 8 + */ freezingTime ?: number; } /** - * Result code. + * Enum for operation result. + * @enum {number} * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 * @deprecated since 9 @@ -248,6 +314,7 @@ declare namespace userAuth { * Indicates that the result is success or ability is supported. * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 + * @deprecated since 9 */ SUCCESS = 0, @@ -255,6 +322,7 @@ declare namespace userAuth { * Indicates the the result is failure or ability is not supported. * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 + * @deprecated since 9 */ FAIL = 1, @@ -262,6 +330,7 @@ declare namespace userAuth { * Indicates other errors. * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 + * @deprecated since 9 */ GENERAL_ERROR = 2, @@ -269,6 +338,7 @@ declare namespace userAuth { * Indicates that this operation has been canceled. * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 + * @deprecated since 9 */ CANCELED = 3, @@ -276,6 +346,7 @@ declare namespace userAuth { * Indicates that this operation has timed out. * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 + * @deprecated since 9 */ TIMEOUT = 4, @@ -283,6 +354,7 @@ declare namespace userAuth { * Indicates that this authentication type is not supported. * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 + * @deprecated since 9 */ TYPE_NOT_SUPPORT = 5, @@ -290,6 +362,7 @@ declare namespace userAuth { * Indicates that the authentication trust level is not supported. * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 + * @deprecated since 9 */ TRUST_LEVEL_NOT_SUPPORT = 6, @@ -297,6 +370,7 @@ declare namespace userAuth { * Indicates that the authentication task is busy. Wait for a few seconds and try again. * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 + * @deprecated since 9 */ BUSY = 7, @@ -304,6 +378,7 @@ declare namespace userAuth { * Indicates incorrect parameters. * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 + * @deprecated since 9 */ INVALID_PARAMETERS = 8, @@ -311,6 +386,7 @@ declare namespace userAuth { * Indicates that the authenticator is locked. * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 + * @deprecated since 9 */ LOCKED = 9, @@ -318,12 +394,14 @@ declare namespace userAuth { * Indicates that the user has not enrolled the authenticator. * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 + * @deprecated since 9 */ NOT_ENROLLED = 10 } /** - * Indicates the enumeration of prompt codes in the process of face authentication. + * The enumeration of prompt codes in the process of face authentication. + * @enum {number} * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 */ @@ -407,7 +485,8 @@ declare namespace userAuth { } /** - * Indicates the enumeration of prompt codes in the process of fingerprint authentication. + * The enumeration of prompt codes in the process of fingerprint authentication. + * @enum {number} * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 */ @@ -457,6 +536,7 @@ declare namespace userAuth { /** * Credential type for authentication. + * @enum {number} * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 */ @@ -478,6 +558,7 @@ declare namespace userAuth { /** * Trust level of authentication results. + * @enum {number} * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 8 */ @@ -524,6 +605,12 @@ declare namespace userAuth { */ type EventInfo = AuthResultInfo | TipInfo; + /** + * Asynchronous callback of authentication event. + * @interface AuthEvent + * @syscap SystemCapability.UserIAM.UserAuth.Core + * @since 9 + */ interface AuthEvent { /** * The authentication event callback. @@ -535,35 +622,66 @@ declare namespace userAuth { } /** - * Authentication result: authentication token, remaining authentication attempts, lockout duration. - * @param result Authentication result. - * @param token Pass the authentication token if the authentication is passed. - * @param remainAttempts Return the remaining authentication attempts if the authentication fails. - * @param lockoutDuration Return the lockout duration if the authentication executor is locked. + * Authentication result information. + * @typedef AuthResultInfo * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 9 */ interface AuthResultInfo { + /** + * The authentication result. + * @type {number} + * @since 9 + */ result : number; + + /** + * The authentication token if the authentication is passed. + * @type {Uint8Array} + * @since 9 + */ token ?: Uint8Array; + + /** + * The remaining authentication attempts if the authentication fails. + * @type {number} + * @since 9 + */ remainAttempts ?: number; + + /** + * The lockout duration if the authentication executor is locked. + * @type {number} + * @since 9 + */ lockoutDuration ?: number; } /** * Authentication tip info. - * @param module Authentication module. - * @param tip Tip information, used to prompt the business to perform some operations. + * @typedef TipInfo * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 9 */ interface TipInfo { + /** + * The authentication module of sending tip information. + * @type {number} + * @since 9 + */ module : number; + + /** + * Tip information, used to prompt the business to perform some operations. + * @type {number} + * @since 9 + */ tip : number; } /** - * Authentication instance, used to initiate a complete authentication + * Authentication instance, used to initiate a complete authentication. + * @interface AuthInstance * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 9 */ @@ -644,6 +762,9 @@ declare namespace userAuth { /** * Get Authentication instance. + * @param challenge Pass in challenge value. + * @param authType Credential type for authentication. + * @param authTrustLevel Trust level of authentication result. * @returns Returns an authentication instance. * @throws { BusinessError } 401 - Incorrect parameters. * @throws { BusinessError } 12500002 - General operation error. @@ -655,7 +776,8 @@ declare namespace userAuth { function getAuthInstance(challenge : Uint8Array, authType : UserAuthType, authTrustLevel : AuthTrustLevel): AuthInstance; /** - * Result code. + * Enum for operation result. + * @enum {number} * @syscap SystemCapability.UserIAM.UserAuth.Core * @since 9 */ -- Gitee From e64698d7ff16f84a3d1e7835c810f01e217c3fbc Mon Sep 17 00:00:00 2001 From: xuzhihao Date: Thu, 24 Nov 2022 19:18:51 +0800 Subject: [PATCH 407/438] BugFix: fix issue of notification dts Signed-off-by: xuzhihao --- api/@ohos.commonEvent.d.ts | 4 ++-- api/@ohos.commonEventManager.d.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/@ohos.commonEvent.d.ts b/api/@ohos.commonEvent.d.ts index 93653e2553..2ca7d7d8f6 100644 --- a/api/@ohos.commonEvent.d.ts +++ b/api/@ohos.commonEvent.d.ts @@ -187,7 +187,7 @@ declare namespace commonEvent { COMMON_EVENT_SCREEN_OFF = "usual.event.SCREEN_OFF", /** - * This commonEvent means when the device is woken up and interactive. + * This commonEvent means when the device is awakened and interactive. */ COMMON_EVENT_SCREEN_ON = "usual.event.SCREEN_ON", @@ -198,7 +198,7 @@ declare namespace commonEvent { COMMON_EVENT_THERMAL_LEVEL_CHANGED = "usual.event.THERMAL_LEVEL_CHANGED", /** - * This commonEvent means when the user is present after the device woken up. + * This commonEvent means when the user is present after the device is awakened. */ COMMON_EVENT_USER_PRESENT = "usual.event.USER_PRESENT", diff --git a/api/@ohos.commonEventManager.d.ts b/api/@ohos.commonEventManager.d.ts index f528ee6162..1cafa28a65 100644 --- a/api/@ohos.commonEventManager.d.ts +++ b/api/@ohos.commonEventManager.d.ts @@ -165,7 +165,7 @@ declare namespace commonEventManager { COMMON_EVENT_SCREEN_OFF = "usual.event.SCREEN_OFF", /** - * This commonEvent means when the device is woken up and interactive. + * This commonEvent means when the device is awakened and interactive. */ COMMON_EVENT_SCREEN_ON = "usual.event.SCREEN_ON", @@ -175,7 +175,7 @@ declare namespace commonEventManager { COMMON_EVENT_THERMAL_LEVEL_CHANGED = "usual.event.THERMAL_LEVEL_CHANGED", /** - * This commonEvent means when the user is present after the device woken up. + * This commonEvent means when the user is present after the device is awakened. */ COMMON_EVENT_USER_PRESENT = "usual.event.USER_PRESENT", -- Gitee From 7aa91a513128fc8ae48f8254e51a99b92d312c86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwangyipeng=E2=80=9D?= Date: Thu, 24 Nov 2022 19:42:05 +0800 Subject: [PATCH 408/438] fix: Correct d.ts word errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: “wangyipeng” --- api/@ohos.usb.d.ts | 8 ++++---- api/@ohos.usbV9.d.ts | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/api/@ohos.usb.d.ts b/api/@ohos.usb.d.ts index d0c2a77f21..b12db3bf57 100644 --- a/api/@ohos.usb.d.ts +++ b/api/@ohos.usb.d.ts @@ -204,13 +204,13 @@ declare namespace usb { * Performs control transfer. * * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the USB device. - * @param contrlparam Control transfer parameters. + * @param controlparam Control transfer parameters. * @param timeout Timeout duration. This parameter is optional. The default value is **0**, indicating no timeout. * @returns Returns the size of the transmitted or received data block if the control transfer is successful; return **-1** if an exception occurs. * @syscap SystemCapability.USB.USBManager * @since 8 */ - function controlTransfer(pipe: USBDevicePipe, contrlparam: USBControlParams, timeout?: number): Promise; + function controlTransfer(pipe: USBDevicePipe, controlparam: USBControlParams, timeout?: number): Promise; /** * Performs bulk transfer. @@ -302,7 +302,7 @@ declare namespace usb { /** - * Represents a USB interface. One USBconfig {@link USBConfig} can contain multiple **USBInterface** instances, each providing a specific function. + * Represents a USB interface. One config {@link USBConfig} can contain multiple **USBInterface** instances, each providing a specific function. * * @syscap SystemCapability.USB.USBManager * @since 8 @@ -628,7 +628,7 @@ declare namespace usb { DFP = 2, /** - * Dynamic configuration port (DRP), which can function as the DFP (host) or UFP (device). It is not supported currently. + * Dynamic reconfiguration port (DRP), which can function as the DFP (host) or UFP (device). It is not supported currently. * * @since 9 */ diff --git a/api/@ohos.usbV9.d.ts b/api/@ohos.usbV9.d.ts index 7d365909f3..310be1eebb 100644 --- a/api/@ohos.usbV9.d.ts +++ b/api/@ohos.usbV9.d.ts @@ -244,14 +244,14 @@ declare namespace usbV9 { * Performs control transfer. * * @param pipe Device pipe defined by {@link USBDevicePipe}, which is used to determine the USB device. - * @param contrlparam Control transfer parameters. + * @param controlparam Control transfer parameters. * @param timeout Timeout duration. This parameter is optional. The default value is **0**, indicating no timeout. * @returns Returns the size of the transmitted or received data block if the control transfer is successful; return **-1** if an exception occurs. * @throws {BusinessError} 401 - The parameter types do not match or parameter is not specified. * @syscap SystemCapability.USB.USBManager * @since 9 */ - function controlTransfer(pipe: USBDevicePipe, contrlparam: USBControlParams, timeout?: number): Promise; + function controlTransfer(pipe: USBDevicePipe, controlparam: USBControlParams, timeout?: number): Promise; /** * Performs bulk transfer. @@ -346,7 +346,7 @@ declare namespace usbV9 { /** - * Represents a USB interface. One USBconfig {@link USBConfig} can contain multiple **USBInterface** instances, each providing a specific function. + * Represents a USB interface. One config {@link USBConfig} can contain multiple **USBInterface** instances, each providing a specific function. * * @typedef USBInterface * @syscap SystemCapability.USB.USBManager @@ -679,7 +679,7 @@ declare namespace usbV9 { DFP = 2, /** - * Dynamic configuration port (DRP), which can function as the DFP (host) or UFP (device). It is not supported currently. + * Dynamic reconfiguration port (DRP), which can function as the DFP (host) or UFP (device). It is not supported currently. * * @since 9 */ -- Gitee From def07d109e8b68b6bea0fc9a4aafeaff9d889ee1 Mon Sep 17 00:00:00 2001 From: wangmiaoliang Date: Fri, 25 Nov 2022 10:18:33 +0800 Subject: [PATCH 409/438] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E6=A1=A3=20?= =?UTF-8?q?api/@ohos.effectKit.d.ts.=20=E5=88=A0=E9=99=A4=E6=A0=87?= =?UTF-8?q?=E7=AD=BE@import=EF=BC=8C=E4=BF=AE=E6=94=B9=E6=A0=87=E7=AD=BE@r?= =?UTF-8?q?eturns?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangmiaoliang Change-Id: I4c765e3fcd24799a0e3c3b365b94612780a90152 --- api/@ohos.effectKit.d.ts | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/api/@ohos.effectKit.d.ts b/api/@ohos.effectKit.d.ts index 78ffb0c148..b25669d0ad 100644 --- a/api/@ohos.effectKit.d.ts +++ b/api/@ohos.effectKit.d.ts @@ -19,7 +19,6 @@ import image from './@ohos.multimedia.image'; /** * @name effectKit * @since 9 - * @import effectKit from '@ohos.effectKit'; */ declare namespace effectKit { @@ -35,7 +34,7 @@ declare namespace effectKit { * @since 9 * @syscap SystemCapability.Multimedia.Image.Core * @param radius The degree of blur, the value is measured in pixels. - * @return Filters for the current effect have been added. + * @returns Filters for the current effect have been added. */ blur(radius:number): Filter; @@ -44,7 +43,7 @@ declare namespace effectKit { * @since 9 * @syscap SystemCapability.Multimedia.Image.Core * @param bright The degree of light and darkness,the value range is 0 to 1. - * @return Filters for the current effect have been added. + * @returns Filters for the current effect have been added. */ brightness(bright:number): Filter; @@ -52,7 +51,7 @@ declare namespace effectKit { * A Grayscale effect is added to the image. * @since 9 * @syscap SystemCapability.Multimedia.Image.Core - * @return Filters for the current effect have been added. + * @returns Filters for the current effect have been added. */ grayscale(): Filter; @@ -60,7 +59,7 @@ declare namespace effectKit { * Gets the PixelMap where all filter effects have been added to the image. * @since 9 * @syscap SystemCapability.Multimedia.Image.Core - * @return image.PixelMap. + * @returns image.PixelMap. */ getPixelMap(): image.PixelMap; } @@ -128,7 +127,7 @@ declare namespace effectKit { * @since 9 * @syscap SystemCapability.Multimedia.Image.Core * @param image.PixelMap. - * @return Returns the head node of FilterChain. + * @returns Returns the head node of FilterChain. */ function createEffect(source: image.PixelMap): Filter; @@ -137,7 +136,7 @@ declare namespace effectKit { * @since 9 * @syscap SystemCapability.Multimedia.Image.Core * @param image.PixelMap. - * @return Returns the ColorPicker. + * @returns Returns the ColorPicker. */ function createColorPicker(source: image.PixelMap): Promise; @@ -146,9 +145,9 @@ declare namespace effectKit { * @since 9 * @syscap SystemCapability.Multimedia.Image.Core * @param image.PixelMap. - * @return Returns the ColorPicker. + * @returns Returns the ColorPicker. */ function createColorPicker(source: image.PixelMap, callback: AsyncCallback): void; } -export default effectKit; \ No newline at end of file +export default effectKit; -- Gitee From 1423d60f8ecb69eadbc6ac8e543224e0d437f8b5 Mon Sep 17 00:00:00 2001 From: jackd320 Date: Fri, 25 Nov 2022 03:10:54 +0000 Subject: [PATCH 410/438] Signed-off-by: jackd320 Signed-off-by: jackd320 --- api/@ohos.update.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/@ohos.update.d.ts b/api/@ohos.update.d.ts index 78760f8efa..b4d5fb04fc 100644 --- a/api/@ohos.update.d.ts +++ b/api/@ohos.update.d.ts @@ -27,7 +27,7 @@ declare namespace update { * Get online update handler for the calling device. * * @param upgradeInfo indicates client app and business type - * @returns online update handler to perform online update + * @returns online update handler to perform online update. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 11500104 - IPC error. * @since 9 @@ -37,7 +37,7 @@ declare namespace update { /** * Get restore handler. * - * @returns restore handler to perform factory reset + * @returns restore handler to perform factory reset. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 11500104 - IPC error. * @since 9 @@ -47,7 +47,7 @@ declare namespace update { /** * Get local update handler. * - * @returns local update handler to perform local update + * @returns local update handler to perform local update. * @throws { BusinessError } 201 - Permission denied. * @throws { BusinessError } 11500104 - IPC error. * @since 9 -- Gitee From 7a5ab878a7949031b0e86b9fb7df8c5a06d170f2 Mon Sep 17 00:00:00 2001 From: h00514358 Date: Fri, 25 Nov 2022 11:46:40 +0800 Subject: [PATCH 411/438] modify comment Signed-off-by: h00514358 --- api/@ohos.sensor.d.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/api/@ohos.sensor.d.ts b/api/@ohos.sensor.d.ts index 4411e8cdda..67a893093a 100644 --- a/api/@ohos.sensor.d.ts +++ b/api/@ohos.sensor.d.ts @@ -1589,7 +1589,7 @@ declare namespace sensor { * @param LocationOptions Indicates geographic location, {@code LocationOptions}. * @param timeMillis Indicates the time at which the magnetic declination is to be obtained, in milliseconds * since the Unix epoch. - * @return Returns the geomagnetic field data, {@code GeomagneticResponse}. + * @returns Returns the geomagnetic field data, {@code GeomagneticResponse}. * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 @@ -1618,7 +1618,7 @@ declare namespace sensor { * * @param seaPressure Indicates the sea level pressure, in hPa. * @param currentPressure Indicates the atmospheric pressure measured by the barometer, in hPa. - * @return Returns the altitude in meters at which the device is located. + * @returns Returns the altitude in meters at which the device is located. * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 @@ -1645,7 +1645,7 @@ declare namespace sensor { * Computes the geomagnetic inclination angle in radians from the inclination matrix. * * @param inclinationMatrix Indicates the inclination matrix. - * @return Returns the geomagnetic inclination angle in radians. + * @returns Returns the geomagnetic inclination angle in radians. * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 @@ -1672,7 +1672,7 @@ declare namespace sensor { * * @param currentRotationMatrix Indicates the current rotation matrix. * @param preRotationMatrix Indicates the current rotation matrix. - * @return Returns the array of number(z, x and y) in which the angle variety. + * @returns Returns the array of number(z, x and y) in which the angle variety. * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 @@ -1701,7 +1701,7 @@ declare namespace sensor { * Convert rotation vector to rotation matrix. * * @param rotationVector Indicates the rotation vector. - * @return Returns the rotation matrix. + * @returns Returns the rotation matrix. * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 @@ -1745,7 +1745,7 @@ declare namespace sensor { * Coordinate System * @param inRotationVector Indicates the rotation matrix to be transformed. * @param coordinates Indicates coordinate system guidance, {@code CoordinatesOptions}. - * @return Returns the transformed rotation matrix. + * @returns Returns the transformed rotation matrix. * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 @@ -1774,7 +1774,7 @@ declare namespace sensor { * convert a rotation vector to a normalized quaternion. * * @param rotationVector Indicates the rotation vector. - * @return Returns the normalized quaternion. + * @returns Returns the normalized quaternion. * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 @@ -1800,7 +1800,7 @@ declare namespace sensor { * Computes the device's orientation based on the rotation matrix. * * @param rotationMatrix Indicates the rotation matrix. - * @return Returns the array is the angle of rotation around the z, x, y axis. + * @returns Returns the array is the angle of rotation around the z, x, y axis. * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 @@ -1837,7 +1837,7 @@ declare namespace sensor { * * @param gravity Indicates the gravity vector. * @param geomagnetic Indicates the geomagnetic vector. - * @return Returns the rotation matrix, {@code RotationMatrixResponse}. + * @returns Returns the rotation matrix, {@code RotationMatrixResponse}. * @syscap SystemCapability.Sensors.Sensor * @since 8 * @deprecated since 9 -- Gitee From 49fdd751e6723660366fe795561b83bcabdcdf04 Mon Sep 17 00:00:00 2001 From: crazy_hu Date: Fri, 25 Nov 2022 04:04:37 +0000 Subject: [PATCH 412/438] rpc.d.ts word update Signed-off-by: crazy_hu --- api/@ohos.rpc.d.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/api/@ohos.rpc.d.ts b/api/@ohos.rpc.d.ts index 93a91a9ea4..2f87c58027 100644 --- a/api/@ohos.rpc.d.ts +++ b/api/@ohos.rpc.d.ts @@ -1812,11 +1812,11 @@ declare namespace rpc { registerDeathRecipient(recipient: DeathRecipient, flags: number): void; /** - * Deregister a callback used to receive notifications of the death of a remote object. + * Unregister a callback used to receive notifications of the death of a remote object. * - * @param recipient Indicates the callback to be deregister. + * @param recipient Indicates the callback to be unregister. * @param flags Indicates the flag of the death notification. - * @returns Return {@code true} if the callback is deregister successfully; return {@code false} otherwise. + * @returns Return {@code true} if the callback is unregister successfully; return {@code false} otherwise. * @since 7 * @deprecated since 9 * @useinstead ohos.rpc.IRemoteObject#unregisterDeathRecipient @@ -1824,9 +1824,9 @@ declare namespace rpc { removeDeathRecipient(recipient: DeathRecipient, flags: number): boolean; /** - * Deregister a callback used to receive notifications of the death of a remote object. + * Unregister a callback used to receive notifications of the death of a remote object. * - * @param recipient Indicates the callback to be deregister. + * @param recipient Indicates the callback to be unregister. * @param flags Indicates the flag of the death notification. * @throws { BusinessError } 401 - check param failed * @throws { BusinessError } 1900008 - proxy or remote object is invalid @@ -2327,11 +2327,11 @@ declare namespace rpc { registerDeathRecipient(recipient: DeathRecipient, flags: number): void; /** - * Deregister a callback used to receive death notifications of a remote object. + * Unregister a callback used to receive death notifications of a remote object. * - * @param recipient Indicates the callback to be deregister. + * @param recipient Indicates the callback to be unregister. * @param flags Indicates the flag of the death notification. This is a reserved parameter. Set it to {@code 0}. - * @returns Return {@code true} if the callback is deregister successfully; return {@code false} otherwise. + * @returns Return {@code true} if the callback is unregister successfully; return {@code false} otherwise. * @since 7 * @deprecated since 9 * @useinstead ohos.rpc.RemoteProxy#unregisterDeathRecipient @@ -2339,9 +2339,9 @@ declare namespace rpc { removeDeathRecipient(recipient: DeathRecipient, flags: number): boolean; /** - * Deregister a callback used to receive death notifications of a remote object. + * Unregister a callback used to receive death notifications of a remote object. * - * @param recipient Indicates the callback to be deregister. + * @param recipient Indicates the callback to be unregister. * @param flags Indicates the flag of the death notification. This is a reserved parameter. Set it to {@code 0}. * @throws { BusinessError } 401 - check param failed * @throws { BusinessError } 1900008 - proxy or remote object is invalid -- Gitee From 50753760b70b33db245d6b9be46f9ca318cf68a0 Mon Sep 17 00:00:00 2001 From: aqxyjay Date: Fri, 25 Nov 2022 12:01:21 +0800 Subject: [PATCH 413/438] docs: change @return to @returns Signed-off-by: aqxyjay --- api/@ohos.batteryStatistics.d.ts | 10 +++++----- api/@ohos.power.d.ts | 6 +++--- api/@ohos.runningLock.d.ts | 12 ++++++------ api/@ohos.thermal.d.ts | 6 +++--- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/api/@ohos.batteryStatistics.d.ts b/api/@ohos.batteryStatistics.d.ts index 84ca2603a2..45289ecc6a 100755 --- a/api/@ohos.batteryStatistics.d.ts +++ b/api/@ohos.batteryStatistics.d.ts @@ -61,7 +61,7 @@ declare namespace batteryStats { /** * Obtains the power consumption information list. * - * @return {Promise>} Power consumption information list. + * @returns {Promise>} Power consumption information list. * @systemapi * @since 8 */ @@ -81,7 +81,7 @@ declare namespace batteryStats { * Obtains power consumption information(Mah) for a given uid. * * @param {number} uid Indicates the uid. - * @return {number} Power consumption information(Mah). + * @returns {number} Power consumption information(Mah). * @throws {BusinessError} 4600101 - If connecting to the service failed. * @systemapi * @since 8 @@ -92,7 +92,7 @@ declare namespace batteryStats { * Obtains power consumption information(Percent) for a given uid. * * @param {number} uid Indicates the uid. - * @return {number} Power consumption information(Percent). + * @returns {number} Power consumption information(Percent). * @throws {BusinessError} 4600101 - If connecting to the service failed. * @systemapi * @since 8 @@ -103,7 +103,7 @@ declare namespace batteryStats { * Obtains power consumption information(Mah) for a given type. * * @param {ConsumptionType} type Indicates the hardware type. - * @return {number} Power consumption information(Mah). + * @returns {number} Power consumption information(Mah). * @throws {BusinessError} 401 - If the type is not valid. * @throws {BusinessError} 4600101 - If connecting to the service failed. * @systemapi @@ -115,7 +115,7 @@ declare namespace batteryStats { * Obtains power consumption information(Percent) for a given type. * * @param {ConsumptionType} type Indicates the hardware type. - * @return {number} Power consumption information(Percent). + * @returns {number} Power consumption information(Percent). * @throws {BusinessError} 401 - If the type is not valid. * @throws {BusinessError} 4600101 - If connecting to the service failed. * @systemapi diff --git a/api/@ohos.power.d.ts b/api/@ohos.power.d.ts index 11e3384bf4..8dc4551a1b 100644 --- a/api/@ohos.power.d.ts +++ b/api/@ohos.power.d.ts @@ -70,7 +70,7 @@ declare namespace power { /** * Checks whether the screen of a device is on or off. * - * @return Returns true if the screen is on; returns false otherwise. + * @returns Returns true if the screen is on; returns false otherwise. * @since 7 * @deprecated since 9 * @useinstead {@link power#isActive} @@ -83,7 +83,7 @@ declare namespace power { *

          * The screen will be on if device is active, screen will be off otherwise. * - * @return Returns true if the device is active; returns false otherwise. + * @returns Returns true if the device is active; returns false otherwise. * @throws {BusinessError} 4900101 - If connecting to the service failed. * @since 9 */ @@ -113,7 +113,7 @@ declare namespace power { * Obtains the power mode of the current device. For details, see {@link DevicePowerMode}. * * @permission ohos.permission.POWER_OPTIMIZATION - * @return The power mode {@link DevicePowerMode} of current device . + * @returns The power mode {@link DevicePowerMode} of current device . * @throws {BusinessError} 201 – If the permission is denied. * @throws {BusinessError} 4900101 - If connecting to the service failed. * @since 9 diff --git a/api/@ohos.runningLock.d.ts b/api/@ohos.runningLock.d.ts index 84a763647c..2379a2fb7c 100644 --- a/api/@ohos.runningLock.d.ts +++ b/api/@ohos.runningLock.d.ts @@ -58,7 +58,7 @@ declare namespace runningLock { /** * Checks whether a lock is held or in use. * - * @return Returns true if the lock is held or in use; returns false if the lock has been released. + * @returns Returns true if the lock is held or in use; returns false if the lock has been released. * @since 7 * @deprecated since 9 * @useinstead {@link RunningLock#isHolding} @@ -68,7 +68,7 @@ declare namespace runningLock { /** * Checks whether a lock is held or in use. * - * @return Returns true if the lock is held or in use; returns false if the lock has been released. + * @returns Returns true if the lock is held or in use; returns false if the lock has been released. * @throws {BusinessError} 4900101 - If connecting to the service failed. * @since 9 */ @@ -125,7 +125,7 @@ declare namespace runningLock { * @param type Indicates the specified {@link RunningLockType}. * @param callback Indicates the callback function contains the result whether the specified * {@link RunningLockType} is supported. - * @return Returns true if the specified {@link RunningLockType} is supported; + * @returns Returns true if the specified {@link RunningLockType} is supported; * returns false otherwise. * @since 7 * @deprecated since 9 @@ -138,7 +138,7 @@ declare namespace runningLock { * Checks whether the specified {@link RunningLockType} is supported. * * @param {RunningLockType} type Indicates the specified {@link RunningLockType}. - * @return {boolean} Whether the specified {@link RunningLockType} is supported. + * @returns {boolean} Whether the specified {@link RunningLockType} is supported. * @throws {BusinessError} 401 - If the type is not valid. * @throws {BusinessError} 4900101 - If connecting to the service failed. * @since 9 @@ -156,7 +156,7 @@ declare namespace runningLock { * a suffix. * @param type Indicates the {@link RunningLockType}. * @param callback Indicates the callback contains the {@link RunningLock} object. - * @return Returns the {@link RunningLock} object. + * @returns Returns the {@link RunningLock} object. * @permission ohos.permission.RUNNING_LOCK * @since 7 * @deprecated since 9 @@ -193,7 +193,7 @@ declare namespace runningLock { * @param {string} name Indicates the {@link RunningLock} name. A recommended name consists of the package or * class name and a suffix. * @param {RunningLockType} type Indicates the {@link RunningLockType}. - * @return {Promise} The {@link RunningLock} object. + * @returns {Promise} The {@link RunningLock} object. * @throws {BusinessError} 401 - If the name or type is not valid. * @since 9 */ diff --git a/api/@ohos.thermal.d.ts b/api/@ohos.thermal.d.ts index 566c146fb3..0be0b69dd0 100644 --- a/api/@ohos.thermal.d.ts +++ b/api/@ohos.thermal.d.ts @@ -69,7 +69,7 @@ declare namespace thermal { * Subscribes to callbacks of thermal level changes. * * @param callback Callback of thermal level changes. - * @return Returns the thermal level. + * @returns Returns the thermal level. * @since 8 * @deprecated since 9 * @useinstead {@link thermal#registerThermalLevelCallback} @@ -109,7 +109,7 @@ declare namespace thermal { /** * Obtains the current thermal level. * - * @return Returns the thermal level. + * @returns Returns the thermal level. * @since 8 * @deprecated since 9 * @useinstead {@link thermal#getLevel} @@ -119,7 +119,7 @@ declare namespace thermal { /** * Obtains the current thermal level. * - * @return {ThermalLevel} The thermal level. + * @returns {ThermalLevel} The thermal level. * @throws {BusinessError} 4800101 If connecting to the service failed. * @since 9 */ -- Gitee From d113c5608fe0bb9ef732cad50ffcb8e1e52a2e33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BB=96=E5=BA=B7=E5=BA=B7?= Date: Fri, 25 Nov 2022 12:12:55 +0800 Subject: [PATCH 414/438] =?UTF-8?q?api=20doc=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 廖康康 --- api/@ohos.backgroundTaskManager.d.ts | 4 ++-- api/@ohos.reminderAgent.d.ts | 1 - ...esourceschedule.backgroundTaskManager.d.ts | 4 ++-- ...ohos.resourceschedule.usageStatistics.d.ts | 24 +++++++++---------- api/@ohos.resourceschedule.workScheduler.d.ts | 4 ++-- 5 files changed, 18 insertions(+), 19 deletions(-) diff --git a/api/@ohos.backgroundTaskManager.d.ts b/api/@ohos.backgroundTaskManager.d.ts index 7f10c8edb5..f707324f0e 100644 --- a/api/@ohos.backgroundTaskManager.d.ts +++ b/api/@ohos.backgroundTaskManager.d.ts @@ -63,7 +63,7 @@ declare namespace backgroundTaskManager { * @since 7 * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @param requestId Indicates the identifier of the delay request. - * @return The remaining delay time + * @returns The remaining delay time * @deprecated since 9 * @useinstead ohos.resourceschedule.backgroundTaskManager.getRemainingDelayTime */ @@ -77,7 +77,7 @@ declare namespace backgroundTaskManager { * @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.TransientTask * @param reason Indicates the reason for delayed transition to the suspended state. * @param callback The callback delay time expired. - * @return Info of delay request + * @returns Info of delay request * @deprecated since 9 * @useinstead ohos.resourceschedule.backgroundTaskManager.requestSuspendDelay */ diff --git a/api/@ohos.reminderAgent.d.ts b/api/@ohos.reminderAgent.d.ts index 189240f524..15d5ce7c67 100644 --- a/api/@ohos.reminderAgent.d.ts +++ b/api/@ohos.reminderAgent.d.ts @@ -23,7 +23,6 @@ import { NotificationSlot } from './notification/notificationSlot'; * * @since 7 * @syscap SystemCapability.Notification.ReminderAgent - * @import reminderAgent from '@ohos.reminderAgent'; * @deprecated since 9 * @useinstead reminderAgentManager */ diff --git a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts index 2675ac4705..9b82d9d302 100644 --- a/api/@ohos.resourceschedule.backgroundTaskManager.d.ts +++ b/api/@ohos.resourceschedule.backgroundTaskManager.d.ts @@ -71,7 +71,7 @@ declare namespace backgroundTaskManager { * @throws { BusinessError } 9800004 - System service operation failed. * @throws { BusinessError } 9900001 - Caller information verification failed. * @throws { BusinessError } 9900002 - Background task verification failed. - * @return The remaining delay time + * @returns The remaining delay time */ function getRemainingDelayTime(requestId: number, callback: AsyncCallback): void; function getRemainingDelayTime(requestId: number): Promise; @@ -90,7 +90,7 @@ declare namespace backgroundTaskManager { * @throws { BusinessError } 9800004 - System service operation failed. * @throws { BusinessError } 9900001 - Caller information verification failed. * @throws { BusinessError } 9900002 - Background task verification failed. - * @return Info of delay request + * @returns Info of delay request */ function requestSuspendDelay(reason: string, callback: Callback): DelaySuspendInfo; diff --git a/api/@ohos.resourceschedule.usageStatistics.d.ts b/api/@ohos.resourceschedule.usageStatistics.d.ts index 04bf7a289a..0916267edf 100644 --- a/api/@ohos.resourceschedule.usageStatistics.d.ts +++ b/api/@ohos.resourceschedule.usageStatistics.d.ts @@ -260,7 +260,7 @@ declare namespace usageStatistics { * @throws { BusinessError } 10000003 - System service operation failed. * @throws { BusinessError } 10000004 - IPC Communication failed. * @throws { BusinessError } 10000006 - Get application info failed. - * @return Returns {@code true} if the application is idle in a particular period; + * @returns Returns {@code true} if the application is idle in a particular period; * returns {@code false} otherwise. The time range of the particular period is defined by the system, * which may be hours or days. */ @@ -285,7 +285,7 @@ declare namespace usageStatistics { * @throws { BusinessError } 10000005 - Application is not installed. * @throws { BusinessError } 10000006 - Get application info failed. * @throws { BusinessError } 10100002 - Get Application group info failed. - * @return Returns the app group of the calling application. + * @returns Returns the app group of the calling application. */ function queryAppGroup(callback: AsyncCallback): void; function queryAppGroup(): Promise; @@ -311,7 +311,7 @@ declare namespace usageStatistics { * @throws { BusinessError } 10000005 - Application is not installed. * @throws { BusinessError } 10000006 - Get application info failed. * @throws { BusinessError } 10100002 - Get Application group info failed. - * @return Returns the usage priority group of the calling application. + * @returns Returns the usage priority group of the calling application. */ function queryAppGroup(bundleName : string, callback: AsyncCallback): void; function queryAppGroup(bundleName : string): Promise; @@ -345,7 +345,7 @@ declare namespace usageStatistics { * @throws { BusinessError } 10000004 - IPC Communication failed. * @throws { BusinessError } 10000006 - Get application info failed. * @throws { BusinessError } 10000007 - Get system or actual time failed. - * @return Returns the {@link BundleStatsMap} objects containing the usage information about each bundle. + * @returns Returns the {@link BundleStatsMap} objects containing the usage information about each bundle. */ function queryBundleStatsInfos(begin: number, end: number, callback: AsyncCallback): void; function queryBundleStatsInfos(begin: number, end: number): Promise; @@ -405,7 +405,7 @@ declare namespace usageStatistics { * @throws { BusinessError } 10000004 - IPC Communication failed. * @throws { BusinessError } 10000006 - Get application info failed. * @throws { BusinessError } 10000007 - Get system or actual time failed. - * @return Returns the list of {@link BundleStatsInfo} objects containing the usage information about each bundle. + * @returns Returns the list of {@link BundleStatsInfo} objects containing the usage information about each bundle. */ function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback>): void; function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise>; @@ -428,7 +428,7 @@ declare namespace usageStatistics { * @throws { BusinessError } 10000004 - IPC Communication failed. * @throws { BusinessError } 10000006 - Get application info failed. * @throws { BusinessError } 10000007 - Get system or actual time failed. - * @return Returns the list of {@link BundleEvents} objects containing the state data of all bundles. + * @returns Returns the list of {@link BundleEvents} objects containing the state data of all bundles. */ function queryBundleEvents(begin: number, end: number, callback: AsyncCallback>): void; function queryBundleEvents(begin: number, end: number): Promise>; @@ -449,7 +449,7 @@ declare namespace usageStatistics { * @throws { BusinessError } 10000004 - IPC Communication failed. * @throws { BusinessError } 10000006 - Get application info failed. * @throws { BusinessError } 10000007 - Get system or actual time failed. - * @return Returns the {@link BundleEvents} object Array containing the state data of the current bundle. + * @returns Returns the {@link BundleEvents} object Array containing the state data of the current bundle. */ function queryCurrentBundleEvents(begin: number, end: number, callback: AsyncCallback>): void; function queryCurrentBundleEvents(begin: number, end: number): Promise>; @@ -471,7 +471,7 @@ declare namespace usageStatistics { * @throws { BusinessError } 10000004 - IPC Communication failed. * @throws { BusinessError } 10000006 - Get application info failed. * @throws { BusinessError } 10000007 - Get system or actual time failed. - * @return Returns the {@link HapModuleInfo} object Array containing the usage data of the modules. + * @returns Returns the {@link HapModuleInfo} object Array containing the usage data of the modules. */ function queryModuleUsageRecords(maxNum: number, callback: AsyncCallback>): void; function queryModuleUsageRecords(maxNum: number): Promise>; @@ -492,7 +492,7 @@ declare namespace usageStatistics { * @throws { BusinessError } 10000004 - IPC Communication failed. * @throws { BusinessError } 10000006 - Get application info failed. * @throws { BusinessError } 10000007 - Get system or actual time failed. - * @return Returns the {@link HapModuleInfo} object Array containing the usage data of the modules. + * @returns Returns the {@link HapModuleInfo} object Array containing the usage data of the modules. */ function queryModuleUsageRecords(callback: AsyncCallback>): void; function queryModuleUsageRecords(): Promise>; @@ -574,7 +574,7 @@ declare namespace usageStatistics { * @throws { BusinessError } 10000003 - System service operation failed. * @throws { BusinessError } 10000004 - IPC Communication failed. * @throws { BusinessError } 10100001 - Application group operation repeated. - * @return Returns AppGroupCallbackInfo when the group of bundle changed. + * @returns Returns AppGroupCallbackInfo when the group of bundle changed. */ function registerAppGroupCallBack(groupCallback: Callback, callback: AsyncCallback): void; function registerAppGroupCallBack(groupCallback: Callback): Promise; @@ -616,7 +616,7 @@ declare namespace usageStatistics { * @throws { BusinessError } 10000004 - IPC Communication failed. * @throws { BusinessError } 10000006 - Get application info failed. * @throws { BusinessError } 10000007 - Get system or actual time failed. - * @return Returns the {@link DeviceEventStats} object Array containing the event states data. + * @returns Returns the {@link DeviceEventStats} object Array containing the event states data. */ function queryDeviceEventStats(begin: number, end: number, callback: AsyncCallback>): void; function queryDeviceEventStats(begin: number, end: number): Promise>; @@ -639,7 +639,7 @@ declare namespace usageStatistics { * @throws { BusinessError } 10000004 - IPC Communication failed. * @throws { BusinessError } 10000006 - Get application info failed. * @throws { BusinessError } 10000007 - Get system or actual time failed. - * @return Returns the {@link NotificationEventStats} object Array containing the event states data. + * @returns Returns the {@link NotificationEventStats} object Array containing the event states data. */ function queryNotificationEventStats(begin: number, end: number, callback: AsyncCallback>): void; function queryNotificationEventStats(begin: number, end: number): Promise>; diff --git a/api/@ohos.resourceschedule.workScheduler.d.ts b/api/@ohos.resourceschedule.workScheduler.d.ts index 0bc914b45f..1cb2eabc86 100644 --- a/api/@ohos.resourceschedule.workScheduler.d.ts +++ b/api/@ohos.resourceschedule.workScheduler.d.ts @@ -157,7 +157,7 @@ declare namespace workScheduler { * @throws { BusinessError } 9700001 - Memory operation failed. * @throws { BusinessError } 9700002 - Parcel operation failed. * @throws { BusinessError } 9700003 - System service operation failed. - * @return the work info list. + * @returns the work info list. */ function obtainAllWorks(callback: AsyncCallback): Array; function obtainAllWorks(): Promise>; @@ -188,7 +188,7 @@ declare namespace workScheduler { * @throws { BusinessError } 9700002 - Parcel operation failed. * @throws { BusinessError } 9700003 - System service operation failed. * @throws { BusinessError } 9700004 - Check workInfo failed. - * @return true if last work running is timeout, otherwise false. + * @returns true if last work running is timeout, otherwise false. */ function isLastWorkTimeOut(workId: number, callback: AsyncCallback): boolean; function isLastWorkTimeOut(workId: number): Promise; -- Gitee From bfaf710006980f6447a4a5b4095758f4e5515710 Mon Sep 17 00:00:00 2001 From: zhouke Date: Fri, 25 Nov 2022 12:45:14 +0800 Subject: [PATCH 415/438] @ohos.uitest.d.ts modify. Signed-off-by: Signed-off-by: zhouke --- api/@ohos.uitest.d.ts | 58 +++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/api/@ohos.uitest.d.ts b/api/@ohos.uitest.d.ts index dc9db54b6c..e694beb9fb 100644 --- a/api/@ohos.uitest.d.ts +++ b/api/@ohos.uitest.d.ts @@ -63,7 +63,7 @@ declare class By { * @syscap SystemCapability.Test.UiTest * @param txt The text value. * @param pattern The {@link MatchPattern} of the text value,default to {@link MatchPattern.EQUALS} - * @return Returns this {@link By} object. + * @returns this {@link By} object. * @since 8 * @deprecated since 9 * @useinstead ohos.uitest.On#text @@ -75,7 +75,7 @@ declare class By { * Specifies the inspector key of the target UiComponent. * @syscap SystemCapability.Test.UiTest * @param key The inspectorKey value. - * @return Returns this {@link By} object. + * @returns this {@link By} object. * @since 8 * @deprecated since 9 * @useinstead ohos.uitest.On#id @@ -87,7 +87,7 @@ declare class By { * Specifies the id of the target UiComponent. * @syscap SystemCapability.Test.UiTest * @param id The id value. - * @return Returns this {@link By} object. + * @returns this {@link By} object. * @since 8 * @deprecated since 9 * @test @@ -98,7 +98,7 @@ declare class By { * Specifies the type of the target UiComponent. * @syscap SystemCapability.Test.UiTest * @param tp The type value. - * @return Returns this {@link By} object. + * @returns this {@link By} object. * @since 8 * @deprecated since 9 * @useinstead ohos.uitest.On#type @@ -110,7 +110,7 @@ declare class By { * Specifies the clickable status of the target UiComponent. * @syscap SystemCapability.Test.UiTest * @param b The clickable status,default to true. - * @return Returns this {@link By} object. + * @returns this {@link By} object. * @since 8 * @deprecated since 9 * @useinstead ohos.uitest.On#clickable @@ -122,7 +122,7 @@ declare class By { * Specifies the scrollable status of the target UiComponent. * @syscap SystemCapability.Test.UiTest * @param b The scrollable status,default to true. - * @return Returns this {@link By} object. + * @returns this {@link By} object. * @since 8 * @deprecated since 9 * @useinstead ohos.uitest.On#scrollable @@ -134,7 +134,7 @@ declare class By { * Specifies the enabled status of the target UiComponent. * @syscap SystemCapability.Test.UiTest * @param b The enabled status,default to true. - * @return Returns this {@link By} object. + * @returns this {@link By} object. * @since 8 * @deprecated since 9 * @useinstead ohos.uitest.On#enabled @@ -146,7 +146,7 @@ declare class By { * Specifies the focused status of the target UiComponent. * @syscap SystemCapability.Test.UiTest * @param b The focused status,default to true. - * @return Returns this {@link By} object. + * @returns this {@link By} object. * @since 8 * @deprecated since 9 * @useinstead ohos.uitest.On#focused @@ -158,7 +158,7 @@ declare class By { * Specifies the selected status of the target UiComponent. * @syscap SystemCapability.Test.UiTest * @param b The selected status,default to true. - * @return Returns this {@link By} object. + * @returns this {@link By} object. * @since 8 * @deprecated since 9 * @useinstead ohos.uitest.On#selected @@ -171,7 +171,7 @@ declare class By { * object,used to locate UiComponent relatively. * @syscap SystemCapability.Test.UiTest * @param by Describes the attribute requirements of UiComponent which the target one is in front of. - * @return Returns this {@link By} object. + * @returns this {@link By} object. * @since 8 * @deprecated since 9 * @useinstead {@link On.isBefore} @@ -184,7 +184,7 @@ declare class By { * object,used to locate UiComponent relatively. * @syscap SystemCapability.Test.UiTest * @param by Describes the attribute requirements of UiComponent which the target one is in back of. - * @return Returns this {@link By} object. + * @returns this {@link By} object. * @since 8 * @deprecated since 9 * @useinstead {@link On.isAfter} @@ -345,7 +345,7 @@ declare class UiComponent { * Scroll on this {@link UiComponent}to find matched {@link UiComponent},applicable to scrollable one. * @syscap SystemCapability.Test.UiTest * @param by The attribute requirements of the target {@link UiComponent}. - * @return the found result,or undefined if not found. + * @returns the found result,or undefined if not found. * @since 8 * @deprecated since 9 * @useinstead {@link Component.scrollSearch} @@ -594,7 +594,7 @@ declare class On { * @syscap SystemCapability.Test.UiTest * @param txt The text value. * @param pattern The {@link MatchPattern} of the text value, default to {@link MatchPattern.EQUALS} - * @return Returns this {@link On} object. + * @returns this {@link On} object. * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test @@ -605,7 +605,7 @@ declare class On { * Specifies the id of the target Component. * @syscap SystemCapability.Test.UiTest * @param id The id value. - * @return Returns this {@link On} object. + * @returns this {@link On} object. * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test @@ -616,7 +616,7 @@ declare class On { * Specifies the type of the target Component. * @syscap SystemCapability.Test.UiTest * @param tp The type value. - * @return Returns this {@link On} object. + * @returns this {@link On} object. * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test @@ -627,7 +627,7 @@ declare class On { * Specifies the clickable status of the target Component. * @syscap SystemCapability.Test.UiTest * @param b The clickable status,default to true. - * @return Returns this {@link On} object. + * @returns this {@link On} object. * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test @@ -638,7 +638,7 @@ declare class On { * Specifies the longClickable status of the target Component. * @syscap SystemCapability.Test.UiTest * @param b The clickable status,default to true. - * @return Returns this {@link On} object. + * @returns this {@link On} object. * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test @@ -649,7 +649,7 @@ declare class On { * Specifies the scrollable status of the target Component. * @syscap SystemCapability.Test.UiTest * @param b The scrollable status,default to true. - * @return Returns this {@link On} object. + * @returns this {@link On} object. * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test @@ -660,7 +660,7 @@ declare class On { * Specifies the enabled status of the target Component. * @syscap SystemCapability.Test.UiTest * @param b The enabled status,default to true. - * @return Returns this {@link On} object. + * @returns this {@link On} object. * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test @@ -671,7 +671,7 @@ declare class On { * Specifies the focused status of the target Component. * @syscap SystemCapability.Test.UiTest * @param b The focused status,default to true. - * @return Returns this {@link On} object. + * @returns this {@link On} object. * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test @@ -682,7 +682,7 @@ declare class On { * Specifies the selected status of the target Component. * @syscap SystemCapability.Test.UiTest * @param b The selected status,default to true. - * @return Returns this {@link On} object. + * @returns this {@link On} object. * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test @@ -693,7 +693,7 @@ declare class On { * Specifies the checked status of the target Component. * @syscap SystemCapability.Test.UiTest * @param b The checked status,default to false. - * @return Returns this {@link On} object. + * @returns this {@link On} object. * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test @@ -704,7 +704,7 @@ declare class On { * Specifies the checkable status of the target Component. * @syscap SystemCapability.Test.UiTest * @param b The checkable status,default to false. - * @return Returns this {@link On} object. + * @returns this {@link On} object. * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test @@ -716,7 +716,7 @@ declare class On { * object,used to locate Component relatively. * @syscap SystemCapability.Test.UiTest * @param on Describes the attribute requirements of Component which the target one is in front of. - * @return Returns this {@link On} object. + * @returns this {@link On} object. * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test @@ -728,7 +728,7 @@ declare class On { * object,used to locate Component relatively. * @syscap SystemCapability.Test.UiTest * @param on Describes the attribute requirements of Component which the target one is in back of. - * @return Returns this {@link On} object. + * @returns this {@link On} object. * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test @@ -944,7 +944,7 @@ declare class Component { * Scroll on this {@link Component}to find matched {@link Component},applicable to scrollable one. * @syscap SystemCapability.Test.UiTest * @param on The attribute requirements of the target {@link Component}. - * @return the found result,or undefined if not found. + * @returns the found result,or undefined if not found. * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 17000002 - if the async function was not called with await. * @throws {BusinessError} 17000004 - if the component is invisible or destroyed. @@ -956,7 +956,7 @@ declare class Component { /** * Get the bounds rect of this {@link Component}. * @syscap SystemCapability.Test.UiTest - * @return the bounds rect object. + * @returns the bounds rect object. * @throws {BusinessError} 17000002 - if the async function was not called with await. * @throws {BusinessError} 17000004 - if the component is invisible or destroyed. * @since 9 @@ -967,7 +967,7 @@ declare class Component { /** * Get the boundsCenter of this {@link Component}. * @syscap SystemCapability.Test.UiTest - * @return the boundsCenter object. + * @returns the boundsCenter object. * @throws {BusinessError} 17000002 - if the async function was not called with await. * @throws {BusinessError} 17000004 - if the component is invisible or destroyed. * @since 9 @@ -1345,7 +1345,7 @@ declare class UiWindow { /** * Get the bounds rect of this {@link UiWindow}. * @syscap SystemCapability.Test.UiTest - * @return the bounds rect object. + * @returns the bounds rect object. * @throws {BusinessError} 17000002 - if the async function was not called with await. * @throws {BusinessError} 17000004 - if the window is invisible or destroyed. * @since 9 -- Gitee From ba9995b28d3418c6204ea19e0fb957681fad558c Mon Sep 17 00:00:00 2001 From: mayunteng_1 Date: Fri, 25 Nov 2022 14:20:04 +0800 Subject: [PATCH 416/438] delete import Signed-off-by: mayunteng_1 --- api/@ohos.devicestatus.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/api/@ohos.devicestatus.d.ts b/api/@ohos.devicestatus.d.ts index 6e231cc780..93cdc7d7ae 100644 --- a/api/@ohos.devicestatus.d.ts +++ b/api/@ohos.devicestatus.d.ts @@ -20,7 +20,6 @@ import { Callback } from "./basic"; * * @since 9 * @syscap SystemCapability.Msdp.DeviceStatus - * @import import DeviceStatus from '@ohos.DeviceStatus' */ declare namespace deviceStatus { /** -- Gitee From 78490b6ca17afb8de8faca4e1c50eeae62eaccf5 Mon Sep 17 00:00:00 2001 From: jidong Date: Fri, 4 Nov 2022 16:22:04 +0800 Subject: [PATCH 417/438] fix interface problem Signed-off-by: jidong Change-Id: I80026d4523d7e9e7d5bd29fd15a527063baad686 --- api/@ohos.ability.wantConstant.d.ts | 4 ++-- api/@ohos.account.osAccount.d.ts | 31 ++++++++++++------------- api/@ohos.app.ability.wantConstant.d.ts | 4 ++-- 3 files changed, 19 insertions(+), 20 deletions(-) diff --git a/api/@ohos.ability.wantConstant.d.ts b/api/@ohos.ability.wantConstant.d.ts index 9ad6e2e43a..16fbc172b9 100644 --- a/api/@ohos.ability.wantConstant.d.ts +++ b/api/@ohos.ability.wantConstant.d.ts @@ -221,11 +221,11 @@ declare namespace wantConstant { ACTION_APP_ACCOUNT_OAUTH = "ohos.account.appAccount.action.oauth", /** - * Indicates the action of providing auth service. + * Indicates the action of providing the application account auth service. * * @since 9 */ - ACTION_APP_ACCOUNT_AUTH = "account.appAccount.action.auth", + ACTION_APP_ACCOUNT_AUTH = "ohos.appAccount.action.auth", /** * Indicates the action of an application downloaded from the application market. diff --git a/api/@ohos.account.osAccount.d.ts b/api/@ohos.account.osAccount.d.ts index 093b0dbfbb..02d45b0ae0 100644 --- a/api/@ohos.account.osAccount.d.ts +++ b/api/@ohos.account.osAccount.d.ts @@ -94,7 +94,7 @@ declare namespace osAccount { /** * Checks whether an OS account is activated based on its local ID. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS or ohos.permission.GET_LOCAL_ACCOUNTS * @param localId Indicates the local ID of the OS account. * @returns void * @throws {BusinessError} 201 - permission denied. @@ -132,7 +132,7 @@ declare namespace osAccount { /** * Checks whether a constraint has been enabled for an OS account based on its local ID. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.GET_LOCAL_ACCOUNTS * @param localId Indicates the local ID of the OS account. * @param constraint Indicates the constraint to check. The value can be: *

            @@ -193,7 +193,7 @@ declare namespace osAccount { /** * Checks whether an OS account has been verified based on its ID. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS or ohos.permission.GET_LOCAL_ACCOUNTS * @param localId Indicates the local ID of the OS account. * @returns Returns {@code true} if the OS account has been verified successfully; * returns {@code false} otherwise. @@ -285,7 +285,7 @@ declare namespace osAccount { /** * Obtains the number of all OS accounts created on a device. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.GET_LOCAL_ACCOUNTS * @returns Returns the number of created OS accounts. * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. @@ -353,7 +353,7 @@ declare namespace osAccount { /** * Queries the ID of an account which is bound to the specified domain account * - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.GET_LOCAL_ACCOUNTS * @param domainInfo Indicates the domain account info. * @returns Returns the local ID of the OS account. * @throws {BusinessError} 201 - permission denied. @@ -390,7 +390,7 @@ declare namespace osAccount { /** * Obtains all constraints of an account based on its ID. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.GET_LOCAL_ACCOUNTS * @param localId Indicates the local ID of the OS account. * @returns Returns a list of constraints. * @throws {BusinessError} 201 - permission denied. @@ -405,7 +405,7 @@ declare namespace osAccount { /** * Queries the list of all the OS accounts that have been created in the system. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.GET_LOCAL_ACCOUNTS * @returns Returns a list of OS accounts. * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. @@ -489,7 +489,7 @@ declare namespace osAccount { /** * Gets information about the current OS account. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.GET_LOCAL_ACCOUNTS * @returns Returns information about the current OS account; returns {@code null} if the query fails. * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. @@ -502,7 +502,7 @@ declare namespace osAccount { /** * Queries OS account information based on the local ID. * - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION or ohos.permission.GET_LOCAL_ACCOUNTS * @param localId Indicates the local ID of the OS account. * @returns Returns the OS account information; returns {@code null} if the query fails. * @throws {BusinessError} 201 - permission denied. @@ -563,7 +563,7 @@ declare namespace osAccount { * The same application running on different devices obtains the same DVID, whereas different applications * obtain different DVIDs. *

            - * @permission ohos.permission.DISTRIBUTED_DATASYNC or ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.DISTRIBUTED_DATASYNC or ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.GET_LOCAL_ACCOUNTS. * @returns Returns the DVID if obtained; returns an empty string if no OHOS account has logged in. * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. @@ -575,7 +575,7 @@ declare namespace osAccount { /** * Obtains the profile photo of an OS account based on its local ID. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.GET_LOCAL_ACCOUNTS * @param localId Indicates the local ID of the OS account. * @returns Returns the profile photo if obtained; * returns {@code null} if the profile photo fails to be obtained. @@ -706,7 +706,7 @@ declare namespace osAccount { /** * Check whether current process belongs to the main account. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.GET_LOCAL_ACCOUNTS * @returns Returns {@code true} if current process belongs to the main os account; * returns {@code false} otherwise. * @throws {BusinessError} 201 - permission denied. @@ -720,7 +720,7 @@ declare namespace osAccount { /** * Query the constraint source type list of the OS account. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.GET_LOCAL_ACCOUNTS * @returns Returns the constraint source type infos of the os account; * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. @@ -914,7 +914,6 @@ declare namespace osAccount { * Sets property that can be used to initialize algorithms. * @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL * @param request Indicates the request information, including authentication type and the key-value to be set. - * @returns Returns a number value indicating whether the property setting was successful. * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. * @throws {BusinessError} 12300001 - system service exception. @@ -922,8 +921,8 @@ declare namespace osAccount { * @systemapi Hide this for inner system use. * @since 8 */ - setProperty(request: SetPropertyRequest, callback: AsyncCallback): void; - setProperty(request: SetPropertyRequest): Promise; + setProperty(request: SetPropertyRequest, callback: AsyncCallback): void; + setProperty(request: SetPropertyRequest): Promise; /** * Executes authentication. diff --git a/api/@ohos.app.ability.wantConstant.d.ts b/api/@ohos.app.ability.wantConstant.d.ts index 05e563cd9f..df5e51ff50 100644 --- a/api/@ohos.app.ability.wantConstant.d.ts +++ b/api/@ohos.app.ability.wantConstant.d.ts @@ -208,11 +208,11 @@ declare namespace wantConstant { PARAMS_STREAM = "ability.params.stream", /** - * Indicates the action of providing auth service. + * Indicates the action of providing the application account auth service. * @syscap SystemCapability.Ability.AbilityBase * @since 9 */ - ACTION_APP_ACCOUNT_AUTH = "account.appAccount.action.auth", + ACTION_APP_ACCOUNT_AUTH = "ohos.appAccount.action.auth", /** * Indicates the action of an application downloaded from the application market. -- Gitee From 27be86ce092a82463df3ea2e615ab97689240dac Mon Sep 17 00:00:00 2001 From: donglin Date: Fri, 25 Nov 2022 14:29:31 +0800 Subject: [PATCH 418/438] fix Signed-off-by: donglin Change-Id: I7b46764385258b265ab637007d06e8e7c6cee4f3 --- api/@internal/ets/lifecycle.d.ts | 86 ++++++++++++++++---------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/api/@internal/ets/lifecycle.d.ts b/api/@internal/ets/lifecycle.d.ts index f86b4ea5ee..5f7160a4e5 100644 --- a/api/@internal/ets/lifecycle.d.ts +++ b/api/@internal/ets/lifecycle.d.ts @@ -47,7 +47,7 @@ export declare interface LifecycleForm { * {@link formInfo#FormParam#NAME_KEY}, and {@link formInfo#FormParam#DIMENSION_KEY}, * respectively. Such form information must be managed as persistent data for further form * acquisition, update, and deletion. - * @return Returns the created {@link formBindingData#FormBindingData} object. + * @returns Returns the created {@link formBindingData#FormBindingData} object. * @FAModelOnly */ onCreate?(want: Want): formBindingData.FormBindingData; @@ -58,7 +58,7 @@ export declare interface LifecycleForm { * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param formId Indicates the ID of the form. - * @return - + * @returns - * @FAModelOnly */ onCastToNormal?(formId: string): void; @@ -69,7 +69,7 @@ export declare interface LifecycleForm { * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param formId Indicates the ID of the form to update. - * @return - + * @returns - * @FAModelOnly */ onUpdate?(formId: string): void; @@ -84,7 +84,7 @@ export declare interface LifecycleForm { * or {@link formInfo#VisibilityType#FORM_INVISIBLE}. {@link formInfo#VisibilityType#FORM_VISIBLE} * means that the form becomes visible, and {@link formInfo#VisibilityType#FORM_INVISIBLE} * means that the form becomes invisible. - * @return - + * @returns - * @FAModelOnly */ onVisibilityChange?(newStatus: { [key: string]: number }): void; @@ -99,7 +99,7 @@ export declare interface LifecycleForm { * the client to the form provider. * @param message Indicates the value of the {@code params} field of the message event. This parameter is * used to identify the specific component on which the event is triggered. - * @return - + * @returns - * @FAModelOnly */ onEvent?(formId: string, message: string): void; @@ -111,7 +111,7 @@ export declare interface LifecycleForm { * @since 8 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param formId Indicates the ID of the deleted form. - * @return - + * @returns - * @FAModelOnly */ onDestroy?(formId: string): void; @@ -126,7 +126,7 @@ export declare interface LifecycleForm { * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param want Indicates the description of the form for which the {@link formInfo#FormState} is obtained. * The description covers the bundle name, ability name, module name, form name, and form dimensions. - * @return Returns the {@link formInfo#FormState} object. + * @returns Returns the {@link formInfo#FormState} object. * @FAModelOnly */ onAcquireFormState?(want: Want): formInfo.FormState; @@ -138,7 +138,7 @@ export declare interface LifecycleForm { * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param formId Indicates the ID of the deleted form. * @systemapi hide for inner use. - * @return Returns the wantParams object. + * @returns Returns the wantParams object. * @FAModelOnly */ onShare?(formId: string): {[key: string]: any}; @@ -158,7 +158,7 @@ export declare interface LifecycleApp { * * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @return - + * @returns - * @FAModelOnly */ onShow?(): void; @@ -168,7 +168,7 @@ export declare interface LifecycleApp { * * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @return - + * @returns - * @FAModelOnly */ onHide?(): void; @@ -178,7 +178,7 @@ export declare interface LifecycleApp { * * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @return - + * @returns - * @FAModelOnly */ onDestroy?(): void; @@ -188,7 +188,7 @@ export declare interface LifecycleApp { * * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @return - + * @returns - * @FAModelOnly */ onCreate?(): void; @@ -202,7 +202,7 @@ export declare interface LifecycleApp { * @param isShownInMultiWindow Specifies whether this ability is currently in multi-window mode. * The value {@code true} indicates the multi-window mode, and {@code false} indicates another mode. * @param newConfig Indicates the new configuration information about this Page ability. - * @return - + * @returns - * @systemapi hide for inner use. * @FAModelOnly */ @@ -213,7 +213,7 @@ export declare interface LifecycleApp { * * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @return Returns {@code true} if the user allows the migration; returns {@code false} otherwise. + * @returns Returns {@code true} if the user allows the migration; returns {@code false} otherwise. * @FAModelOnly */ onStartContinuation?(): boolean; @@ -226,7 +226,7 @@ export declare interface LifecycleApp { * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param data Indicates the user data to save. - * @return Returns {@code true} if the data is successfully saved; returns {@code false} otherwise. + * @returns Returns {@code true} if the data is successfully saved; returns {@code false} otherwise. * @FAModelOnly */ onSaveData?(data: Object): boolean; @@ -241,7 +241,7 @@ export declare interface LifecycleApp { * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param result Indicates the migration result code. The value {@code 0} indicates that the migration is * successful, and {@code -1} indicates that the migration fails. - * @return - + * @returns - * @FAModelOnly */ onCompleteContinuation?(result: number): void; @@ -254,7 +254,7 @@ export declare interface LifecycleApp { * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param data Indicates the user data to restore. - * @return - + * @returns - * @FAModelOnly */ onRestoreData?(data: Object): void; @@ -265,7 +265,7 @@ export declare interface LifecycleApp { * * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @return - + * @returns - * @FAModelOnly */ onRemoteTerminated?(): void; @@ -279,7 +279,7 @@ export declare interface LifecycleApp { * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param outState Indicates the {@code PacMap} object used for storing user data and states. This * parameter cannot be null. - * @return - + * @returns - * @FAModelOnly */ onSaveAbilityState?(outState: PacMap): void; @@ -293,7 +293,7 @@ export declare interface LifecycleApp { * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param inState Indicates the {@code PacMap} object used for storing data and states. This * parameter can not be null. - * @return - + * @returns - * @FAModelOnly */ onRestoreAbilityState?(inState: PacMap): void; @@ -304,7 +304,7 @@ export declare interface LifecycleApp { * * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @return - + * @returns - * @FAModelOnly */ onInactive?(): void; @@ -314,7 +314,7 @@ export declare interface LifecycleApp { * * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @return - + * @returns - * @FAModelOnly */ onActive?(): void; @@ -325,7 +325,7 @@ export declare interface LifecycleApp { * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param want Indicates the new {@code want} containing information about the ability. - * @return - + * @returns - * @FAModelOnly */ onNewWant?(want: Want): void; @@ -337,7 +337,7 @@ export declare interface LifecycleApp { * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param level Indicates the memory trim level, which shows the current memory usage status. - * @return - + * @returns - * @FAModelOnly */ onMemoryLevel?(level: number): void; @@ -358,7 +358,7 @@ export declare interface LifecycleService { * * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @return - + * @returns - * @FAModelOnly */ onStart?(): void; @@ -372,7 +372,7 @@ export declare interface LifecycleService { * @param startId Indicates the number of times the Service ability has been started. The {@code startId} is * incremented by 1 every time the ability is started. For example, if the ability has been started * for six times. - * @return - + * @returns - * @FAModelOnly */ onCommand?(want: Want, startId: number): void; @@ -382,7 +382,7 @@ export declare interface LifecycleService { * * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel - * @return - + * @returns - * @FAModelOnly */ onStop?(): void; @@ -393,7 +393,7 @@ export declare interface LifecycleService { * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param want Indicates connection information about the Service ability. - * @return Returns the proxy of the Service ability. + * @returns Returns the proxy of the Service ability. * @FAModelOnly */ onConnect?(want: Want): rpc.RemoteObject; @@ -404,7 +404,7 @@ export declare interface LifecycleService { * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param want Indicates disconnection information about the Service ability. - * @return - + * @returns - * @FAModelOnly */ onDisconnect?(want: Want): void; @@ -419,7 +419,7 @@ export declare interface LifecycleService { * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param want Indicates the want of the Service ability being connected. - * @return - + * @returns - * @FAModelOnly */ onReconnect?(want: Want): void; @@ -445,7 +445,7 @@ export declare interface LifecycleData { * default. * @param callback function specified by framework to receive the result, developer should call this function to * return the result to framework. - * @return - + * @returns - * @FAModelOnly */ update?(uri: string, valueBucket: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; @@ -462,7 +462,7 @@ export declare interface LifecycleData { * default. * @param callback function specified by framework to receive the result, developer should call this function to * return the result to framework. - * @return - + * @returns - * @FAModelOnly */ query?(uri: string, columns: Array, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; @@ -477,7 +477,7 @@ export declare interface LifecycleData { * default. * @param callback function specified by framework to receive the result, developer should call this function to * return the result to framework. - * @return - + * @returns - * @FAModelOnly */ delete?(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; @@ -492,7 +492,7 @@ export declare interface LifecycleData { * @param uri Indicates the uri to normalize. * @param callback function specified by framework to receive the result, developer should call this function to * return the result to framework. - * @return - + * @returns - * @FAModelOnly */ normalizeUri?(uri: string, callback: AsyncCallback): void; @@ -506,7 +506,7 @@ export declare interface LifecycleData { * @param valueBuckets Indicates the data to insert. * @param callback function specified by framework to receive the result, developer should call this function to * return the result to framework. - * @return - + * @returns - * @FAModelOnly */ batchInsert?(uri: string, valueBuckets: Array, callback: AsyncCallback): void; @@ -520,7 +520,7 @@ export declare interface LifecycleData { * @param uri Indicates the uri to denormalize. * @param callback function specified by framework to receive the result, developer should call this function to * return the result to framework. - * @return - + * @returns - * @FAModelOnly */ denormalizeUri?(uri: string, callback: AsyncCallback): void; @@ -534,7 +534,7 @@ export declare interface LifecycleData { * @param valueBucket Indicates the data to insert. * @param callback function specified by framework to receive the result, developer should call this function to * return the result to framework. - * @return - + * @returns - * @FAModelOnly */ insert?(uri: string, valueBucket: rdb.ValuesBucket, callback: AsyncCallback): void; @@ -551,7 +551,7 @@ export declare interface LifecycleData { * existing data, or "rwt" for read and write access that truncates any existing file. * @param callback function specified by framework to receive the result, developer should call this function to * return the result to framework. - * @return - + * @returns - * @FAModelOnly */ openFile?(uri: string, mode: string, callback: AsyncCallback): void; @@ -569,7 +569,7 @@ export declare interface LifecycleData { *

            3. "*/jpg": Obtains files whose subtype is JPG of any main type. * @param callback function specified by framework to receive the result, developer should call this function to * return the result to framework. - * @return - + * @returns - * @FAModelOnly */ getFileTypes?(uri: string, mimeTypeFilter: string, callback: AsyncCallback>): void; @@ -580,7 +580,7 @@ export declare interface LifecycleData { * @since 7 * @syscap SystemCapability.Ability.AbilityRuntime.FAModel * @param info Indicates the {@code AbilityInfo} object containing information about this ability. - * @return - + * @returns - * @FAModelOnly */ onInitialized?(info: AbilityInfo): void; @@ -596,7 +596,7 @@ export declare interface LifecycleData { * @param uri Indicates the uri of the data. * @param callback function specified by framework to receive the result, developer should call this function to * return the result to framework. - * @return - + * @returns - * @FAModelOnly */ getType?(uri: string, callback: AsyncCallback): void; @@ -609,7 +609,7 @@ export declare interface LifecycleData { * @param ops Indicates the data operation list, which can contain multiple operations on the database. * @param callback function specified by framework to receive the result, developer should call this function to * return the result to framework. - * @return - + * @returns - * @FAModelOnly */ executeBatch?(ops: Array, callback: AsyncCallback>): void; @@ -624,7 +624,7 @@ export declare interface LifecycleData { * @param extras Indicates the parameter transferred by the method. * @param callback function specified by framework to receive the result, developer should call this function to * return the result to framework. - * @return - + * @returns - * @FAModelOnly */ call?(method: string, arg: string, extras: PacMap, callback: AsyncCallback): void; -- Gitee From f58464c487683905ab54c30e9ee18412a6652016 Mon Sep 17 00:00:00 2001 From: zhufenghao Date: Fri, 25 Nov 2022 15:32:17 +0800 Subject: [PATCH 419/438] =?UTF-8?q?=E3=80=90web=E3=80=91=20API=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E8=A7=84=E8=8C=83=E4=BF=AE=E6=94=B9=20return=20?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=20returns?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhufenghao --- api/@internal/component/ets/web.d.ts | 70 ++++++++++++++-------------- api/@ohos.web.webview.d.ts | 10 ++-- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/api/@internal/component/ets/web.d.ts b/api/@internal/component/ets/web.d.ts index 57325d3d9e..7de600559a 100644 --- a/api/@internal/component/ets/web.d.ts +++ b/api/@internal/component/ets/web.d.ts @@ -353,7 +353,7 @@ declare class FileSelectorParam { /** * Gets the title of this file selector. - * @return Return the title of this file selector. + * @returns Return the title of this file selector. * * @since 9 */ @@ -361,7 +361,7 @@ declare class FileSelectorParam { /** * Gets the FileSelectorMode of this file selector. - * @return Return the FileSelectorMode of this file selector. + * @returns Return the FileSelectorMode of this file selector. * * @since 9 */ @@ -369,7 +369,7 @@ declare class FileSelectorParam { /** * Gets an array of acceptable MMIE type. - * @return Return an array of acceptable MMIE type. + * @returns Return an array of acceptable MMIE type. * * @since 9 */ @@ -377,7 +377,7 @@ declare class FileSelectorParam { /** * Gets whether this file selector use a live media captured value. - * @return Return {@code true} if captured media; return {@code false} otherwise. + * @returns Return {@code true} if captured media; return {@code false} otherwise. * @since 9 */ isCapture(): boolean; @@ -621,7 +621,7 @@ declare class WebContextMenuParam { /** * Horizontal offset coordinates of the menu within the Web component. - * @return The context menu x coordinate. + * @returns The context menu x coordinate. * * @since 9 */ @@ -629,7 +629,7 @@ declare class WebContextMenuParam { /** * Vertical offset coordinates for the menu within the Web component. - * @return The context menu y coordinate. + * @returns The context menu y coordinate. * * @since 9 */ @@ -637,7 +637,7 @@ declare class WebContextMenuParam { /** * If the long-press location is the link returns the link's security-checked URL. - * @return If relate to a link return link url, else return null. + * @returns If relate to a link return link url, else return null. * * @since 9 */ @@ -645,7 +645,7 @@ declare class WebContextMenuParam { /** * If the long-press location is the link returns the link's original URL. - * @return If relate to a link return unfiltered link url, else return null. + * @returns If relate to a link return unfiltered link url, else return null. * * @since 9 */ @@ -653,7 +653,7 @@ declare class WebContextMenuParam { /** * Returns the SRC URL if the selected element has a SRC attribute. - * @return If this context menu is "src" attribute, return link url, else return null. + * @returns If this context menu is "src" attribute, return link url, else return null. * * @since 9 */ @@ -661,7 +661,7 @@ declare class WebContextMenuParam { /** * Long press menu location has image content. - * @return Return whether this context menu has image content. + * @returns Return whether this context menu has image content. * * @since 9 */ @@ -722,7 +722,7 @@ declare class ConsoleMessage { /** * Gets the message of a console message. - * @return Return the message of a console message. + * @returns Return the message of a console message. * * @since 8 */ @@ -730,7 +730,7 @@ declare class ConsoleMessage { /** * Gets the Web source file's path and name of a console message. - * @return Return the Web source file's path and name of a console message. + * @returns Return the Web source file's path and name of a console message. * * @since 8 */ @@ -738,7 +738,7 @@ declare class ConsoleMessage { /** * Gets the line number of a console message. - * @return Return the line number of a console message. + * @returns Return the line number of a console message. * * @since 8 */ @@ -746,7 +746,7 @@ declare class ConsoleMessage { /** * Gets the message level of a console message. - * @return Return the message level of a console message, which can be {@link MessageLevel}. + * @returns Return the message level of a console message, which can be {@link MessageLevel}. * * @since 8 */ @@ -771,7 +771,7 @@ declare class WebResourceRequest { /** * Gets request headers. - * @return Return the request headers + * @returns Return the request headers * * @since 8 */ @@ -779,7 +779,7 @@ declare class WebResourceRequest { /** * Gets the request URL. - * @return Return the request URL. + * @returns Return the request URL. * * @since 8 */ @@ -787,7 +787,7 @@ declare class WebResourceRequest { /** * Check whether the request is associated with gesture. - * @return Return {@code true} if the request is associated with gesture;return {@code false} otherwise. + * @returns Return {@code true} if the request is associated with gesture;return {@code false} otherwise. * * @since 8 */ @@ -795,7 +795,7 @@ declare class WebResourceRequest { /** * Check whether the request is for getting the main frame. - * @return Return {@code true} if the request is associated with gesture for getting the main frame; return {@code false} otherwise. + * @returns Return {@code true} if the request is associated with gesture for getting the main frame; return {@code false} otherwise. * * @since 8 */ @@ -803,7 +803,7 @@ declare class WebResourceRequest { /** * Check whether the request redirects. - * @return Return {@code true} if the request redirects; return {@code false} otherwise. + * @returns Return {@code true} if the request redirects; return {@code false} otherwise. * * @since 8 */ @@ -824,7 +824,7 @@ declare class WebResourceRequest { /** * Gets the response data. - * @return Return the response data. + * @returns Return the response data. * * @since 8 */ @@ -832,7 +832,7 @@ declare class WebResourceRequest { /** * Gets the response encoding. - * @return Return the response encoding. + * @returns Return the response encoding. * * @since 8 */ @@ -840,7 +840,7 @@ declare class WebResourceRequest { /** * Gets the response MIME type. - * @return Return the response MIME type. + * @returns Return the response MIME type. * * @since 8 */ @@ -848,7 +848,7 @@ declare class WebResourceRequest { /** * Gets the reason message. - * @return Return the reason message. + * @returns Return the reason message. * * @since 8 */ @@ -856,7 +856,7 @@ declare class WebResourceRequest { /** * Gets the response headers. - * @return Return the response headers. + * @returns Return the response headers. * * @since 8 */ @@ -864,7 +864,7 @@ declare class WebResourceRequest { /** * Gets the response code. - * @return Return the response code. + * @returns Return the response code. * * @since 8 */ @@ -950,7 +950,7 @@ declare class WebResourceError { /** * Gets the info of the Web resource error. - * @return Return the info of the Web resource error. + * @returns Return the info of the Web resource error. * * @since 8 */ @@ -958,7 +958,7 @@ declare class WebResourceError { /** * Gets the code of the Web resource error. - * @return Return the code of the Web resource error. + * @returns Return the code of the Web resource error. * * @since 8 */ @@ -1000,7 +1000,7 @@ declare class WebCookie { /** * Get whether cookies can be send or accepted. - * @return true if can send and accept cookies else false. + * @returns true if can send and accept cookies else false. * * @since 9 */ @@ -1008,7 +1008,7 @@ declare class WebCookie { /** * Get whether third party cookies can be send or accepted. - * @return true if can send and accept third party cookies else false. + * @returns true if can send and accept third party cookies else false. * * @since 9 */ @@ -1016,7 +1016,7 @@ declare class WebCookie { /** * Get whether file scheme cookies can be send or accepted. - * @return true if can send and accept else false. + * @returns true if can send and accept else false. * @since 9 */ isFileURICookieAllowed(): boolean; @@ -1077,7 +1077,7 @@ declare class WebCookie { * Gets all cookies for the given URL. * * @param url the URL for which the cookies are requested. - * @return the cookie value for the given URL. + * @returns the cookie value for the given URL. * * @since 9 */ @@ -1086,7 +1086,7 @@ declare class WebCookie { /** * Check whether exists any cookies. * - * @return true if exists cookies else false; + * @returns true if exists cookies else false; * @since 9 */ existCookie(): boolean; @@ -1389,7 +1389,7 @@ declare class WebCookie { /** * Gets the url of current Web page. - * @return the url of current Web page. + * @returns the url of current Web page. * @since 9 */ getUrl(): string; @@ -1836,7 +1836,7 @@ declare class WebAttribute extends CommonMethod { * Triggered when the resources loading is intercepted. * @param callback The triggered callback when the resources loading is intercepted. * - * @return If the response value is null, the Web will continue to load the resources. Otherwise, the response value will be used + * @returns If the response value is null, the Web will continue to load the resources. Otherwise, the response value will be used * @since 9 */ onInterceptRequest(callback: (event?: { request: WebResourceRequest}) => WebResourceResponse): WebAttribute; @@ -1854,7 +1854,7 @@ declare class WebAttribute extends CommonMethod { * Triggered when called to allow custom display of the context menu. * @param callback The triggered callback when called to allow custom display of the context menu. * - * @return If custom display return true.Otherwise, default display return false. + * @returns If custom display return true.Otherwise, default display return false. * @since 9 */ onContextMenuShow(callback: (event?: { param: WebContextMenuParam, result: WebContextMenuResult }) => boolean): WebAttribute; diff --git a/api/@ohos.web.webview.d.ts b/api/@ohos.web.webview.d.ts index 0bdb35eb44..164a1ef752 100644 --- a/api/@ohos.web.webview.d.ts +++ b/api/@ohos.web.webview.d.ts @@ -194,7 +194,7 @@ declare namespace webview { class WebDataBase { /** * Get whether instances holds any http authentication credentials. - * @return { boolean } true if instances saved any http authentication credentials otherwise false. + * @returns { boolean } true if instances saved any http authentication credentials otherwise false. * * @since 9 */ @@ -212,7 +212,7 @@ declare namespace webview { * @param { string } host - The host to which the credentials apply. * @param { string } realm - The realm to which the credentials apply. * @throws { BusinessError } 401 - Invalid input parameter. - * @return { Array } Return an array containing username and password. + * @returns { Array } Return an array containing username and password. * @since 9 */ static getHttpAuthCredentials(host: string, realm: string): Array; @@ -320,7 +320,7 @@ declare namespace webview { * geographic location permission status. * @throws { BusinessError } 401 - Invalid input parameter. * @throws { BusinessError } 17100011 - Invalid origin. - * @return { Promise } Return whether there is a saved result. + * @returns { Promise } Return whether there is a saved result. * * @since 9 */ @@ -332,7 +332,7 @@ declare namespace webview { * @param { AsyncCallback } callback - Return all source information of * stored geographic location permission status. * @throws { BusinessError } 401 - Invalid input parameter. - * @return { Promise> } Return whether there is a saved result. + * @returns { Promise> } Return whether there is a saved result. * * @since 9 */ @@ -376,7 +376,7 @@ declare namespace webview { * * @param { AsyncCallback } callback - Called after the cookies have been saved. * @throws { BusinessError } 401 - Invalid input parameter. - * @return { Promise } A promise resolved after the cookies have been saved. + * @returns { Promise } A promise resolved after the cookies have been saved. * * @since 9 */ -- Gitee From db475eb98ddec429ee23b3e63530df31ea9b98eb Mon Sep 17 00:00:00 2001 From: liu-ganlin Date: Fri, 25 Nov 2022 11:48:36 +0800 Subject: [PATCH 420/438] update unknow decorator and misspell words Signed-off-by: liu-ganlin --- api/@ohos.buffer.d.ts | 142 ++++++++++++++--------------- api/@ohos.util.ArrayList.d.ts | 18 ++-- api/@ohos.util.Deque.d.ts | 10 +- api/@ohos.util.HashMap.d.ts | 10 +- api/@ohos.util.HashSet.d.ts | 6 +- api/@ohos.util.LightWeightMap.d.ts | 28 +++--- api/@ohos.util.LightWeightSet.d.ts | 16 ++-- api/@ohos.util.LinkedList.d.ts | 30 +++--- api/@ohos.util.List.d.ts | 24 ++--- api/@ohos.util.PlainArray.d.ts | 20 ++-- api/@ohos.util.Queue.d.ts | 6 +- api/@ohos.util.Stack.d.ts | 6 +- api/@ohos.util.TreeMap.d.ts | 22 ++--- api/@ohos.util.TreeSet.d.ts | 22 ++--- api/@ohos.util.Vector.d.ts | 31 ++++--- 15 files changed, 196 insertions(+), 195 deletions(-) diff --git a/api/@ohos.buffer.d.ts b/api/@ohos.buffer.d.ts index d4ec693cfd..9fc9a1bfac 100644 --- a/api/@ohos.buffer.d.ts +++ b/api/@ohos.buffer.d.ts @@ -31,7 +31,7 @@ declare namespace buffer { * @param size The desired length of the new Buffer * @param [fill=0] A value to pre-fill the new Buffer with * @param [encoding='utf8'] If `fill` is a string, this is its encoding - * @return Return a new allocated Buffer + * @returns Return a new allocated Buffer * @throws {BusinessError} 401 - if the input parameters are invalid. */ function alloc(size: number, fill?: string | Buffer | number, encoding?: BufferEncoding): Buffer; @@ -41,7 +41,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param size The desired length of the new Buffer - * @return Return a new allocated Buffer + * @returns Return a new allocated Buffer * @throws {BusinessError} 401 - if the input parameters are invalid. */ function allocUninitializedFromPool(size: number): Buffer; @@ -51,7 +51,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param size The desired length of the new Buffer - * @return Return a new allocated Buffer + * @returns Return a new allocated Buffer * @throws {BusinessError} 401 - if the input parameters are invalid. */ function allocUninitialized(size: number): Buffer; @@ -64,7 +64,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param string A value to calculate the length of * @param [encoding='utf8'] If `string` is a string, this is its encoding - * @return The number of bytes contained within `string` + * @returns The number of bytes contained within `string` * @throws {BusinessError} 401 - if the input parameters are invalid. */ function byteLength(string: string | Buffer | TypedArray | DataView | ArrayBuffer | SharedArrayBuffer, encoding?: BufferEncoding): number; @@ -75,7 +75,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param list List of `Buffer` or Uint8Array instances to concatenate * @param totalLength Total length of the `Buffer` instances in `list` when concatenated - * @return Return a new allocated Buffer + * @returns Return a new allocated Buffer * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "length" is out of range. It must be >= 0 and <= uint32 max. Received value is: [length] */ @@ -86,7 +86,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param array an array of bytes in the range 0 – 255 - * @return Return a new allocated Buffer + * @returns Return a new allocated Buffer * @throws {BusinessError} 401 - if the input parameters are invalid. */ function from(array: number[]): Buffer; @@ -98,7 +98,7 @@ declare namespace buffer { * @param arrayBuffer An ArrayBuffer, SharedArrayBuffer, for example the .buffer property of a TypedArray. * @param [byteOffset = 0] Index of first byte to expose * @param [length = arrayBuffer.byteLength - byteOffset] Number of bytes to expose - * @return Return a view of the ArrayBuffer + * @returns Return a view of the ArrayBuffer * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "[byteOffset/length]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [byteOffset/length] */ @@ -109,7 +109,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param buffer An existing Buffer or Uint8Array from which to copy data - * @return Return a new allocated Buffer + * @returns Return a new allocated Buffer * @throws {BusinessError} 401 - if the input parameters are invalid. */ function from(buffer: Buffer | Uint8Array): Buffer; @@ -122,7 +122,7 @@ declare namespace buffer { * @param object An object supporting Symbol.toPrimitive or valueOf() * @param offsetOrEncoding A byte-offset or encoding * @param length A length - * @return Return a new allocated Buffer + * @returns Return a new allocated Buffer * @throws {BusinessError} 401 - if the input parameters are invalid. */ function from(object: Object, offsetOrEncoding: number | string, length: number): Buffer; @@ -134,7 +134,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param string A string to encode * @param [encoding='utf8'] The encoding of string - * @return Return a new Buffer containing string + * @returns Return a new Buffer containing string * @throws {BusinessError} 401 - if the input parameters are invalid. */ function from(string: String, encoding?: BufferEncoding): Buffer; @@ -144,7 +144,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param obj Objects to be judged - * @return true or false + * @returns true or false */ function isBuffer(obj: Object): boolean; @@ -153,7 +153,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param encoding A character encoding name to check - * @return true or false + * @returns true or false */ function isEncoding(encoding: string):boolean; @@ -163,7 +163,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param buf1 A Buffer or Uint8Array instance. * @param buf2 A Buffer or Uint8Array instance. - * @return 0 is returned if target is the same as buf + * @returns 0 is returned if target is the same as buf * 1 is returned if target should come before buf when sorted. * -1 is returned if target should come after buf when sorted. * @throws {BusinessError} 401 - if the input parameters are invalid. @@ -177,7 +177,7 @@ declare namespace buffer { * @param source A Buffer or Uint8Array instance. * @param fromEnc The current encoding * @param toEnc To target encoding - * @return Returns a new Buffer instance + * @returns Returns a new Buffer instance * @throws {BusinessError} 401 - if the input parameters are invalid. */ function transcode(source: Buffer | Uint8Array, fromEnc: string, toEnc: string): Buffer; @@ -218,7 +218,7 @@ declare namespace buffer { * @param [offset = 0] Number of bytes to skip before starting to fill buf * @param [end = buf.length] Where to stop filling buf (not inclusive) * @param [encoding='utf8'] The encoding for value if value is a string - * @return A reference to buf + * @returns A reference to buf * @throws {BusinessError} 10200001 - The value of "[offset/end]" is out of range. It must be >= 0 and <= [right range]. Received value is: [offset/end] * @throws {BusinessError} 401 - if the input parameters are invalid. */ @@ -234,7 +234,7 @@ declare namespace buffer { * @param [targetEnd = target.length] The offset within target at which to end comparison (not inclusive) * @param [sourceStart = 0] The offset within buf at which to begin comparison * @param [sourceEnd = buf.length] The offset within buf at which to end comparison (not inclusive) - * @return 0 is returned if target is the same as buf + * @returns 0 is returned if target is the same as buf * 1 is returned if target should come before buf when sorted. * -1 is returned if target should come after buf when sorted. * @throws {BusinessError} 401 - if the input parameters are invalid. @@ -252,7 +252,7 @@ declare namespace buffer { * @param [targetStart = 0] The offset within target at which to begin writing * @param [sourceStart = 0] The offset within buf from which to begin copying * @param [sourceEnd = buf.length] The offset within buf at which to stop copying (not inclusive) - * @return The number of bytes copied + * @returns The number of bytes copied * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "[targetStart/sourceStart/sourceEnd]" is out of range. It must be >= 0. * Received value is: [targetStart/sourceStart/sourceEnd] @@ -264,7 +264,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param otherBuffer A Buffer or Uint8Array with which to compare buf - * @return true or false + * @returns true or false * @throws {BusinessError} 401 - if the input parameters are invalid. */ equals(otherBuffer: Uint8Array | Buffer): boolean; @@ -276,7 +276,7 @@ declare namespace buffer { * @param value What to search for * @param [byteOffset = 0] Where to begin searching in buf. If negative, then offset is calculated from the end of buf * @param [encoding='utf8'] If value is a string, this is its encoding - * @return true or false + * @returns true or false * @throws {BusinessError} 401 - if the input parameters are invalid. */ includes(value: string | number | Buffer | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): boolean; @@ -288,7 +288,7 @@ declare namespace buffer { * @param value What to search for * @param [byteOffset = 0] Where to begin searching in buf * @param [encoding='utf8'] If value is a string, this is the encoding used to determine the binary representation of the string that will be searched for in buf - * @return The index of the first occurrence of value in buf, or -1 if buf does not contain value + * @returns The index of the first occurrence of value in buf, or -1 if buf does not contain value * @throws {BusinessError} 401 - if the input parameters are invalid. */ indexOf(value: string | number | Buffer | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; @@ -321,7 +321,7 @@ declare namespace buffer { * @param value What to search for * @param [byteOffset = 0] Where to begin searching in buf * @param [encoding='utf8'] If value is a string, this is the encoding used to determine the binary representation of the string that will be searched for in buf - * @return The index of the last occurrence of value in buf, or -1 if buf does not contain value + * @returns The index of the last occurrence of value in buf, or -1 if buf does not contain value * @throws {BusinessError} 401 - if the input parameters are invalid. */ lastIndexOf(value: string | number | Buffer | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number; @@ -331,7 +331,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 - * @return Return a signed, big-endian 64-bit integer + * @returns Return a signed, big-endian 64-bit integer * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] */ @@ -342,7 +342,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 - * @return Return a signed, little-endian 64-bit integer + * @returns Return a signed, little-endian 64-bit integer * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] */ @@ -353,7 +353,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 - * @return Return a unsigned, big-endian 64-bit integer + * @returns Return a unsigned, big-endian 64-bit integer * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] */ @@ -364,7 +364,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 - * @return Return a unsigned, little-endian 64-bit integer + * @returns Return a unsigned, little-endian 64-bit integer * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] */ @@ -375,7 +375,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 - * @return Return a 64-bit, big-endian double + * @returns Return a 64-bit, big-endian double * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] */ @@ -386,7 +386,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 8 - * @return Return a 64-bit, little-endian double + * @returns Return a 64-bit, little-endian double * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] */ @@ -397,7 +397,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4 - * @return Return a 32-bit, big-endian float + * @returns Return a 32-bit, big-endian float * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] */ @@ -408,7 +408,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4 - * @return Return a 32-bit, little-endian float + * @returns Return a 32-bit, little-endian float * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] */ @@ -419,7 +419,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 1 - * @return Return a signed 8-bit integer + * @returns Return a signed 8-bit integer * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 1. Received value is: [offset] */ @@ -430,7 +430,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 2 - * @return Return a signed, big-endian 16-bit integer + * @returns Return a signed, big-endian 16-bit integer * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset] */ @@ -441,7 +441,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 2 - * @return Return a signed, little-endian 16-bit integer + * @returns Return a signed, little-endian 16-bit integer * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset] */ @@ -452,7 +452,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4 - * @return Return a signed, big-endian 32-bit integer + * @returns Return a signed, big-endian 32-bit integer * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] */ @@ -463,7 +463,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - 4 - * @return Return a signed, little-endian 32-bit integer + * @returns Return a signed, little-endian 32-bit integer * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] */ @@ -476,7 +476,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to read. Must satisfy 0 < byteLength <= 6 - * @return + * @returns * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ @@ -489,7 +489,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to read. Must satisfy 0 < byteLength <= 6 - * @return + * @returns * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ @@ -500,7 +500,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 1 - * @return Reads an unsigned 8-bit integer + * @returns Reads an unsigned 8-bit integer * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 1. Received value is: [offset] */ @@ -511,7 +511,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 2 - * @return Reads an unsigned, big-endian 16-bit integer + * @returns Reads an unsigned, big-endian 16-bit integer * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset] */ @@ -522,7 +522,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 2 - * @return Reads an unsigned, little-endian 16-bit integer + * @returns Reads an unsigned, little-endian 16-bit integer * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 2. Received value is: [offset] */ @@ -533,7 +533,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 4 - * @return Reads an unsigned, big-endian 32-bit integer + * @returns Reads an unsigned, big-endian 32-bit integer * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] */ @@ -544,7 +544,7 @@ declare namespace buffer { * @since 9 * @syscap SystemCapability.Utils.Lang * @param [offset = 0] Number of bytes to skip before starting to read. Must satisfy 0 <= offset <= buf.length - 4 - * @return Reads an unsigned, little-endian 32-bit integer + * @returns Reads an unsigned, little-endian 32-bit integer * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] */ @@ -557,7 +557,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to read. Must satisfy 0 < byteLength <= 6 - * @return + * @returns * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ @@ -570,7 +570,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param offset Number of bytes to skip before starting to read. Must satisfy: 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to read. Must satisfy 0 < byteLength <= 6 - * @return + * @returns * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ @@ -582,7 +582,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param [start = 0] Where the new Buffer will start * @param [end = buf.length] Where the new Buffer will end (not inclusive) - * @return Returns a new Buffer that references the same memory as the original + * @returns Returns a new Buffer that references the same memory as the original */ subarray(start?: number, end?: number): Buffer; @@ -590,7 +590,7 @@ declare namespace buffer { * Interprets buf as an array of unsigned 16-bit integers and swaps the byte order in-place. * @since 9 * @syscap SystemCapability.Utils.Lang - * @return A reference to buf + * @returns A reference to buf * @throws {BusinessError} 10200009 - Buffer size must be a multiple of 16-bits */ swap16(): Buffer; @@ -599,7 +599,7 @@ declare namespace buffer { * Interprets buf as an array of unsigned 32-bit integers and swaps the byte order in-place. * @since 9 * @syscap SystemCapability.Utils.Lang - * @return A reference to buf + * @returns A reference to buf * @throws {BusinessError} 10200009 - Buffer size must be a multiple of 32-bits */ swap32(): Buffer; @@ -608,7 +608,7 @@ declare namespace buffer { * Interprets buf as an array of unsigned 64-bit integers and swaps the byte order in-place. * @since 9 * @syscap SystemCapability.Utils.Lang - * @return A reference to buf + * @returns A reference to buf * @throws {BusinessError} 10200009 - Buffer size must be a multiple of 64-bits */ swap64(): Buffer; @@ -617,7 +617,7 @@ declare namespace buffer { * Returns a JSON representation of buf * @since 9 * @syscap SystemCapability.Utils.Lang - * @return Returns a JSON + * @returns Returns a JSON */ toJSON(): Object; @@ -640,7 +640,7 @@ declare namespace buffer { * @param [offset = 0] Number of bytes to skip before starting to write string * @param [length = buf.length - offset] Maximum number of bytes to write (written bytes will not exceed buf.length - offset) * @param [encoding='utf8'] The character encoding of string. - * @return Number of bytes written. + * @returns Number of bytes written. * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "[offset/length]" is out of range. It must be >= 0 and <= buf.length. Received value is: [offset/length] */ @@ -652,7 +652,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 - * @return offset plus the number of bytes written + * @returns offset plus the number of bytes written * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ @@ -664,7 +664,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 - * @return offset plus the number of bytes written + * @returns offset plus the number of bytes written * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ @@ -676,7 +676,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 - * @return offset plus the number of bytes written + * @returns offset plus the number of bytes written * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ @@ -688,7 +688,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 - * @return offset plus the number of bytes written + * @returns offset plus the number of bytes written * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ @@ -700,7 +700,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 - * @return offset plus the number of bytes written + * @returns offset plus the number of bytes written * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] */ @@ -712,7 +712,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 8 - * @return offset plus the number of bytes written + * @returns offset plus the number of bytes written * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 8. Received value is: [offset] */ @@ -724,7 +724,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 4 - * @return offset plus the number of bytes written + * @returns offset plus the number of bytes written * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] */ @@ -736,7 +736,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 4 - * @return offset plus the number of bytes written + * @returns offset plus the number of bytes written * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "offset" is out of range. It must be >= 0 and <= buf.length - 4. Received value is: [offset] */ @@ -748,7 +748,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 1 - * @return offset plus the number of bytes written + * @returns offset plus the number of bytes written * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ @@ -760,7 +760,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 2 - * @return offset plus the number of bytes written + * @returns offset plus the number of bytes written * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ @@ -772,7 +772,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 2 - * @return offset plus the number of bytes written + * @returns offset plus the number of bytes written * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ @@ -784,7 +784,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 4 - * @return offset plus the number of bytes written + * @returns offset plus the number of bytes written * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ @@ -796,7 +796,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy: 0 <= offset <= buf.length - 4 - * @return offset plus the number of bytes written + * @returns offset plus the number of bytes written * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ @@ -809,7 +809,7 @@ declare namespace buffer { * @param value Number to be written to buf * @param offset Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to write. Must satisfy 0 < byteLength <= 6 - * @return offset plus the number of bytes written + * @returns offset plus the number of bytes written * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ @@ -822,7 +822,7 @@ declare namespace buffer { * @param value Number to be written to buf * @param offset Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to write. Must satisfy 0 < byteLength <= 6 - * @return offset plus the number of bytes written + * @returns offset plus the number of bytes written * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ @@ -834,7 +834,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 1 - * @return offset plus the number of bytes written + * @returns offset plus the number of bytes written * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ @@ -846,7 +846,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 2 - * @return offset plus the number of bytes written + * @returns offset plus the number of bytes written * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ @@ -858,7 +858,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 2 - * @return offset plus the number of bytes written + * @returns offset plus the number of bytes written * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ @@ -870,7 +870,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 4 - * @return offset plus the number of bytes written + * @returns offset plus the number of bytes written * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ @@ -882,7 +882,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @param value Number to be written to buf * @param [offset = 0] Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - 4 - * @return offset plus the number of bytes written + * @returns offset plus the number of bytes written * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ @@ -895,7 +895,7 @@ declare namespace buffer { * @param value Number to be written to buf * @param offset Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to write. Must satisfy 0 < byteLength <= 6 - * @return offset plus the number of bytes written + * @returns offset plus the number of bytes written * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ @@ -908,7 +908,7 @@ declare namespace buffer { * @param value Number to be written to buf * @param offset Number of bytes to skip before starting to write. Must satisfy 0 <= offset <= buf.length - byteLength * @param byteLength Number of bytes to write. Must satisfy 0 < byteLength <= 6 - * @return offset plus the number of bytes written + * @returns offset plus the number of bytes written * @throws {BusinessError} 401 - if the input parameters are invalid. * @throws {BusinessError} 10200001 - The value of "[param]" is out of range. It must be >= [left range] and <= [right range]. Received value is: [param] */ diff --git a/api/@ohos.util.ArrayList.d.ts b/api/@ohos.util.ArrayList.d.ts index abeeada5a6..4e5a2e0a4c 100644 --- a/api/@ohos.util.ArrayList.d.ts +++ b/api/@ohos.util.ArrayList.d.ts @@ -52,7 +52,7 @@ declare class ArrayList { /** * Check if arraylist contains the specified element * @param element element to be contained - * @return the boolean type,if arraylist contains the specified element,return true,else return false + * @returns the boolean type,if arraylist contains the specified element,return true,else return false * @throws { BusinessError } 10200011 - The has method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -62,7 +62,7 @@ declare class ArrayList { * Returns the index of the first occurrence of the specified element * in this arraylist, or -1 if this arraylist does not contain the element. * @param element element to be contained - * @return the number type ,returns the lowest index such that or -1 if there is no such index. + * @returns the number type ,returns the lowest index such that or -1 if there is no such index. * @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -72,7 +72,7 @@ declare class ArrayList { * Find the corresponding element according to the index, * delete the element, and move the index of all elements to the right of the element forward by one. * @param index the index in the arraylist - * @return the T type ,returns undefined if arraylist is empty,If the index is + * @returns the T type ,returns undefined if arraylist is empty,If the index is * @throws { BusinessError } 10200001 - The type of parameters are out of range. * @throws { BusinessError } 10200011 - The removeByIndex method cannot be bound. * @throws { BusinessError } 401 - The type of parameters are invalid. @@ -85,7 +85,7 @@ declare class ArrayList { * if it is present. If the arraylist does not contain the element, it is * unchanged. More formally, removes the element with the lowest index * @param element element to remove - * @return the boolean type ,If there is no such element, return false + * @returns the boolean type ,If there is no such element, return false * @throws { BusinessError } 10200011 - The remove method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -95,7 +95,7 @@ declare class ArrayList { * Returns in the index of the last occurrence of the specified element in this arraylist , * or -1 if the arraylist does not contain the element. * @param element element to find - * @return the number type + * @returns the number type * @throws { BusinessError } 10200011 - The getLastIndexOf method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -181,7 +181,7 @@ declare class ArrayList { clear(): void; /** * Returns a shallow copy of this instance. (The elements themselves are not copied.) - * @return this arraylist instance + * @returns this arraylist instance * @throws { BusinessError } 10200011 - The clone method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -189,7 +189,7 @@ declare class ArrayList { clone(): ArrayList; /** * returns the capacity of this arraylist - * @return the number type + * @returns the number type * @throws { BusinessError } 10200011 - The getCapacity method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -197,7 +197,7 @@ declare class ArrayList { getCapacity(): number; /** * convert arraylist to array - * @return the Array type + * @returns the Array type * @throws { BusinessError } 10200011 - The convertToArray method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -205,7 +205,7 @@ declare class ArrayList { convertToArray(): Array; /** * Determine whether arraylist is empty and whether there is an element - * @return the boolean type + * @returns the boolean type * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang diff --git a/api/@ohos.util.Deque.d.ts b/api/@ohos.util.Deque.d.ts index 15c3906eab..8591d7d411 100644 --- a/api/@ohos.util.Deque.d.ts +++ b/api/@ohos.util.Deque.d.ts @@ -46,7 +46,7 @@ declare class Deque { /** * Check if deque contains the specified element * @param element element to be contained - * @return the boolean type,if deque contains the specified element,return true,else return false + * @returns the boolean type,if deque contains the specified element,return true,else return false * @throws { BusinessError } 10200011 - The has method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -54,7 +54,7 @@ declare class Deque { has(element: T): boolean; /** * Obtains the header element of a deque. - * @return the T type + * @returns the T type * @throws { BusinessError } 10200011 - The getFirst method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -62,7 +62,7 @@ declare class Deque { getFirst(): T; /** * Obtains the end element of a deque. - * @return the T type + * @returns the T type * @throws { BusinessError } 10200011 - The getLast method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -70,7 +70,7 @@ declare class Deque { getLast(): T; /** * Obtains the header element of a deque and delete the element. - * @return the T type + * @returns the T type * @throws { BusinessError } 10200011 - The popFirst method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -78,7 +78,7 @@ declare class Deque { popFirst(): T; /** * Obtains the end element of a deque and delete the element. - * @return the T type + * @returns the T type * @throws { BusinessError } 10200011 - The popLast method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang diff --git a/api/@ohos.util.HashMap.d.ts b/api/@ohos.util.HashMap.d.ts index 46db82f142..e565fbd938 100644 --- a/api/@ohos.util.HashMap.d.ts +++ b/api/@ohos.util.HashMap.d.ts @@ -29,7 +29,7 @@ declare class HashMap { length: number; /** * Returns whether the Map object contains elements - * @return the boolean type + * @returns the boolean type * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -38,7 +38,7 @@ declare class HashMap { /** * Returns whether a key is contained in this map * @param key need to determine whether to include the key - * @return the boolean type + * @returns the boolean type * @throws { BusinessError } 10200011 - The hasKey method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -47,7 +47,7 @@ declare class HashMap { /** * Returns whether a value is contained in this map * @param value need to determine whether to include the value - * @return the boolean type + * @returns the boolean type * @throws { BusinessError } 10200011 - The hasValue method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -56,7 +56,7 @@ declare class HashMap { /** * Returns a specified element in a Map object, or null if there is no corresponding element * @param key the index in HashMap - * @return value or null + * @returns value or null * @throws { BusinessError } 10200011 - The get method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -85,7 +85,7 @@ declare class HashMap { /** * Remove a specified element from a Map object * @param key Target to be deleted - * @return Target mapped value + * @returns Target mapped value * @throws { BusinessError } 10200011 - The remove method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang diff --git a/api/@ohos.util.HashSet.d.ts b/api/@ohos.util.HashSet.d.ts index e10b40ea0b..4d270bf821 100644 --- a/api/@ohos.util.HashSet.d.ts +++ b/api/@ohos.util.HashSet.d.ts @@ -29,7 +29,7 @@ declare class HashSet { length: number; /** * Returns whether the Set object contains elements - * @return the boolean type + * @returns the boolean type * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -38,7 +38,7 @@ declare class HashSet { /** * Returns whether the Set object contain s the elements * @param value need to determine whether to include the element - * @return the boolean type + * @returns the boolean type * @throws { BusinessError } 10200011 - The has method cannot be bound. * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 @@ -58,7 +58,7 @@ declare class HashSet { /** * Remove a specified element from a Set object * @param value Target to be deleted - * @return the boolean type(Is there contain this element) + * @returns the boolean type(Is there contain this element) * @throws { BusinessError } 10200011 - The remove method cannot be bound. * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 diff --git a/api/@ohos.util.LightWeightMap.d.ts b/api/@ohos.util.LightWeightMap.d.ts index 94862c4fc1..e8e29b62d1 100644 --- a/api/@ohos.util.LightWeightMap.d.ts +++ b/api/@ohos.util.LightWeightMap.d.ts @@ -30,7 +30,7 @@ declare class LightWeightMap { /** * Returns whether this map has all the object in a specified map * @param map the Map object to compare - * @return the boolean type + * @returns the boolean type * @throws { BusinessError } 401 - The type of parameters are invalid. * @throws { BusinessError } 10200011 - The hasAll method cannot be bound. * @since 8 @@ -40,7 +40,7 @@ declare class LightWeightMap { /** * Returns whether a key is contained in this map * @param key need to determine whether to include the key - * @return the boolean type + * @returns the boolean type * @throws { BusinessError } 10200011 - The hasKey method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -49,7 +49,7 @@ declare class LightWeightMap { /** * Returns whether a value is contained in this map * @param value need to determine whether to include the value - * @return the boolean type + * @returns the boolean type * @throws { BusinessError } 10200011 - The hasValue method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -75,7 +75,7 @@ declare class LightWeightMap { /** * Returns the value to which the specified key is mapped, or undefined if this map contains no mapping for the key * @param key the index in LightWeightMap - * @return value or undefined + * @returns value or undefined * @throws { BusinessError } 10200011 - The get method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -84,7 +84,7 @@ declare class LightWeightMap { /** * Obtains the index of the key equal to a specified key in an LightWeightMap container * @param key Looking for goals - * @return Subscript corresponding to target + * @returns Subscript corresponding to target * @throws { BusinessError } 10200011 - The getIndexOfKey method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -93,7 +93,7 @@ declare class LightWeightMap { /** * Obtains the index of the value equal to a specified value in an LightWeightMap container * @param value Looking for goals - * @return Subscript corresponding to target + * @returns Subscript corresponding to target * @throws { BusinessError } 10200011 - The getIndexOfValue method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -101,16 +101,16 @@ declare class LightWeightMap { getIndexOfValue(value: V): number; /** * Returns whether the Map object contains elements - * @return the boolean type + * @returns the boolean type * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ isEmpty(): boolean; /** - * Obtains the key at the loaction identified by index in an LightWeightMap container + * Obtains the key at the location identified by index in an LightWeightMap container * @param index Target subscript for search - * @return the key of key-value pairs + * @returns the key of key-value pairs * @throws { BusinessError } 10200011 - The getKeyAt method cannot be bound. * @throws { BusinessError } 10200001 - The type of parameters are out of range. * @throws { BusinessError } 401 - The type of parameters are invalid. @@ -147,16 +147,16 @@ declare class LightWeightMap { /** * Remove the mapping for this key from this map if present * @param key Target to be deleted - * @return Target mapped value + * @returns Target mapped value * @throws { BusinessError } 10200011 - The remove method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ remove(key: K): V; /** - * Deletes a key-value pair at the loaction identified by index from an LightWeightMap container + * Deletes a key-value pair at the location identified by index from an LightWeightMap container * @param index Target subscript for search - * @return the boolean type(Is there a delete value) + * @returns the boolean type(Is there a delete value) * @throws { BusinessError } 10200011 - The removeAt method cannot be bound. * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 @@ -175,7 +175,7 @@ declare class LightWeightMap { * Sets the value identified by index in an LightWeightMap container to a specified value * @param index Target subscript for search * @param value Updated the target mapped value - * @return the boolean type(Is there a value corresponding to the subscript) + * @returns the boolean type(Is there a value corresponding to the subscript) * @throws { BusinessError } 10200011 - The setValueAt method cannot be bound. * @throws { BusinessError } 10200001 - The type of parameters are out of range. * @throws { BusinessError } 401 - The type of parameters are invalid. @@ -210,7 +210,7 @@ declare class LightWeightMap { /** * Obtains the value identified by index in an LightWeightMap container * @param index Target subscript for search - * @return the value of key-value pairs + * @returns the value of key-value pairs * @throws { BusinessError } 10200011 - The getValueAt method cannot be bound. * @throws { BusinessError } 10200001 - The type of parameters are out of range. * @throws { BusinessError } 401 - The type of parameters are invalid. diff --git a/api/@ohos.util.LightWeightSet.d.ts b/api/@ohos.util.LightWeightSet.d.ts index 628504e614..236e4140ef 100644 --- a/api/@ohos.util.LightWeightSet.d.ts +++ b/api/@ohos.util.LightWeightSet.d.ts @@ -49,7 +49,7 @@ declare class LightWeightSet { /** * Returns whether this set has all the object in a specified set * @param set the Set object to compare - * @return the boolean type + * @returns the boolean type * @throws { BusinessError } 10200011 - The hasAll method cannot be bound. * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 @@ -59,7 +59,7 @@ declare class LightWeightSet { /** * Checks whether an LightWeightSet container has a specified key * @param key need to determine whether to include the key - * @return the boolean type + * @returns the boolean type * @throws { BusinessError } 10200011 - The has method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -68,7 +68,7 @@ declare class LightWeightSet { /** * Checks whether an the objects of an LightWeighSet containeer are of the same type as a specified Object LightWeightSet * @param obj need to determine whether to include the obj - * @return the boolean type + * @returns the boolean type * @throws { BusinessError } 10200011 - The equal method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -88,7 +88,7 @@ declare class LightWeightSet { /** * Obtains the index of s key of a specified Object type in an LightWeightSet container * @param key Looking for goals - * @return Subscript corresponding to target + * @returns Subscript corresponding to target * @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -97,16 +97,16 @@ declare class LightWeightSet { /** * Deletes an object of a specified Object type from an LightWeightSet container * @param key Target to be deleted - * @return Target element + * @returns Target element * @throws { BusinessError } 10200011 - The remove method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang */ remove(key: T): T; /** - * Deletes an object at the loaction identified by index from an LightWeightSet container + * Deletes an object at the location identified by index from an LightWeightSet container * @param index Target subscript for search - * @return the boolean type(Is there a delete value) + * @returns the boolean type(Is there a delete value) * @throws { BusinessError } 10200011 - The removeAt method cannot be bound. * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 @@ -154,7 +154,7 @@ declare class LightWeightSet { /** * Obtains the object at the location identified by index in an LightWeightSet container * @param index Target subscript for search - * @return the value of key-value pairs + * @returns the value of key-value pairs * @throws { BusinessError } 10200011 - The getValueAt method cannot be bound. * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 diff --git a/api/@ohos.util.LinkedList.d.ts b/api/@ohos.util.LinkedList.d.ts index c46491eba3..755a9b17e2 100644 --- a/api/@ohos.util.LinkedList.d.ts +++ b/api/@ohos.util.LinkedList.d.ts @@ -51,7 +51,7 @@ declare class LinkedList { * Returns the element at the specified position in this linkedlist, * or returns undefined if this linkedlist is empty * @param index specified position - * @return the T type + * @returns the T type * @throws { BusinessError } 10200011 - The get method cannot be bound. * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 @@ -68,7 +68,7 @@ declare class LinkedList { addFirst(element: T): void; /** * Retrieves and removes the head (first element) of this linkedlist. - * @return the head of this list + * @returns the head of this list * @throws { BusinessError } 10200011 - The removeFirst method cannot be bound. * @throws { BusinessError } 10200010 - Container is empty. * @since 8 @@ -77,7 +77,7 @@ declare class LinkedList { removeFirst(): T; /** * Removes and returns the last element from this linkedlist. - * @return the head of this list + * @returns the head of this list * @throws { BusinessError } 10200011 - The removeLast method cannot be bound. * @throws { BusinessError } 10200010 - Container is empty. * @since 8 @@ -87,7 +87,7 @@ declare class LinkedList { /** * Check if linkedlist contains the specified element * @param element element to be contained - * @return the boolean type,if linkedList contains the specified element,return true,else return false + * @returns the boolean type,if linkedList contains the specified element,return true,else return false * @throws { BusinessError } 10200011 - The has method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -97,7 +97,7 @@ declare class LinkedList { * Returns the index of the first occurrence of the specified element * in this linkedlist, or -1 if this linkedlist does not contain the element. * @param element element to be contained - * @return the number type ,returns the lowest index such that or -1 if there is no such index. + * @returns the number type ,returns the lowest index such that or -1 if there is no such index. * @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -106,7 +106,7 @@ declare class LinkedList { /** * Find the corresponding element according to the index, * @param index the index in the linkedlist - * @return the T type ,returns undefined if linkedlist is empty,If the index is + * @returns the T type ,returns undefined if linkedlist is empty,If the index is * out of bounds (greater than or equal to length or less than 0), throw an exception * @throws { BusinessError } 10200011 - The removeByIndex method cannot be bound. * @throws { BusinessError } 401 - The type of parameters are invalid. @@ -120,7 +120,7 @@ declare class LinkedList { * if it is present. If the linkedlist does not contain the element, it is * unchanged. More formally, removes the element with the lowest index * @param element element to remove - * @return the boolean type ,If there is no such element, return false + * @returns the boolean type ,If there is no such element, return false * @throws { BusinessError } 10200011 - The remove method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -131,7 +131,7 @@ declare class LinkedList { * if it is present. If the linkedlist does not contain the element, it is * unchanged. More formally, removes the element with the lowest index * @param element element to remove - * @return the boolean type ,If there is no such element, return false + * @returns the boolean type ,If there is no such element, return false * @throws { BusinessError } 10200011 - The removeFirstFound method cannot be bound. * @throws { BusinessError } 10200010 - Container is empty. * @since 8 @@ -143,7 +143,7 @@ declare class LinkedList { * if it is present. If the linkedlist does not contain the element, it is * unchanged. More formally, removes the element with the lowest index * @param element element to remove - * @return the boolean type ,If there is no such element, return false + * @returns the boolean type ,If there is no such element, return false * @throws { BusinessError } 10200011 - The removeLastFound method cannot be bound. * @throws { BusinessError } 10200010 - Container is empty. * @since 8 @@ -154,7 +154,7 @@ declare class LinkedList { * Returns in the index of the last occurrence of the specified element in this linkedlist , * or -1 if the linkedlist does not contain the element. * @param element element to find - * @return the number type + * @returns the number type * @throws { BusinessError } 10200011 - The getLastIndexOf method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -163,7 +163,7 @@ declare class LinkedList { /** * Returns the first element (the item at index 0) of this linkedlist. * or returns undefined if linkedlist is empty - * @return the T type ,returns undefined if linkedList is empty + * @returns the T type ,returns undefined if linkedList is empty * @throws { BusinessError } 10200011 - The getFirst method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -172,7 +172,7 @@ declare class LinkedList { /** * Returns the Last element (the item at index length-1) of this linkedlist. * or returns undefined if linkedlist is empty - * @return the T type ,returns undefined if linkedList is empty + * @returns the T type ,returns undefined if linkedList is empty * @throws { BusinessError } 10200011 - The getLast method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -182,7 +182,7 @@ declare class LinkedList { * Replaces the element at the specified position in this Vector with the specified element * @param element replaced element * @param index index to find - * @return the T type ,returns undefined if linkedList is empty + * @returns the T type ,returns undefined if linkedList is empty * @throws { BusinessError } 10200011 - The set method cannot be bound. * @throws { BusinessError } 10200001 - The type of parameters are out of range. * @throws { BusinessError } 401 - The type of parameters are invalid. @@ -216,7 +216,7 @@ declare class LinkedList { clear(): void; /** * Returns a shallow copy of this instance. (The elements themselves are not copied.) - * @return this linkedlist instance + * @returns this linkedlist instance * @throws { BusinessError } 10200011 - The clone method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -224,7 +224,7 @@ declare class LinkedList { clone(): LinkedList; /** * convert linkedlist to array - * @return the Array type + * @returns the Array type * @throws { BusinessError } 10200011 - The convertToArray method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang diff --git a/api/@ohos.util.List.d.ts b/api/@ohos.util.List.d.ts index e2d80d0575..657f82992c 100644 --- a/api/@ohos.util.List.d.ts +++ b/api/@ohos.util.List.d.ts @@ -51,7 +51,7 @@ declare class List { * Returns the element at the specified position in this list, * or returns undefined if this list is empty * @param index specified position - * @return the T type + * @returns the T type * @throws { BusinessError } 10200011 - The get method cannot be bound. * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 @@ -61,7 +61,7 @@ declare class List { /** * Check if list contains the specified element * @param element element to be contained - * @return the boolean type,if list contains the specified element,return true,else return false + * @returns the boolean type,if list contains the specified element,return true,else return false * @throws { BusinessError } 10200011 - The has method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -71,7 +71,7 @@ declare class List { * Returns the index of the first occurrence of the specified element * in this list, or -1 if this list does not contain the element. * @param element element to be contained - * @return the number type ,returns the lowest index such that or -1 if there is no such index. + * @returns the number type ,returns the lowest index such that or -1 if there is no such index. * @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -80,7 +80,7 @@ declare class List { /** * Find the corresponding element according to the index, * @param index the index in the list - * @return the T type ,returns undefined if list is empty,If the index is + * @returns the T type ,returns undefined if list is empty,If the index is * out of bounds (greater than or equal to length or less than 0), throw an exception * @throws { BusinessError } 10200011 - The removeByIndex method cannot be bound. * @throws { BusinessError } 10200001 - The type of parameters are out of range. @@ -94,7 +94,7 @@ declare class List { * if it is present. If the list does not contain the element, it is * unchanged. More formally, removes the element with the lowest index * @param element element to remove - * @return the boolean type ,If there is no such element, return false + * @returns the boolean type ,If there is no such element, return false * @throws { BusinessError } 10200011 - The remove method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -104,7 +104,7 @@ declare class List { * Returns in the index of the last occurrence of the specified element in this list , * or -1 if the list does not contain the element. * @param element element to find - * @return the number type + * @returns the number type * @throws { BusinessError } 10200011 - The getLastIndexOf method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -113,7 +113,7 @@ declare class List { /** * Returns the first element (the item at index 0) of this list. * or returns undefined if list is empty - * @return the T type ,returns undefined if list is empty + * @returns the T type ,returns undefined if list is empty * @throws { BusinessError } 10200011 - The getFirst method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -122,7 +122,7 @@ declare class List { /** * Returns the Last element (the item at index length-1) of this list. * or returns undefined if list is empty - * @return the T type ,returns undefined if list is empty + * @returns the T type ,returns undefined if list is empty * @throws { BusinessError } 10200011 - The getLast method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -132,7 +132,7 @@ declare class List { * Replaces the element at the specified position in this List with the specified element * @param element replaced element * @param index index to find - * @return the T type + * @returns the T type * @throws { BusinessError } 10200011 - The set method cannot be bound. * @throws { BusinessError } 10200001 - The type of parameters are out of range. * @throws { BusinessError } 401 - The type of parameters are invalid. @@ -144,7 +144,7 @@ declare class List { * Compares the specified object with this list for equality.if the object are the same as this list * return true, otherwise return false. * @param obj Compare objects - * @return the boolean type + * @returns the boolean type * @throws { BusinessError } 10200011 - The equal method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -217,7 +217,7 @@ declare class List { thisArg?: Object): void; /** * convert list to array - * @return the Array type + * @returns the Array type * @throws { BusinessError } 10200011 - The convertToArray method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -225,7 +225,7 @@ declare class List { convertToArray(): Array; /** * Determine whether list is empty and whether there is an element - * @return the boolean type + * @returns the boolean type * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang diff --git a/api/@ohos.util.PlainArray.d.ts b/api/@ohos.util.PlainArray.d.ts index ef10608a24..1f7371770c 100644 --- a/api/@ohos.util.PlainArray.d.ts +++ b/api/@ohos.util.PlainArray.d.ts @@ -54,7 +54,7 @@ declare class PlainArray { /** * Checks whether the current PlainArray object contains the specified key * @param key need to determine whether to include the key - * @return the boolean type + * @returns the boolean type * @throws { BusinessError } 10200011 - The has method cannot be bound. * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 @@ -64,7 +64,7 @@ declare class PlainArray { /** * Queries the value associated with the specified key * @param key Looking for goals - * @return the value of key-value pairs + * @returns the value of key-value pairs * @throws { BusinessError } 10200011 - The get method cannot be bound. * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 @@ -74,7 +74,7 @@ declare class PlainArray { /** * Queries the index for a specified key * @param key Looking for goals - * @return Subscript corresponding to target + * @returns Subscript corresponding to target * @throws { BusinessError } 10200011 - The getIndexOfKey method cannot be bound. * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 @@ -84,7 +84,7 @@ declare class PlainArray { /** * Queries the index for a specified value * @param value Looking for goals - * @return Subscript corresponding to target + * @returns Subscript corresponding to target * @throws { BusinessError } 10200011 - The getIndexOfValue method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -92,7 +92,7 @@ declare class PlainArray { getIndexOfValue(value: T): number; /** * Checks whether the current PlainArray object is empty - * @return the boolean type + * @returns the boolean type * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -101,7 +101,7 @@ declare class PlainArray { /** * Queries the key at a specified index * @param index Target subscript for search - * @return the key of key-value pairs + * @returns the key of key-value pairs * @throws { BusinessError } 10200011 - The getKeyAt method cannot be bound. * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 @@ -111,7 +111,7 @@ declare class PlainArray { /** * Remove the key-value pair based on a specified key if it exists and return the value * @param key Target to be deleted - * @return Target mapped value + * @returns Target mapped value * @throws { BusinessError } 10200011 - The remove method cannot be bound. * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 @@ -121,7 +121,7 @@ declare class PlainArray { /** * Remove the key-value pair at a specified index if it exists and return the value * @param index Target subscript for search - * @return the T type + * @returns the T type * @throws { BusinessError } 10200011 - The removeAt method cannot be bound. * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 @@ -132,7 +132,7 @@ declare class PlainArray { * Remove a group of key-value pairs from a specified index * @param index remove start index * @param size Expected deletion quantity - * @return Actual deleted quantity + * @returns Actual deleted quantity * @throws { BusinessError } 10200011 - The removeRangeFrom method cannot be bound. * @throws { BusinessError } 10200001 - The type of parameters are out of range. * @throws { BusinessError } 401 - The type of parameters are invalid. @@ -161,7 +161,7 @@ declare class PlainArray { /** * Queries the value at a specified index * @param index Target subscript for search - * @return the value of key-value pairs + * @returns the value of key-value pairs * @throws { BusinessError } 10200011 - The getValueAt method cannot be bound. * @throws { BusinessError } 10200001 - The type of parameters are out of range. * @throws { BusinessError } 401 - The type of parameters are invalid. diff --git a/api/@ohos.util.Queue.d.ts b/api/@ohos.util.Queue.d.ts index 20443d8d11..7a5795e56a 100644 --- a/api/@ohos.util.Queue.d.ts +++ b/api/@ohos.util.Queue.d.ts @@ -31,7 +31,7 @@ declare class Queue { * Inserting specified element at the end of a queue if it is possible to do * so immediately without violating capacity restrictions. * @param element to be appended to this queue - * @return the boolean type + * @returns the boolean type * @throws { BusinessError } 10200011 - The add method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -39,7 +39,7 @@ declare class Queue { add(element: T): boolean; /** * Obtains the header element of a queue. - * @return the T type + * @returns the T type * @throws { BusinessError } 10200011 - The getFirst method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -47,7 +47,7 @@ declare class Queue { getFirst(): T; /** * Retrieves and removes the head of this queue - * @return the T type + * @returns the T type * @throws { BusinessError } 10200011 - The pop method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang diff --git a/api/@ohos.util.Stack.d.ts b/api/@ohos.util.Stack.d.ts index e1c4ade374..b3113cebfd 100644 --- a/api/@ohos.util.Stack.d.ts +++ b/api/@ohos.util.Stack.d.ts @@ -29,7 +29,7 @@ declare class Stack { length: number; /** * Tests if this stack is empty - * @return the boolean type + * @returns the boolean type * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -37,8 +37,8 @@ declare class Stack { isEmpty(): boolean; /** * Looks at the object at the top of this stack without removing it from the stack - * Return undfined if this stack is empty - * @return the top value or undefined + * Return undefined if this stack is empty + * @returns the top value or undefined * @throws { BusinessError } 10200011 - The peek method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang diff --git a/api/@ohos.util.TreeMap.d.ts b/api/@ohos.util.TreeMap.d.ts index 3598b07737..194a5af151 100644 --- a/api/@ohos.util.TreeMap.d.ts +++ b/api/@ohos.util.TreeMap.d.ts @@ -34,7 +34,7 @@ declare class TreeMap { length: number; /** * Returns whether the Map object contains elements - * @return the boolean type + * @returns the boolean type * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -43,7 +43,7 @@ declare class TreeMap { /** * Returns whether a key is contained in this map * @param key need to determine whether to include the key - * @return the boolean type + * @returns the boolean type * @throws { BusinessError } 10200011 - The hasKey method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -52,7 +52,7 @@ declare class TreeMap { /** * Returns whether a value is contained in this map * @param value need to determine whether to include the value - * @return the boolean type + * @returns the boolean type * @throws { BusinessError } 10200011 - The hasValue method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -61,7 +61,7 @@ declare class TreeMap { /** * Returns a specified element in a Map object, or null if there is no corresponding element * @param key the index in TreeMap - * @return value or null + * @returns value or null * @throws { BusinessError } 10200011 - The get method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -70,7 +70,7 @@ declare class TreeMap { /** * Obtains the first sorted key in the treemap. * Or returns undefined if tree map is empty - * @return value or undefined + * @returns value or undefined * @throws { BusinessError } 10200011 - The getFirstKey method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -79,7 +79,7 @@ declare class TreeMap { /** * Obtains the last sorted key in the treemap. * Or returns undefined if tree map is empty - * @return value or undefined + * @returns value or undefined * @throws { BusinessError } 10200011 - The getLastKey method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -109,7 +109,7 @@ declare class TreeMap { * Remove a specified element from a Map object * @param key Target to be deleted * @throws { BusinessError } 10200011 - The remove method cannot be bound. - * @return Target mapped value + * @returns Target mapped value * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -123,19 +123,19 @@ declare class TreeMap { clear(): void; /** * Returns the greatest element smaller than or equal to the specified key - * if the key does not exist, undefied is returned + * if the key does not exist, undefined is returned * @param key Objective of comparison * @throws { BusinessError } 10200011 - The getLowerKey method cannot be bound. - * @return key or undefined + * @returns key or undefined * @since 8 * @syscap SystemCapability.Utils.Lang */ getLowerKey(key: K): K; /** * Returns the least element greater than or equal to the specified key - * if the key does not exist, undefied is returned + * if the key does not exist, undefined is returned * @param key Objective of comparison - * @return key or undefined + * @returns key or undefined * @throws { BusinessError } 10200011 - The getHigherKey method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang diff --git a/api/@ohos.util.TreeSet.d.ts b/api/@ohos.util.TreeSet.d.ts index 77d9e5635b..4e04894074 100644 --- a/api/@ohos.util.TreeSet.d.ts +++ b/api/@ohos.util.TreeSet.d.ts @@ -33,7 +33,7 @@ declare class TreeSet { length: number; /** * Returns whether the Set object contains elements - * @return the boolean type + * @returns the boolean type * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -42,7 +42,7 @@ declare class TreeSet { /** * Returns whether the Set object contain s the elements * @param value need to determine whether to include the element - * @return the boolean type + * @returns the boolean type * @throws { BusinessError } 10200011 - The has method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -61,7 +61,7 @@ declare class TreeSet { /** * Remove a specified element from a Set object * @param value Target to be deleted - * @return the boolean type(Is there contain this element) + * @returns the boolean type(Is there contain this element) * @throws { BusinessError } 10200011 - The remove method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -76,7 +76,7 @@ declare class TreeSet { clear(): void; /** * Gets the first elements in a set - * @return value or undefined + * @returns value or undefined * @throws { BusinessError } 10200011 - The getFirstValue method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -84,7 +84,7 @@ declare class TreeSet { getFirstValue(): T; /** * Gets the last elements in a set - * @return value or undefined + * @returns value or undefined * @throws { BusinessError } 10200011 - The getLastValue method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -92,9 +92,9 @@ declare class TreeSet { getLastValue(): T; /** * Returns the greatest element smaller than or equal to the specified key - * if the key does not exist, undefied is returned + * if the key does not exist, undefined is returned * @param key Objective of comparison - * @return key or undefined + * @returns key or undefined * @throws { BusinessError } 10200011 - The getLowerValue method cannot be bound. * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 @@ -103,9 +103,9 @@ declare class TreeSet { getLowerValue(key: T): T; /** * Returns the least element greater than or equal to the specified key - * if the key does not exist, undefied is returned + * if the key does not exist, undefined is returned * @param key Objective of comparison - * @return key or undefined + * @returns key or undefined * @throws { BusinessError } 10200011 - The getHigherValue method cannot be bound. * @throws { BusinessError } 401 - The type of parameters are invalid. * @since 8 @@ -114,7 +114,7 @@ declare class TreeSet { getHigherValue(key: T): T; /** * Return and delete the first element, returns undefined if tree set is empty - * @return first value or undefined + * @returns first value or undefined * @throws { BusinessError } 10200011 - The popFirst method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang @@ -122,7 +122,7 @@ declare class TreeSet { popFirst(): T; /** * Return and delete the last element, returns undefined if tree set is empty - * @return last value or undefined + * @returns last value or undefined * @throws { BusinessError } 10200011 - The popLast method cannot be bound. * @since 8 * @syscap SystemCapability.Utils.Lang diff --git a/api/@ohos.util.Vector.d.ts b/api/@ohos.util.Vector.d.ts index 8b1603b83a..febbedd86e 100644 --- a/api/@ohos.util.Vector.d.ts +++ b/api/@ohos.util.Vector.d.ts @@ -17,6 +17,7 @@ * @syscap SystemCapability.Utils.Lang * @since 8 * @deprecated since 9 + * @useinstead ohos.util.ArrayList */ declare class Vector { /** @@ -53,7 +54,7 @@ declare class Vector { /** * Check if vector contains the specified element * @param element element to be contained - * @return the boolean type,if vector contains the specified element,return true,else return false + * @returns the boolean type,if vector contains the specified element,return true,else return false * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -61,7 +62,7 @@ declare class Vector { /** * Returns the element at the specified position in this Vector,or returns undefined if vector is empty * @param element element to be contained - * @return the number type ,returns the lowest index such that or -1 if there is no such index. + * @returns the number type ,returns the lowest index such that or -1 if there is no such index. * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -70,7 +71,7 @@ declare class Vector { * Returns the index of the first occurrence of the specified element * in this vector, or -1 if this vector does not contain the element. * @param element current index - * @return the number type + * @returns the number type * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -78,7 +79,7 @@ declare class Vector { /** * Returns the first component (the item at index 0) of this vector. * or returns undefined if vector is empty - * @return the T type ,returns undefined if vector is empty + * @returns the T type ,returns undefined if vector is empty * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -86,7 +87,7 @@ declare class Vector { /** * Returns the Last component (the item at index length-1) of this vector. * or returns undefined if vector is empty - * @return the T type ,returns undefined if vector is empty + * @returns the T type ,returns undefined if vector is empty * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -95,7 +96,7 @@ declare class Vector { * Find the corresponding element according to the index, * delete the element, and move the index of all elements to the right of the element forward by one. * @param index the index in the vector - * @return the T type ,returns undefined if vector is empty,If the index is + * @returns the T type ,returns undefined if vector is empty,If the index is * out of bounds (greater than or equal to length or less than 0), throw an exception * @since 8 * @syscap SystemCapability.Utils.Lang @@ -106,7 +107,7 @@ declare class Vector { * if it is present. If the vector does not contain the element, it is * unchanged. More formally, removes the element with the lowest index * @param element element to remove - * @return the boolean type ,If there is no such element, return false + * @returns the boolean type ,If there is no such element, return false * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -115,7 +116,7 @@ declare class Vector { * Replaces the element at the specified position in this Vector with the specified element * @param element replaced element * @param index index to find - * @return the T type + * @returns the T type * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -124,7 +125,7 @@ declare class Vector { * Returns in the index of the last occurrence of the specified element in this vector , * or -1 if the vector does not contain the element. * @param element element to find - * @return the number type + * @returns the number type * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -134,7 +135,7 @@ declare class Vector { * or returns -1 if the element is not found,or -1 if there is no such index * @param element element to find * @param index start index - * @return the number type + * @returns the number type * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -144,7 +145,7 @@ declare class Vector { * or returns -1 if the element is not found,or -1 if there is no such index * @param element element to find * @param index start index - * @return the number type + * @returns the number type * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -219,7 +220,7 @@ declare class Vector { clear(): void; /** * Returns a shallow copy of this instance. (The elements themselves are not copied.) - * @return this vector instance + * @returns this vector instance * @since 8 * @syscap SystemCapability.Utils.Lang */ @@ -232,21 +233,21 @@ declare class Vector { setLength(newSize: number): void; /** * returns the capacity of this vector - * @return the number type + * @returns the number type * @since 8 * @syscap SystemCapability.Utils.Lang */ getCapacity(): number; /** * convert vector to array - * @return the Array type + * @returns the Array type * @since 8 * @syscap SystemCapability.Utils.Lang */ convertToArray(): Array; /** * Determine whether vector is empty and whether there is an element - * @return the boolean type + * @returns the boolean type * @since 8 * @syscap SystemCapability.Utils.Lang */ -- Gitee From 2344dda77bb62e9b58e8b360a96e588701d5bb43 Mon Sep 17 00:00:00 2001 From: jidong Date: Fri, 25 Nov 2022 08:09:05 +0000 Subject: [PATCH 421/438] update api/@ohos.account.osAccount.d.ts. Signed-off-by: jidong --- api/@ohos.account.osAccount.d.ts | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/api/@ohos.account.osAccount.d.ts b/api/@ohos.account.osAccount.d.ts index 1663e862ce..b933280d9e 100644 --- a/api/@ohos.account.osAccount.d.ts +++ b/api/@ohos.account.osAccount.d.ts @@ -94,7 +94,7 @@ declare namespace osAccount { /** * Checks whether an OS account is activated based on its local ID. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS or ohos.permission.GET_LOCAL_ACCOUNTS + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param localId Indicates the local ID of the OS account. * @returns void * @throws {BusinessError} 201 - permission denied. @@ -132,7 +132,7 @@ declare namespace osAccount { /** * Checks whether a constraint has been enabled for an OS account based on its local ID. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.GET_LOCAL_ACCOUNTS + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @param localId Indicates the local ID of the OS account. * @param constraint Indicates the constraint to check. The value can be: *

              @@ -193,7 +193,7 @@ declare namespace osAccount { /** * Checks whether an OS account has been verified based on its ID. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS or ohos.permission.GET_LOCAL_ACCOUNTS + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS * @param localId Indicates the local ID of the OS account. * @returns Returns {@code true} if the OS account has been verified successfully; * returns {@code false} otherwise. @@ -285,7 +285,7 @@ declare namespace osAccount { /** * Obtains the number of all OS accounts created on a device. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.GET_LOCAL_ACCOUNTS + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @returns Returns the number of created OS accounts. * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. @@ -353,7 +353,7 @@ declare namespace osAccount { /** * Queries the ID of an account which is bound to the specified domain account * - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.GET_LOCAL_ACCOUNTS + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @param domainInfo Indicates the domain account info. * @returns Returns the local ID of the OS account. * @throws {BusinessError} 201 - permission denied. @@ -390,7 +390,7 @@ declare namespace osAccount { /** * Obtains all constraints of an account based on its ID. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.GET_LOCAL_ACCOUNTS + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @param localId Indicates the local ID of the OS account. * @returns Returns a list of constraints. * @throws {BusinessError} 201 - permission denied. @@ -405,7 +405,7 @@ declare namespace osAccount { /** * Queries the list of all the OS accounts that have been created in the system. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.GET_LOCAL_ACCOUNTS + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @returns Returns a list of OS accounts. * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. @@ -497,7 +497,7 @@ declare namespace osAccount { * @since 9 */ getCurrentOsAccount(callback: AsyncCallback): void; - getCurrentOsAccount(): Promise; + getCurrentOsAccount(): Promise; /** * Queries OS account information based on the local ID. @@ -563,7 +563,7 @@ declare namespace osAccount { * The same application running on different devices obtains the same DVID, whereas different applications * obtain different DVIDs. *

              - * @permission ohos.permission.DISTRIBUTED_DATASYNC or ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.GET_LOCAL_ACCOUNTS. + * @permission ohos.permission.DISTRIBUTED_DATASYNC or ohos.permission.MANAGE_LOCAL_ACCOUNTS * @returns Returns the DVID if obtained; returns an empty string if no OHOS account has logged in. * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. @@ -575,7 +575,7 @@ declare namespace osAccount { /** * Obtains the profile photo of an OS account based on its local ID. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.GET_LOCAL_ACCOUNTS + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @param localId Indicates the local ID of the OS account. * @returns Returns the profile photo if obtained; * returns {@code null} if the profile photo fails to be obtained. @@ -706,7 +706,7 @@ declare namespace osAccount { /** * Check whether current process belongs to the main account. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.GET_LOCAL_ACCOUNTS + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @returns Returns {@code true} if current process belongs to the main os account; * returns {@code false} otherwise. * @throws {BusinessError} 201 - permission denied. @@ -720,7 +720,7 @@ declare namespace osAccount { /** * Query the constraint source type list of the OS account. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.GET_LOCAL_ACCOUNTS + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @returns Returns the constraint source type infos of the os account; * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. -- Gitee From 95a57c5ec1974eb30ec4a7ddbaa8996fc19104a0 Mon Sep 17 00:00:00 2001 From: jidong Date: Fri, 25 Nov 2022 08:13:20 +0000 Subject: [PATCH 422/438] update api/@ohos.account.osAccount.d.ts. Signed-off-by: jidong --- api/@ohos.account.osAccount.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.account.osAccount.d.ts b/api/@ohos.account.osAccount.d.ts index b933280d9e..235fce1eec 100644 --- a/api/@ohos.account.osAccount.d.ts +++ b/api/@ohos.account.osAccount.d.ts @@ -502,7 +502,7 @@ declare namespace osAccount { /** * Queries OS account information based on the local ID. * - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION or ohos.permission.GET_LOCAL_ACCOUNTS + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION * @param localId Indicates the local ID of the OS account. * @returns Returns the OS account information; returns {@code null} if the query fails. * @throws {BusinessError} 201 - permission denied. -- Gitee From 6f279fa66fe9009a0078e8294be439ba4350e659 Mon Sep 17 00:00:00 2001 From: jidong Date: Fri, 25 Nov 2022 08:31:11 +0000 Subject: [PATCH 423/438] update api/@ohos.account.osAccount.d.ts. Signed-off-by: jidong --- api/@ohos.account.osAccount.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.account.osAccount.d.ts b/api/@ohos.account.osAccount.d.ts index 235fce1eec..614155cce2 100644 --- a/api/@ohos.account.osAccount.d.ts +++ b/api/@ohos.account.osAccount.d.ts @@ -489,7 +489,7 @@ declare namespace osAccount { /** * Gets information about the current OS account. - * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.GET_LOCAL_ACCOUNTS + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS * @returns Returns information about the current OS account; returns {@code null} if the query fails. * @throws {BusinessError} 201 - permission denied. * @throws {BusinessError} 401 - the parameter check failed. -- Gitee From 48fc902e30ce2be2f4f79b6a3404bd7dc7c685a4 Mon Sep 17 00:00:00 2001 From: fangyun Date: Thu, 17 Nov 2022 20:55:34 +0800 Subject: [PATCH 424/438] edm add get device info interface Signed-off-by: fangyun --- api/@ohos.enterprise.deviceInfo.d.ts | 78 ++++++++++++++++++++++++++-- 1 file changed, 73 insertions(+), 5 deletions(-) diff --git a/api/@ohos.enterprise.deviceInfo.d.ts b/api/@ohos.enterprise.deviceInfo.d.ts index b1ebb9170a..281b6ef042 100644 --- a/api/@ohos.enterprise.deviceInfo.d.ts +++ b/api/@ohos.enterprise.deviceInfo.d.ts @@ -21,7 +21,7 @@ import Want from "./@ohos.app.ability.Want"; * @namespace deviceInfo. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @since 9 + * @since 10 */ declare namespace deviceInfo { @@ -37,8 +37,8 @@ declare namespace deviceInfo { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly - * @since 9 + * @StageModelOnly + * @since 10 */ function getDeviceSerial(admin: Want, callback: AsyncCallback): void; @@ -54,10 +54,78 @@ declare namespace deviceInfo { * @throws { BusinessError } 401 - invalid input parameter. * @syscap SystemCapability.Customization.EnterpriseDeviceManager * @systemapi - * @stagemodelonly - * @since 9 + * @StageModelOnly + * @since 10 */ function getDeviceSerial(admin: Want): Promise; + + /** + * Gets the display version. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_DEVICE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { AsyncCallback } callback - the callback of getDisplayVersion. + * @throws { BusinessError } 9200001 - the application is not an administrator of the device. + * @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 10 + */ + function getDisplayVersion(admin: Want, callback: AsyncCallback): void; + + /** + * Gets the display version. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_DEVICE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @returns { Promise } the promise returned by the getDisplayVersion. + * @throws { BusinessError } 9200001 - the application is not an administrator of the device. + * @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 10 + */ + function getDisplayVersion(admin: Want): Promise; + + /** + * Gets the device name. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_DEVICE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @param { AsyncCallback } callback - the callback of getDeviceName. + * @throws { BusinessError } 9200001 - the application is not an administrator of the device. + * @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 10 + */ + function getDeviceName(admin: Want, callback: AsyncCallback): void; + + /** + * Gets the device name. + * This function can be called by a super administrator. + * @permission ohos.permission.ENTERPRISE_GET_DEVICE_INFO + * @param { Want } admin - admin indicates the administrator ability information. + * @returns { Promise } the promise returned by the getDeviceName. + * @throws { BusinessError } 9200001 - the application is not an administrator of the device. + * @throws { BusinessError } 9200002 - the administrator application does not have permission to manage the device. + * @throws { BusinessError } 201 - the application does not have permission to call this function. + * @throws { BusinessError } 401 - invalid input parameter. + * @syscap SystemCapability.Customization.EnterpriseDeviceManager + * @systemapi + * @StageModelOnly + * @since 10 + */ + function getDeviceName(admin: Want): Promise; } export default deviceInfo; \ No newline at end of file -- Gitee From d3f55cd10f10d93055252fa197c7614379407f97 Mon Sep 17 00:00:00 2001 From: mayunteng_1 Date: Fri, 25 Nov 2022 17:39:11 +0800 Subject: [PATCH 425/438] delete import&montify syscap Signed-off-by: mayunteng_1 --- api/@ohos.devicestatus.d.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/api/@ohos.devicestatus.d.ts b/api/@ohos.devicestatus.d.ts index 93cdc7d7ae..aa8f85e288 100644 --- a/api/@ohos.devicestatus.d.ts +++ b/api/@ohos.devicestatus.d.ts @@ -19,13 +19,13 @@ import { Callback } from "./basic"; * Declares a namespace that provides APIs to report the device status. * * @since 9 - * @syscap SystemCapability.Msdp.DeviceStatus + * @syscap SystemCapability.Msdp.DeviceStatus.Stationary */ declare namespace deviceStatus { /** * Declares a response interface to receive the device status. * - * @syscap SystemCapability.Msdp.DeviceStatus + * @syscap SystemCapability.Msdp.DeviceStatus.Stationary * @since 9 */ interface ActivityResponse { @@ -35,7 +35,7 @@ declare namespace deviceStatus { /** * Declares the device status type. * - * @syscap SystemCapability.Msdp.DeviceStatus + * @syscap SystemCapability.Msdp.DeviceStatus.Stationary * @since 9 */ type ActivityType = 'still' | 'relativeStill'; @@ -43,7 +43,7 @@ declare namespace deviceStatus { /** * Enumerates the device status events. * - * @syscap SystemCapability.Msdp.DeviceStatus + * @syscap SystemCapability.Msdp.DeviceStatus.Stationary * @since 9 */ enum ActivityEvent { @@ -66,7 +66,7 @@ declare namespace deviceStatus { /** * Declares a response interface to receive the device status. * - * @syscap SystemCapability.Msdp.DeviceStatus + * @syscap SystemCapability.Msdp.DeviceStatus.Stationary * @since 9 */ enum ActivityState { @@ -88,7 +88,7 @@ declare namespace deviceStatus { * @param event Indicates the device status event. * @param reportLatencyNs Indicates the event reporting period. * @param callback Indicates the callback for receiving reported data. - * @syscap SystemCapability.Msdp.DeviceStatus + * @syscap SystemCapability.Msdp.DeviceStatus.Stationary * @since 9 */ function on(activity: ActivityType, event: ActivityEvent, reportLatencyNs: number, callback: Callback): void; @@ -98,7 +98,7 @@ declare namespace deviceStatus { * * @param activity Indicates the device status type. For details, see {@code type: ActivityType}. * @param callback Indicates the callback for receiving reported data. - * @syscap SystemCapability.Msdp.DeviceStatus + * @syscap SystemCapability.Msdp.DeviceStatus.Stationary * @since 9 */ function once(activity: ActivityType, callback: Callback): void; @@ -109,7 +109,7 @@ declare namespace deviceStatus { * @param activity Indicates the device status type. For details, see {@code type: ActivityType}. * @param event Indicates the device status event. * @param callback Indicates the callback for receiving reported data. - * @syscap SystemCapability.Msdp.DeviceStatus + * @syscap SystemCapability.Msdp.DeviceStatus.Stationary * @since 9 */ function off(activity: ActivityType, event: ActivityEvent, callback?: Callback): void; -- Gitee From ba6ee0e0d776f416c3517e6873d0cafc04ddbd2c Mon Sep 17 00:00:00 2001 From: huangjie Date: Fri, 25 Nov 2022 17:40:03 +0800 Subject: [PATCH 426/438] =?UTF-8?q?=E4=BF=AE=E6=94=B9JS=20Doc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huangjie --- api/@ohos.resourceManager.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.resourceManager.d.ts b/api/@ohos.resourceManager.d.ts index d8fc0a9bb8..f135490472 100644 --- a/api/@ohos.resourceManager.d.ts +++ b/api/@ohos.resourceManager.d.ts @@ -456,7 +456,7 @@ export interface ResourceManager { /** * Obtains the device configuration in Promise mode. * - * @return Returns the device configuration. + * @returns Returns the device configuration. * @since 6 */ getConfiguration(): Promise; -- Gitee From e0daf3d395377a1d0c5fb26ec01391bea871354d Mon Sep 17 00:00:00 2001 From: wangqing Date: Fri, 25 Nov 2022 18:05:10 +0800 Subject: [PATCH 427/438] add syscap value Signed-off-by: wangqing --- api/device-define/default.json | 3 ++- api/device-define/tablet.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/api/device-define/default.json b/api/device-define/default.json index bc91123441..0502d6583f 100644 --- a/api/device-define/default.json +++ b/api/device-define/default.json @@ -176,6 +176,7 @@ "SystemCapability.BundleManager.BundleFramework.AppControl", "SystemCapability.Ability.AbilityRuntime.QuickFix", "SystemCapability.Graphic.Graphic2D.ColorManager.Core", - "SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply" + "SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply", + "SystemCapability.Msdp.DeviceStatus.Stationary" ] } diff --git a/api/device-define/tablet.json b/api/device-define/tablet.json index 73bf456d67..891340559b 100644 --- a/api/device-define/tablet.json +++ b/api/device-define/tablet.json @@ -175,6 +175,7 @@ "SystemCapability.BundleManager.BundleFramework.AppControl", "SystemCapability.Ability.AbilityRuntime.QuickFix", "SystemCapability.Graphic.Graphic2D.ColorManager.Core", - "SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply" + "SystemCapability.ResourceSchedule.BackgroundTaskManager.EfficiencyResourcesApply", + "SystemCapability.Msdp.DeviceStatus.Stationary" ] } \ No newline at end of file -- Gitee From b423f22ac11128e9890f7ef6998b07a06de88b89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E5=87=AF=E6=98=8E?= Date: Fri, 25 Nov 2022 10:08:04 +0000 Subject: [PATCH 428/438] =?UTF-8?q?jsdoc=E6=95=B4=E6=94=B9/@ohos.configPol?= =?UTF-8?q?icy.d.ts.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 谢凯明 --- api/@ohos.configPolicy.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/api/@ohos.configPolicy.d.ts b/api/@ohos.configPolicy.d.ts index c7f19d5baa..f7dc969833 100644 --- a/api/@ohos.configPolicy.d.ts +++ b/api/@ohos.configPolicy.d.ts @@ -30,7 +30,7 @@ declare namespace configPolicy { * @systemapi Hide this for inner system use. * @syscap SystemCapability.Customization.ConfigPolicy * @param relPath the relative path of the config file. - * @return Returns the path of the highest priority config file. + * @returns Returns the path of the highest priority config file. * @throws { BusinessError } 401 - invalid input parameter. */ function getOneCfgFile(relPath: string, callback: AsyncCallback); @@ -43,7 +43,7 @@ declare namespace configPolicy { * @systemapi Hide this for inner system use. * @syscap SystemCapability.Customization.ConfigPolicy * @param relPath the relative path of the config file. - * @return Returns paths of config files. + * @returns Returns paths of config files. * @throws { BusinessError } 401 - invalid input parameter. */ function getCfgFiles(relPath: string, callback: AsyncCallback>); @@ -55,7 +55,7 @@ declare namespace configPolicy { * @since 8 * @systemapi Hide this for inner system use. * @syscap SystemCapability.Customization.ConfigPolicy - * @return Returns paths of config directories. + * @returns Returns paths of config directories. * @throws { BusinessError } 401 - invalid input parameter. */ function getCfgDirList(callback: AsyncCallback>); -- Gitee From 0b0c39a50e5859b0af8aec31a66796447b1d0213 Mon Sep 17 00:00:00 2001 From: duanweiling Date: Fri, 25 Nov 2022 18:30:30 +0800 Subject: [PATCH 429/438] API specification Signed-off-by: duanweiling --- api/@ohos.data.storage.d.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/api/@ohos.data.storage.d.ts b/api/@ohos.data.storage.d.ts index 37be8a4c2d..d0bfc2b9d5 100644 --- a/api/@ohos.data.storage.d.ts +++ b/api/@ohos.data.storage.d.ts @@ -21,6 +21,7 @@ import { AsyncCallback, Callback } from './basic'; * @name storage * @since 6 * @deprecated since 9 + * @useinstead ohos.preferences.preferences * @syscap SystemCapability.DistributedDataManager.Preferences.Core * */ @@ -32,7 +33,7 @@ declare namespace storage { * resides in the memory. You can use removeStorageFromCache to remove the instance from the memory. * * @param path Indicates the path of storage file stored. - * @return Returns the {@link Storage} instance matching the specified storage file name. + * @returns Returns the {@link Storage} instance matching the specified storage file name. * @throws BusinessError if invoked failed * @since 6 * @deprecated since 9 @@ -92,6 +93,7 @@ declare namespace storage { * * @since 6 * @deprecated since 9 + * @useinstead ohos.preferences.preferences */ interface Storage { /** @@ -101,7 +103,7 @@ declare namespace storage { * * @param key Indicates the key of the storage. It cannot be {@code null} or empty. * @param defValue Indicates the default value to return. - * @return Returns the value matching the specified key if it is found; returns the default value otherwise. + * @returns Returns the value matching the specified key if it is found; returns the default value otherwise. * @throws BusinessError if invoked failed * @since 6 * @deprecated since 9 @@ -115,7 +117,7 @@ declare namespace storage { * Checks whether the {@link Storage} object contains a storage matching a specified key. * * @param key Indicates the key of the storage to check for. - * @return Returns {@code true} if the {@link Storage} object contains a storage with the specified key; + * @returns Returns {@code true} if the {@link Storage} object contains a storage with the specified key; * returns {@code false} otherwise. * @throws BusinessError if invoked failed * @since 6 @@ -138,7 +140,6 @@ declare namespace storage { * @throws BusinessError if invoked failed * @since 6 * @deprecated since 9 - * @deprecated since 9 * @useinstead ohos.preferences.preferences.put */ putSync(key: string, value: ValueType): void; -- Gitee From 3da8b3da819cfe9fd57030adb62ffef72af000a3 Mon Sep 17 00:00:00 2001 From: duanweiling Date: Fri, 25 Nov 2022 19:05:48 +0800 Subject: [PATCH 430/438] API specification Signed-off-by: duanweiling --- api/@ohos.data.dataSharePredicates.d.ts | 34 ++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/api/@ohos.data.dataSharePredicates.d.ts b/api/@ohos.data.dataSharePredicates.d.ts index bb6997f643..7d1f140691 100644 --- a/api/@ohos.data.dataSharePredicates.d.ts +++ b/api/@ohos.data.dataSharePredicates.d.ts @@ -25,7 +25,7 @@ declare namespace dataSharePredicates { */ class DataSharePredicates { /** - * Configures the DataSharePredicates to match the field whose data type is ValueType and value is equal + * Configure the DataSharePredicates to match the field whose data type is ValueType and value is equal * to a specified value. * This method is similar to = of the SQL statement. * @@ -39,7 +39,7 @@ declare namespace dataSharePredicates { equalTo(field: string, value: ValueType): DataSharePredicates; /** - * Configures the DataSharePredicates to match the field whose data type is ValueType and value is unequal to + * Configure the DataSharePredicates to match the field whose data type is ValueType and value is unequal to * a specified value. * This method is similar to != of the SQL statement. * @@ -97,7 +97,7 @@ declare namespace dataSharePredicates { */ and(): DataSharePredicates; /** - * Configures the DataSharePredicates to match the field whose data type is string and value + * Configure the DataSharePredicates to match the field whose data type is string and value * contains a specified value. * This method is similar to contains of the SQL statement. * @@ -111,7 +111,7 @@ declare namespace dataSharePredicates { contains(field: string, value: string): DataSharePredicates; /** - * Configures the DataSharePredicates to match the field whose data type is string and value starts + * Configure the DataSharePredicates to match the field whose data type is string and value starts * with a specified string. * This method is similar to value% of the SQL statement. * @@ -125,7 +125,7 @@ declare namespace dataSharePredicates { beginsWith(field: string, value: string): DataSharePredicates; /** - * Configures the DataSharePredicates to match the field whose data type is string and value + * Configure the DataSharePredicates to match the field whose data type is string and value * ends with a specified string. * This method is similar to %value of the SQL statement. * @@ -139,7 +139,7 @@ declare namespace dataSharePredicates { endsWith(field: string, value: string): DataSharePredicates; /** - * Configures the DataSharePredicates to match the fields whose value is null. + * Configure the DataSharePredicates to match the fields whose value is null. * This method is similar to is null of the SQL statement. * * @since 9 @@ -151,7 +151,7 @@ declare namespace dataSharePredicates { isNull(field: string): DataSharePredicates; /** - * Configures the DataSharePredicates to match the specified fields whose value is not null. + * Configure the DataSharePredicates to match the specified fields whose value is not null. * This method is similar to is not null of the SQL statement. * * @since 9 @@ -163,7 +163,7 @@ declare namespace dataSharePredicates { isNotNull(field: string): DataSharePredicates; /** - * Configures the DataSharePredicates to match the fields whose data type is string and value is + * Configure the DataSharePredicates to match the fields whose data type is string and value is * similar to a specified string. * This method is similar to like of the SQL statement. * @@ -178,7 +178,7 @@ declare namespace dataSharePredicates { like(field: string, value: string): DataSharePredicates; /** - * Configures the DataSharePredicates to match the fields whose data type is string and value is + * Configure the DataSharePredicates to match the fields whose data type is string and value is * similar to a specified string. * This method is similar to unlike of the SQL statement. * @@ -193,7 +193,7 @@ declare namespace dataSharePredicates { unlike(field: string, value: string): DataSharePredicates; /** - * Configures DataSharePredicates to match the specified field whose data type is string and the value contains + * Configure DataSharePredicates to match the specified field whose data type is string and the value contains * a wildcard. * Different from like, the input parameters of this method are case-sensitive. * @@ -220,7 +220,7 @@ declare namespace dataSharePredicates { between(field: string, low: ValueType, high: ValueType): DataSharePredicates; /** - * Configures DataSharePredicates to match the specified field whose data type is int and value is + * Configure DataSharePredicates to match the specified field whose data type is int and value is * out of a given range. * * @since 9 @@ -328,7 +328,7 @@ declare namespace dataSharePredicates { limit(total: number, offset: number): DataSharePredicates; /** - * Configures {@code DataSharePredicates} to group query results by specified columns. + * Configure {@code DataSharePredicates} to group query results by specified columns. * * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core @@ -339,7 +339,7 @@ declare namespace dataSharePredicates { groupBy(fields: Array): DataSharePredicates; /** - * Configures {@code DataSharePredicates} to specify the index column. + * Configure {@code DataSharePredicates} to specify the index column. * Before using this method, you need to create an index column. * * @since 9 @@ -351,7 +351,7 @@ declare namespace dataSharePredicates { indexedBy(field: string): DataSharePredicates; /** - * Configures {@code DataSharePredicates} to match the specified field whose data type is ValueType array and values + * Configure {@code DataSharePredicates} to match the specified field whose data type is ValueType array and values * are within a given range. * * @since 9 @@ -364,7 +364,7 @@ declare namespace dataSharePredicates { in(field: string, value: Array): DataSharePredicates; /** - * Configures {@code DataSharePredicates} to match the specified field whose data type is String array and values + * Configure {@code DataSharePredicates} to match the specified field whose data type is String array and values * are out of a given range. * * @since 9 @@ -377,7 +377,7 @@ declare namespace dataSharePredicates { notIn(field: string, value: Array): DataSharePredicates; /** - * Configures {@code DataSharePredicates} Creates a query condition using the specified key prefix. + * Configure {@code DataSharePredicates} Creates a query condition using the specified key prefix. * * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core @@ -388,7 +388,7 @@ declare namespace dataSharePredicates { prefixKey(prefix: string): DataSharePredicates; /** - * Configures {@code DataSharePredicates} to match the specified value whose key is within a given range. + * Configure {@code DataSharePredicates} to match the specified value whose key is within a given range. * * @since 9 * @syscap SystemCapability.DistributedDataManager.DataShare.Core -- Gitee From d41fd0dc28687c856f7487bc8f990c4086a3d493 Mon Sep 17 00:00:00 2001 From: sunyaozu Date: Sat, 26 Nov 2022 09:27:09 +0800 Subject: [PATCH 431/438] fix error word Signed-off-by: sunyaozu --- api/@ohos.i18n.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.i18n.d.ts b/api/@ohos.i18n.d.ts index 75c85d0322..f6a4eff3af 100644 --- a/api/@ohos.i18n.d.ts +++ b/api/@ohos.i18n.d.ts @@ -328,7 +328,7 @@ export class System { * @syscap SystemCapability.Global.I18n * @since 8 * @deprecated since 9 - * @useinstead I18NUitl + * @useinstead I18NUtil */ export interface Util { /** @@ -1103,7 +1103,7 @@ export class TimeZone { * Get the offset of the TimeZone object. * * @syscap SystemCapability.Global.I18n - * @date Indicates a date use to compute offset. + * @param date Indicates a date use to compute offset. * @returns Returns a number represents the offset with date. * @since 7 */ -- Gitee From 35737110b50c2233477da527d5a80b417deb027f Mon Sep 17 00:00:00 2001 From: mayunteng_1 Date: Sat, 26 Nov 2022 14:46:04 +0800 Subject: [PATCH 432/438] ispressed Signed-off-by: mayunteng_1 Change-Id: Ic03ddbddeed61c5f079b40a807f6b5cd0989d5a7 --- api/@ohos.multimodalInput.inputEventClient.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.multimodalInput.inputEventClient.d.ts b/api/@ohos.multimodalInput.inputEventClient.d.ts index 39b5a50717..b898d63b38 100644 --- a/api/@ohos.multimodalInput.inputEventClient.d.ts +++ b/api/@ohos.multimodalInput.inputEventClient.d.ts @@ -34,7 +34,7 @@ declare namespace inputEventClient { * @param isIntercepted Whether the key is blocked. */ interface KeyEvent { - isPressed: boolean, + isPressed: boolean; keyCode: number; keyDownDuration: number; isIntercepted: boolean; -- Gitee From 32b7bfe9c0a68b4871f15075b55a55b658bd6c60 Mon Sep 17 00:00:00 2001 From: lyj_love_code Date: Sat, 26 Nov 2022 15:28:11 +0800 Subject: [PATCH 433/438] modify the format of @ohos.hiviewdfx.hiAppEvent.d.ts Signed-off-by: lyj_love_code --- api/@ohos.hiviewdfx.hiAppEvent.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.hiviewdfx.hiAppEvent.d.ts b/api/@ohos.hiviewdfx.hiAppEvent.d.ts index a856daee9b..800f55cc47 100644 --- a/api/@ohos.hiviewdfx.hiAppEvent.d.ts +++ b/api/@ohos.hiviewdfx.hiAppEvent.d.ts @@ -343,7 +343,7 @@ declare namespace hiAppEvent { /** * The callback function of watcher. */ - onTrigger?: (curRow: number, curSize:number, holder:AppEventPackageHolder) => void; + onTrigger?: (curRow: number, curSize: number, holder: AppEventPackageHolder) => void; } /** -- Gitee From 5889da5f658224a4420bd9ab29ec3b5fd46a5361 Mon Sep 17 00:00:00 2001 From: liyufan123 Date: Sat, 26 Nov 2022 15:31:28 +0800 Subject: [PATCH 434/438] fix API description Signed-off-by: liyufan123 --- api/@ohos.net.connection.d.ts | 6 +++--- api/@ohos.net.ethernet.d.ts | 2 +- api/@ohos.net.http.d.ts | 6 ++++-- api/@ohos.net.socket.d.ts | 13 ++++++------- api/@system.fetch.d.ts | 2 -- api/@system.network.d.ts | 2 -- 6 files changed, 14 insertions(+), 17 deletions(-) diff --git a/api/@ohos.net.connection.d.ts b/api/@ohos.net.connection.d.ts index 283d7bef59..ea1121b4d8 100644 --- a/api/@ohos.net.connection.d.ts +++ b/api/@ohos.net.connection.d.ts @@ -29,7 +29,7 @@ declare namespace connection { type UDPSocket = socket.UDPSocket; /** - * Create a network connection with optional netSpefifier and timeout. + * Create a network connection with optional netSpecifier and timeout. * * @param netSpecifier Indicates the network specifier. See {@link NetSpecifier}. * @param timeout The time in milliseconds to attempt looking for a suitable network before @@ -52,7 +52,7 @@ declare namespace connection { * *

              To call this method, you must have the {@code ohos.permission.GET_NETWORK_INFO} permission. * - * @return Returns the {@link NetHandle} object; + * @returns Returns the {@link NetHandle} object; * returns {@code null} if the default network is not activated. * @permission ohos.permission.GET_NETWORK_INFO * @since 9 @@ -212,7 +212,7 @@ declare namespace connection { * Resolves a host name to obtain the first IP address based on the specified NetHandle. * * @param host Indicates the host name or the domain. - * @return Returns the first NetAddress. + * @param callback Returns the first NetAddress. * @permission ohos.permission.GET_NETWORK_INFO */ getAddressByName(host: string, callback: AsyncCallback): void; diff --git a/api/@ohos.net.ethernet.d.ts b/api/@ohos.net.ethernet.d.ts index b1a3e6a33f..12ea7797b2 100644 --- a/api/@ohos.net.ethernet.d.ts +++ b/api/@ohos.net.ethernet.d.ts @@ -19,7 +19,7 @@ import {AsyncCallback, Callback} from "./basic"; * Provides interfaces to manage ethernet. * * @since 9 - * @syscap SystemCapability.Communication.NetManager.Ethernet + * @syscap SystemCapability.Communication.NetManager.Extension */ declare namespace ethernet { /** diff --git a/api/@ohos.net.http.d.ts b/api/@ohos.net.http.d.ts index ce56e55549..88537cab53 100644 --- a/api/@ohos.net.http.d.ts +++ b/api/@ohos.net.http.d.ts @@ -98,14 +98,16 @@ declare namespace http { /** * Registers an observer for HTTP Response Header events. * - * @deprecated use on_headersReceive instead since 8. + * @deprecated since 8 + * @useinstead on_headersReceive */ on(type: "headerReceive", callback: AsyncCallback): void; /** * Unregisters the observer for HTTP Response Header events. * - * @deprecated use off_headersReceive instead since 8. + * @deprecated since 8 + * @useinstead off_headersReceive */ off(type: "headerReceive", callback?: AsyncCallback): void; diff --git a/api/@ohos.net.socket.d.ts b/api/@ohos.net.socket.d.ts index 1f6d090abd..aceaa13962 100644 --- a/api/@ohos.net.socket.d.ts +++ b/api/@ohos.net.socket.d.ts @@ -442,8 +442,7 @@ declare namespace socket { /** * Returns an object representing the peer certificate. If the peer does not provide a certificate, * an empty object will be returned. If the socket is destroyed, null is returned. - * If needChain is true, it contains the complete certificate chain. Otherwise, - * it only contains the peer's certificate. + * It only contains the peer's certificate. * * @throws {BusinessError} 2303501 - SSL is null. * @throws {BusinessError} 2300002 - System internal error. @@ -464,8 +463,8 @@ declare namespace socket { getProtocol(): Promise; /** - * Returns an object containing the negotiated cipher suite information. - * For example:{"name": "AES128-SHA256", "standardName": "TLS_RSA_WITH_AES_128_CBC_SHA256", "version": "TLSv1.2"} + * Returns a list containing the negotiated cipher suite information. + * For example:{"TLS_RSA_WITH_AES_128_CBC_SHA256", "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256"} * * @throws {BusinessError} 2303501 - SSL is null. * @throws {BusinessError} 2303502 - Error in tls reading. @@ -545,12 +544,12 @@ declare namespace socket { /** * Certificate proving the identity of the client */ - cert: string; + cert?: string; /** * Private key of client certificate */ - key: string; + key?: string; /** * Password of the private key @@ -568,7 +567,7 @@ declare namespace socket { useRemoteCipherPrefer?: boolean; /** - * Supported signature algorithms. This list can contain summary algorithms(SHA256、MD5、etc)、 + * Supported signature algorithms. This string can contain summary algorithms(SHA256、MD5、etc)、 * Public key algorithm(RSA-PSS、ECDSA、etc)、Combination of the two(For example 'RSA+SHA384') * or TLS v1.3 Scheme name(For example rsa_pss_pss_sha512) */ diff --git a/api/@system.fetch.d.ts b/api/@system.fetch.d.ts index b36c780dbd..f728c65db9 100644 --- a/api/@system.fetch.d.ts +++ b/api/@system.fetch.d.ts @@ -14,7 +14,6 @@ */ /** - * @import import fetch from '@system.fetch'; * @since 3 * @syscap SystemCapability.Communication.NetStack */ @@ -39,7 +38,6 @@ export interface FetchResponse { } /** - * @import import fetch from '@system.fetch'; * @since 3 * @syscap SystemCapability.Communication.NetStack */ diff --git a/api/@system.network.d.ts b/api/@system.network.d.ts index 977bcd3414..c4ca822793 100644 --- a/api/@system.network.d.ts +++ b/api/@system.network.d.ts @@ -14,7 +14,6 @@ */ /** - * @import import network from '@system.network'; * @since 3 * @syscap SystemCapability.Communication.NetManager.Core */ @@ -33,7 +32,6 @@ export interface NetworkResponse { } /** - * @import import network from '@system.network'; * @since 3 * @syscap SystemCapability.Communication.NetManager.Core */ -- Gitee From 1240f7d38df8295ccc693dbc3c13c5ea30d2bb5f Mon Sep 17 00:00:00 2001 From: liyufan123 Date: Sat, 26 Nov 2022 17:27:20 +0800 Subject: [PATCH 435/438] fix words Signed-off-by: liyufan123 --- api/@ohos.net.ethernet.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.net.ethernet.d.ts b/api/@ohos.net.ethernet.d.ts index 12ea7797b2..b1a3e6a33f 100644 --- a/api/@ohos.net.ethernet.d.ts +++ b/api/@ohos.net.ethernet.d.ts @@ -19,7 +19,7 @@ import {AsyncCallback, Callback} from "./basic"; * Provides interfaces to manage ethernet. * * @since 9 - * @syscap SystemCapability.Communication.NetManager.Extension + * @syscap SystemCapability.Communication.NetManager.Ethernet */ declare namespace ethernet { /** -- Gitee From 43c91f8247de9a899674afc8fc24a89041c62821 Mon Sep 17 00:00:00 2001 From: Jeam_wang Date: Mon, 28 Nov 2022 11:16:11 +0800 Subject: [PATCH 436/438] =?UTF-8?q?request=E6=8E=A5=E5=8F=A3=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E4=B8=AD@returns=E4=B8=8D=E8=A7=84=E8=8C=83=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jeam_wang --- api/@ohos.request.d.ts | 97 +++++++++++++++++++++++++----------------- 1 file changed, 57 insertions(+), 40 deletions(-) diff --git a/api/@ohos.request.d.ts b/api/@ohos.request.d.ts index 445beb6b17..2fba516780 100644 --- a/api/@ohos.request.d.ts +++ b/api/@ohos.request.d.ts @@ -251,7 +251,6 @@ declare namespace request { * @param config Download config * @param callback Indicate the callback function to receive DownloadTask. * @permission ohos.permission.INTERNET - * @return - * @FAModelOnly */ function download(config: DownloadConfig, callback: AsyncCallback): void; @@ -266,7 +265,6 @@ declare namespace request { * @param config Download config * @param callback Indicate the callback function to receive DownloadTask. * @permission ohos.permission.INTERNET - * @return - */ function download(context: BaseContext, config: DownloadConfig, callback: AsyncCallback): void; @@ -278,7 +276,6 @@ declare namespace request { * @param config Download config * @param callback Indicate the callback function to receive DownloadTask. * @permission ohos.permission.INTERNET - * @return - * @throws {BusinessError} 201 - the permissions check fails * @throws {BusinessError} 401 - the parameters check fails * @throws {BusinessError} 13400001 - file operation error @@ -295,7 +292,7 @@ declare namespace request { * @useinstead ohos.request.downloadFile * @param config Download config * @permission ohos.permission.INTERNET - * @return - + * @returns { Promise } the promise returned by the function. * @FAModelOnly */ function download(config: DownloadConfig): Promise; @@ -309,7 +306,7 @@ declare namespace request { * @param BaseContext Indicates the application BaseContext. * @param config Download config * @permission ohos.permission.INTERNET - * @return - + * @returns { Promise } the promise returned by the function. */ function download(context: BaseContext, config: DownloadConfig): Promise; @@ -320,7 +317,7 @@ declare namespace request { * @param BaseContext Indicates the application BaseContext. * @param config Download config * @permission ohos.permission.INTERNET - * @return - + * @returns { Promise } the promise returned by the function. * @throws {BusinessError} 201 - the permissions check fails * @throws {BusinessError} 401 - the parameters check fails * @throws {BusinessError} 13400001 - file operation error @@ -338,7 +335,6 @@ declare namespace request { * @param config Upload config * @param callback Indicate the callback function to receive UploadTask. * @permission ohos.permission.INTERNET - * @return - * @FAModelOnly */ function upload(config: UploadConfig, callback: AsyncCallback): void; @@ -353,7 +349,6 @@ declare namespace request { * @param config Upload config * @param callback Indicate the callback function to receive UploadTask. * @permission ohos.permission.INTERNET - * @return - */ function upload(context: BaseContext, config: UploadConfig, callback: AsyncCallback): void; @@ -364,7 +359,6 @@ declare namespace request { * @param BaseContext Indicates the application BaseContext. * @param config Upload config * @param callback Indicate the callback function to receive UploadTask. - * @return - * @throws {BusinessError} 201 - the permissions check fails * @throws {BusinessError} 401 - the parameters check fails * @throws {BusinessError} 13400002 - bad file path @@ -379,7 +373,7 @@ declare namespace request { * @useinstead ohos.request.uploadFile * @param config Upload config * @permission ohos.permission.INTERNET - * @return - + * @returns { Promise } the promise returned by the function. * @FAModelOnly */ function upload(config: UploadConfig): Promise; @@ -393,7 +387,7 @@ declare namespace request { * @param BaseContext Indicates the application BaseContext. * @param config Upload config * @permission ohos.permission.INTERNET - * @return - + * @returns { Promise } the promise returned by the function. */ function upload(context: BaseContext, config: UploadConfig): Promise; @@ -404,7 +398,7 @@ declare namespace request { * @param BaseContext Indicates the application BaseContext. * @param config Upload config * @permission ohos.permission.INTERNET - * @return - + * @returns { Promise } the promise returned by the function. * @throws {BusinessError} 201 - the permissions check fails * @throws {BusinessError} 401 - the parameters check fails * @throws {BusinessError} 13400002 - bad file path @@ -582,7 +576,6 @@ declare namespace request { * receivedSize the length of downloaded data, in bytes * totalSize he length of data expected to be downloaded, in bytes. * @permission ohos.permission.INTERNET - * @return - */ on(type: 'progress', callback: (receivedSize: number, totalSize: number) => void): void; @@ -595,35 +588,32 @@ declare namespace request { * receivedSize the length of downloaded data, in bytes * totalSize he length of data expected to be downloaded, in bytes. * @permission ohos.permission.INTERNET - * @return - */ off(type: 'progress', callback?: (receivedSize: number, totalSize: number) => void): void; /** - * Called when the current download session complete、pause or remove. + * Called when the current download session complete pause or remove. * @syscap SystemCapability.MiscServices.Download * @since 7 * @param type Indicates the download session event type * complete: download task completed, * pause: download task stopped, * remove: download task deleted. - * @param callback The callback function for the download complete、pause or remove change event. + * @param callback The callback function for the download complete pause or remove change event. * @permission ohos.permission.INTERNET - * @return - */ on(type: 'complete' | 'pause' | 'remove', callback: () => void): void; /** - * Called when the current download session complete、pause or remove. + * Called when the current download session complete pause or remove. * @syscap SystemCapability.MiscServices.Download * @since 7 * @param type Indicates the download session event type * complete: download task completed, * pause: download task stopped, * remove: download task deleted. - * @param callback The callback function for the download complete、pause or remove change event. + * @param callback The callback function for the download complete pause or remove change event. * @permission ohos.permission.INTERNET - * @return - */ off(type: 'complete' | 'pause' | 'remove', callback?: () => void): void; @@ -635,7 +625,6 @@ declare namespace request { * @param callback The callback function for the download fail change event * err The error code for download task. * @permission ohos.permission.INTERNET - * @return - */ on(type: 'fail', callback: (err: number) => void): void; @@ -647,7 +636,6 @@ declare namespace request { * @param callback Indicate the callback function to receive err. * err The error code for download task. * @permission ohos.permission.INTERNET - * @return - */ off(type: 'fail', callback?: (err: number) => void): void; @@ -659,7 +647,6 @@ declare namespace request { * @useinstead ohos.request.delete * @param callback Indicates asynchronous invoking Result. * @permission ohos.permission.INTERNET - * @return - */ remove(callback: AsyncCallback): void; @@ -670,7 +657,7 @@ declare namespace request { * @deprecated since 9 * @useinstead ohos.request.delete * @permission ohos.permission.INTERNET - * @return - + * @returns { Promise } the promise returned by the function. */ remove(): Promise; @@ -682,7 +669,6 @@ declare namespace request { * @useinstead ohos.request.suspend * @param callback Indicates asynchronous invoking Result. * @permission ohos.permission.INTERNET - * @return - */ pause(callback: AsyncCallback): void; @@ -693,7 +679,7 @@ declare namespace request { * @deprecated since 9 * @useinstead ohos.request.suspend * @permission ohos.permission.INTERNET - * @return - + * @returns { Promise } the promise returned by the function. */ pause(): Promise; @@ -705,7 +691,6 @@ declare namespace request { * @useinstead ohos.request.restore * @param callback Indicates asynchronous invoking Result. * @permission ohos.permission.INTERNET - * @return - */ resume(callback: AsyncCallback): void; @@ -716,7 +701,7 @@ declare namespace request { * @deprecated since 9 * @useinstead ohos.request.restore * @permission ohos.permission.INTERNET - * @return - + * @returns { Promise } the promise returned by the function. */ resume(): Promise; @@ -728,7 +713,6 @@ declare namespace request { * @useinstead ohos.request.getTaskInfo * @param callback Indicate the callback function to receive download info. * @permission ohos.permission.INTERNET - * @return - */ query(callback: AsyncCallback): void; @@ -739,7 +723,7 @@ declare namespace request { * @deprecated since 9 * @useinstead ohos.request.getTaskInfo * @permission ohos.permission.INTERNET - * @return - + * @returns { Promise } the promise returned by the function. */ query(): Promise; @@ -751,7 +735,6 @@ declare namespace request { * @useinstead ohos.request.getTaskMimeType * @param callback Indicate the callback function to receive download file MIME type. * @permission ohos.permission.INTERNET - * @return - */ queryMimeType(callback: AsyncCallback): void; @@ -762,7 +745,7 @@ declare namespace request { * @deprecated since 9 * @useinstead ohos.request.getTaskMimeType * @permission ohos.permission.INTERNET - * @return - + * @returns { Promise } the promise returned by the function. */ queryMimeType(): Promise; @@ -786,6 +769,16 @@ declare namespace request { * @syscap SystemCapability.MiscServices.Download */ suspend(callback: AsyncCallback): void; + + /** + * Suspend the download task + * @since 9 + * @permission ohos.permission.INTERNET + * @throws {BusinessError} 201 - the permissions check fails + * @throws {BusinessError} 401 - the parameters check fails + * @syscap SystemCapability.MiscServices.Download + * @returns { Promise } the promise returned by the function. + */ suspend(): Promise; /** @@ -797,6 +790,16 @@ declare namespace request { * @syscap SystemCapability.MiscServices.Download */ restore(callback: AsyncCallback): void; + + /** + * Restore the download task + * @since 9 + * @permission ohos.permission.INTERNET + * @throws {BusinessError} 201 - the permissions check fails + * @throws {BusinessError} 401 - the parameters check fails + * @syscap SystemCapability.MiscServices.Download + * @returns { Promise } the promise returned by the function. + */ restore(): Promise; /** @@ -808,6 +811,16 @@ declare namespace request { * @syscap SystemCapability.MiscServices.Download */ getTaskInfo(callback: AsyncCallback): void; + + /** + * Get the download task info + * @since 9 + * @permission ohos.permission.INTERNET + * @throws {BusinessError} 201 - the permissions check fails + * @throws {BusinessError} 401 - the parameters check fails + * @syscap SystemCapability.MiscServices.Download + * @returns { Promise } the promise returned by the function. + */ getTaskInfo(): Promise; /** @@ -819,6 +832,16 @@ declare namespace request { * @syscap SystemCapability.MiscServices.Download */ getTaskMimeType(callback: AsyncCallback): void; + + /** + * Get mimetype of the download task + * @since 9 + * @permission ohos.permission.INTERNET + * @throws {BusinessError} 201 - the permissions check fails + * @throws {BusinessError} 401 - the parameters check fails + * @syscap SystemCapability.MiscServices.Download + * @returns { Promise } the promise returned by the function. + */ getTaskMimeType(): Promise; } @@ -974,7 +997,6 @@ declare namespace request { * uploadedSize The length of uploaded data, in bytes * totalSize The length of data expected to be uploaded, in bytes. * @permission ohos.permission.INTERNET - * @return - */ on(type: 'progress', callback: (uploadedSize: number, totalSize: number) => void): void; @@ -987,7 +1009,6 @@ declare namespace request { * uploadedSize The length of uploaded data, in bytes * totalSize The length of data expected to be uploaded, in bytes. * @permission ohos.permission.INTERNET - * @return - */ off(type: 'progress', callback?: (uploadedSize: number, totalSize: number) => void): void; @@ -999,7 +1020,6 @@ declare namespace request { * @param callback The callback function for the HTTP Response Header event * header HTTP Response Header returned by the developer server. * @permission ohos.permission.INTERNET - * @return - */ on(type: 'headerReceive', callback: (header: object) => void): void; @@ -1011,7 +1031,6 @@ declare namespace request { * @param callback The callback function for the HTTP Response Header event * header HTTP Response Header returned by the developer server. * @permission ohos.permission.INTERNET - * @return - */ off(type: 'headerReceive', callback?: (header: object) => void): void; @@ -1024,7 +1043,6 @@ declare namespace request { * fail: upload task failed * @param callback The callback function for the upload complete or fail change event. * @permission ohos.permission.INTERNET - * @return - */ on(type:'complete' | 'fail', callback: Callback>): void; @@ -1036,7 +1054,6 @@ declare namespace request { * complete: upload task completed * fail: upload task failed * @permission ohos.permission.INTERNET - * @return - */ off(type:'complete' | 'fail', callback?: Callback>): void; @@ -1048,7 +1065,6 @@ declare namespace request { * @useinstead ohos.request.delete * @param callback Indicates asynchronous invoking Result. * @permission ohos.permission.INTERNET - * @return - */ remove(callback: AsyncCallback): void; @@ -1059,7 +1075,7 @@ declare namespace request { * @deprecated since 9 * @useinstead ohos.request.delete * @permission ohos.permission.INTERNET - * @return - + * @returns { Promise } the promise returned by the function. */ remove(): Promise; @@ -1080,6 +1096,7 @@ declare namespace request { * @throws {BusinessError} 201 - the permissions check fails * @throws {BusinessError} 401 - the parameters check fails * @syscap SystemCapability.MiscServices.Upload + * @returns { Promise } the promise returned by the function. */ delete(): Promise; } -- Gitee From 55bd7f4f4e6b48ea90967e11194222cef992eecb Mon Sep 17 00:00:00 2001 From: liu-binjun Date: Mon, 28 Nov 2022 14:49:36 +0800 Subject: [PATCH 437/438] bugfix:delete import Signed-off-by: liu-binjun --- api/@ohos.geolocation.d.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/api/@ohos.geolocation.d.ts b/api/@ohos.geolocation.d.ts index 824216be5b..0b2d3e4992 100644 --- a/api/@ohos.geolocation.d.ts +++ b/api/@ohos.geolocation.d.ts @@ -21,7 +21,6 @@ import { WantAgent } from './@ohos.wantAgent'; * * @since 7 * @syscap SystemCapability.Location.Location.Core - * @import import geolocation from '@ohos.geolocation' * @permission ohos.permission.LOCATION * @deprecated since 9 */ -- Gitee From a7117302de85a34d2b45e533b401ffbbf4ed9d36 Mon Sep 17 00:00:00 2001 From: mayunteng_1 Date: Mon, 28 Nov 2022 19:21:21 +0800 Subject: [PATCH 438/438] change devicestatus name Signed-off-by:mayunteng_1 Signed-off-by: mayunteng_1 --- api/{@ohos.devicestatus.d.ts => @ohos.Stationary.d.ts} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename api/{@ohos.devicestatus.d.ts => @ohos.Stationary.d.ts} (99%) diff --git a/api/@ohos.devicestatus.d.ts b/api/@ohos.Stationary.d.ts similarity index 99% rename from api/@ohos.devicestatus.d.ts rename to api/@ohos.Stationary.d.ts index aa8f85e288..9412317be7 100644 --- a/api/@ohos.devicestatus.d.ts +++ b/api/@ohos.Stationary.d.ts @@ -21,7 +21,7 @@ import { Callback } from "./basic"; * @since 9 * @syscap SystemCapability.Msdp.DeviceStatus.Stationary */ -declare namespace deviceStatus { +declare namespace Stationary { /** * Declares a response interface to receive the device status. * -- Gitee